
function homePopFornitori() {

	 
				 
	var elem = document.getElementById('homePopFornitori') ;
	elem.style.display='' ;
					
				
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}	
	
	//var l =( (myWidth - elem.style.width.substr(0,elem.style.width.length - 2)) / 2 ) - (elem.style.width.substr(0,elem.style.width.length - 2) / 2) ;
	var l = (myWidth - elem.style.width.substr(0,elem.style.width.length - 2)) / 2 ;
	var t = scrOfY + ((myHeight - elem.style.height.substr(0,elem.style.height.length - 2)) / 2) ;

				 
					
	elem.style.top = t ;
	elem.style.left = l ;
					
	url  = "../ajax/ajax.php?" ;
	url += "&action=homePopFornitori" ;
	  
 	 
	var ajaxObj = new ClassAJAX();
		ajaxObj.setExecute(false) ;
		ajaxObj.setReturn(true) ;
		ajaxObj.runAJAX(url) ;
		
		var html = "" ;
		var htmlOld = "" ;
	
		myInterval = window.setInterval(
		function() {
			htmlOld = html ;
			html = ajaxObj.getHtml() ;
			if (html != false) {
	
				if (htmlOld == html) {
	
					window.clearInterval(myInterval);

						elem.innerHTML=html ;
	
				}
	
			} else {
				//alert ("") ;
			}
		}
		,1) ;		 
  
		
		
		/*
		var arrayPageSize = getPageSize();
		var w = arrayPageSize[0] ;
		var h = arrayPageSize[1] ;
		
		var bodyPage = document.getElementById("body") ;
		
		var divNode = document.createElement('div') ;
		
		divNode.setAttribute('id', 'patina') ;	
		divNode.style.display="" ;
		divNode.style.backgroundImage="url(http://www.idorcomponenti.it/img/g.gif)" ;
		divNode.style.position="absolute" ;
		divNode.style.width=w+"px" ;
		divNode.style.height=h+"px";
		
		divNode.style.zIndex="91";	
		divNode.style.top = "0px" ;
		divNode.style.left = "0px" ;
				
		/*divNode.innerHTML = '<div id="'+this.spanLoading + this.idSpanCounter +'_inner" style="position:absolute; left:'+l+'px; top:'+t+'px; width:300px; height:100px;">' + 
							'<table class="caricamento" border="0" cellpadding="0" cellspacing="0" width="300" height="100">' +
							'<tr><td valign="middle" align="center">' +
							'<b>Waiting...</b>&nbsp;&nbsp;<img align="absmiddle" src="http://wezimple.com/img/loading.gif">' +
							'</td></tr>'+
							'</table>' +
							'</div>' ;*/
								
						
		//bodyPage.appendChild(divNode) ;

}




function homePop(pagina) {

	 
				 
	var elem = document.getElementById('homePop') ;
	elem.style.display='' ;
					
				
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}	
	
	//var l =( (myWidth - elem.style.width.substr(0,elem.style.width.length - 2)) / 2 ) - (elem.style.width.substr(0,elem.style.width.length - 2) / 2) ;
	var l = (myWidth - elem.style.width.substr(0,elem.style.width.length - 2)) / 2 ;
	var t = scrOfY + ((myHeight - elem.style.height.substr(0,elem.style.height.length - 2)) / 2) ;

				 
					
	elem.style.top = t ;
	elem.style.left = l ;
					
	url  = "../ajax/ajax.php?" ;
	url += "&action=homePop" ;
	url += "&pagina="+pagina ;
	 
 	 
	var ajaxObj = new ClassAJAX();
		ajaxObj.setExecute(false) ;
		ajaxObj.setReturn(true) ;
		ajaxObj.runAJAX(url) ;
		
		var html = "" ;
		var htmlOld = "" ;
	
		myInterval = window.setInterval(
		function() {
			htmlOld = html ;
			html = ajaxObj.getHtml() ;
			if (html != false) {
	
				if (htmlOld == html) {
	
					window.clearInterval(myInterval);

						elem.innerHTML=html ;
	
				}
	
			} else {
				//alert ("") ;
			}
		}
		,1) ;		 
  

}


function checkFormContatto() { 	
		var swKO = 0 ;
		 
 
		// sezione valida email
		var x = document.contatto.email.value;
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(x)) {
		//alert('YES! Correct email address');
		} else {
		alert('Indirizzo email inesatto.');
		swKO = 1 ;	
		} 

		// sezione campi obbligatori
		if (document.contatto.nome.value == "" ) {
		alert('Manca il nome.');
		swKO = 1 ;
		}
 	
		if (document.contatto.email.value == "" ) {
		alert('Manca l\' email.');
		swKO = 1 ;
		} 
		
		if (document.contatto.messaggio.value == "" ) {
		alert('Manca il messaggio.');
		swKO = 1 ;
		} 
 
		
		
		var the_box1 = document.contatto.acconsento1[1].checked;
		
		 
		if (the_box1 == true) {
		alert('Devi accettare la clausola .');
		swKO = 1 ;
		}
 		 
					
		if (swKO == 1) {
			 
		return false ;	
		}  
}	
