// JavaScript External Document
// Scripting by: andrea.bettoni@ideaup.com

function addbookmark() {
url="http://www.cedit-torino.it/"
title="FERBOR S.p.A. - La risposta all'accessorio..."
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Premete la combinazione di tasti:\n\rCTRL-D (per Netscape)\n\rCTRL-T (per Opera)\n\rper inserire questo sito nei preferiti/segnalibri");
  }
}

function doPop() { 
larg=parseInt(screen.width-20); 
alt=parseInt(screen.height-30); 
url='http://88.60.150.82/ferboragenti/';
toptop=parseInt((screen.height/2)-(screen.width/2));
leftleft=parseInt((screen.width/2)-(screen.width/2)); 
window.open(url,'popwindow','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=yes,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
} 

function popUp() { 
larg=505; 
alt=550; 
toptop=20;//(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
searchWin = window. open('disclaimer.htm','lexwindow','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=yes,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
} 

function popMap() { 
larg=795; 
alt=590; 
toptop=10;//(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
searchWin = window. open('mappa_grande.htm','mapwindow','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=yes,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
} 


function apriForm() { 
larg=550; 
alt=585; 
toptop=10;//(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
searchWin = window. open('http://www.ideaup.com/_fer/contatti.htm','mapwindow','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=yes,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
} 

function checkFields() {
missinginfo = "";

if (document.modulocomm.nomeazienda.value == "") {
missinginfo += "\n     -  Nome azienda";
}

if (document.modulocomm.settore.value == "") {
missinginfo += "\n     -  Settore merceologico";
}

if (document.modulocomm.responsabile.value == "") {
missinginfo += "\n     -  Nome responsabile";
}

if (document.modulocomm.indirizzo.value == "") {
missinginfo += "\n     -  Indirizzo";
}

if (document.modulocomm.city.value == "") {
missinginfo += "\n     -  Cittą";
}

if (document.modulocomm.provincia.value == "") {
missinginfo += "\n     -  Provincia";
}

if (document.modulocomm.cap.value == "") {
missinginfo += "\n     -  C.A.P.";
}

if (document.modulocomm.telefono.value == "") {
missinginfo += "\n     -  Telefono";
}

//if (document.modulocomm.fax.value == "") {
//missinginfo += "\n     -  Fax";
//}

if ((document.modulocomm.email.value == "") || (document.modulocomm.email.value.indexOf('@') == -1) || (document.modulocomm.email.value.indexOf('.') == -1)) {
missinginfo += "\n     -  E-mail";
}

if (document.modulocomm.dettaglio.value == "") {
missinginfo += "\n     -  Dettaglio richiesta informazioni";
}

if (missinginfo != "") {

missinginfo2 = "Non avete inserito i seguenti dati obbligatori:\n" ;

missinginfo2 += missinginfo ;
alert(missinginfo2);
return false
}
else return true 
//document.modulocomm.submit();
}
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
