/*
Dropdown menu. FreeWare.
Nikolai Lebedev, Microinform&Webstreet101
Works in IE4x, IE4x, NN4x and do not give garbage in old browsers.
Both graphics and text can drop.
The menu drops just below the calling image, situated anywhere on the page.
No preliminary positioning is need.
Short and simple code.
*/



//Detecting the browser type
var isNS = (navigator.appName == "Netscape");
var isMacIE = ( (navigator.userAgent.indexOf("IE 4")  > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );
var layerRef = (isNS) ? "document" : "document.all";
var styleRef = (isNS) ? "" : ".style";
var isDynamic = ( (document.layers || document.all) && !isMacIE );

// To hide from old browsers generate the menu
// dynamically, invisible at the beginning
function MenuCall(Content, Width, BackgrColor, MenuNumber) {
    MenuID=MenuNumber;
    WidthMenu=Width;
    Color=BackgrColor;

    if (isDynamic) {
              if (isNS) { 

                document.write("<LAYER  class=menu   bgcolor="+Color+"  width="+WidthMenu+"  visibility=hidden  id="+MenuID+"   onMouseover=\"MenuActivate('"+MenuID+"')\" onMouseOut=\"MenuKill('"+MenuID+"')\">"+Content+"</LAYER>");	
    } else {  
	            document.write("<DIV class=menu   id="+MenuID+"  STYLE=\"position:absolute; z-index:2; visibility:hidden; background:"+Color+"\"  onMouseover=\"MenuActivate('"+MenuID+"')\" onMouseOut=\"MenuKill('"+MenuID+"')\">"+Content+"</DIV>");
		        eval(layerRef + '["'+MenuID+'"]'+ styleRef + '.width ='+WidthMenu);
	      }
    }

}

// To activate a menu just change the visibility parameter
function MenuActivate(MenuNumber) {
         MenuID=MenuNumber;

         if (isDynamic) { 
                         if (isNS) { 
                               MenuIDPlace=MenuID+"Place"
                               CoordX=document.anchors[MenuIDPlace].x;
                               CoordY=document.anchors[MenuIDPlace].y +document.images["Menu1Picture"].height;
                               eval(layerRef + '["'+MenuID+'"]' + styleRef + '.top = '+CoordY);
                               eval(layerRef + '["'+MenuID+'"]' + styleRef + '.left = '+CoordX);
                               eval(layerRef + '["'+MenuID+'"]' + styleRef + '.visibility = "visible"');                     
                        
                         } else {
                           eval(layerRef + '["'+MenuID+'"]' + styleRef + '.visibility = "visible"');
                         }
        }
}
// To de-activate a menu just change the visibility parameter
function MenuKill(MenuNumber) {
        MenuID=MenuNumber;
        if (isDynamic) {
              eval(layerRef + '["'+MenuID+'"]' + styleRef + '.visibility = "hidden"');
        }
}
// that's all
