
highlighted=-1;
numButtons=7;

if (document.images)
{
        preloadImages();
}

function preloadImages()
{
        buttons = new Array(numButtons*10);
        for (i = 0;i < numButtons; i++)
        {
                buttons[i]=new Image;
                buttons[i+numButtons]=new Image;
                buttons[i+numButtons*2]=new Image;
                buttons[i+numButtons*3]=new Image;
                buttons[i+numButtons*4]=new Image;
                buttons[i].src = "images/num"+i+".gif";
                buttons[i+numButtons].src = "images/num"+i+"-on.gif";
                buttons[i+numButtons*2].src = "images/hpnav"+i+".gif";
				buttons[i+numButtons*3].src = "images/hpnav"+i+"-on.gif";
				buttons[i+numButtons*4].src = "images/hp_head"+i+".gif";
        }
}

function buttonOn(which)
{
     document["num"+which].src = buttons[which+numButtons].src;
     document["nav"+which].src = buttons[which+numButtons*3].src;
}

function buttonOff(which)
{
     document["num"+which].src = buttons[which].src;
	 document["nav"+which].src = buttons[which+numButtons*2].src;
}

function highlight(which)
{
	if (document.images)
	{
	highlighted=which;
	document.head.src = buttons[which+numButtons*4].src;
	}
}

function doNothing()
{
}

if (document.images) {
 	contactoff = new Image;
   	contactoff.src = "images/contact.gif";
	contacton = new Image;
   	contacton.src = "images/contact-on.gif";
	
	sitemapoff = new Image;
	sitemapoff.src = "images/sitemap.gif";
	sitemapon = new Image;
   	sitemapon.src = "images/sitemap-on.gif";

	newsletteroff = new Image;
	newsletteroff.src = "images/newsletter.gif";
	newsletteron = new Image;
   	newsletteron.src = "images/newsletter-on.gif";
	}
	
function text_on(textName) {
	if (document.images) {
		textOn = eval(textName + "on.src");
		document.images[textName].src=textOn;
	}
}

function text_off(textName) {
	if (document.images) {
		textOff = eval(textName + "off.src");
		document.images[textName].src = textOff;
	}
}

function checkBrowser(){
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new checkBrowser()

timSpeed=250
contHeight=100

function makeScrollObj(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'										
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;		
	this.height=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.top=b_gettop										
	return this
}

function b_gettop(){
	var gleft=(bw.ns4 || bw.ns6)?parseInt(this.css.top):eval(this.css.pixelTop);
	return gleft;
}

var scrollTim;
var active=0;

function scroll(speed){
	clearTimeout(scrollTim)
	way=speed>0?1:0
	if((!way && oScroll[active].top()>-oScroll[active].height+contHeight) || (oScroll[active].top()<0 && way)){
		oScroll[active].css.top=oScroll[active].top()+speed
		scrollTim=setTimeout("scroll("+speed+")",timSpeed)
	}
	noScroll()
}

function noScroll(){
	clearTimeout(scrollTim)
}

function changeActive(num){
	oScroll[active].css.visibility='hidden'
	active=num
	oScroll[active].css.top=0
	oScroll[active].css.visibility='visible'
}

function scrollInit(){
	oScroll=new Array()
	oScroll[0]=new	makeScrollObj('divScroll1','divCont')
	oScroll[1]=new	makeScrollObj('divScroll2','divCont')
	oScroll[2]=new	makeScrollObj('divScroll3','divCont')
	oScroll[0].css.left = 0
	oScroll[0].css.top = 0
	oScroll[0].css.visibility='visible'
	oControl=new makeScrollObj('divControl')
	oControl.css.visibility='visible'
}

onload=scrollInit;

function todaysDate()
		{
		var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
		monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
		var now = new Date();
		document.write("<span class=greendate>" + dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " "+ now.getDate() + ", 2004</span>" );
		}

function extranetLogin(url){
    xNet=window.open(url, 		'xNet','width=10,height=10,top=150,left=250,toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
	xNet.focus();
	xNet.resizeTo(158,144);
	void(0);
}

function openNews(url){
    we=window.open(url, 		'we','width=250,height=125,top=50,left=200,toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
	we.focus();
	void(0);
}
