

<!-- 	/*controllo form*/	
function convalida(){
	var erroremsg="";
	frm = document.forms['contatti'];
		
	var chiocciola=frm.email.value.indexOf("@",0);	
	var punto=frm.email.value.indexOf(".",chiocciola);	
	var cippa=frm.email.value.length;


	// dati
	if (frm.Nome.value  == ""){
		erroremsg = erroremsg + "* nome" + "\n";
	}
	
	if (frm.Cognome.value  == ""){
		erroremsg = erroremsg + "* cognome" + "\n";
	}

	if (frm.email.value == ""){
		erroremsg = erroremsg + "* e-mail " + "\n";
		}
		else if (frm.email.value.length<5)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
		}
		else if (chiocciola<0 ||	punto<0 ||	cippa<4)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
	}
	
	if (frm.Commenti.value  == ""){
		erroremsg = erroremsg + "* Note" + "\n";
	}		
	
	if (frm.privacy[1].checked || !frm.privacy[0].checked) {
		erroremsg = erroremsg + "* Informativa sulla privacy" + "\n";
	}
	
	if (erroremsg=="") {
		//alert(invierebbe)
		frm.submit();
	} 
	
	else {
		erroremsg = 'Mancano i seguenti campi obbligatori:\n'+ '\n' + erroremsg;
		alert(erroremsg);
	}
}
//-->

<!-- 	/*controllo form Area riservata RIVENDITORI */	
function convalidaAccesso(){
	var erroremsg="";
	frm = document.forms['loginRivenditori'];

	// dati
	if (frm.userid.value  == ""){
		erroremsg = erroremsg + "* Username" + "\n";
	}
	
	if (frm.password.value  == ""){
		erroremsg = erroremsg + "* Password" + "\n";
	}
	
	if (erroremsg=="") {
		//alert(invierebbe)
		frm.submit();
	} 
	
	else {
		erroremsg = 'Mancano i seguenti campi obbligatori:\n'+ '\n' + erroremsg;
		alert(erroremsg);
	}
}
//-->

<!-- 	/*controllo Registrazione*/	
function convalidaRegistrazione(){
	var erroremsg="";
	frm = document.forms['registrazione'];
		
	var chiocciola=frm.email.value.indexOf("@",0);	
	var punto=frm.email.value.indexOf(".",chiocciola);	
	var cippa=frm.email.value.length;


	// dati
	if (frm.nome.value  == ""){
		erroremsg = erroremsg + "* Nome" + "\n";
	}
	
	if (frm.cognome.value  == ""){
		erroremsg = erroremsg + "* Cognome" + "\n";
	}
	if (frm.professione.value  == ""){
		erroremsg = erroremsg + "* Professione" + "\n";
	}

	if (frm.citta.value  == ""){
		erroremsg = erroremsg + "* Cittą" + "\n";
	}	
	if (frm.cap.value  == ""){
		erroremsg = erroremsg + "* Cap" + "\n";
	}
	if (frm.indirizzo.value  == ""){
		erroremsg = erroremsg + "* Indirizzo" + "\n";
	}	
	
	if (frm.email.value == ""){
		erroremsg = erroremsg + "* E-mail " + "\n";
		}
		else if (frm.email.value.length<5)
		{
		erroremsg = erroremsg + "* E-mail (non corretta)" + "\n";
		}
		else if (chiocciola<0 ||	punto<0 ||	cippa<4)
		{
		erroremsg = erroremsg + "* E-mail (non corretta)" + "\n";
	}
	
	if (frm.telefono.value  == ""){
		erroremsg = erroremsg + "* Telefono" + "\n";
	}
	
	
	
	if (frm.IscrizioneOrdine.value  == ""){
		erroremsg = erroremsg + "* N. Iscrizione ordine med./farm." + "\n";
	}	
	if (frm.CittaIscrizione.value  == ""){
		erroremsg = erroremsg + "* Cittą d'iscrizione" + "\n";
	}	
	
	if (frm.privacy[1].checked || !frm.privacy[0].checked) {
		erroremsg = erroremsg + "* Informativa sulla privacy" + "\n";
	}
	
	if (erroremsg=="") {
		//alert(invierebbe)
		frm.submit();
	} 
	
	else {
		erroremsg = 'Mancano i seguenti campi obbligatori:\n'+ '\n' + erroremsg;
		alert(erroremsg);
	}
}
//-->

<!-- metodo links
function intercetta() {
    for (var i=0; i<document.links.length; i++)
        if (document.links[i].className=="blank" | document.links[i].className=="generaleBlank") {
            document.links[i].target="_blank";
        }
}
window.onload = intercetta;
//-->


<!--  Funzione per l'effeto del menu!
$(document).ready(function() {
	 
	 // **************** center an element
	 	  //$('#foo').css({position: 'absolute'});
	  $('#centered').vCenter();   
	  
	  $(window).resize(function()  {
		$('#centered').vCenter();            
	  });
	 
	 
	/**
	 * @author Alexander Farkas
	 * v. 1.02*/
	
	(function($) {
		$.extend($.fx.step,{
			backgroundPosition: function(fx) {
				if (fx.state === 0 && typeof fx.end == 'string') {
					var start = $.curCSS(fx.elem,'backgroundPosition');
					start = toArray(start);
					fx.start = [start[0],start[2]];
					var end = toArray(fx.end);
					fx.end = [end[0],end[2]];
					fx.unit = [end[1],end[3]];
				}
				
				var nowPosX = [];
				nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
				nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
				fx.elem.style.backgroundPosition = nowPosX[0] + ' ' + nowPosX[1];
			//alert(' fx.elem.style.backgroundPosition ');
	
			   function toArray(strg){
				   strg = strg.replace(/left|top/g,'0px');
				   strg = strg.replace(/right|bottom/g,'100%');
				   strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
				   var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
				   return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
			   }
			}
		});
	})(jQuery); 
	
<!--   //-->	
	$(function(){
		
		$('#d a')
			.css( {backgroundPosition: "0 0"} )
			.mouseover(function(){
				$(this).stop().animate({backgroundPosition:"(0 -191px)"}, {duration:550})

			})
			.mouseout(function(){
				$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:600})
			})
	});

});

//-->
///////////////////////////
//animazione campi
//////////////////////////
function FieldFocus(xthis,strvalue)
{
	if (xthis.value==strvalue)
	{
		xthis.value='';
	}
}
function FieldBlur(xthis,strvalue)
{
	if (xthis.value=='')
	{
		xthis.value=strvalue;
	}
}
function gologin(valore)
{
    document.logform.azione.value=valore;
    document.logform.submit()
}