//  ------------------------------------------------------// IDENTIFICATION OF BROWSER VERSION// This function returns a code to identify// which browser is currently used at client sidefunction browserVersion() {        var version = 0;        if (navigator.userAgent.indexOf("MSIE") != -1) version = 1;        else if (navigator.userAgent.indexOf("Netscape6") != -1) version = 6;         else if (navigator.userAgent.indexOf("Mozilla/5") != -1) version = 5;         else if (navigator.userAgent.indexOf("Mozilla/4") != -1) version = 4;         else if (navigator.userAgent.indexOf("Mozilla/3") != -1) version = 3;        else if (navigator.userAgent.indexOf("Mozilla/2") != -1) version = 2;        else version = 0;        return version;}// CSS SELECTION// This function allows the selection of the proper CSS// to provide uniform display across different platforms/browsersfunction selectCSS() {var version=browserVersion();if (version == 1 || version > 4 || navigator.appVersion.indexOf("Mac") == -1) {   document.write("<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\">"); }else {    document.write("<link rel=\"stylesheet\" href=\"stylens.css\" type=\"text/css\">"); }return true;}// AUTOMATIC LAST-UPDATED-ON// This functions automatically inserts the date of the last// modification of a page in the format: Month Day, Yearvar months = new Array(13);months[1] = "January";months[2] = "February";months[3] = "March";months[4] = "April";months[5] = "May";months[6] = "June";months[7] = "July";months[8] = "August";months[9] = "September";months[10] = "October";months[11] = "November";months[12] = "December";function last_update() {  dateObj = new Date(document.lastModified);  lmonth = months[dateObj.getMonth() + 1];  date = dateObj.getDate();  fyear = dateObj.getYear();  if (browserVersion() != 1) {     fyear += 1900; }  document.write(lmonth + " " + date + ", " + fyear);}// STANDARD PAGE FOOTERfunction pageFooter() {   document.write("<p><br /><small><i>Page last updated on ");   last_update();   document.write("<br />&copy; GrigioSoft - 2004</i></small></p>");}// SWAP HYPER-IMAGES ON MOUSE FOCUSfunction imgFocusOn (imgName) {   document[imgName].src = "./images/sel_"+imgName+".jpg";   }function imgFocusOut (imgName) {   document[imgName].src = "./images/"+imgName+".jpg";   }   // CENTER TEXT IN OLDER BROWSERfunction centerStart () {var version=browserVersion();if (version > 1 && version < 5) {   document.write ("<center>"); }else {   document.write ("<div align=\"center\">"); }}function centerStop () {var version=browserVersion();if (version > 1 && version < 5) {   document.write ("</center>"); }else {   document.write ("</div>"); }}// Consent operationsfunction annulla(newUrl) {		window.open (newUrl, "_top");	}function prosegui(newUrl) {		window.open (newUrl, "_top");	}// ------------------------------------------------------// OPEN AUXILIARY MENU WINDOW (NO SCROLLBARS)// This function opens an auxiliary browser window, without// toolbar, menu, status bar and scroll bar.// Purpose: to display context sensitive help information // or additional menu // Input parameters: //     loc = URL of the file to be loaded in the window//     ww = width of the window (pixel)//     wh = height of the window (pixel)function openWindow(loc,ww,wh) {    output=window.open(loc,"aux",'alwaysRaised=yes,toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,width='+ww+',height='+wh);   }// ------------------------------------------------------// OPEN AUXILIARY MENU WINDOW (WITH SCROLLBARS)// This function opens an auxiliary browser window, without// toolbar, menu, status bar but with scroll bar enabled.// Purpose: to display auxiliary context sensitive information // Input parameters: //     loc = URL of the file to be loaded in the window//     ww = width of the window (pixel)//     wh = height of the window (pixel)function openScrollWindow(loc,ww,wh) {    output=window.open(loc,"aux",'alwaysRaised=yes,toolbar=no,scrollbars=yes,directories=no,status=no,menubar=no,width='+ww+',height='+wh);   }// ------------------------------------------------------// SELECT MOST SUITABLE STYLE SHEETS FOR USER BROWSER// This funcion selects the most suitable style sheets // to grant uniform presentation across different browsers// function for level-1 relative linksfunction selectCss() {if ((browserVersion() > 3) && (navigator.appVersion.indexOf("Mac") != -1)) {   document.write("<link rel=\"stylesheet\" href=\"stylens.css\" type=\"text/css\">"); }else {    document.write("<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\">"); }}// function selectCss() {// if (navigator.appName == "Microsoft Internet Explorer")  {//    document.write("<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\">"); }// else if ((navigator.appVersion.indexOf("Mac") != -1)) {//    document.write("<link rel=\"stylesheet\" href=\"stylens.css\" type=\"text/css\">"); }// else { //    document.write("<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\">"); }// }// function for level-2 relative linksfunction selectCss2() {if (navigator.appName == "Microsoft Internet Explorer")  {   document.write("<link rel=\"stylesheet\" href=\"../style.css\" type=\"text/css\">"); }else if ((navigator.appVersion.indexOf("Mac") != -1)) {   document.write("<link rel=\"stylesheet\" href=\"../stylens.css\" type=\"text/css\">"); }else {    document.write("<link rel=\"stylesheet\" href=\"../style.css\" type=\"text/css\">"); }}// function for level-3 relative linksfunction selectCss3() {if (navigator.appName == "Microsoft Internet Explorer")  {   document.write("<link rel=\"stylesheet\" href=\"../../style.css\" type=\"text/css\">"); }else if ((navigator.appVersion.indexOf("Mac") != -1)) {   document.write("<link rel=\"stylesheet\" href=\"../../stylens.css\" type=\"text/css\">"); }else {    document.write("<link rel=\"stylesheet\" href=\"../../style.css\" type=\"text/css\">"); }}// FORM-MAIL 1  function sendMail() {//    if (document.forms[0].recipient.value == "") {//       alert("No recipient has been specified!");//       return false;//    }//    if (document.forms[0].message.value == "") {//       alert("No message has been entered!");//       return false;//    }//    if (document.forms[0].subject.value == "") {//       document.forms[0].subject.value = "No subject";//       return false;//    }    // Construct a mailto: URL with all the details:    document.forms[0].action = "mailto:" +                    document.forms[0].recipient.value +                    "?subject=" +                    document.forms[0].subject.value;    return true;  }// FORM-MAIL 2function mailIt() {    var dataForm = document.dataForm;    var mailForm = document.mailForm;    var message = dataForm.body.value;    // redefine the mailForm action property//    mailForm.action = "mailto:" + dataForm.recipient.value;//    mailForm.action += "?subject=" + dataForm.subject.value;    // retrieve location information    var pageTitle = "Page Title: " + document.title;    var sentFrom = "Mailed From: " + document.location;    var userInfo = pageTitle + "\r\n" + sentFrom + "\r\n\r\n";    // transfer all information from dataForm to mailForm for sending    mailForm.mailBody.value = userInfo + message;    // open new window    newWindow = window.open("", "new_Window", "status='yes', scrollbars='yes'");    newWindow.document.clear();    // create a page that presents the transmitted message    newWindow.document.write("<HTML><HEAD><TITLE>Message sent to " + dataForm.recipient.value + "</TITLE></HEAD>");    newWindow.document.write("<BLOCKQUOTE>");    newWindow.document.write("<BODY bgcolor='white'>");    newWindow.document.write("<H2>The following message has been sent:</H2>");    newWindow.document.write("Recipient: " + dataForm.recipient.value + "<p><hr><p>");    newWindow.document.write(message + "<p>");    newWindow.document.write("<hr><p><DIV align='right'><FORM>");    newWindow.document.write("<INPUT type='button' value=' Close Window ' onClick='window.close();'>");    newWindow.document.write("</FORM></DIV></BLOCKQUOTE></BODY></HTML>");    newWindow.document.close();    // return true to send mail (returning false should prevent submission)    return true;  }
