// JavaScript Document
// Scripting by: andrea.bettoni@webandstyle.com


function addbookmark()
{
url="http://www.boscoitalia.it/"
title="BOSCO ITALIA S.p.A. - Sistemi Antirumore"
  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 {
	  strAlert="\nPremete i tasti CTRL + D (se utilizzate Netscape)\n\r";
	  strAlert+="oppure CTRL + T (se utilizzate Opera)\n\rper aggiungere questo sito ai preferiti...\n"
    alert(strAlert);
  }
}

function popScheda1(indx,aux) { 
if ((indx!='')||(indx!='undefined')) {
paginascheda=indx;
}  else {
paginascheda="scheda_errore.asp";
}
var imgToPop = paginascheda+"?id="+aux  ;
larg = 750;
alt = 550;
toptop=(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
window.open(imgToPop,'schedaPop','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=no,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
} 


function popImg(quale) { 
var ImgSrc = quale //.replace('/miniature','/foto')
var imgToPop = "zoom.asp?src=" + ImgSrc  ;
larg = 200;
alt = 200;
toptop=(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
window.open(imgToPop,'imgpopwindow','top='+toptop+',left='+leftleft+',scrollbars=no,resizable=no,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
} 

function condizioni() { 
larg = 640;
alt = 480;
toptop=(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
window.open('/condizioni.htm','privacyWin','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=no,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
}

function privacy() { 
larg=640; 
alt=480; 
toptop=(screen.height/2)-(alt/2); 
leftleft=(screen.width/2)-(larg/2); 
window.open('/privacy.htm','privacyWin','top='+toptop+',left='+leftleft+',width='+larg+',height='+alt+',scrollbars=yes,status=no,location=no,toolbar=no'); 
} 
function contatti(flag,aux) { 
url = '/_form/modulo.asp?x='+flag+'&p='+aux
larg = 640;
alt = 540;
toptop=(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
window.open(url,'formWindow','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=no,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
}
function registrazione() { 
larg = 640;
alt = 520;
toptop=(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
window.open('/_app/registrazione_pubblico.asp','regWindow','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=no,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
}

function vediCarrello() { 
larg = 700;
alt = 500;
toptop=(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
window.open('/_app/cart.asp','cartWindow','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=no,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
} 


function lostpwd() { 
larg = 640;
alt = 230;
toptop=(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
window.open('/_app/lostpwd.htm','lostpwdwindow','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=no,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
} 

function logout() { 
larg = 640;
alt = 230;
toptop=(screen.height/2)-(alt/2)
leftleft=(screen.width/2)-(larg/2); 
window.open('/_app/logout.asp','logoutWindow','top='+toptop+',left='+leftleft+',scrollbars=yes,resizable=no,width='+larg+',height='+alt+',status=no,location=no,toolbar=no'); 
} 

function privacy() { 
larg=480; 
alt=400; 
toptop=(screen.height/2)-(alt/2); 
leftleft=(screen.width/2)-(larg/2); 
window.open('/privacy.htm','privacyPop','top='+toptop+',left='+leftleft+',width='+larg+',height='+alt+',scrollbars=yes,status=no,location=no,toolbar=no'); 
} 

function seleziona(id) {
  if (!document.getElementById) return;
  selDiv = document.getElementById(id);
  selDiv.style.color = "#FF2222";
	selDiv.style.fontWeight = "Bold";
}

function deseleziona(id) {
  if (!document.getElementById) return;
  selDiv = document.getElementById(id);
		selDiv.style.color = "#000000";
		selDiv.style.fontWeight = "Normal";
}

function controlla()
{
var param1 = document.logform.email.value;
var param2 = document.logform.password.value;
if ((param1 != "")&&(param1 != "")) {
return true
} else {
alert('Errore nei dati inseriti!!\n\r');
return false
} 

}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function doEmail() { 
// Customized by A.M. Bettoni from www.dynamicdrive.com original script
var emailarray0367= new Array(110,111,105,115,101,64,98,111,115,99,111,105,116,97,108,105,97,46,105,116)
var postemail0367=''
for (i=0;i<emailarray0367.length;i++)
postemail0367+=String.fromCharCode(emailarray0367[i])
document.write('<a href="mailto:'+postemail0367+'?subject=Comunicazione dal sito internet...">'+postemail0367+'</a>')
}


function maiuscola(str){
var strOut;
str = new String(str);
strOut = str.toUpperCase();
document.modulocomm.provincia.value = strOut;
}

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
}
else {
document.modulocomm.action="SENDMAIL_ITA.ASP";
document.modulocomm.submit();
}
}


function conferma() {
var strEliminazione = 'Eliminare questo articolo?';
return confirm(strEliminazione);
} 
