
                                                //   alert(navigator.userAgent);

                                                   var Win=navigator.userAgent.indexOf("Win")!=-1;
                                                   var Mac=navigator.userAgent.indexOf("Mac")!=-1;
                                                   var InternetExplorer=navigator.userAgent.indexOf("MSIE")!=-1;
                                                   var	IE=((typeof document.all!="undefined") && (parseInt(navigator.appVersion)>=4))?1:0;
                                                   var Gecko=navigator.userAgent.indexOf("Gecko")!=-1;
                                                   var Safari=navigator.userAgent.indexOf("Safari")!=-1;
                                                   var Opera=navigator.userAgent.indexOf("Opera")!=-1;
                                                   var Konqueror=navigator.userAgent.indexOf("Konqueror")!=-1;

                                                   var MSIE=navigator.userAgent.indexOf("MSIE")!=-1;
                                                   var FFOX=navigator.userAgent.indexOf("Firefox")!=-1;
                                                   var CHROME=navigator.userAgent.indexOf("Chrome")!=-1;
                                                   
                                                   var browser="Mozilla"

                                                   if(InternetExplorer) { browser="IE"; }



 function OpenPage(nextPage,logPage,logTable,logKey)
         {                                                //        alert(nextPage+"::"+logPage+"::"+logTable+"::"+logKey);
                         if(logPage==undefined) {logPage=nextPage};  
           
                                                       var  pathPage="";
                         if(sourcePage=="NewsletterPAGE") { pathPage="../"; }

                         if(nextPage=="newsletter" 
                         && logPage =="=" 
                         && logTable=="=" 
                         && logKey!=undefined) { 
                                                 nextPage="Newsletter"+logKey;
                                                 logTable="-";
                                                 logPage ="newsletter";
                                               }  

          PageInput.action          =pathPage+"index.php";
          PageInput.target          ="_self";
          PageInput.NextPage.value  =nextPage;
          PageInput.ServerPage.value=sourcePage;
          PageInput.LogTable.value  =logTable;
          PageInput.LogKey.value    =logKey;
          PageInput.LogPage.value   =logPage;
          PageInput.submit();
         }


function Articolo(articolo)        {                   
                                     OpenPage("Statuto","read","statuto",articolo); 
                                   }

function OpenBook(isbn,recensione) {                   
                                     OpenPage("Pubblicazioni_ISTREVI","presentazione",isbn,recensione); 
                                   }


function OpenHomePage()
       {
          winIstrevi=window.open("about:blank","ISTREVI_homepage",
                                 "toolbar=yes,     menubar=yes,  location=yes,   \
                                  scrollbars=yes, resizable=yes,  status=yes,    \
                                  top=10,        left=10,                      \
                                  width=900,    height=700 ");
          winIstrevi.focus();
       }

function OpenPrivacy()
       {
            winPrivacy=window.open("privacy.htm","ISTREVI_privacy",
                                   "left=200,top=70,width=320,height=150, \
                                    fullscreen=no, toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no");

        if(!winPrivacy.opener) winPrivacy.opener = self;
        if( winPrivacy.focus != null) winPrivacy.focus();
       }


function OpenDonnaSkeda(Ytop,Xleft)
     {
      winDonnaSkeda=window.open("about:blank","ISTREVI_Donna",
                                "toolbar=yes,    menubar=yes,  location=yes,   \
                                 scrollbars=yes, resizable=yes,  status=yes,   \
                                 top="+Ytop+",        left="+Xleft+",          \
                                 width=458,    height=600 ");
      winDonnaSkeda.focus();
     }

function OpenAccessPage()
     {
      winAccessPage=window.open("about:blank","ISTREVI_reserved",
                                "toolbar=yes,    menubar=yes,  location=yes,   \
                                 scrollbars=yes, resizable=yes,  status=yes,   \
                                 top=50,        left=600,                      \
                                 width=458,    height=600 ");
      winAccessPage.focus();
     }

function OpenWatchAccess()
     {
      winOpenWatchAcc=window.open("about:blank","ISTREVI_WatchLog",
                                  "toolbar=yes,    menubar=yes,  location=yes,   \
                                   scrollbars=yes, resizable=yes,  status=yes,   \
                                   top=100,        left=550,                      \
                                   width=640,    height=530 ");
      winOpenWatchAcc.focus();
     }

function OpenWatchList()
     {
      winOpenWatchList=window.open("about:blank","ISTREVI_WatchList",
                                  "toolbar=yes,    menubar=yes,  location=yes,   \
                                   scrollbars=yes, resizable=yes,  status=yes,   \
                                   top=40,         left=300,                     \
                                   width=800,    height=600 ");
      winOpenWatchList.focus();
     }

function OpenAdminUser()
     {
      winAdminUser=window.open("about:blank","ISTREVI_User",
                               "toolbar=yes,    menubar=yes,  location=yes,   \
                                scrollbars=yes, resizable=yes,  status=yes,   \
                                top=140,        left=360,                      \
                                width=700,    height=400 ");
      winAdminUser.focus();
     }

function OpenAdminUserITEM()
     {
      winAdminUserITEM=window.open("about:blank","ISTREVI_User_ITEM",
                                   "toolbar=yes,    menubar=yes,  location=yes,   \
                                    scrollbars=yes, resizable=yes,  status=yes,   \
                                    top=100,        left=700,                      \
                                    width=450,    height=500 ");
      winAdminUserITEM.focus();
     }

