var IE = 0;
var N4 = 0;
var MO = 0;
if (document.all) {IE = 1;}  //IE
if (document.layers) {N4 = 1;}  //Netscape 4
if (document.getElementById&&!document.all) {MO = 1;}  //Mozilla, Netscape 6+

var timer;
var oldY = new Array(29);
for (i=0; i<30; i++) {oldY[i] = 0;}

function getElement(psID) { 
   if(IE) { 
      return document.all[psID]; 
   } else if(MO) { 
      return document.getElementById(psID); 
   } else if (N4) { 
      return document.layers[psID]; 
   }
   return Null; 
}

function getScrollY() {
   var scrOfY = 0;
   if (typeof( window.pageYOffset ) == 'number') {
      //Netscape compliant
      scrOfY = window.pageYOffset;
   } else if (document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
      //DOM compliant
      scrOfY = document.body.scrollTop;
   } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
     //IE6 standards compliant mode
     scrOfY = document.documentElement.scrollTop;
   }
   return scrOfY;
}

function Show() { 

   if(IE || N4 || MO) {
      if(timer) clearTimeout(timer);
      for(menu=0; menu<Layer.length; menu++) { 
         if(Layer[menu]) {
             var elm = getElement('L'+menu);
             if (IE || MO) {elm.style.visibility = "hidden";}
             if (N4) {elm.visibility = "hidden";}
         } 
      }
      for(i=0; i<arguments.length; i++) { 
         menu=arguments[i];
         var elm = getElement('L'+menu);
         var yy = getScrollY();
         if (IE) {
            elm.style.pixelTop += yy - oldY[menu];
            elm.style.visibility = "visible";
         }
         if (N4) {
            elm.moveBy(0, yy - oldY[menu]);
            elm.visibility = "visible";
         }
         if (MO) {
            elm.style.top = parseInt(elm.style.top) + yy - oldY[menu];
            elm.style.visibility = "visible";
         }
         oldY[menu] = yy;
      }
   } 
}

function Hide() { 
   timer = setTimeout("Show()", 1000);
}

