cm1x=null;
cm2x=null;
cm3x=null;
cm4x=null;

hide_delayx=500;

tstat1x=0;
tstat2x=0;
tstat3x=0;
tstat4x=0;

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

function switchDivx(objElement,bolVisible){
if(isNS4||isIE4){
     if(!bolVisible) {
       objElement.visibility ="hidden"
     } else {
       objElement.visibility ="visible"
     }
 } else if (isIE5 || isNS6) {
      if(!bolVisible){
         objElement.style.display = "none";

      } else {
        objElement.style.display = "";

        }

      }

return 1;
}

function getPosx(elx,sPropx) {
        var iPosx = 0;
        while (elx!=null) {
                iPosx+=elx["offset" + sPropx]
                elx = elx.offsetParent
        }
        return iPosx

}

function getelementbyidx(myid) {
   if (isNS4){
        objElement = document.layers[myid];
     }else if (isIE4) {
        objElement = document.all[myid];
     }else if (isIE5 || isNS6) {
             objElement = document.getElementById(myid);
     }
return(objElement);
}

function show1x(elx,mx) {
show2x(null,null);
show3x(null,null);
show4x(null,null);
if (cm1x!=null) {
 switchDivx(cm1x,false);
 }

 if (mx!=null) {
 mx=getelementbyidx(mx);
 mx.style.left = 100 + getPosx(elx,"Left") + "px";
 mx.style.top =  -50 + getPosx(elx,"Top")+elx.offsetHeight+"px";
 switchDivx(mx,true);
 cm1x=mx;
 }
}

function show2x(elx,mx) {
show3x(null,null);
show4x(null,null);
if (cm2x!=null) {
 switchDivx(cm2x,false);
 }

 if (mx!=null) {
 mx=getelementbyidx(mx);mx.style.left = (getPosx(elx,"Left")+elx.offsetWidth)+"px";
 mx.style.top =  getPosx(elx,"Top")+"px";
 switchDivx(mx,true);
 cm2x=mx;
 }
}

function show3x(elx,mx) {
show4x(null,null);
if (cm3x!=null) {
 switchDivx(cm3x,false);
 }

 if (mx!=null) {
 mx=getelementbyidx(mx);mx.style.left = (getPosx(elx,"Left")+elx.offsetWidth)+"px";
 mx.style.top =  getPosx(elx,"Top")+"px";
 switchDivx(mx,true);
 cm3x=mx;
 }
}

function show4x(elx,mx) {
if (cm4x!=null) {
 switchDivx(cm4x,false);
 }

 if (mx!=null) {
 mx=getelementbyidx(mx);mx.style.left = (getPosx(elx,"Left")+elx.offsetWidth)+"px";
 mx.style.top =  getPosx(elx,"Top")+"px";
 switchDivx(mx,true);
 cm4x=mx;
 }
}


function hidemenux() {

timer1x=setTimeout("show1x(null,null)",hide_delayx);
timer2x=setTimeout("show2x(null,null)",hide_delayx);
timer3x=setTimeout("show3x(null,null)",hide_delayx);
timer4x=setTimeout("show4x(null,null)",hide_delayx);
tstat1x=1;
tstat2x=1;
tstat3x=1;
tstat4x=1;
return 1;
}

function cancelhidex() {

if (tstat1x==1) {
 clearTimeout(timer1x);
 tstat1x=0;
 }
 if (tstat2x==1) {
 clearTimeout(timer2x);
 tstat2x=0;
 }
 if (tstat3x==1) {
 clearTimeout(timer3x);
 tstat3x=0;
 }
 if (tstat4x==1) {
 clearTimeout(timer4x);
 tstat4x=0;
 }
 return 1;
}


