var IWIDTH=250
var ns4
var ie4
var ie5
var kon
var x,y,winW,winH
var idiv=null
var px="px"
function nsfix(){setTimeout("window.onresize = rebrowse", 2000);}
function rebrowse(){window.location.reload();}
function hascss(){ return gettip('infodiv')?true:false }
function infoinit(){
ns4=(document.layers)?true:false, ie4=(document.all)?true:false;
ie5=((ie4)&&((navigator.userAgent.indexOf('MSIE 5')>0)||(navigator.userAgent.indexOf('MSIE 6')>0)))?true:false;
kon=(navigator.userAgent.indexOf('konqueror')>0)?true:false;
x=0;y=0;winW=800;winH=600;
idiv=null;
document.onmousemove = mousemove;
if(ns4&&document.captureEvents) document.captureEvents(Event.MOUSEMOVE);
if(ns4||kon){ nsfix() }
if(ns4) { px=""; }
}
function untip(){
if(idiv) idiv.visibility=ns4?"hide":"hidden";
idiv=null;
}
function gettip(name){return (document.layers&&document.layers[name])?document.layers[name]:(document.all&&document.all[name]&&document.all[name].style)?document.all[name].style:document[name]?document[name]:(document.getElementById(name)?document.getElementById(name).style:0);}
function maketip(name,title,text){
 if(hascss()) document.write('<div id="'+name+'" name="'+name+'" style="position:absolute; visibility:hidden; z-index:20; top:0'+px+'; left:0'+px+';"><table width='+IWIDTH+' border=0 cellpadding=2 cellspacing=0 bgcolor="#333399"><tr><td class="tiptd"><table width="100%" border=0 cellpadding=0 cellspacing=0><tr><th><span class="ptt"><b><font color="#FFFFFF">'+title+'</font></b></span></th></tr></table><table width="100%" border=0 cellpadding=2 cellspacing=0 bgcolor="#CCCCFF"><tr><td><span class="pst"><font color="#000000">'+text+'</font></span></td></tr></table></td></tr></table></div>'+"\n");
}
function tip(name){
if(hascss()){
if(idiv) untip();
idiv=gettip(name);
if(idiv){
winW=(window.innerWidth)? window.innerWidth+window.pageXOffset-16:document.body.offsetWidth-20;
winH=(window.innerHeight)?window.innerHeight+window.pageYOffset  :document.body.offsetHeight;
if(x<=0||y<=0){ // konqueror can't get mouse position
x=(winW-IWIDTH)/2+(window.pageXOffset?window.pageXOffset:0); y=(winH-50)/2+(window.pageYOffset?window.pageYOffset:0);
}
showtip();
}
}
}
function showtip(){
idiv.left=(((x+260)<winW)?x+12:x-215)+px; idiv.top=(((y+90)<winH)?y+12:y-90)+px;
idiv.visibility=ns4?"show":"visible";
}
function mousemove(e){
if(e)   {x=e.pageX?e.pageX:e.clientX?e.clientX:0; y=e.pageY?e.pageY:e.clientY?e.clientY:0;}
else if(event) {x=event.clientX; y=event.clientY;}
else {x=0; y=0;}
if((ie4||ie5) && document.documentElement)
{
x+=document.documentElement.scrollLeft;
y+=document.documentElement.scrollTop;
}
if(idiv) showtip();
}
var defaultMenuWidth="150px"
var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
linkset[0]='<a href="/xp8">Windows XP 8bit</a>'
linkset[0]+='<hr>'
linkset[0]+='<a href="/xp32">Windows XP 32bit</a>'
linkset[0]+='<hr>'
linkset[0]+='<a href="/ubuntu">Ubuntu Linux</a>'
linkset[1]='<a href="http://www.repubblica.it/">La Repubblica</a>'
linkset[1]+='<a href="http://cnn.com">CNN</a>'
linkset[1]+='<a href="http://news.bbc.co.uk">BBC News</a>'
linkset[1]+='<a href="http://www.washingtonpost.com">Washington Post</a>'
var iex5=document.all && !window.opera
var ns6=document.getElementById
if (iex5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')
function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}
function showmenu(e, which, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=iex5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=iex5? event.clientX : e.clientX
eventY=iex5? event.clientY : e.clientY
var rightedge=iex5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=iex5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
if (rightedge<menuobj.contentwidth)
menuobj.style.left=iex5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
menuobj.style.left=iex5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
if (bottomedge<menuobj.contentheight)
menuobj.style.top=iex5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=iex5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.visibility="visible"
return false
}
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}
function dynamichide(e){
if (iex5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}
function delayhidemenu(){
delayhide=setTimeout("hidemenu()",1000)
}
function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}
if (iex5||ns6)
document.onclick=hidemenu
function fnS(){
		oInterval=window.setInterval("fnR()",1000);
}
function fnR(){
	var oDate=new Date();
	var sSwitch="am";
	var iHours=oDate.getHours();
	if(iHours>12){
		iHours-=12;
		sSwitch="pm";
	}
	var sMinutes=oDate.getMinutes() + "";
	if(sMinutes.length==1){
		sMinutes="0" + sMinutes;
	}
	var sSeconds=oDate.getSeconds() + "";
	if(sSeconds.length==1){
		sSeconds="0" + sSeconds;
	}
	oTimer.innerHTML=iHours + ":" + sMinutes + ":" + sSeconds + " " + sSwitch;
}
