/*  (C) Upgrade Multimediale Srl      via Francia 5/D      37135 Verona - ITALY      Tel:  +39 045 8903199      Fax:  +39 045 8231203        @: info@upgrade4.it      W: http://www.upgrade4.it            Content:   Common variables setting, functions and generic routines called by other functions...   Type:      Generic*/                  var browser = navigator.appName;  var version = parseInt(navigator.appVersion);   var NS = (browser == "Netscape");   var IE = (browser == "Microsoft Internet Explorer");                                                                                           var NS4 = (browser == "Netscape" && version >= 4); // almeno NS4..  var IE4 = (browser == "Microsoft Internet Explorer" && version >= 4); // almeno IE4  var IE5 = (browser == "Microsoft Internet Explorer" && version >= 5); // almeno IE5    var WIN = false;  var MAC = false;  var UNIX = false;                                                                   // set platform type ...                                                                 if (navigator.platform)        if (navigator.platform.indexOf("Win")!=-1)  WIN = true; // windows      else      if (navigator.platform.indexOf("Mac")!=-1)  MAC = true; // Mac      else      if (navigator.platform.indexOf("Linux")!=-1 || navigator.platform.indexOf("Unix")!=-1)  UNIX = true; // unix o linux        /*******************/  function getArgs() {   /*******************/        /* Estrae i parametri passati al "file.htm?p1=primo_par,p2=secondo_par" ecc. */        var args = new Object();    var query = location.search.substring(1);    var params = query.split(",");    for (var i=0; i<params.length; i++) {      var pos=params[i].indexOf('=');      if (pos==-1) continue;           var argname=params[i].substring(0,pos);           var value=params[i].substring(pos+1);           args[argname]=unescape(value);      }    return args;  }/************** Gestione Finestre *******************/      function openInner(url, name, param, innerW, innerH) {          if (NS) {              new_win=window.top.open(url, name, param+",innerHeight="+innerH+",innerWidth="+innerW);             if (MAC) { new_win._mac_flag="opened"} // fix per comportamento anomalo con NS e MAC          }            else if (IE&&WIN) {                                          offH=offW=0;            new_win=window.top.open(url, name, param+",width="+(innerW+offW)+",height="+(innerH+offH));          }            else if (IE&&MAC) {                         //offW=-5;offH=28; ok per IE4 ma non IE5            offW=0;            offH=5;            new_win=window.top.open(url, name, param+",width="+(innerW+offW)+",height="+(innerH+offH));          }                  return new_win;  }    function openNew(url, param) {  	var win_name="win"+Math.round(Math.random()*9999999);   	window.open(url, win_name, param);  }    function zoom(img, w, h, titolo, code) {       if ((typeof titolo) == "undefined") titolo="[zoom]";    if ((typeof code) == "undefined") code=Math.round(Math.random()*999999999);                var w_zoom=openInner("", "zoom"+(code), "resizable=yes,scrollbars=no,menubar=yes,directories=no,location=no,status=yes,toolbar=no",w,h);    if (w_zoom!=null) {  // controllo..      w_zoom.document.writeln('<html><title>'+titolo+'</title><body marginwidth=0 marginheight=0 topmargin="0" rightmargin="0" leftmargin="0" bottommargin="0" bgcolor="#6C8FB6"><table width="'+w+'" height="'+h+'"><tr><td valign="middle" align="center"><font face="Arial, Helvetica, Sans-serif" color="#FFFFFF" size="1">loading...</font></td></tr></table><div id="zoom" style="position:absolute; width:1; height:1;  z-index:10; left: 0px;  top: 0px"><img src='+img+' width='+w+' height='+h+'></div></body></html>');      w_zoom.document.close();    }        return w_zoom;  }	    function zoom_cyan(img, w, h, titolo, code) {       if ((typeof titolo) == "undefined") titolo="[zoom]";    if ((typeof code) == "undefined") code=Math.round(Math.random()*999999999);                var w_zoom=openInner("", "zoom"+(code), "resizable=yes,scrollbars=no,menubar=yes,directories=no,location=no,status=yes,toolbar=no",w,h);    if (w_zoom!=null) {  // controllo..      w_zoom.document.writeln('<html><title>'+titolo+'</title><body marginwidth=0 marginheight=0 topmargin="0" rightmargin="0" leftmargin="0" bottommargin="0" bgcolor="#9CB6D2"><table width="'+w+'" height="'+h+'"><tr><td valign="middle" align="center"><font face="Arial, Helvetica, Sans-serif" color="#000000" size="1">loading...</font></td></tr></table><div id="zoom" style="position:absolute; width:1; height:1;  z-index:10; left: 0px;  top: 0px"><img src='+img+' width='+w+' height='+h+'></div></body></html>');      w_zoom.document.close();    }        return w_zoom;  }	    function zoom_bianco(img, w, h, titolo, code) {       if ((typeof titolo) == "undefined") titolo="[zoom]";    if ((typeof code) == "undefined") code=Math.round(Math.random()*999999999);                var w_zoom=openInner("", "zoom"+(code), "resizable=yes,scrollbars=no,menubar=yes,directories=no,location=no,status=yes,toolbar=no",w,h);    if (w_zoom!=null) {  // controllo..      w_zoom.document.writeln('<html><title>'+titolo+'</title><body marginwidth=0 marginheight=0 topmargin="0" rightmargin="0" leftmargin="0" bottommargin="0" bgcolor="#FFFFFF"><table width="'+w+'" height="'+h+'"><tr><td valign="middle" align="center"><font face="Arial, Helvetica, Sans-serif" color="#000000" size="1">loading...</font></td></tr></table><div id="Ltop" style="position:absolute; width:600; height:13; z-index:10; left: 0; top: 0"><img src="../../img/fintit.gif" width="600" height="13"></div><div id="zoom" style="position:absolute; width:1; height:1;  z-index:10; left: 0px;  top: 13px"><img src='+img+' width='+w+' height='+h+'></div></body></html>');      w_zoom.document.close();    }        return w_zoom;  }	    function Rnd(n) { // return an integer between 0 and n-1     return Math.ceil(Math.random()*n)-1  }                    /******* flash functions *************/  function set_sound() {        path="";        if (parent.frames["audio"]) {            path=parent.frames["audio"].location.href;            if (path.indexOf("no_audio.htm")!=-1) {             // setta audio off             parent.frames["audio"].document.location.href="audio.htm";            }            else {             // setta audio on             parent.frames["audio"].document.location.href="no_audio.htm";            }         }              }    /********* Gestion Bug NS onresize... ************/      var _innerW, _innerH;function Cookie(document, name, hours, path, domain, secure)                             {      this.$document = document;      this.$name = name;      if (hours)          this.$expiration = new Date((new Date()).getTime() + hours*3600000);      else this.$expiration = null;      if (path) this.$path = path; else this.$path = null;      if (domain) this.$domain = domain; else this.$domain = null;      if (secure) this.$secure = true; else this.$secure = false;  }    function _Cookie_store()  {      var cookieval = "";      for(var prop in this) {          if ((prop.charAt(0) == '$') || ((typeof this[prop]) == 'function'))               continue;          if (cookieval != "") cookieval += '&';          cookieval += prop + ':' + escape(this[prop]);      }      var cookie = this.$name + '=' + cookieval;      if (this.$expiration)          cookie += '; expires=' + this.$expiration.toGMTString();      if (this.$path) cookie += '; path=' + this.$path;      if (this.$domain) cookie += '; domain=' + this.$domain;      if (this.$secure) cookie += '; secure';        this.$document.cookie = cookie;  }    function _Cookie_load()  {      var allcookies = this.$document.cookie;      if (allcookies == "") return false;      var start = allcookies.indexOf(this.$name + '=');      if (start == -1) return false;       start += this.$name.length + 1;        var end = allcookies.indexOf(';', start);      if (end == -1) end = allcookies.length;      var cookieval = allcookies.substring(start, end);      var a = cookieval.split('&');          for(var i=0; i < a.length; i++)            a[i] = a[i].split(':');      for(var i = 0; i < a.length; i++) {          this[a[i][0]] = unescape(a[i][1]);      }      return true;  }    function _Cookie_remove()  {      var cookie;      cookie = this.$name + '=';      if (this.$path) cookie += '; path=' + this.$path;      if (this.$domain) cookie += '; domain=' + this.$domain;      cookie += '; expires=Fri, 02-Jan-1970 00:00:00 GMT';        this.$document.cookie = cookie;  }    new Cookie();  Cookie.prototype.store = _Cookie_store;  Cookie.prototype.load = _Cookie_load;  Cookie.prototype.remove = _Cookie_remove;