n4=false;   ie=false;   ns=false;

function browser(){
    if( document.getElementById && !document.all )
    {
        ns=true; speed=10; return;
    }
    else if( document.all )
    {
        ie=true; return;
    }
    else
    {
        n4=true; return;
    }
}
browser();

function cycle_img(){
    pic_num=Math.round(Math.random()*3)+1;
    document.write("<a href='/'>");
    document.write("<img border=\'0\' src=\'/slideshow_images/top"+pic_num+".jpg\' width='700' height='100%'></a>");
}

var t=0;
var l=0;
var sm_style=false;
var m_style=false;
var i=0;
var hlite_color="#eeeeee"

function find_pos( menu_pos ) {
    if( menu_pos.offsetParent )
    {
        for( var pos_top = 0, pos_left = 0; menu_pos.offsetParent; menu_pos = menu_pos.offsetParent )
        {
            pos_top += menu_pos.offsetTop;
            pos_left += menu_pos.offsetLeft;
        }
        t=pos_top
        l=pos_left
        return;
    }
    else
    {
        t=menu_pos.y
        l=menu_pos.x
        return;
    }
}

function menu_control(name,mode) {
    this.name=name;
    this.mode=mode;

    this.do_menu = function() {
        if( sm_style )
        {
            sm_style.visibility="hidden";
        }

        m_style=document.getElementById(this.name).style;

        if( this.mode > 0 )
        {
            m_style.backgroundColor=hlite_color;

            if( this.mode > 1 )
            {
                sm_style=document.getElementById("s"+this.name).style;
                m_style.position="relative";
                m_style.left="12px";
                sm_style.position="absolute";
                sm_style.left=l+225+"px";
                sm_style.top=t+-7+"px";
                sm_style.visibility="visible"
            }
        }
    }
}

function m_pop(name,mode){
    if( m_style )
    {
        //alert("move");
        m_style.backgroundColor="transparent";
        m_style.position="relative";
        m_style.left="0px";
    }
    m = new menu_control(name,mode)
    m.do_menu()
}

/* highlights individual menu items onmousover without doing anything else */

function hlite(a,b){
    b == 1 ? a.style.backgroundColor=hlite_color : a.style.backgroundColor="transparent";
}