<!--
// Commonly used functions

function $(name) {
  if (document.getElementById)
  {
  	return document.getElementById(name);
  }
  else if (document.all)
  {
	return document.all[name];
  }
  else if (document.layers)
  {
	return getObjNN4(document,name);
  }
}

function getObjNN4(obj,name) {
	var x = obj.layers;
	var foundLayer;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	foundLayer = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) foundLayer = tmp;
	}
	return foundLayer;
}

function pause(millisecondi)
{
    var now = new Date();
    var exitTime = now.getTime() + millisecondi;

    while(true)
    {
        now = new Date();
        if(now.getTime() > exitTime) return;
    }
}

function cover(top,from,to) {
	var tmpPos=styleSheet.getPosition(from);
	var tmpPos2=styleSheet.getPosition(to);
	var tmpHeight=parseInt(tmpPos2[1])+parseInt(styleSheet.getProperty(to,'height'))-parseInt(tmpPos[1]);
	styleSheet.setProperty(top,'top',tmpPos[1]+'px');
	styleSheet.setProperty(top,'left',tmpPos[0]+'px');
	styleSheet.setProperty(top,'height',tmpHeight+'px');
	styleSheet.setProperty(top,'width',styleSheet.getProperty(from,'width'));
	styleSheet.setProperty(top,'line-height',tmpHeight+'px');
	styleSheet.setProperty(top,'visibility','visible');
}

function hide(el) {
  styleSheet.setProperty(el,'visibility','hidden');
  styleSheet.setProperty(el,'height','0px');
  styleSheet.setProperty(el,'width','0px');


}

function unshade(el,time,prfx) {
	eval("if (!document."+prfx+"_to) { document."+prfx+"_to={interval: "+parseInt(time/10)+", opacity: 1.0} }; var toUse=document."+prfx+"_to;");
	if (navigator.appName!='Microsoft Internet Explorer') {
    	styleSheet.setProperty(el,'MozOpacity',toUse.opacity);
	} else {
		styleSheet.setProperty(el,'filter','alpha(opacity='+parseInt(toUse.opacity*100)+')');
	}
	eval("document."+prfx+"_to.opacity-=0.1;");
	if (toUse.opacity>0) {
		window.setTimeout("unshade('"+el+"',"+time+",'"+prfx+"')",toUse.interval);	
	} else {
		hide('menupl');
    }
}

function Style() {
   this.getProperty=function(nElm, strCssRule){
	var oElm=$(nElm);
    var strValue = "";
	if(document.defaultView && document.defaultView.getComputedStyle){
		try {
           strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
		} catch (e) {}
    }
    else if(oElm.currentStyle){
      try{
		strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
			return p1.toUpperCase();
		});
		strValue = oElm.currentStyle[strCssRule];
	  }
	    catch(e){
		// Used to prevent an error in IE 5.0
	  }
      strValue = oElm.currentStyle[strCssRule];
    }
    return strValue;
   }
   
   this.setProperty=function(nElm,strCssRule,value) {
	  var oElm=$(nElm);
	  oElm.style[strCssRule]= value;
   }
   
   this.getPosition= function(objName) {
	var obj=$(objName);
	var curleft = curtop = 0;
	var lastol= lastot = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			lastol=obj.offsetLeft;
			lastot=obj.offsetTop;
			curleft += lastol;
			curtop += lastot;
		}
	}
	if (navigator.appName!='Microsoft Internet Explorer') {
    	return [curleft,curtop];
	} else {
		return [curleft-lastol, curtop-lastot];	
	}
}
}

styleSheet=new Style();

-->