function newsletter_submitform(azione) {
	var objRegExp02 = /^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/; //email
	
	theForm = document.form_neswletter;
	if (theForm.email_newsletter.value == '') {
		alert ('Prego, inserire e-mail!');
		theForm.email_newsletter.focus();
		return false;
		
	} else if (!objRegExp02.test(theForm.email_newsletter.value)) {
		alert ('Formato e-mail non valido! Prego, riprovare...');
		theForm.email_newsletter.focus();
		return false;
	} else {
		if (theForm.email_newsletter.value != '' && azione) {
			theForm.action = 'newsletter_resp.php?action='+azione;
			theForm.submit();
			return true;
		}
	}
}

function catToggle(id1,id2,valign) {
	var obj1 = document.getElementById(id1);
	var obj2 = document.getElementById(id2);
	(obj1.className=="itemshown") ? obj1.className="itemhidden" : obj1.className="itemshown"; 
	(obj1.className=="itemshown") ? obj2.innerHTML="<img border='0' src='../../../images/g_arrow1.gif' alt='[&ndash;]' style='vertical-align:"+valign+"'>" : obj2.innerHTML="<img border='0' src='../../../images/g_arrow0.gif' alt='[+]' style='vertical-align:"+valign+"'>"; 
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function toggleLayer(whichLayer, hiddenLayer) {
	if(navigator.appName == "Microsoft Internet Explorer") {
		var visibility = "block";
	} else {
		var visibility = "table-row";
	}
	whichLayerSplit = whichLayer.split(",");
	//alert(whichLayerSplit.length);
	for (i=0;i<whichLayerSplit.length;i++) {
		if (document.getElementById) {
		// this is the way the standards work
		var styleLayer = document.getElementById(whichLayerSplit[i]).style;
		styleLayer.display = visibility;
		} else if (document.all) {
		// this is the way old msie versions work
		var styleLayer = document.all[whichLayerSplit[i]].style;
		styleLayer.display = visibility;
		} else if (document.layers) {
		// this is the way nn4 works
		var styleLayer = document.layers[whichLayerSplit[i]].style;
		styleLayer.display = visibility;
		}
	}
	hiddenLayerSplit = hiddenLayer.split(",");
	for (i=0;i<hiddenLayerSplit.length;i++) {
		if (document.getElementById) {
		// this is the way the standards work
		var styleLayer2 = document.getElementById(hiddenLayerSplit[i]).style;
		styleLayer2.display = "none";
		} else if (document.all) {
		// this is the way old msie versions work
		var styleLayer2 = document.all[hiddenLayerSplit[i]].style;
		styleLayer2.display = "none";
		} else if (document.layers) {
		// this is the way nn4 works
		var styleLayer2 = document.layers[hiddenLayerSplit[i]].style;
		styleLayer2.display = "none";
		}
	}
}

function ordine_step1(){
	elem = document.getElementById("submit_form");
	elem.disabled = true;
    document.ordine1.method = "post";
    document.ordine1.action = "ordine.php";
    document.ordine1.submit();
}

function ordine_step3(uri,check_determina){
	elem1 = document.getElementById("determina");
	if (check_determina==true && elem1.value == '') {
		alert ('Prego, inserire determina!');
		elem1.focus();
		return false;
	} else {
	elem = document.getElementById("procedi_buttn");
	elem.disabled = true;
    document.ordine3.method = "post";
    document.ordine3.action = uri;
    document.ordine3.submit();
	return true;
	}
}

function acquisto_prodotto(){
		theForm = document.forms['buy_prodotto'];
		theForm.method = "post";
		theForm.action = "carttmp.php";
		theForm.submit();
}
