function displaySon (fO) {
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);
var num = document.getElementsByTagName('div');
xx = fO.split("_") ;
if (xx[0] == "menu") { 
for (var i=0;i<num.length;i++) { 
idx = num[i].id ;
arr = idx.split("_") ; 
if (arr[0] == "menu") { 	 	 
if(ie5 || ns6){ 
document.getElementById(idx).style.display="none";
}
if(ie4){
document.all[idx].style.display="none";
} 
} 		
}
}
if(ie5 || ns6){
document.getElementById(fO).style.display="inline";
}
if(ie4){
document.all[fO].style.display="inline";
}
}
function displayMenuSx(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('ctg_container').style.display="none";	
document.getElementById('marche_container').style.display="none";	
document.getElementById(fO).style.display="inline";
} 
}
if(ie4){
if (document.all[fO].style.display=="none") {
document.all['ctg_container'].style.display="none";
document.all['marche_container'].style.display="none";
document.all[fO].style.display="inline";
} 
}	
}
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 openPopup(url,w,h,scroll) {
l = (screen.width - w) / 2;
t = (screen.height - h) / 2;
wnd = window.open(url,"","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+", resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
wnd.focus();		
}
function returnProd(id_prodotto,id_prodotto_codice,id_prodotto_nome) {
window.opener.document.form.id_prodotto.value=id_prodotto ;
nome = id_prodotto_codice+" - "+id_prodotto_nome ; 
window.opener.document.form.id_prodotto_text.value=nome ;
self.close();	
}

function checkForm(){
var swKO = 0 ;
var msg = "" ;
var x = document.form.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 {
msg += "Indirizzo email inesatto.\n" ;
swKO = 1 ;	
} 

if (document.form.nome.value == "" ) {
msg += "Manca il nome.\n" ;
swKO = 1 ;
}
if (document.form.cognome.value == "" ) {
msg += "Manca il cognome.\n" ;
swKO = 1 ;
}	
if (swKO == 1) {
alert(msg);
return false ;	
}  
}