function LayerSpecs(Left,Top,Width) {
        if (IE) { Top+=7; Left+=2; Width-=6; }
        this.left  = Left;
        this.top   = Top;
        this.info  = "";
        T=0;
        L=0;
        CellWidth	 = 17;			//Width of the cell in menu
        SeparatorWidth =1;  		// Width of the separater
        BorderWidth = 2; 		// Width of 3D border (Darker Side) 
        BorderWidth2 = 2; 		// Width of 3D border (Lighter Side) 
        BorderColor = "#555555"   	// 3D Border color (Darker Side)
        BorderColor2 ="#FEFEFE"       	// 3D Border color (Lighter Side)


        //var itemProps = 'font-Family:arial,helvetica,espy,sans-serif' 
        //                +';font-Weight:plain'
        //                +';font-color:#000000'
        //                +';font-Weight:plain'
        //                +';fontSize:20' 
        //                +';';

/***********   Drawing of 3D border (Top)   ****************/
	if(IE) {		// IE part
		this.info += "<DIV ID='Border' style='position:absolute;width:" + (Width+2*BorderWidth) +";height:10;left:0;top=0; background-color: #000000;clip: rect(0 " + (Width+2*BorderWidth) + " 1 0);'></DIV>";		//Top Outside Black line
		T +=1;	
		this.info += "<DIV ID='Border1' style='position:absolute;width:" + (Width+2*BorderWidth) +";height:10;left:0;top:" + T+ "; background-color: " + BorderColor2 + ";clip: rect(0 " + (Width+2*BorderWidth) + " " + BorderWidth+ " 0);'></DIV>";		//Top Light Border
	} else if (N4) {				// Netscape part
		this.info +="<LAYER BGCOLOR=#000000 Width=" + (Width + 2*BorderWidth) + " Height=" + BorderWidth2 + " POSITION=RELATIVE TOP="+T+"></LAYER>";		//Top Outside Black line
		T +=1;	
		this.info +="<LAYER BGCOLOR=" + BorderColor2 + " Width=" + (Width + 2*BorderWidth) + " Height=" + BorderWidth2 + " POSITION=RELATIVE TOP="+T+"></LAYER>";		// Top Light Border
	} else if(MO) {		// Netscape 6+, Mozilla
		this.info += "<DIV ID='Border' style='position:absolute;width:" + (Width+2*BorderWidth) +";height:10;left:0;top:0; background-color: #000000;clip: rect(0 " + (Width+2*BorderWidth) + " 1 0);'></DIV>";		//Top Outside Black line
		T +=1;	
		this.info += "<DIV ID='Border1' style='position:absolute;width:" + (Width+2*BorderWidth) +";height:10;left:0;top:" + T+ "; background-color: " + BorderColor2 + ";clip: rect(0 " + (Width+2*BorderWidth) + " " + BorderWidth+ " 0);'></DIV>";		//Top Light Border
        }
	T += BorderWidth2;
/***********   Drawing of 3D border (Top)   ****************/


        for(i=3; i<arguments.length; i++) {
                if(IE) {  		// IE part  onMouseOver="this.style.backgroundColor = '#00FF00'"
                    this.info += "<DIV class='submenu' ID=" + i + " onMouseOver=\"this.style.backgroundColor='"+hovercolor+"'\" onMouseOut='this.style.backgroundColor=\""+bgcolor+"\"' style='position:absolute;background-color: #CCCCCC;layer-background: #CCCCCC;width:" + Width +";height:" + CellWidth + ";left:" + (BorderWidth+1) + ";top:"+ T +";'>"+arguments[i]+"</DIV>";
                    T += CellWidth;
                    if ( i+1 < arguments.length) {
			this.info += "<DIV ID='Separater' style='position:absolute;width:" + Width +";height:10;left:" + (BorderWidth+1) + ";top:"+T+"; background-color: #000000;clip: rect(0 " + Width + " " + SeparatorWidth + " 0);'></DIV>";	// Separater for IE
                        T+=SeparatorWidth;
                    }

                } else if (N4) { 			// Netscape part
                    this.info += "<LAYER onMouseOver='this.bgColor=\""+hovercolor+"\"' onMouseOut='this.bgColor=\""+bgcolor+"\"' POSITION=RELATIVE TOP="+T+">&nbsp;"+arguments[i]+"</LAYER>"; 
                    T += CellWidth;
                    if ( i+1 < arguments.length) {
                        this.info +="<LAYER BGCOLOR=#000000 Width=" + (Width+BorderWidth) + " Height=" + SeparatorWidth + " POSITION=RELATIVE TOP="+T+"></LAYER>";       // Separater for Netscape
		        T+=SeparatorWidth;
		    }
                } else if(MO) {   		// IE part  onMouseOver="this.style.backgroundColor = '#00FF00'"
                    this.info += "<DIV  ID=" + i + " onMouseOver=\"this.style.backgroundColor='"+hovercolor+"'\" onMouseOut='this.style.backgroundColor=\""+bgcolor+"\"' style='font-size:10pt;font-family:arial;position:absolute;background-color: #CCCCCC;layer-background: #CCCCCC;width:" + Width +";height:" + CellWidth + ";left:" + (BorderWidth+1) + ";top:"+ T +";'>"+arguments[i]+"</DIV>";
                    T += CellWidth;
                    if ( i+1 < arguments.length) {
                        this.info += "<DIV ID='Separater' style='position:absolute;width:" + Width +";height:10;left:" + (BorderWidth+1) + ";top:"+T+"; background-color: #000000;clip: rect(0 " + Width + " " + SeparatorWidth + " 0);'></DIV>";	// Separater for IE
                        T+=SeparatorWidth;
                    }
                }
        }

/***********   Drawing of 3D border   ****************/

	T += BorderWidth;
	if(IE) {		// IE part
		this.info += "<DIV ID='Border' style='position:absolute;width:10;height:" + (T+BorderWidth2) +";left:0;top:0; background-color: #000000;clip: rect(0 1 " + (T+BorderWidth2-2) + " 0);'></DIV>";		// Left Outside Black line
		this.info += "<DIV ID='Border1' style='position:absolute;width:10;height:" + (T+BorderWidth2-1) + ";left:1;top:1; background-color: " + BorderColor2 + ";clip: rect(0 " + BorderWidth + " " + (T+BorderWidth2-3)+ " 0);'></DIV>";		//Left Light Border
		this.info += "<DIV ID='Border1' style='position:absolute;width:" + (Width+2*BorderWidth+1) +";height:10;left:0;top:" + (T-2) + "; background-color: " + BorderColor + ";clip: rect(0 " + (Width+2*BorderWidth+1) + " " + BorderWidth+ " 0);'></DIV>";		//Bottom darker border
		this.info += "<DIV ID='Border1' style='position:absolute;width:10;height:" + (T+2*BorderWidth) + ";left:" + (Width+2*BorderWidth -1) + ";top:0; background-color: " + BorderColor + ";clip: rect(0 " + BorderWidth + " " + (T+BorderWidth2-2)+ " 0);'></DIV>";		//Right darker border
	} else if (N4) {				// Netscape part
		this.info +="<LAYER BGCOLOR=#000000 Width=1 Height=" + (T+2*BorderWidth + 2) + " POSITION=RELATIVE TOP=0 LEFT=0></LAYER>";			// Left Outside black line
		this.info +="<LAYER BGCOLOR=" + BorderColor2 + " Width=" + BorderWidth2 + " Height=" + (T+2*BorderWidth) + " POSITION=RELATIVE TOP=" + BorderWidth + " LEFT=1></LAYER>";		// Left white border
		this.info +="<LAYER BGCOLOR=" + BorderColor + " Width=" + (Width +3*BorderWidth) + " Height=" + BorderWidth + " POSITION=RELATIVE TOP="+ (T+2*BorderWidth) +" LEFT=0></LAYER>";	// Bottom darker border
		this.info +="<LAYER BGCOLOR=" + BorderColor + " Width=" + BorderWidth + " Height=" + (T+2*BorderWidth) + " POSITION=RELATIVE TOP=0 LEFT=" + (Width+2*BorderWidth) + "></LAYER>";		// Right darker border
	} else if(MO) {		// Netscape 6+, Mozilla
		this.info += "<DIV ID='Border' style='position:absolute;width:10;height:" + (T+BorderWidth2) +";left:0;top:0; background-color: #000000;clip: rect(0 1 " + (T+BorderWidth2-2) + " 0);'></DIV>";		// Left Outside Black line
		this.info += "<DIV ID='Border1' style='position:absolute;width:10;height:" + (T+BorderWidth2-1) + ";left:1;top:1; background-color: " + BorderColor2 + ";clip: rect(0 " + BorderWidth + " " + (T+BorderWidth2-3)+ " 0);'></DIV>";		//Left Light Border
		this.info += "<DIV ID='Border1' style='position:absolute;width:" + (Width+2*BorderWidth+1) +";height:10;left:0;top:" + (T-2) + "; background-color: " + BorderColor + ";clip: rect(0 " + (Width+2*BorderWidth+1) + " " + BorderWidth+ " 0);'></DIV>";		//Bottom darker border
		this.info += "<DIV ID='Border1' style='position:absolute;width:10;height:" + (T+2*BorderWidth) + ";left:" + (Width+2*BorderWidth -1) + ";top:0; background-color: " + BorderColor + ";clip: rect(0 " + BorderWidth + " " + (T+BorderWidth2-2)+ " 0);'></DIV>";		//Right darker border
        }
/***********   Drawing of 3D border   ****************/
}

