function ZoomCartina(str){
   	searchWin = window.open(str,'ingradimento_cartina','left=0, top=0, scrollbars=no, width=600, height=450, resizable=no, status=no, location=no, toolbar=no');
  	// searchWin.refer = self;
}
function ZoomFotoStoria(str, H){
   	searchWin = window.open(str,'ingradimento_foto','left=0, top=0, scrollbars=no, width=400, height='+ (H + 55) + ', resizable=no, status=no, location=no, toolbar=no');
  	// searchWin.refer = self;
}

function ZoomFoto(sPaginaASP, iFotoH){
	searchWin = window.open(sPaginaASP,'ingrandimento_foto','left=0, top=0, scrollbars=no, width=400, height='+ (iFotoH + 35) + ', resizable=no, status=no, location=no, toolbar=no');
    // searchWin.refer = self;
}


function ZoomFotoTrucks(sPaginaASP, iFotoH){
	searchWin = window.open(sPaginaASP,'ingrandimento_foto','left=0, top=0, scrollbars=no, width=400, height='+ (iFotoH + 35) + ', resizable=no, status=no, location=no, toolbar=no');
    // searchWin.refer = self;
}

function isEmail(string, sNomeCampo) {
    var intMinLen = 6;
    if(string.length < intMinLen) 
        {
        alert("Inserire nel campo " + sNomeCampo + " un indirizzo email valido");
        return (false);
        }

   var iChars = "*|,\":<>[]{}`\';()&$#%";
   for (var i = 0; i < string.length; i++) 	{
//	  alert (string + ' ' + i + ' ' + string.charAt(i) ); 
      
      if (iChars.indexOf(string.charAt(i)) != -1)
		{
         alert("Attenzione! Il campo " + sNomeCampo + " contiene caratteri non consentiti");
         return (false);
		}
	}

	var txtAmpersand = /@/i;
    if( string.search(txtAmpersand) < 0 ) 
       {
        alert("Attenzione! Nel campo " + sNomeCampo + " manca il separatore (@) tra account e dominio");
        return (false);
        }

    var txtDot = /(\.)/i;
    if( string.search(txtDot) < 0 ) 
        {
        alert("Attenzione! Nel campo " + sNomeCampo + " manca il separatore (.) di dominio");
       return (false);
        }

   return true;
}              


function isProper(string) {
   if (!string) return false;
   var iChars = "*|,\":<>[]{}`\';()@&$#%";

   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1)
         return false;
   }
   return true;
} 
