function menu_on(othis,otb,mcol_on,mcol_tb)
{
	othis.style.cursor='hand';
	othis.bgColor=''+mcol_on+'';
	otb.bgColor=''+mcol_tb+'';
}

function menu_off(othis,otb,mcol_off)
{
	othis.bgColor=''+mcol_off+'';
	otb.bgColor=''+mcol_off+'';
}

function submenu_on(othis,smcol_on)
{
	othis.style.cursor='hand';
	othis.bgColor=''+smcol_on+'';
}

function chkSendMessageForm()
{
	
	var tFields = new Array('message_surname','message_name','message_contact','message_subject');
	var faults = 0;
	
	document.getElementById('err_message').style.display = 'none';
	
	for(i=0;i<4;i++)
	{
		document.getElementById('err_'+tFields[i]+'').style.display = 'none';
		if(document.getElementById(tFields[i]).value == '')
		{document.getElementById('err_'+tFields[i]+'').style.display = '';faults++;}
	}
	
	if (faults > 0)
	{	
		document.getElementById('err_message').style.display = '';
		return false;
	}
	else {return true;}
}

function submenu_off(othis,smcol_off)
{
	othis.bgColor=''+smcol_off+'';
}

function fullscreen()
{
	var brw_v=navigator.appVersion.charAt(0);
	var brw_n=navigator.appName.charAt(0);
	var iIE4 = false;
	if((brw_v >= 4)&&(brw_n == "M"))iIE4 = true;
	if(iIE4){
	window.open('fullscreen_page.php',null,'scrollbars=0 fullscreen=1');
	}else{
	alert("Sorry, IE required !!");
	}
}

function checkForOtherName(check, theDiv, theValue)
{
	if (theValue == check){DivDisplay(theDiv);}
	else{DivHide(theDiv);}
}

function textareaMaxCharactersControl(p_textarea_id, p_max, p_counter)
{
	var oText = document.getElementById(p_textarea_id);
	var oCounter = document.getElementById(p_counter);
	var remainingChars = p_max-(oText.innerText.length);

	oCounter.innerText = remainingChars;
	if (oText.innerText.length > p_max){oText.value = oText.value.slice(0, p_max);}
}

function logo_management_popup(function_id,function_name)
{
	sH = 250;
	sW = 700;
								
	pos_x = (sW/2) - (sW/2);
	pos_y = (sH/2) - (sH/2) - 20;
	
	url = 'logo_management_popup.php?function_id='+function_id+'&function_name='+function_name;
	
	parametres='toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=no, copyhistory=no, width='+sW+', height='+sH+', left='+pos_x+', top='+pos_y;
	window.open(''+url+'','',''+parametres+'');	
	
}

function page_loaded()
{
	oDIV = document.getElementById('loading_logo');
	oDIV.style.display = 'none';	
}
