// JavaScript Documentfunction obj(theId) {  return document.getElementById(theId);}//###########################################################################################################################function centerPopup (url, nome, w, h, scroll) {    var winl = (screen.width - w) / 2;    var wint = (screen.height - h) / 2;    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable, toolbars=false'    win = window.open(url, nome, winprops)    win.window.focus();}//###########################################################################################################################function data_news (giorno, numero, mese, anno){  anno=1900+anno;  if (mese == 0) nomeMese = "January";  else if (mese == 1) nomeMese = "February";  else if (mese == 2) nomeMese = "March";  else if (mese == 3) nomeMese = "April";  else if (mese == 4) nomeMese = "May";  else if (mese == 5) nomeMese = "June";  else if (mese == 6) nomeMese = "July";  else if (mese == 7) nomeMese = "August";  else if (mese == 8) nomeMese = "September";  else if (mese == 9) nomeMese = "October";  else if (mese == 10) nomeMese = "November";  else if (mese == 11) nomeMese = "Dicember";  if (giorno == 0) nomeGiorno = "Sunday";  else if (giorno == 1) nomeGiorno = "Monday";  else if (giorno == 2) nomeGiorno = "Tuesday";  else if (giorno == 3) nomeGiorno = "Wednesday";  else if (giorno == 4) nomeGiorno = "Thursday";  else if (giorno == 5) nomeGiorno = "Friday";  else if (giorno == 6) nomeGiorno = "Saturday";  document.write(numero+' '+nomeMese+' '+anno);}/*function data_news (giorno, numero, mese, anno){  anno=1900+anno;  if (mese == 0) nomeMese = "Gennaio";  else if (mese == 1) nomeMese = "Febbraio";  else if (mese == 2) nomeMese = "Marzo";  else if (mese == 3) nomeMese = "Aprile";  else if (mese == 4) nomeMese = "Maggio";  else if (mese == 5) nomeMese = "Giugno";  else if (mese == 6) nomeMese = "Luglio";  else if (mese == 7) nomeMese = "Agosto";  else if (mese == 8) nomeMese = "Settembre";  else if (mese == 9) nomeMese = "Ottobre";  else if (mese == 10) nomeMese = "Novembre";  else if (mese == 11) nomeMese = "Gennaio";  if (giorno == 0) nomeGiorno = "Domenica";  else if (giorno == 1) nomeGiorno = "Luned&igrave;";  else if (giorno == 2) nomeGiorno = "Marted&igrave;";  else if (giorno == 3) nomeGiorno = "Mercoled&igrave;";  else if (giorno == 4) nomeGiorno = "Gioved&igrave;";  else if (giorno == 5) nomeGiorno = "Venerd&igrave;";  else if (giorno == 6) nomeGiorno = "Sabato";  document.write(numero+' '+nomeMese+' '+anno);}*///###########################################################################################################################  function isDate(dateStr) {    // Per controllare la validità di una data nei seguenti formati    // GG/MM/AA   GG/MM/AAAA   GG-MM-AA   GG-MM-AAAA    if (dateStr == "") { return true }    var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;    // Per forzare l'inserimento dell'anno in 4 cifre, sostituire la riga seguente    // var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;    var mesi = new Array("January", "February", "March", "April", "May", "June", "July", "Agost", "September", "October", "November", "Dicember")    var matchArray = dateStr.match(datePat); // is the format ok?    if (matchArray == null) {      alert("Date correct format:\nDD/MM/YYYY");      return false;    }    //giorno = parseInt(matchArray[1]);         // recupera i valori di giorno, mese anno e li memorizza nelle variabili    //mese   = parseInt(matchArray[3]);    anno   = parseInt(matchArray[4],10);    giorno = parseInt(matchArray[1],10);         // recupera i valori di giorno, mese anno e li memorizza nelle variabili    mese   = parseInt(matchArray[3],10);    if (anno <=99){      anno =(anno<30?anno+2000:anno+1900);    }    if (anno < 1600) {      alert("Uncorrect year value.");      return false;    }    if (giorno < 1 || giorno > 31) {      alert("Uncorrect day value.");      return false;    }    if ((mese==4 || mese==6 || mese==9 || mese==11) && giorno==31) {      alert("Month " + mesi[mese-1] + " has not 31 days!");      return false;    }    if (mese == 2) {                // controlla se l'anno e bisestile      var isleap = (anno % 4 == 0 && (anno % 100 != 0 || anno % 400 == 0));      if (giorno>29 || (giorno==29 && !isleap)) {        alert("February " + anno + " has not " + giorno + " days!");        return false;      }    }    if (mese < 1 || mese > 12) { // controlla il range del mese      alert("Month value must be between 1 and 12");      return false;    }    return true;  // date is valid  }//###########################################################################################################################// per Controllare che una certa stringa é numericofunction isNumeric(NumStr){  if (NumStr=="") {    return true  } else {    if ( ! /^ *[+-]?[0-9]+[.,]?[0-9]* *$/.test(NumStr)){      alert("Please fill with a numeric value");      return false;    }    return true;  }}//###########################################################################################################################  function checkValueDate (formName, theId) {  //alert(formName);  //alert(theId);  //alert('checkValueDate' +obj(formName));    if(!isDate(obj(formName).theId.value)) {      obj(formName).theId.focus();      obj(formName).theId.value='';      return false;    }  }//########################################################################################################################### //funzione per mantenere settati i valori inseriti in htmlarea // utilizzata in updateWizardControl e wizardControl function storeHtmlAreaValue() {  if (obj('HTMLTEXT') && obj('HTMLTEXT').tagName=="TEXTAREA") {    obj('HTMLTEXT').value = editor.doctype + ' ' +editor.getHTML(editor._doc.documentElement, true, editor)  } }//###########################################################################################################################  // FUNZIONI PER LA PERSONALIZZAZIONE DELLA TOOLBAR DI HTMLAREA  function activePartPopUp() {    var w = window.open('insert_part.screen','insertPartWindow','width=600,height=400,status=0,scrollbars=0,resizable=0');    if( w )      w.focus();  }//###########################################################################################################################  function doImage() {    var limit = '&limitCount=20';    var tn    = '1'; // equivale a '$SHOWTHUMBNAILS'; (cioè mostra thumbs)    var leftPos = (screen.availWidth-700) / 2    var topPos = (screen.availHeight-500) / 2    var rep = '/local/images';    imageWin = window.open('insert_image.screen?ToDo=InsertImage&imgDir='+rep+'&tn='+tn+'&du=$DISABLEIMAGEUPLOADING&dd=$DISABLEIMAGEDELETING&dt=$EDITINGHTMLDOC'+limit,'','width=700,height=500,scrollbars=yes,resizable=yes,titlebar=0,top=' + topPos + ',left=' + leftPos+limit);    if (imageWin)    imageWin.focus();  }//###########################################################################################################################  function doImageAll( ) {    var limit = '';    var tn    = '0';    var leftPos = (screen.availWidth-700) / 2    var topPos = (screen.availHeight-500) / 2    var rep = '/local/images';    imageWin = window.open('insert_image.screen?ToDo=InsertImage&imgDir='+rep+'&tn='+tn+'&du=$DISABLEIMAGEUPLOADING&dd=$DISABLEIMAGEDELETING&dt=$EDITINGHTMLDOC'+limit,'','width=700,height=500,scrollbars=yes,resizable=yes,titlebar=0,top=' + topPos + ',left=' + leftPos+limit);  }//###########################################################################################################################  function isAllowed() {    foo.focus();    return true;  }//###########################################################################################################################function getCursorSelection () {  var cursorSelection = ''; if (isNetscape){    cursorSelection = window.opener.foo.document.getSelection();  } else if (isExplorer){    cursorSelection = window.opener.foo.document.selection.createRange();  }  //alert('getCursorSelection '+cursorSelection);  return cursorSelection;}//###########################################################################################################################function paste (html) {    //alert('insertHTML line 1377\n');	var sel = this._getSelection();	var range = this._createRange(sel);	if (HTMLArea.is_ie) {		range.pasteHTML(html);	} else {		// construct a new document fragment with the given HTML		var fragment = this._doc.createDocumentFragment();		var div = this._doc.createElement("div");		div.innerHTML = html;		while (div.firstChild) {			// the following call also removes the node from div			fragment.appendChild(div.firstChild);		}		// this also removes the selection		var node = this.insertNodeAtSelection(fragment);	}};//########################################################################################################################### if(navigator.appName == "Netscape")var isNetscape = true; if(navigator.appName == "Microsoft Internet Explorer") var isExplorer = true; if(window.opera) var isOpera = true;//###########################################################################################################################var imgPath="";var desc = "";var idDoc = "";// ho bisogno di nodeId e currentDocumentfunction imgPopup (imgName, docDesc, docID) {	imgPath= imgName;	desc = docDesc;	idDoc = docID;	var winl = (screen.width - 400) / 2;    var wint = (screen.height - 400) / 2;    winprops = 'height=400,width=400, resizable, toolbars=false';    win = window.open('popup_photogall.screen', 'imgPopUp', winprops);    if (parseInt(navigator.appVersion) >= 4)       win.window.focus();}//###########################################################################################################################// Correctly handle PNG transparency in Win IE 5.5 or higher.// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004function correctPNG() {   for(var i=0; i<document.images.length; i++) {      var img = document.images[i]      var imgName = img.src.toUpperCase()      if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {         var imgID = (img.id) ? "id='" + img.id + "' " : ""         var imgClass = (img.className) ? "class='" + img.className + "' " : ""         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "         var imgStyle = "display:inline-block;" + img.style.cssText          if (img.align == "left") imgStyle = "float:left;" + imgStyle         if (img.align == "right") imgStyle = "float:right;" + imgStyle         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle                 var strNewHTML = "<span " + imgID + imgClass + imgTitle         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"          img.outerHTML = strNewHTML         i = i-1         }      }   }//window.attachEvent("onload", correctPNG);//########################################################################################################################### var timerID = null;      var timerRunning = false;      function stopclock (){      if(timerRunning)      clearTimeout(timerID);      timerRunning = false;      } function showtime () {      var now = new Date();      var hours = now.getHours();      var minutes = now.getMinutes();      var seconds = now.getSeconds();      var timeValue = "" + ((hours >12) ? hours -12 :hours);      if (timeValue == "0")         timeValue = 12;      timeValue += ((minutes < 10) ? ":0" : ":") + minutes;      timeValue += ((seconds < 10) ? ":0" : ":") + seconds;      //timeValue += (hours >= 12) ? " P.M." : " A.M.";      document.onload=obj('clock').innerHTML = timeValue;      timerID = setTimeout("showtime()",1000);      timerRunning = true;  }//###########################################################################################################################function ValidateForm(language){	//var companyID=document.form.company;	var companyID=document.forms['sendMail'].company;  var nameID=document.forms['sendMail'].name;  var emailID=document.forms['sendMail'].email;  var phoneID=document.forms['sendMail'].phone;  var datiID=document.forms['sendMail'].personal;  var alertCompany  = "Inserire il nome dell'azienda";  var alertName     = "Inserire in nominativo di un contatto";  var alertEmail    = "Inserire la email";  var alertPhone    = "Inserire un recapito telefonico";  var alertCheck    = "Seleziona il trattamento dati personali";  if ( language!=null && language=="ENG" ) {    alertCompany = "Please fill Company name/Istitution field";    alertName = "Please fill Contact field";    alertEmail = "Please fill Email field";    alertPhone = "Please fill Phone field";    alertCheck = "Please activate Consensus checkbox";  }  if ((companyID.value==null)||(companyID.value=="")){		alert(alertCompany);		companyID.focus();		return (false);	}  if ((nameID.value==null)||(nameID.value=="")){		alert(alertName);		nameID.focus();		return (false);	}	if ((emailID.value==null)||(emailID.value=="")){		alert(alertEmail);		emailID.focus();		return (false);	}	if (echeck(emailID.value, language)==false){		emailID.value=""		emailID.focus();		return (false);	}  if ((phoneID.value==null)||(phoneID.value=="")){		alert(alertPhone);		phoneID.focus();		return (false);	}  if (!datiID.checked){    alert(alertCheck);    datiID.focus();    return (false);  }	document.forms['sendMail'].submit(); }//###########################################################################################################################function echeck(str, language) {		var at="@"		var dot="."		var lat=str.indexOf(at)		var lstr=str.length		var ldot=str.indexOf(dot)		var alertMessage = "Indirizzo email scorretto";		if ( language!=null && language=="ENG" ) {		  alertMessage = "Wrong email address";		}		if (str.indexOf(at)==-1){		   alert(alertMessage)		   return (false);		}		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){		   alert(alertMessage)		   return (false);		}		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){		    alert(alertMessage)		    return (false);		}    if (str.indexOf(at,(lat+1))!=-1){      alert(alertMessage)      return (false);    }    if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){		  alert(alertMessage)		  return (false);		}    if (str.indexOf(dot,(lat+2))==-1){		  alert(alertMessage)		  return (false);		}		if (str.indexOf(" ")!=-1){		  alert(alertMessage)		  return (false);		}		return (true);	}