  // MouseOn   
     home1 = new Image(100, 22);
     home1.src = "images/home_on.gif";
     info1 = new Image(100, 22);
     info1.src = "images/info_on.gif";
     photos1 = new Image(100, 22);
     photos1.src = "images/photos_on.gif";
     running1 = new Image(120, 22);
     running1.src = "images/running_on.gif";


  // MouseOff
     home0 = new Image(100, 22);
     home0.src = "images/home_off.gif";
     info0 = new Image(100, 22);
     info0.src = "images/info_off.gif";
     photos0 = new Image(100, 22);
     photos0.src = "images/photos_off.gif";
     running0 = new Image(120, 22);
     running0.src = "images/running_off.gif";

function menu_on(n){
     document ['home'].src = eval("home0.src");
     document ['info'].src = eval("info0.src");
     document ['photos'].src = eval("photos0.src");
     document ['running'].src = eval("running0.src");
     imageON = eval(n + "1.src");
     document [n].src = imageON;
}
function menu_off(n){
     imageOFF = eval(n + "0.src");
     document [n].src = imageOFF;
}

function roll_on(n){
     imageON = eval(n + "1.src");
     document [n].src = imageON;
}

function roll_off(n){
     imageOFF = eval(n + "0.src");
     document [n].src = imageOFF;
}

function GetRule(ruleName){
	var styleSheet=null;
	var Rules=new Array();
	var styleCount=0;
	for (var ssIndex=0;
			ssIndex<document.styleSheets.length;
			ssIndex++){
		styleSheet=document.styleSheets[ssIndex];
                if (styleSheet.cssRules)
		  for (var rIndex=0;rIndex<styleSheet.cssRules.length;rIndex++){
 			rule=styleSheet.cssRules[rIndex]
			if ((rule.selectorText=="."+ruleName)||(rule.selectorText==ruleName)){
                          Rules[styleCount]=rule
                          styleCount++;
                        }								
                  }
                else if (styleSheet.rules)
		  for (var rIndex=0;rIndex<styleSheet.rules.length;rIndex++){
 			rule=styleSheet.rules[rIndex]
			if ((rule.selectorText=="."+ruleName)||(rule.selectorText==ruleName)){
                          Rules[styleCount]=rule
                          styleCount++;
                        }								
                  }
                else return;
        }
	return Rules;
}


var cssdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout

dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all,

getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},

showhide:function(obj, e, visible, hidden, menuitem){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
{
menu_on(menuitem);
obj.visibility=visible
}
else if (e.type=="click")
{
menu_off(menuitem);
obj.visibility=hidden;
}
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure)
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID, menuitem){
if (this.dropmenuobj!=null) //hide previous menu
{menu_off(menuitem);
this.dropmenuobj.style.visibility="hidden";
this.clearhidemenu()}
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdown.delayhidemenu(menuitem)}
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(){cssdropdown.dynamichide(e, menuitem)}
this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu(menuitem)}
this.showhide(this.dropmenuobj.style, e, "visible", "hidden", menuitem)
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
}
},

contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichide:function(e, menuitem){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu(menuitem)
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu(menuitem)
},

delayhidemenu:function(menuitem){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden';menu_off('"+menuitem+"')",this.disappeardelay);
},

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
}
}