function MenuOver(catId, backgColor) {
	document.getElementById("Menu0" + catId).style.backgroundColor = backgColor;
	document.getElementById("subMenu0" + catId).style.visibility = "visible";
}

function MenuOut(catId, backgColor) {
	document.getElementById("Menu0" + catId).style.backgroundColor = backgColor;
	document.getElementById("subMenu0" + catId).style.visibility = "hidden";
}
function MenuOutTestVisible(catId, backgColor) {
	document.getElementById("Menu0" + catId).style.backgroundColor = backgColor;
	if ( document.getElementById("subMenu0" + catId).style.visibility.indexOf("visible")==-1)
	{
		document.getElementById("subMenu0" + catId).style.visibility = "hidden";
	}
}

function changeStyle(elementId, styleName) {
	document.getElementById(elementId).className = styleName;
}

function OpenImage (imageName, imageWidth, imageHeight) {
	var newWindow = window.open("","newWindow","titlebar=0, fullscreen=0, toolbar=0, status=0, menubar=0, scrollbars=0, resizable=0, directories=0, location=0, width=640, height=480");
	newWindow.document.open();
	newWindow.document.write('<html>\n<title>Slovenská lekárska komora</title>\n<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">\n');
	newWindow.document.write('<table width="100%" height="100%" cellpadding="0" cellspacing="0">\n<tr>\n<td align="center" valign="middle"><img src="./files/media/'+imageName+'" alt="FOTOGRAFIA" onclick="window.close()"></td>\n</tr>\n</table>\n');
	newWindow.document.write('</body>\n</html>\n');
	newWindow.document.close();
	newWindow.focus();
}

function ValidateProfileChange()
{
	var msg='';	
	var b = document;
	
	if (b.getElementById("profileName").value == '') {
		msg+= 'musíte zadať Vaše meno\n';
	}
	
	if (b.getElementById("profileSurname").value == '') {
		msg+= 'musíte zadať Vaše priezvisko\n';
	}
	
	if (b.getElementById("profileSpecialization").value == '') {
		msg+= 'musíte zadať Vašu špecializáciu\n';
	}
	
	if (b.getElementById("profileEmail").value == '') {
		msg+= 'musíte zadať Váš email\n';
	}
	
	if (b.getElementById("profileCity").value == '') {
		msg+= 'musíte zadať mesto\n';
	}

	
	if (msg == ''){
	  return true;
	} else {
	  msg = 'Vo formulári sú nasledovné chyby: \n' + msg;
	  alert(msg);
	  return false;
	} 
}

function ValidatePasswordChange(){
	var b = document;
	var msg='';
	
	if (b.getElementById("oldpass").value == '') {
		msg+= 'musíte zadať staré heslo\n';
	}
	
	if ((b.getElementById("newpass").value == '')||(b.getElementById("repass").value == '')) {
		msg+= 'musíte zadať nové heslo, aj ho potvrdiť\n';		
	}
	
	if ((b.getElementById("newpass").value != '')||(b.getElementById("repass").value != '')) {
		if (b.getElementById("newpass").value != b.getElementById("repass").value) {			
		  msg+= 'nové heslo a potvrdenie hesla sa nezhodujú\n';		
		}
	}
	if (msg == ''){
	  return true;
	} else {
	  msg = 'Vo formulári sú nasledovné chyby: \n' + msg;
	  alert(msg);
	  return false;
	}
	
}