function showFiglio (codice,imgName) {
			
	altro_el = document.getElementById(codice).style; 
	//spanName = document.getElementById(imgName).style;
	
	if(altro_el.display == "") {
		altro_el.display = "none" ;
		//spanName.backgroundImage = "url(img/pallino.gif)" ;
		spanName.backgroundRepeat = "no-repeat" ;
	}else {
		altro_el.display = "" ;
		//spanName.backgroundImage = "url(img/pallino.gif)" ;
		spanName.backgroundRepeat = "no-repeat" ;
	}
}


function popup(url_pagina,w,h,sw_scroll) {

	  l = (screen.width - w) / 2;
	  t = (screen.height - h) / 2;
	
	  wnd = window.open(url_pagina,"","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+sw_scroll+", resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	  wnd.focus();		

}

function toggleDisplay(fO){

	var ns4 = (document.layers);
	var ie4 = (document.all && !document.getElementById);
	var ie5 = (document.all && document.getElementById);
	var ns6 = (!document.all && document.getElementById);
	
	
	if(ie5 || ns6){
		if (document.getElementById(fO).style.display=="none") {
		document.getElementById(fO).style.display="inline";
		}else{
		document.getElementById(fO).style.display="none";
		}
	}
	
	if(ie4){
		if (document.all[fO].style.display=="none") {
		document.all[fO].style.display="inline";
		}else{
		document.all[fO].style.display="none";
		}
	}	
}


function popupconfezione(id_prodotto) {

	
	  w = 492;
	  h = 600;
	  l = (screen.width - w) / 2;
	  t = (screen.height - w) / 2;
	
	  wnd = window.open("popupconfezione.php?id_prodotto="+id_prodotto,"","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	  wnd.focus();		

}

function popupcontatto() {

	
	  w = 672;
	  h = 500;
	  l = (screen.width - w) / 2;
	  t = (screen.height - w) / 2;
	
	  wnd = window.open("popupcontatto.php","","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	  wnd.focus();		

}

function checkForm() { 	
		var swKO = 0 ;
		
		
		
		// sezione valida email
		var x = document.formDepliant.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.formDepliant.nome.value == "" ) {
		alert('Manca il nome.');
		swKO = 1 ;
		}
		if (document.formDepliant.cognome.value == "" ) {
		alert('Manca il cognome.');
		swKO = 1 ;
		}	
		if (document.formDepliant.messaggio.value == "" ) {
		alert('Manca il messaggio.');
		swKO = 1 ;
		}
		if (document.formDepliant.citta.value == "" ) {
		alert('Manca la citta\'.');
		swKO = 1 ;
		}		
		if (document.formDepliant.cap.value == "" ) {
		alert('Manca il cap.');
		swKO = 1 ;
		}
		if (document.formDepliant.prov.value == "" ) {
		alert('Manca la provincia.');
		swKO = 1 ;
		}
		if (document.formDepliant.societa.value == "" ) {
		alert('Manca la societa\'.');
		swKO = 1 ;
		}
		if (document.formDepliant.tel.value == "" ) {
		alert('Manca il telefono\'.');
		swKO = 1 ;
		}
		if (document.formDepliant.indirizzo.value == "" ) {
		alert('Manca l\' indirizzo\'.');
		swKO = 1 ;
		}
		if (document.formDepliant.attivita.value == "" ) {
		alert('Manca l\' attivita\'.');
		swKO = 1 ;
		}
					
		if (swKO == 1) {
		return false ;	
		}  


}

function checkFormContatto () {
	var swKO = 0 ;
		
		
 
		// sezione valida email
		var x = document.formContatto.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.formContatto.nome.value == "" ) {
		alert('Manca il nome.');
		swKO = 1 ;
		}
		if (document.formContatto.cognome.value == "" ) {
		alert('Manca il cognome.');
		swKO = 1 ;
		}
		if (document.formContatto.azienda.value == "" ) {
		alert('Manca l\' azienda.');
		swKO = 1 ;
		}		
		if (document.formContatto.messaggio.value == "" ) {
		alert('Manca il messaggio.');
		swKO = 1 ;
		}	
		if (swKO == 1) {
		return false ;	
		}  
}