	//Menu//
	var numMenu = 7;
	// if (document.getElementById('menuLeft')) alert("n:"+document.getElementById('menuLeft').childNodes.length); //only tag div
	
	function showMenu(submenu){
		//document.getElementById(submenu).style.visibility='visible';
		document.getElementById(submenu).style.display='block';
		for (i=1; i<=numMenu; i++) {
			if (('subMenu'+i)!=submenu)
				if (document.getElementById('subMenu'+i)){
					//document.getElementById('subMenu'+i).style.visibility='hidden';
					document.getElementById('subMenu'+i).style.display='none';
				}
		}
		
	}
	
	function hiddenMenu(submenu){
		//document.getElementById(submenu).style.visibility='hidden';	
		document.getElementById(submenu).style.display='none';
	}
	
	function posSubMenu(){
		//for each submenu know the correct position
		
		var marginLeft=20;
		var paddingLeft=15;
		var minimunLenght=150;
		for (i=1; i<=numMenu; i++) {
			if (i==7) { 
			//customization for menuRight
				var sizeMenuLeft = 754;
				document.getElementById('subMenu'+i).style.left=sizeMenuLeft+paddingLeft+marginLeft+"px"; //lenght of Menu Left
			}else{
				if (document.getElementById('subMenu'+i)){
					var spaceLeft=0;
					for (k=(i-1); k>=1; k--) {
						if (document.getElementById('subMenu'+k)) {
							if(k!=i) {
								spaceLeft+=document.getElementById('Menu'+k).scrollWidth;
							}
						}
					}
					if (i==1)
						document.getElementById('subMenu'+i).style.left=spaceLeft+marginLeft+"px";
					else
						document.getElementById('subMenu'+i).style.left=spaceLeft+marginLeft+paddingLeft+"px";
					if (document.getElementById('Menu'+i).scrollWidth>minimunLenght) 
						document.getElementById('subMenu'+i).style.width=document.getElementById('Menu'+i).scrollWidth-paddingLeft+"px";
				}
			}
		}
		
	}
	
	function posSubMenu3level(subMenu,number,level){
		//for each submenu3level know the correct position
		/*20 margin + 150 submenu + 16 submenu padding + 2 submenu border*/
		/*now not use because have little problem for display submenu with fx, the function is call onmouseover on li submenu*/
		
		/*
		var marginLeft=20;
		var border=2;
		var padding=0;//16
		var liheight=26;
		var topmenuborder=6;
		var menuLenght=document.getElementById(subMenu).clientWidth-1; //-1 for use the same border IE fix
		document.getElementById(level).style.left=marginLeft+border+padding+menuLenght+"px";
		document.getElementById(level).style.top=(liheight*number)+topmenuborder+"px";
		*/
		
	}
	
	function selectMenuOld(id, bool, className){
	//to delete in the future used only for old page... to check if the function is already used
		if (bool) {
			if (document.getElementById(id)) document.getElementById(id).className=className;
		}else{
			if (document.getElementById(id)) document.getElementById(id).className='';
		}
	}
	
	function selectMenu(id, className){
	//for Tools and Menu
		if (className) {
			if (document.getElementById(id)) document.getElementById(id).className=className;
		}else{
			if (document.getElementById(id)) document.getElementById(id).className='';
		}
	}
	
	//Email//
	
	function checkEmail(emailAddress) {
		Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
		if (!Filtro.test(emailAddress)) {
			alert('Please correct the following invalid email address:\n'+emailAddress);
		}
	}
	
	function cryptMailto(s) {	//
	// JS function for uncrypting spam-protected emails:
		var n=0;
		var r="";
		for(var i=0; i < s.length; i++) {
			n=s.charCodeAt(i);
			if (n>=8364) {n = 128;}
			r += String.fromCharCode(n+(1));
		}
		return r;
	}
	
	function UnCryptMailto(s) {	//
	// JS function for uncrypting spam-protected emails:
		var n=0;
		var r="";
		for(var i=0; i < s.length; i++) {
			n=s.charCodeAt(i);
			if (n>=8364) {n = 128;}
			r += String.fromCharCode(n-(1));
		}
		return r;
	}
	
	function linkTo_UnCryptMailto(s)	{	//
	// JS function for uncrypting spam-protected emails:
		location.href=UnCryptMailto(s);
		//alert(UnCryptMailto(s));
	}
	
	//Popup//
	
	function openPopup() {
		setOpacity('content',3);
		setOpacity('toolsIco',3);
		setOpacity('toolsOpen',3);
		setOpacity('footer',3);
		setOpacity('redBox',3);
		document.getElementById('popup').style.display = 'block';
	}
	
	function closePopup() {
		document.getElementById('popup').style.display = 'none';
		setOpacity('content',10);
		setOpacity('toolsIco',10);
		setOpacity('toolsOpen',10);
		setOpacity('footer',10);
		setOpacity('redBox',10);
	}
	
	function setOpacity(id,value) {
		document.getElementById(id).style.opacity = value/10;
		document.getElementById(id).style.filter = 'alpha(opacity=' + value*10 + ')';
	}
	
	//Popup//
	
	function selectedSearch(id,color){
		if (document.getElementById(id)) document.getElementById(id).style.background=color;	
	}
	
	function HiddenSelect(id)	{
		if (document.getElementById(id)) document.getElementById(id).style.visibility = 'hidden';
	}
	
	function ShowSelect(id)	{
		if (document.getElementById(id)) document.getElementById(id).style.visibility = 'visible';
	}

	

	