
    function makearray(n){
      this.length = n;
      for(var i = 1; i <= n; i++)
      this[i] = 0;
      return this;
    }
    hexa = new makearray(16);
    for(var i = 0; i < 10; i++) hexa[i] = i;
    hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
    hexa[13]="d"; hexa[14]="e"; hexa[15]="f";
    function hex(i){
      if (i < 0) return "00";
      else if (i >255) return "ff";
      else return "" + hexa[Math.floor(i/16)] + hexa[i%16];
    }
    function setbgColor(r, g, b, divelement){
	  var hr = hex(r); var hg = hex(g); var hb = hex(b);
      divelement.backgroundColor = "#"+hr+hg+hb;
    }
    function fade(sr, sg, sb, er, eg, eb, step, divelement){      
        setbgColor(Math.floor(sr * ((step-i)/step) + er * (i/step)),
        Math.floor(sg * ((step-i)/step) + eg * (i/step)),
        Math.floor(sb * ((step-i)/step) + eb * (i/step)), divelement);
  
  		step--;
		
		if(step > 0)
			setTimeout(function(){fade(sr, sg, sb, er, eg, eb, step, divelement);}, 10);      
    }
	
    /* Usage:
     *   fade(inr,ing,inb, outr,outg,outb, step);
     * example.
     *   fade(0,0,0, 255,255,255, 255);
     * fade from black to white with very slow speed.
     *   fade(255,0,0, 0,0,255, 50);
     *   fade(0xff,0x00,0x00, 0x00,0x00,0xff, 50); // same as above
     * step 2 is very fast and step 255 is very slow.
    */



var zxcHideDelay=1000;
var SubAry=new Array();
var OOPCnt=0;

function Init(mid){
 var zxcargs=Init.arguments;
 for (var zxc0=0;zxc0<zxcargs.length;zxc0++){
 var mobj=document.getElementById(zxcargs[zxc0]);
 mobj.s=document.getElementById(zxcargs[zxc0]+'S');
// mobj.s.style.left=(zxcPos(mobj)[0]+mobj.offsetWidth+5)+'px';
// mobj.s.style.top=(zxcPos(mobj)[1])+'px';
 mobj.s.obj=mobj;
 mobj.bg=mobj.className;
 SubAry.push(mobj);
 zxcAddShow(mobj);
 zxcAddHide(mobj);
 zxcAddShow(mobj.s);
 zxcAddHide(mobj.s);
 mobj.oop=new zxcAddOOP(mobj);
 }
}

function zxcPos(zxc){
 zxcObjLeft = zxc.offsetLeft;
 zxcObjTop = zxc.offsetTop;
 while(zxc.offsetParent!=null){
  zxcObjParent=zxc.offsetParent;
  zxcObjLeft+=zxcObjParent.offsetLeft;
  zxcObjTop+=zxcObjParent.offsetTop;
  zxc=zxcObjParent;
 }
 return [zxcObjLeft,zxcObjTop];
}

function zxcShow(){
 if (this.s){
  for (var zxc0=0;zxc0<SubAry.length;zxc0++){
   clearTimeout(SubAry[zxc0].oop.to);
   SubAry[zxc0].s.style.visibility='hidden';
   SubAry[zxc0].className=SubAry[zxc0].bg;
  }
  this.s.style.visibility='visible';
  //this.className='on'+this.className;
 }
 else {
  clearTimeout( this.obj.oop.to);
 }
}

function zxcHide(){
 if (this.s){
  this.oop.setTimeOut("hide();",zxcHideDelay);
 }
 else {
  this.obj.oop.setTimeOut("hide();",zxcHideDelay);
 }
}

function zxcAddOOP(zxc){
 this.mobj=zxc;
 this.ref = 'zxcoop'+OOPCnt;
 window[this.ref]=this;
 this.to=null;
 OOPCnt++;
}

zxcAddOOP.prototype.hide= function(){
 this.mobj.s.style.visibility='hidden';
 //this.mobj.className=this.mobj.bg;
}

zxcAddOOP.prototype.setTimeOut= function(zxcf,zxcd){
 this.to=setTimeout("window."+this.ref+"."+zxcf,zxcd);
}

function zxcEventAdd(zxco,zxct,zxcf) {
 if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ zxco[zxcf](e);}, false); }
 else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ zxco[zxcf](e); }); }
 else {
  var zxcPrev=zxco["on" + zxct];
  if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
  else { zxco['on'+zxct]=zxco[zxcf]; }
 }
}

function zxcAddShow(zxc){
 if (zxc.addShow){ return; }
 zxc.addShow=zxcShow;
 zxcEventAdd(zxc,'mouseover','addShow');
}
function zxcAddHide(zxc){
 if (zxc.addHide){ return; }
 zxc.addHide=zxcHide;
 zxcEventAdd(zxc,'mouseout','addHide');
}

function reloadMenuPos(menu) {
    //var xmod = menuCoords[menu];
    xmod = -375;
   	if( navigator.appName == "Netscape" ) {xmod = xmod-8;}
   	//document.getElementById("M"+menu+"S").style.left = eval(getScreenHoriCenter()/2)+xmod;
}
function reloadAll() {
	for (var a=0; a < menuCoords.length; a++) {
        if (menuCoords[a]) {
			reloadMenuPos(a);
		}
	}
}

function getScreenHoriCenter() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  
  return myWidth;
}



