selId=-1;
section=new Array();
timeoutId=-1; 
//overObj=-1;
timeoutLength=2000;
maxI=-1;
// FIRST LEVEL NAV
function write_menu(id,name,i,url) {
    
    if (i==0) {
        document.write('<div class="topmenu_first" style="z-index:8;width:'+width[i]+'em" id='+id+' onmouseover="onClickTopLevel(this.id,1)" onmouseout="uncolorTopLevel(this.id,1)">'+name+'</div>');
    } else {
        document.write('<div class="topmenu" style="z-index:8;left:'+left[i]+'em;width:'+width[i]+'em" id='+id+' onmouseover="onClickTopLevel(this.id,1)" onmouseout="uncolorTopLevel(this.id,1)">'+name+'</div>');
        
    }
    section[i]='section'+id;
    maxI=i;
    //alert (document.getElementById(id).style.top);
}

// SECOND LEVEL NAV part 1 - getting top tab to change color & appropriate vertical placement
function write_tab(name,i,ids,names,urls,url) {
    document.write('<DIV id='+section[i]+' style="visibility:hidden;z-index:10;width:750px;left:0.0px;position:absolute">');
    document.write('<div class="firsttabclicked" onclick="onClickLevel(\''+url+'\')" onmouseover="omoverFTC()" onmouseout="omoutFTC()" style="left:'+left[i]+'em;width:'+width[i]+'em;height:1.3em">'+name+'</div>');
    write_second_layers(i,ids,names,urls);
    document.write('</DIV>');
    if (is_ie4up){
        if (i==3)hideLayers();
    }    
}

function omoverFTC() {clearTimeout(timeoutId);}
function omoutFTC() {timeoutId=setTimeout("selectTopItem()", timeoutLength);}

function write_second_layers(toplevel,ids,names,urls) {
    leftpos=0; w=0; initpos=7; dashpos=0;
    for (k=0; k<ids.length; k++) {
        if (document.getElementById('stringDiv')){ 
            document.getElementById('stringDiv').style.visibility = 'hidden';
            document.getElementById('stringDiv').style.fontFamily = 'verdana'; 
            document.getElementById('stringDiv').style.fontSize   = '11'; 
            document.getElementById('stringDiv').style.fontStyle  = 'normal';
            document.getElementById('stringDiv').style.fontWeight = 'bold';
            document.getElementById('stringDiv').innerHTML = names[k];
            var width = document.getElementById('stringDiv').clientWidth;
        }
        else {alert(names[k]);}
        cw=Number(width+8);
        if (toplevel==2) {
            if (ids.length<4) initpos=300.0;
            else if (ids.length==4) initpos=200.0;
            else if (ids.length>4) initpos=200.0;
        }
        if (toplevel==3) {
            if (ids.length<=3) initpos=475.0;
            else if (ids.length==4) initpos=375.0;
            else if (ids.length>4) initpos=200.0;
        }

        if (k==0 && initpos!=7) {leftpos=initpos;}
        else {leftpos=Number(2*k+w+initpos);}

        // SECOND LEVEL NAV part 2 - getting 2nd level tabs to change color & proper vertical placement
        
        document.write('<div id='+ids[k]+' class="secondlevelmenu" style="z-index:10;top:25px;left:'+leftpos+'px;width:'+cw+'px;height:1.3em" onclick="onClickSecondLevel(\''+urls[k]+'\')" onmouseover="colorTopLevel(this.id)" onmouseout="uncolorTopLevel(this.id,2)">&nbsp;'+names[k]+'&nbsp;</div>');
        last=Number(ids.length-1);             
        if (k==last) return; 
        dashpos=cw+leftpos;
        document.write('<div class="dash" style="z-index:10;top:25px;left:'+dashpos+'px;height:26px">|</div>');
        w=Number(w+cw+0);
    }
}

function hideLayers() {
    for (i=0;i<section.length;i++){document.getElementById(section[i]).style.visibility='hidden';}
}

function onClickTopLevel(id,menuLevel){
    hideLayers();
    var obj='section'+id;
    document.getElementById(obj).style.visibility='visible';
    if (id!=0) {
        document.getElementById(obj).style.borderLeft = '#55758F 1px solid';
    } else {
        document.getElementById(obj).style.borderLeft = '#9BADBF 1px solid';
    }
    clearTimeout(timeoutId);
}

function onClickSecondLevel(gotoURL){parent.location=gotoURL;}

function onClickLevel(gotoURL){parent.location=gotoURL;}

function colorTopLevel(obj){
    clearTimeout(timeoutId);
    document.getElementById(obj).style.backgroundColor = '#e6eaeb';
    document.getElementById(obj).style.color = '#55758F';
    document.getElementById('secondon').style.visibility = 'visible';
    if (obj==selId) document.getElementById(obj).style.fontWeight="normal";
}

function uncolorTopLevel(obj,menuLevel){
    if (obj==selId) {return;}
    var hbg, htxt;
    if(menuLevel==2) {hbg='#9BADBF';htxt='#FFFFFF';}
    if(menuLevel==1) {hbg='#55758f';htxt='#FFFFFF';}
    document.getElementById(obj).style.backgroundColor = hbg;
    document.getElementById(obj).style.color = htxt;
    timeoutId=setTimeout("selectTopItem()", timeoutLength);
}

function selectTopItem() {
    hideLayers();
}

var day="";
var month="";
var ampm="";
var ampmhour="";
var myweekday="";
var year="";
mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
weekday= myweekday;
myyear= mydate.getFullYear();
year = myyear;
myhours = mydate.getHours();
ampmhour  =  (myhours > 12) ? myhours - 12 : myhours;
ampm =  (myhours >= 12) ? ' PM' : ' AM';
mytime = mydate.getMinutes();
myminutes =  ((mytime < 10) ? ':0' : ':') + mytime;
if(myday == 0)
day = " Sun, ";
else if(myday == 1)
day = " Mon, ";
else if(myday == 2)
day = " Tue, ";
else if(myday == 3)
day = " Wed, ";
else if(myday == 4)
day = " Thur, ";
else if(myday == 5)
day = " Fri, ";
else if(myday == 6)
day = " Sat, ";
if(mymonth == 0) 
month = "January";
else if(mymonth ==1)
month = "February ";
else if(mymonth ==2)
month = "March";
else if(mymonth ==3)
month = "April ";
else if(mymonth ==4)
month = "May ";
else if(mymonth ==5)
month = "June ";
else if(mymonth ==6)
month = "July ";
else if(mymonth ==7)
month = "August ";
else if(mymonth ==8)
month = "September";
else if(mymonth ==9)
month = "October ";
else if(mymonth ==10)
month = "November ";
else if(mymonth ==11)
month = "December ";

