<!-- COPYRIGHT 2006 Studio 23® -->
<!-- Ogni uso anche se parziale della seguente pagina è reato. Tutti i diritti sono riservati.-->
<!--
function controllodati(which)
{
 var pass = true;
 if (document.images)
  {
   for (i = 0;i < which.length; i++)
    {
     var tempobj = which.elements[i];
     if ((((tempobj.type == "text") || (tempobj.type == "password"))&& (tempobj.value == '')) || ((tempobj.type.toString().charAt(0) == "s") && (tempobj.selectedIndex == -1)))
      {
	   pass = false;
       break;
      } 
    } // fine for
  }
 if (!pass)
  {
   alert("Non hai compilato correttamente il form. Alcune informazioni non sono state inserite. ");
   return false;
  }
 else
  {
   var psw,cpsw
   for (i = 0;i < which.length; i++)
    {
	 var tempobj = which.elements[i];
     if(tempobj.name == "nuovapass")
      psw = tempobj.value;
	 if(tempobj.name == "nuovacopass")
      {
	   cpsw = tempobj.value;
       break;
      }
    } // fine for
   if (psw == cpsw)
    return true;
   else
    {
	 alert("Hai inserito una password di conferma diversa dalla prima!!");
     return false;
    }
  }
}

function controllodatifoto(which)
{
 var pass = true;
 var por = true;
 var rep = true;
 var gen = true;
 var prezzo1 = true; var prezzo2 = true; var prezzo3 = true; var contattami = true;
if (document.images)
  {
   for (i = 0;i < which.length; i++)
    {
     var tempobj = which.elements[i];
     if ((tempobj.name == "sorgente") || (tempobj.name == "infoit") || (tempobj.name == "codice"))
      {
       if ((((tempobj.type == "text") || (tempobj.type == "file")) && (tempobj.value == '')) || ((tempobj.type.toString().charAt(0) == "s") && (tempobj.selectedIndex == -1)))
        {
		 pass = false;
         break;
        } 
      }
 	 if  ((tempobj.name == "sorgente") && (tempobj.value.indexOf('?',0) != -1))
	  {
	   alert("Il nome del file non può contenere il carattere '?' per conflitti col Server.");
	   return false;		   
	  }
	 if ((tempobj.name == "prezzo1") && (isNaN(tempobj.value))) // Se il valore è numerico restituisce false, in caso contrario restituisce true	  
	  {
	   alert("E' stato immesso un carattere e non un prezzo!!!!");
	   return false;
	  }
	 if ((tempobj.name == "prezzo2") && (isNaN(tempobj.value))) // Se il valore è numerico restituisce false, in caso contrario restituisce true	  
	  {
	   alert("E' stato immesso un carattere e non un prezzo!!!!");
	   return false;
	  }
	 if ((tempobj.name == "prezzo3") && (isNaN(tempobj.value))) // Se il valore è numerico restituisce false, in caso contrario restituisce true	  
	  {
	   alert("E' stato immesso un carattere e non un prezzo!!!!");
	   return false;
	  }
	 if ((tempobj.name == "prezzo1") && ((tempobj.value == "") || (tempobj.value == "0")))
	  {prezzo1 = false;}
	 if ((tempobj.name == "prezzo2") && ((tempobj.value == "") || (tempobj.value == "0")))
	  {prezzo2 = false;}
	 if ((tempobj.name == "prezzo3") && ((tempobj.value == "") || (tempobj.value == "0")))
	  {prezzo3 = false;}
	 if ((tempobj.type == "checkbox") && (tempobj.checked == false) && (tempobj.name == "contattami"))
	  {contattami = false;} 
	 if ((tempobj.name == "reportage") && (tempobj.value != "0"))
	  {rep = false;}
	 if ((tempobj.name == "portfolio") && (tempobj.value != "0"))
	  {por = false;}
	 if ((tempobj.type == "checkbox") && (tempobj.checked == true) && (tempobj.name == "generica")) 
	  {gen = false;}
	} // fine for
  }
 if ((!por && !rep) || (!gen && !por) || (!gen && !rep))
  {
   alert ("Non puoi inserire la foto contemporaneamente nel Portfolio e nel Reportage e nella cartella Generica. Deseleziona uno dei due.");
   return false;
  }
 if (!pass)
  {
   alert("Non hai compilato correttamente il form. Alcune informazioni non sono state inserite. ");
   return false;
  }
 if ((por && rep) && gen)
  {
   alert("Devi selezionare o un Reportage o un Portfolio o la foto generica.");
   return false;
  }
 if (!prezzo1 && !prezzo2 && !prezzo3 && !contattami)
  {
   alert("Devi dare un prezzo alla foto oppure selezionare il campo contattare agenzia.");
   return false;	  
  }
 return true;
}

function controllodatireportage(which)
{
 var pass = true;
 if (document.images)
  {
   for (i = 0;i < which.length; i++)
    {
     var tempobj = which.elements[i];
     if ((tempobj.name == "nome") || (tempobj.name == "nomeingl") || (tempobj.name == "paese") || (tempobj.name == "paeseingl") || (tempobj.name == "data"))
      { 
   	   if ((tempobj.name == "nome") && (tempobj.value.toLowerCase() == "generica"))
	    {
		 alert("Il nome non può essere \"Generica\"");
		 return false;
		}
	   if ((tempobj.name == "nome") && (tempobj.value.indexOf('?',0) != -1))
	    {
	     alert("Il nome dell'album non può contenere il carattere '?' per conflitti col Server.");
	     return false;		   
	    }
       if (((tempobj.type == "text") && (tempobj.value == '')) || ((tempobj.type.toString().charAt(0) == "s") && (tempobj.selectedIndex == -1)))
        {
  	     pass = false;
         break;
        }
      }
    } // fine for
  }
 if (!pass)
  {
   alert("Non hai compilato correttamente il form. Alcune informazioni non sono state inserite. ");
   return false;
  }
 return true;
}


