// JavaScript Document

<!--
// template 

//function br(var) {
//	if (var !="")
//	    return "";
//	else 
//	    return "<br>";
//}

function mandaxaf() {
	if (window.confirm('<<4-confirm_print>>')) window.open('prntFAX.htm','prnt', 'width=550,height=640,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1')
}
		    
						
function dettaglio() {

  this.codice=var1; //"Codice Coupon"
  this.perc_sconto=var2; //"% di sconto"
  this.importo=var3; //"Importo sconto"

} 


function click_dettaglio(tag) {
					 
						var str = tag ;
						var str2 = str.slice(2,20); // slice(2,8)
						cerca="a href";
						 // document.write(str2);
						if (str2 != cerca)
		  					{ document.write('<span class="scheda"></span>');			 
							} else
							{ document.write('<br><span class="scheda"><b>Click per Scheda</b></span>');			 
							}
							
}


function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}

function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}


function Mostra(x)
{
  if (document.getElementById(x)) 
	  document.getElementById(x).style.display = '';
}


function Nascondi(x)
{
  if (document.getElementById(x)) 
    document.getElementById(x).style.display = 'none';
}


function MostraNascondi(x)
{
  if (document.getElementById(x)) 
  {
    if (document.getElementById(x).style.display == '')
    {
    	document.getElementById(x).style.display = 'none';
    }
    else
    {
    	document.getElementById(x).style.display = '';
    }
  }
}

var isNS4 = (document.layers) ? true : false;
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;

function switchDiv(strDivName,bolVisible)
{
	if (isNS4)
	{
	 objElement = document.layers[strDivName];
	}
	else if (isIE4)
	{
	 objElement = document.all[strDivName];
	}
	else if (isIE5 || isNS6)
	{
	 objElement = document.getElementById(strDivName);
	}
	
	if(isNS4){
	   if(!bolVisible) {
		 objElement.visibility ="hidden"
	   } else {
		 objElement.visibility ="visible"
	   }     
	 }else{
	   if(!bolVisible) {
		 objElement.style.visibility = "hidden";
	   } else {
		 objElement.style.visibility = "visible";
	   }
	}
}

function privacy_nwl(){
if (document.newsletter.privacy.checked == false) {
	 window.alert("Per iscriverti alla newsletter devi leggere l'informativa Privacy");
	 return false;
	}
}

function isEmail(strEmail){
    validRegExp = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    if (strEmail.search(validRegExp) == -1) {
      alert('Inserire un indirizzo e-mail valido');
      return false;
    }
    return true;
  }


//-->
