// JavaScript Document

function addbookmark(){
url="http://www.marcograf.it/";
title="STAMPERIA MARCOGRAF - Tipografia Litografia Offset";
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("\n\rPremere i tasti: CTRL+D (Netscape) oppure CTRL+T (Opera)\n\rPer aggiungere questo sito nei segnalibri...\n\r");
  }
}

function doEmail() {
var emailriddlerarray=[109,97,114,99,111,103,114,97,102,64,109,97,114,99,111,103,114,97,102,46,105,116]
var encryptedemail_id30='' //variable to contain encrypted email 
for (var i=0; i<emailriddlerarray.length; i++)
encryptedemail_id30+=String.fromCharCode(emailriddlerarray[i])
document.write('<a href="mailto:'+encryptedemail_id30+'?subject=Messaggio dal sito web...">'+encryptedemail_id30+'</a>')
}

function ApriForm() { 
larg=510; 
alt=550; 
str="contatti.htm";
toptop=50; //(screen.height/2)-(alt/2); 
leftleft=(screen.width/2)-(larg/2); 
searchWin = window.open(str,'formwindow','top='+toptop+',left='+leftleft+',scrollbars=yes,width='+larg+',height='+alt+',status=no,location=no,toolbar=no,resizable=no'); 
} 

function apripop(str) { 
larg=510; 
alt=500; 
toptop=(screen.height/2)-(alt/2); 
leftleft=(screen.width/2)-(larg/2); 
searchWin = window. open(str,'holidaywin','top='+toptop+',left='+leftleft+',scrollbars=yes,width='+larg+',height='+alt+',status=no,location=no,toolbar=no,resizable=no'); 
} 

function mappaZoom() { 
larg=600; 
alt=500; 
toptop=(screen.height/2)-(alt/2); 
leftleft=(screen.width/2)-(larg/2); 
window.open('mappazoom.htm','popup','top='+toptop+',left='+leftleft+',width='+larg+',height='+alt+',scrollbars=no,status=no,location=no,toolbar=no'); 
} 

function privacy() { 
larg=600; 
alt=400; 
toptop=(screen.height/2)-(alt/2); 
leftleft=(screen.width/2)-(larg/2); 
window.open('privacy.htm','popup','top='+toptop+',left='+leftleft+',width='+larg+',height='+alt+',scrollbars=yes,status=no,location=no,toolbar=no'); 
} 

function maiuscola(str){
var strOut;
str = new String(str);
strOut = str.toUpperCase();
document.modulocomm.provincia.value = strOut;
}

function ApriFinestra(str) { 
larg=510; 
alt=500; 
toptop=(screen.height/2)-(alt/2); 
leftleft=(screen.width/2)-(larg/2); 
searchWin = window. open(str,'holidaywin','top='+toptop+',left='+leftleft+',scrollbars=yes,width='+larg+',height='+alt+',status=no,location=no,toolbar=no,resizable=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.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     {
	stringa="/SCELTA.A";
	stringa+="SP?x=1"
document.modulocomm.action=stringa;
return true   
}

}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