function controllodatinews(which)
{
 var pass = true;
 if (document.images)
  {
   for (i = 0;i < which.length; i++)
    {
     var tempobj = which.elements[i];
       if (((tempobj.type == "text") && (tempobj.value == '')) || ((tempobj.type.toString().charAt(0) == "s") && (tempobj.selectedIndex == -1)))
        {
         pass = false;
         break;
	    }
    } // fine for
  }
 if (!pass)
  {
   alert("Non hai compilato correttamente il form. Alcune informazioni non sono state inserite. ");
   return false;
  }
 return true; 
}

function controllodatimail(which)
{
 var pass = true;
 if (document.images)
  {
   for (i = 0;i < which.length; i++)
    {
	 var tempobj = which.elements[i];
     if (((tempobj.type == "text") && (tempobj.value == '')) || ((tempobj.type.toString().charAt(0) == "s") && (tempobj.selectedIndex == -1)))
      {
	   if ((tempobj.name == "pariva") || (tempobj.name == "nazione") || (tempobj.name == "citta"))	
	   {/*vuoto*/}
	   else
	    {
	     pass = false;
         break;
		}
      }
	 if (tempobj.name == "telefono")
      {
	   if (tempobj.value.indexOf('',0) == -1)
	    {
		 for (a = 0;a < which.length; a++)
          {
	       var tempobj2 = which.elements[a];
		   if(tempobj2.name == "lingua")
            {
			 if (tempobj2.value == "en")
			  alert("Phone number must contain only number!");
			 else
              alert("Il numero di Telefono deve contenere solo numeri!");
			 break;
		    }
		  }	
		}
	  }
     if(tempobj.name == "mail")
      {
	   if ((tempobj.value.indexOf('@',0) == -1) || (tempobj.value.indexOf ('.',0) == -1))
 	   {
		for (a = 0;a < which.length; a++)
         {
	      var tempobj2 = which.elements[a];
		  if(tempobj2.name == "lingua")
           {
			if (tempobj2.value == "en")
			 alert("E-mail address must contain " + "the characters '@' and '.'\n" + "Must be youraddress@domain.state ");
			else
             alert("L'indirizzo e-mail deve contenere " + "i caratteri '@' e '.' \n" + "Deve essere del tipo tuoindirizzo@dominio.stato ")	;
			 break;
		   }
		 }
   	    return false;
   	   }
      }
    }
  }
 if (!pass)
 {
  for (a = 0;a < which.length; a++)
   {
    var tempobj2 = which.elements[a];
    if(tempobj2.name == "lingua")
     {
	  if (tempobj2.value == "en")
	   alert("The form isn't compiled correctly. Some information forgotten. ");
	  else
       alert("Non hai compilato correttamente il form. Alcune informazioni non sono state inserite. ");
	  break;
	 }
   }
  return false;
 }
  return true; 
}
/*
function BrowserCheck() 
 {
  var b = navigator.appName;
 if (b == "Netscape") 
  this.b = "ns";
 else if (b == "Microsoft Internet Explorer") 
  this.b = "ie";
 else 
  this.b = b;
 this.version = navigator.appVersion;
 this.v = parseInt(this.version);
 this.ns = (this.b == "ns" && this.v >= 4);
 this.ns4 = (this.b == "ns" && this.v == 4);
 this.ns5 = (this.b == "ns" && this.v == 5);
 this.ie = (this.b == "ie" && this.v >= 4);
 this.ie4 = (this.version.indexOf('MSIE 4') > 0);
 this.ie5 = (this.version.indexOf('MSIE 5') > 0);
 this.min = (this.ns || this.ie);
}

is = new BrowserCheck();
function init() 
{
 if(document.images) 
  {
   document.images.onmousedown = mouseDown;
   for(i = 0;i < document.images.length; i++) 
    document.images[i].onmousedown = mouseDown;
  }
}

function mouseDown(e) 
{
 if ((is.ns && e.which == 1) || (is.ie && event.button == 1)) 
  {    }
 else 
  {
   if (is.ie) 
    alert("Copyright!");
   else if (is.ns) 
    setTimeout('alert("Copyright!")',50);
  }
}
*/

function MM_preloadImages() { //v3.0
  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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}


function popUp(strURL, strType, strHeight, strWidth) 
{ 
 newWin = null; 
 if (newWin != null && !newWin.closed) 
   newWin.close(); 
 strOptions=""; 
 if (strType=="console") 
   strOptions="channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,height="+strHeight+",width="+strWidth; 
 if (strType=="fixed") 
   strOptions="status,height="+strHeight+",width="+strWidth; 
 if (strType=="elastic") 
   strOptions="toolbar,menubar,scrollbars,"+"resizable,location,height="+strHeight+",width="+strWidth;
 newWin = window.open(strURL, 'newWin', strOptions); 
 newWin.focus(); 
}
//-->