//menu
function menuOn(id) {
document.getElementById(id).style.display = 'block';
}
function menuOff(id) {
document.getElementById(id).style.display = 'none';
}

//popup
/*parameters
file= url;
title = popup's window title;
width = popup's window width;
height = popup's window height;
scrollbars = yes or no;
resize = yes or no;
*/
function openPopup(file, title, width, height) {
var coordX = (screen.width-width)/2;
var coordY = (screen.height-height)/2;
width = width+17;
height = height+17;
file  = '/' + file;
window.open(file, 'asd', 'top='+coordY+', left='+coordX+', width='+width+', height='+height+', toolbar=no, menubar=no, resizable=no, scrollbars=no, location=no');

}


//popup for images
/*	������� ������� � ����� ���� ������� ����������� ����� ������ �� ������.
	� ������ ����� ���� ����������� ��������� �����������.
	������� ���� ����������� ������� ���� ������ �������� �����������.
	����� ������� �������� �������� ���:
	<a href="javascript:openPopup('','������� �����������',600,400,'yes','yes','/imagesFolder/imageName.jpg');">zzz</a>
*/
/*parameters
file = file name;
name = popup's window name;
w = popup's window width;
h = popup's window height;
scrollbars = yes or no;
resize = yes or no;
content = <img src=/imagesFolder/imageName>;

*/
function openImagePopup(file,title,w,h){
	title = "Image";
	if (screen.width>=w){
		var coordX = (screen.width-w)/2;
	}
	else {
		var coordX = 0;
	}
	if (screen.height>=h){
		var coordY = (screen.height-h)/2;
	}
	else {
		var coordY = 0;
	}
	var newPopup=window.open(title, name, 'width='+w+', height='+h+', top='+coordY+', left='+coordX+', toolbar=no, menubar=no, resizable=no, scrollbars=no, location=no, status=no');
	newPopup.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><title>'+title+'</title></head><body bgcolor="#FFFFFF" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0"><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="100%" align="center" valign="middle"><img src="/'+file+'" width='+w+' height='+h+' border="0"</td></tr></table></body></html>');
}



//portfolio

function portfolioItemOff(name,index){
var id=name+index;
document.getElementById(id).src='/img/portfolio/'+name+'/'+id+'_bw.jpg';
/*
var currentDiv=document.getElementById(id);
currentDiv.style.background='#ffffff url(/img/portfolio/style/'+id+'_bw.jpg) top left no-repeat';
currentDiv.style.padding='10px';
currentDiv.innerHTML='<b>������ � ������ �������������� ��������� ��� �������� Schneider Electric</b>';
*/
}

function portfolioItemOn(name,index){
var id=name+index;
document.getElementById(id).src='/img/portfolio/'+name+'/'+id+'.jpg';
}