// Javascript for drop-down menu ...

// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
//
// Coded by Travis Beckham
// http://www.squidfingers.com | http://www.podlob.com
// If want to use this code, feel free to do so, but please leave this message intact.
//
// --- Version Date 8-15-02 --------------------------------------------------------------------------------------------------------------
//
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

var w3c = document.getElementById ? true : false;
var iex = document.all ? true : false;
var ns4 = document.layers ? true : false;

function fixNetscape(){
        if(origWidth != window.innerWidth || origHeight != window.innerHeight){
                window.location.reload();
        }
}
if(ns4){
        origWidth = window.innerWidth;
        origHeight = window.innerHeight;
        window.onresize = fixNetscape;
}
function newImage(src){
        img = new Image();
        img.src = src;
        return img;
}
function imageSwap(img,obj,div){
        if(ns4 && div != null){
                document.layers[div].document.images[img].src = obj.src;
        }else{
                document.images[img].src = obj.src;
        }
}
function getStyle(name, nest){
        nest = nest ? 'document.'+nest+'.' : '';
        return w3c ? document.getElementById(name).style : iex ? document.all[name].style : ns4 ? eval(nest+'document.'+name) : false;
}

// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

Menus = new Object();
var curMenu = null;

MakeMenu = function(name,left,top,rollimg,rollout,rollover,rolldiv){
        this.name = name;
        this.left = left;
        this.top = top;
        this.timer = null;
        this.rollimg = rollimg;
        this.rollout = newImage(rollout);
        this.rollover = newImage(rollover);
        this.rolldiv = (rolldiv != null) ? rolldiv : null;
        this.obj = name+'Object';
        eval(this.obj+'=this');
}
MakeMenu.prototype.show = function(){
        clearTimeout(this.timer);
        getStyle(this.name).visibility = 'visible';
        imageSwap(this.rollimg,this.rollover,this.rolldiv);
        curMenu = this.name;
}
MakeMenu.prototype.hide = function(){
        this.timer = setTimeout(this.obj+'.hideIt()',500);
}
MakeMenu.prototype.hideIt = function(){
        getStyle(this.name).visibility = 'hidden';
        imageSwap(this.rollimg,this.rollout,this.rolldiv);
}
MakeMenu.prototype.startMenu = function(){
        var html;
        if(ns4){
                html = '<layer name="'+this.name+'" left="'+this.left+'" top="'+this.top+'" z-index="1000" visibility="hidden" ';
        }else{
                html = '<div id="'+this.name+'" style="position:absolute; left:'+this.left+'px; top:'+this.top+'px; z-index:1000; visibility:hidden" ';
        }
        html += 'onMouseOver="Menus.'+this.name+'.show()" onMouseOut="Menus.'+this.name+'.hide()">';
        return html;
}
hideCur = function(){
        if(curMenu != null){
                Menus[curMenu].hideIt();
                curMenu = null;
        }
}
endMenu = function(){
         return ns4 ? '<\/layer>' : '<\/div>';
}
createMenu = function(name,left,top,rollimg,rollout,rollover,rolldiv){
        Menus[name] = new MakeMenu(name,left,top,rollimg,rollout,rollover,rolldiv);
}

// ... End of file.
