function gulliverBrescia() {
	openBrWindow("gulliver_raccolta_ordini/gulliver_software_house_brescia.jpg","mappa","scrollbars=auto,resizeable=yes,menubar=no,width=700,height=800");	
}

function doLogon() {
  var userTextCtrlValue = document.logonForm.userTextCtrl.value;
  var passwordCtrlValue = document.logonForm.passwordCtrl.value;

  if (userTextCtrlValue == '') {
    alert("Devi specificare un nome utente ed una password per l'accesso! ");
    document.logonForm.userTextCtrl.focus();
  } else if (passwordCtrlValue == '') {
    alert("Devi specificare un nome utente ed una password per l'accesso! ");
    document.logonForm.passwordCtrl.focus();
  } else {
	document.webMailForm.imapuser.value = userTextCtrlValue;
	document.webMailForm.pass.value = passwordCtrlValue;
	document.webMailForm.submit();
  }
}

function lanciaBrexDemo() { //v2.0
	var h2;
	var w2;
	var w2 = screen.width;
	var h2 = screen.height;
	var t = 0;
	var l = 0;
	if (screen.width > 800 ) {
		w2 = 1024;
		h2 = 768;
		l = (( screen.width - w2 )/ 2 );
		t = (( screen.height - h2 )/ 2 );
	}
	var url="http://demo.gullivernet.com/brex/homebrex_ferramenta.jsp";
	var name="";
	var parametri="resizable=yes,width=" + w2 + ",height=" + h2 + ",location=no, top=" + t + ",left=" + l;
	window.open(url,name,parametri);
}

function lanciaFlashDemo(theURL,winName,features) { //v2.0
  var i,j;
  var x,y,width,height;
  i=features.indexOf("width=");
  i+=6;
  j=features.indexOf(",",i);
  if(j==-1){
	j=features.length;
  }
  width=parseInt(features.substring(i,j));
  i=features.indexOf("height=",i);
  i+=7;
  j=features.indexOf(",",i);
  if(j==-1){
	j=features.length;
  }
  height=parseInt(features.substring(i,j));
  x=(screen.width-width)/2;
  y=(screen.height-height)/2;
  features+=",left="+x+",top="+y;
  features+=",screenX="+x+",screenY="+y;
  var win=window.open(theURL,winName,features);
  win.focus();
}

function openService() {
	var a = document.logonForm.userTextCtrl.value;
	var b = document.logonForm.passwordCtrl.value;
	var url = 'http://www.controlloremoto.eu/gservice/servlet/com.gullivernet.gservice.web.servlet.GServiceServlet?GB_OBJ=com.gullivernet.gservice.web.acl.acl&GB_METHOD=Validate&LANG=IT&GB_CUSTOMIZEDFOR=DEFAULT&USER=' + a + '&PASSWORD=' + b;
	window.open(url,'GulliverService','width=800,height=600,resizable=yes,location=no');
}

//----------------------------------------------------------------------------------------------------
//
// Funzione contatto
//

function ok() {

	var nomeValue 		  = document.couponForm.nome.value;
	var cognomeValue 	  = document.couponForm.cognome.value;
	var emailValue 		  = document.couponForm.email.value;
	var privacyValue 	  = getCheckedValue(document.couponForm.privacy);

	var showAlert = false;
	  if (nomeValue == '') {
		showAlert = true;
		document.couponForm.nome.focus();
	  } else if (cognomeValue == '') {
		showAlert = true;
		document.couponForm.cognome.focus();
	  } else if (emailValue == '') {
		showAlert = true;
		document.couponForm.email.focus();
	  }

	  if (showAlert) {
		alert("Hai omesso uno o pił campi obbligatori.");
	  } else if (privacyValue != 'si') {
		alert("Devi autorizzare il trattamento dei dati personali.");
	  } else if (isValidEmailAddrs(emailValue)) {
			 document.sendMailForm.nome.value 		= nomeValue;
			 document.sendMailForm.cognome.value 	= cognomeValue;
			 document.sendMailForm.email.value 		= emailValue;
			 document.sendMailForm.submit();
	  } else {
		alert("Hai scritto l'indirizzo di posta elettronica in modo errato.");
		document.couponForm.email.select();
		document.couponForm.email.focus();
	  }
}
