//Stores each of the Rollover objects
//so they can be turned on by the onload
//of the layout*.jsp
var rollList = new Array();
var topNav = new Rollover('','');
var setup = "false";
var lastImg = "";

function addRollover(rollover) {
    rollList[rollList.length] = rollover;
}

function navSetup(section) {
    if(section!=null) {
	topNav = new Rollover(section);
	addRollover(topNav);
    }

    for(i=0;i<rollList.length;i++) 
	rollList[i].set();

    setup = "true";
}

function Rollover(section) {
    //properties
    this.section = section;
    this.prefix = "images/nav/";
    //methods
    this.Over = navImageOver;
    this.On = navImageOn;
    this.Off = navImageOff;
    this.toggle = navImageToggle;
    this.set = navImageSetOn;
}

function navImageToggle(section,name,extension) {
if(name != "" && name != section) {
	if(document.layers && document.layers["mainnav"] && document.layers["mainnav"].document.images[name]) {
	    document.layers["mainnav"].document.images[name].src = this.prefix+name+extension;
	} else if((is_nav6 || is_moz7)&& document.getElementById(name)) {
	    document.getElementById(name).src = this.prefix+name+extension;
	} else if(document.images[name]) {
	    document.images[name].src = this.prefix+name+extension;
	}
    }
}

function navImageSetOn() {
    this.toggle("",this.section,"_on.gif");
}

function navImageOver(name) {
    if(setup == "true") 
    {
    	this.toggle(this.section,name,"_over.gif");
	lastImg = name;
    }
}

function navImageOff(name) {
    if(setup == "true") {
	if(this.section != name)
	    this.toggle(this.section,name,".gif");
	else
	    this.toggle(this.section,name,"_on.gif");
	
	lastImg = "";
    }
}

function navImageOn(name) {
    if(setup == "true") {
	this.toggle(this.section,name,"_on.gif");
    }
}


function preCache(image,w,h){
	
    if (document.images){
	pic = new Image(w,h);
	pic.src = image;
    }
}

function rollOn(imgName,imgSrc,section)
{
	document.images[imgName].src=imgSrc;
	document.images['slogan'].src="images/home/slogan_"+section+".gif";
	document.images[section].src="images/nav/"+section+"_over.gif";
}

function rollOff(imgName,imgSrc,section)
{
	document.images[imgName].src=imgSrc;
	//document.images['slogan'].src="images/home/slogan_home.gif";
	document.images['slogan'].src="images/home/slogan_promo_feis.gif";
	document.images[section].src="images/nav/"+section+".gif";
}

function divOver(divName){
	document.getElementById(divName).style.display = "block";
}

function divOff(divName){
	document.getElementById(divName).style.display = "none";
}