function OpenAdminLog()
     {
      winAdminLog=window.open("about:blank","_self",
                              "toolbar=yes,    menubar=yes,  location=yes,   \
                               scrollbars=yes, resizable=yes,  status=yes,   \
                               top=50,        left=350,                      \
                               width=850,    height=610 ");
      winAdminLog.focus();
     }

function OpenAdminLogITEM()
     {
      winAdminLogITEM=window.open("about:blank","ISTREVI_Log_ITEM",
                                   "toolbar=yes,    menubar=yes,  location=yes,   \
                                    scrollbars=yes, resizable=yes,  status=yes,   \
                                    top=100,        left=700,                      \
                                    width=450,    height=500 ");
      winAdminLogITEM.focus();
     }


function RotateMicrophone()
     {
                                                            m="A";

           SpinMicrophoneLoop=setInterval("SpinMicrophone()",350);
     }

function SpinMicrophone()
     {
                                                           MicrophoneImg    =document.getElementById("Microphone"); 
                                                       //  MicrophoneImg_SRC=document.getElementById("Microphone").src;
                                                       //  MicrophoneImg_SEQ=MicrophoneImg_SRC.indexOf("microphone");
    
                                                           MicrophoneTitle  =document.getElementById("TxtPDF");

                                                           switch(m)
                                                                 {
                                                                  case "A": m="B"; 
                                                                            MicrophoneImg.src="img/ico/microphone_B.png";
                                                                            MicrophoneTitle.style.textDecoration="underline";
                                                                            MicrophoneTitle.style.color="#2020c0";
                                                                            break;
                                                                  case "B": m="C"; 
                                                                            MicrophoneImg.src="img/ico/microphone_C.png";
                                                                            MicrophoneTitle.style.textDecoration="underline";
                                                                            MicrophoneTitle.style.color="#2020c0";
                                                                            break;
                                                                  case "C": m="D"; 
                                                                            MicrophoneImg.src="img/ico/microphone_D.png";
                                                                            MicrophoneTitle.style.textDecoration="underline";
                                                                            MicrophoneTitle.style.color="#2020c0";
                                                                            break;
                                                                  case "D": m="E"; 
                                                                            MicrophoneImg.src="img/ico/microphone_C.png";
                                                                            MicrophoneTitle.style.textDecoration="underline";
                                                                            MicrophoneTitle.style.color="#2020c0";
                                                                            break;
                                                                  case "E": m="F"; 
                                                                            MicrophoneImg.src="img/ico/microphone_B.png";
                                                                            MicrophoneTitle.style.textDecoration="underline";
                                                                            MicrophoneTitle.style.color="#2020c0";
                                                                            break;
                                                                  case "F": m="A"; 
                                                                            MicrophoneImg.src="img/ico/microphone_A.png";
                                                                            MicrophoneTitle.style.textDecoration="none";
                                                                            MicrophoneTitle.style.color="#f00000";
                                                                            break;

                                                                  deafult : m="A"; 
                                                                            MicrophoneImg.src="img/ico/microphone_A.png";
                                                                            MicrophoneTitle.style.textDecoration="none";
                                                                            MicrophoneTitle.style.color="#f00000";
                                                                 }
     }

       



var xmlhttp;
                             /*  The LogClick() function is executed every time a click is pushed on the PDF version button
                                                         the function executes the following:

                                                           - Calls the GetXmlHttpObject() function to create an XMLHTTP object
                                                           - Defines the URL (filename) to send to the server
                                                           - Adds a parameter (q) to the URL 
                                                             with the content of the input field
                                                           - Adds a random number to prevent the server 
                                                             from using a cached file
                                                           - Each time the readyState property changes, 
                                                             the stateChanged() function will be executed
                                                           - Opens the XMLHTTP object with the given URL
                                                           - Sends an HTTP request to the server
                              */                            
function LogClick(obj,usr)
       {              
           xmlhttp=GetXmlHttpObject();
        if(xmlhttp==null)
          {
            alert ("Your browser does not support XMLHTTP!"); return;
          }

           var path_php=""; var obj_vector=obj.split(":");
                             if(obj_vector[2]=="newsletter"
                             || obj_vector[3]=="newsletter"
                             || obj_vector[2]=="user message") path_php="../";

       var url=path_php+"lib/log[obj].php?o="+obj+"&u="+usr;

           xmlhttp.onreadystatechange=stateChanged;
           xmlhttp.open("GET",url,true);
           xmlhttp.send(null);
       }
                                                          // -----------------------------------------
                                                          //  executes every time the state 
                                                          //    of the XMLHTTP object changes
                                                          // ---------
                                                          //  When the state changes to 4 ("complete"), 
                                                          //   the content of the txtHint placeholder 
                                                          //    is filled with the response text
                                                          // -----------------------------------------
function stateChanged()
       {
            // document.getElementById("TimeNOTIFY").innerHTML=xmlhttp.readyState;

        if(xmlhttp.readyState==4)
          {
            // document.getElementById("TimeNOTIFY").innerHTML=xmlhttp.responseText;
          }
       } 
                                                           // -------- ============== --------- 
                                                           // creating XMLHttpRequest object 
                                                           //           for different browsers
                                                           // -------- ============== ---------
function GetXmlHttpObject()
       {
         if(window.XMLHttpRequest)
           {                          // code for IE7+, Firefox, Chrome, Opera, Safari
        return new XMLHttpRequest();
           }

         if(window.ActiveXObject)
           {                          // code for IE6, IE5
        return new ActiveXObject("Microsoft.XMLHTTP");
           }
        return null;
       }
     
