	//Menu//
	var numMenu = 7;
	var srctemp=""
	
	function showMenu(num,src){
		num=num.substring(1,2);
		srctemp=document.getElementById('m'+num).src;
		document.getElementById('m'+num).src=src;
		if (document.getElementById('s'+num)) {
			document.getElementById('s'+num).style.display='block';
			/* not mandatory
			for (i=1; i<=numMenu; i++) {
				if (i!=num)
					if (document.getElementById('s'+i)){
						document.getElementById('s'+i).style.display='none';
					}
			}	
			*/
		}
	}
	
	function hiddenMenu(num){
		num=num.substring(1,2);
		document.getElementById('m'+num).src=srctemp;
		if (document.getElementById('s'+num)) document.getElementById('s'+num).style.display='none';
	}
	
	function SearchOnWebSite(SearchType){
		if (SearchType == "Header"){
			if (document.frmSearch.TextSearch.value == "") alert("Insert word(s)")
			else if (document.frmSearch.TextSearch.value != "" && document.frmSearch.TextSearch.value.length <= 2) alert("The word(s) must be at least 3 characters")
			else document.frmSearch.submit();
		}
		else{
			if (document.frmBoxSearch.TextBoxSearch.value == "") alert("Insert word(s)")
			else if (document.frmBoxSearch.TextBoxSearch.value != "" && document.frmBoxSearch.TextBoxSearch.value.length <= 3) alert("The word(s) must be at least 3 characters")
			else document.frmBoxSearch.submit();			
		} 
	} 	
	
	function posSubMenu(){
		//for each submenu know the correct position
		var marginLeft=20;
		var paddingLeft=0;
		var minimunLenght=0;
		var border=2;
		var borderRight=1;
		for (i=1; i<=numMenu; i++) {
			if (document.getElementById('s'+i)){
				var spaceLeft=0;
				for (k=(i-1); k>=1; k--) {
					if (document.getElementById('m'+k)) {
						if(k!=i) {
							spaceLeft+=document.getElementById('m'+k).scrollWidth;
						}
					}
				}
				if (i==1)
					document.getElementById('s'+i).style.left=spaceLeft+marginLeft+"px";
				else
					if (i==numMenu)
						document.getElementById('s'+i).style.right=marginLeft-borderRight+"px"; 
					else
						document.getElementById('s'+i).style.left=spaceLeft+marginLeft+paddingLeft-border+"px";
				if (document.getElementById('m'+i).scrollWidth<minimunLenght) 
					document.getElementById('s'+i).style.width=document.getElementById('m'+i).scrollWidth-paddingLeft-border+"px";				
			}
		}
	}
	
	function ShowHideDetails(num){
		if (document.getElementById('d'+num)) {
			if (document.getElementById('d'+num).style.display=='block') {
				document.getElementById('r'+num).className='row';
				document.getElementById('i'+num).src='/images/icone/icoPiu.gif';
				document.getElementById('d'+num).style.display='none';
			}else{
				document.getElementById('r'+num).className='selectedrow';
				document.getElementById('i'+num).src='/images/icone/icoMeno.gif';
				document.getElementById('d'+num).style.display='block';
			}
		}
	}
	
	function ShowHideElencoTDS(num){
		if (document.getElementById('d'+num)) {
			if (document.getElementById('d'+num).style.display=='block') {
				document.getElementById('r'+num).className='row';
				document.getElementById('d'+num).style.display='none';
			}else{
				document.getElementById('r'+num).className='selectedrow';
				document.getElementById('d'+num).style.display='block';
			}
		}
	}	
	
	function PosArrow(){
		document.getElementById('arrow').style.display='block';
		var newtop = (document.getElementById('navsel').scrollHeight/30);
		if (newtop!=1) {
			document.getElementById('arrow').style.top=(newtop+15)+'px';
			document.getElementById('navsel').style.lineHeight='20px';
			document.getElementById('navsel').style.height=(newtop*20)+'px';
			document.getElementById('navsel').style.margin='5px 0px';
		}
	}	
	
	function NewWidth(){
		//1 solution
		parg = document.getElementById('selectSubMenu').parentNode;
		document.getElementById('selectSubMenu').style.width=parg.scrollWidth+'px';
		//2 solution
		maxwidth=0;
		if (parg.hasChildNodes()) {
			var children = parg.childNodes;
			for (var i = 0; i < children.length; i++) {
				if (children[i].scrollWidth > maxwidth) maxwidth=children[i].style.scrollWidth;
			}
		}
		document.getElementById('selectSubMenu').style.width=maxwidth+'px';
	}
	
	function histori(id){
		//alert(document.getElementById(id).style.backgroundImage);
		for (k=1; k<=6; k++) {
			if (document.getElementById('h'+k))
				document.getElementById('h'+k).style.backgroundImage='url(/images/aboutUs/h'+k+'.gif)';
		}
		if (document.getElementById(id)){			
			document.getElementById(id).style.backgroundImage='url(/images/aboutUs/'+id+'_a.gif)';
		}
	}
	//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));
		}
		alert(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));
	}
	
	
	function ApriPopUp(indirizzo,alt,lar){
		dimensione = "width=" + lar + ",height=" + alt ;
		mywindow = window.open(indirizzo,"Lamberti","left=0,top=0,resizable=yes,scrollbars=yes," + dimensione);  	
	}	
	
	function loadClickTds(idHref){
		document.getElementById(idHref).onclick();
	}
	