// JavaScript Document
// Scripting by: andrea.bettoni@ideaup.com

function seleziona(id) {
  if (!document.getElementById) return;
  selDiv = document.getElementById(id);
  selDiv.style.color = "#FF0000";
	selDiv.style.fontWeight = "Bold";
}
function deseleziona(id) {
  if (!document.getElementById) return;
  selDiv = document.getElementById(id);
		selDiv.style.color = "#000000";
		selDiv.style.fontWeight = "Normal";
}

function doEmail(aux)     {  
var emailarray9231= new Array(105,110,102,111,64,102,105,97,109,109,97,45,97,110,116,105,110,99,101,110,100,105,111,46,105,116);
var postemail9231='';
var subj = '';
if ((aux == 1)||(!aux)) { 
subj = "Message from F.I.A.M.M.A. website..." ;
} else     { subj = aux; }
for (i=0;i<emailarray9231.length;i++)
postemail9231+=String.fromCharCode(emailarray9231[i])
document.write('<a href="mailto:'+postemail9231+'?subject='+subj+'" title="Drop us a few lines...">'+postemail9231+'</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     -  Enterprise Name";
}

//if (document.modulocomm.settore.value == "") {
//missinginfo += "\n     -  Business Area";
//}

if (document.modulocomm.responsabile.value == "") {
missinginfo += "\n     -  Name and surname";
}

if (document.modulocomm.indirizzo.value == "") {
missinginfo += "\n     -  Address";
}

if (document.modulocomm.city.value == "") {
missinginfo += "\n     -  City";
}

if (document.modulocomm.provincia.value == "") {
missinginfo += "\n     -  State/Province";
}

if (document.modulocomm.cap.value == "") {
missinginfo += "\n     -  ZIP Code";
}

if (document.modulocomm.telefono.value == "") {
missinginfo += "\n     -  Phone";
}

if ((document.modulocomm.email.value == "") || (document.modulocomm.email.value.indexOf('@') == -1) || (document.modulocomm.email.value.indexOf('.') == -1)) {
missinginfo += "\n     -  E-mail address";
}

if (document.modulocomm.dettaglio.value == "") {
missinginfo += "\n     -  Detail of request";
}

if (document.modulocomm.controllo.value == "") {
missinginfo += "\n     -  Control characters";
}
if (missinginfo != "") {

missinginfo2 = "You must fill the following mandatory fields:\n" ;

missinginfo2 += missinginfo ;
alert(missinginfo2);
return false;
}
else {
document.modulocomm.action="SENDMAIL_ENG.ASP";
document.modulocomm.submit();
return true;
}
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function checkJS() { // verifica javascript attivo
document.modulocomm.flag.value = "js_ok";
}
//-->
