function Popup(locazione,larg,alt) {
newwindow = window.open (locazione, "NewWin", "toolbar=no, scrollbars=yes, location=no, resizable=yes, width="+larg+", height="+alt+", left=0, top=0, right=0, bottom=0");
newwindow.creator=self;
}

function popup(locazione,larg,alt,name) {
newwindow = window.open (locazione, name, "toolbar=no, scrollbars=yes, location=no, resizable=yes, width="+larg+", height="+alt+", left=0, top=0, right=0, bottom=0");
newwindow.creator=self;
}

function redirect(pagina){
	location.href=pagina;
	}

function conferma()
{
    var confirmMsg  = 'Are you sure to delete? ';
    var is_confirmed = confirm(confirmMsg + ' \n');
    return is_confirmed;
}

function afficheMaxi(chemin)
	{
	i1 = new Image;
	i1.src = chemin;
	html = '<HTML>\n<HEAD>\n<TITLE>Image</TITLE>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>\n<CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER>\n</BODY>\n</HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
	};
	
	
	
function trim(x) 
		{
			return x.toString().replace(/^[ \t\r\n]+/,'').replace(/[ \t\r\n]+$/,'');
		}
		
	
	

//controlla il form nel campo contatti
function checkform_c(Form) 
{
   var descrErrore = "Error:";
   var errore = false;

   // Controllo sul campo name
   if (trim(Form.nome.value).length==0) 
   {
      descrErrore += "\n- Fill \"Name\"";
      if (!errore) Form.nome.focus();
      errore = true;
   }
   
      // Controllo sul campo cognome
   if (trim(Form.cognome.value).length==0) 
   {
      descrErrore += "\n- Fill \"Surname\"";
      if (!errore) Form.cognome.focus();
      errore = true;
   }
   
   // Controllo sul campo e-mail
   if (trim(Form.email.value).length==0) 
   {
      descrErrore += "\n- Fill \"E-Mail\"";
      if (!errore) Form.email.focus();
      errore = true;
   }
   else 
   {
      // controllo forma dell'email
      if (Form.email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) 
      {
         descrErrore += "\n-  \"E-Mail\" must be liki name@domain.com";
         if (!errore) 
	 {
            Form.email.select();
            Form.email.focus();
         }
      errore = true;
      }
   }
   
/*
    if (trim(Form.messaggio.value).length==0) 
   {
      descrErrore += "\n- Fill a message";
      if (!errore) Form.messaggio.focus();
      errore = true;
   }*/
   
   /*	if (Form.disclaimer.checked==false) 
   {
      descrErrore += "\n- Devi accettare l'informativa";
      errore = true;
   }
   */
   if (errore) 
   {
      alert(descrErrore);
      return false;
   }
   else 
   {
      return true;
   }

}













//controlla il form nel campo contatti-company
function checkform_ccompany(Form) 
{
   var descrErrore = "Error:";
   var errore = false;

      // Controllo sul campo name
   if (trim(Form.nomecompany.value).length==0) 
   {
      descrErrore += "\n- Fill \"Company Name\"";
      if (!errore) Form.nomecompany.focus();
      errore = true;
   }
   
      // Controllo sul campo name
   if (trim(Form.nomer.value).length==0) 
   {
      descrErrore += "\n- Fill \"Responsable Name\"";
      if (!errore) Form.nomer.focus();
      errore = true;
   }
   
      // Controllo sul campo cognome
   if (trim(Form.cognomer.value).length==0) 
   {
      descrErrore += "\n- Fill \"Responsable Surname\"";
      if (!errore) Form.cognomer.focus();
      errore = true;
   }
   
   
   
   // Controllo sul campo name
   if (trim(Form.nome.value).length==0) 
   {
      descrErrore += "\n- Fill \"Referent Name\"";
      if (!errore) Form.nome.focus();
      errore = true;
   }
   
      // Controllo sul campo cognome
   if (trim(Form.cognome.value).length==0) 
   {
      descrErrore += "\n- Fill \"Referent Surname\"";
      if (!errore) Form.cognome.focus();
      errore = true;
   }
   
   // Controllo sul campo e-mail
   if (trim(Form.email.value).length==0) 
   {
      descrErrore += "\n- Fill \"E-Mail\"";
      if (!errore) Form.email.focus();
      errore = true;
   }
   else 
   {
      // controllo forma dell'email
      if (Form.email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) 
      {
         descrErrore += "\n-  \"E-Mail\" must be liki name@domain.com";
         if (!errore) 
	 {
            Form.email.select();
            Form.email.focus();
         }
      errore = true;
      }
   }
   
   if (errore) 
   {
      alert(descrErrore);
      return false;
   }
   else 
   {
      return true;
   }

}