 // |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// 
// 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.
// If you do remove this, I will hunt you down :)
//
// |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// --- Version Date 8-6-02 ---------------------------------------------------------------

// rollover code
var ok = false;

if (document.images) {
        var names = new Array();

        names[0] = "home";
        names[1] = "products";
        names[2] = "services";
        names[3] = "about";
        names[4] = "case";
        names[5] = "contact";

        var on = new Array();
        var off = new Array();

        for (var i=0; i<names.length; i++) {
                on[i] = new Image();
                on[i].src = "images/nav/" + names[i] + "_on.gif";

                off[i] = new Image();
		off[i].src = "images/nav/" + names[i] + "_off.gif";
        }

	var sub_prod = new Array();

	sub_prod[0] = "sales";
	sub_prod[1] = "initiative";
	sub_prod[2] = "opportunity";
	sub_prod[3] = "promotions";
	sub_prod[4] = "game";

	var prod_on = new Array();
	var prod_off = new Image();
	prod_off.src = "images/nav/subnav/products_off.gif";

        for (var i=0; i<sub_prod.length; i++) {
                prod_on[i] = new Image();
                prod_on[i].src = "images/nav/subnav/products_" + sub_prod[i] + "_on.gif";
        }

	var sub_about = new Array();
	sub_about[0] = "company";
	sub_about[1] = "letter";
	sub_about[2] = "partners";
	sub_about[3] = "opportunities";	

	var about_on = new Array();
	var about_off = new Image();
	about_off.src = "images/nav/subnav/about_off.gif";

        for (var i=0; i<sub_about.length; i++) {
                about_on[i] = new Image();
                about_on[i].src = "images/nav/subnav/about_" + sub_about[i] + "_on.gif";
        }

        ok = true;
}


//function switch_on(num) { if (ok) { document.getElementById("nav").src = on[num].src; } }
//function switch_off(num) { setTimeout("chg_off(" +num+ ")", 500); }
//function switch_off() { chg_off(); }

//function chg_off() { if (ok) { document.getElementById("nav").src = off.src; } } 

function switch_prod_on(num) { if (ok) { document.getElementById("sub_products").src = prod_on[num].src; } }
function switch_prod_off() { if (ok) { document.getElementById("sub_products").src = prod_off.src; } } 

function switch_about_on(num) { if (ok) { document.getElementById("sub_about").src = about_on[num].src; } }
function switch_about_off() { if (ok) { document.getElementById("sub_about").src = about_off.src; } } 

var agent = navigator.userAgent.toLowerCase(); 
var mac = agent.indexOf('mac') != -1;
var safari = agent.indexOf('safari') != -1;
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 getStyle(name, nest){
	nest = nest ? 'document.'+nest+'.' : '';
	return w3c ? document.getElementById(name).style : iex ? document.all[name].style : ns4 ? eval(nest+'document.'+name) : false;
}

// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
// Menu Constructor

CenterMenu = function(name,left,top,num){
	this.name = name;
	this.left = left;
	this.top = top;
	this.num = num;
	this.timer = null;
	this.obj = name+'Object';
	eval(this.obj+'=this');
}
CenterMenu.prototype.show = function(){
	clearTimeout(this.timer);
	var windowWidth = iex ? document.body.clientWidth : window.innerWidth;
	var offset = Math.floor((windowWidth-pageWidth)/2);
	if(offset < 0){
		offset = 0;
	}

	if(ns4 && offset > 0){ // Ugly NS4 Bug Fix
		if(mac){
			if(document.height < window.innerHeight){
				offset -= 8;
			}
		}else{
			offset -= 8;
		}
	}
	getStyle(this.name).left = offset+this.left;
	getStyle(this.name).visibility = 'visible';
	curMenu = this.name;
	document.getElementById(names[this.num]).src = on[this.num].src;
}
CenterMenu.prototype.hide = function(){
	this.timer = setTimeout(this.obj+'.hideIt()',500);
}
CenterMenu.prototype.hideIt = function(){
	getStyle(this.name).visibility = 'hidden';
	document.getElementById(names[this.num]).src = off[this.num].src;
}
CenterMenu.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;
}

// Global Menu Functions
hideCur = function(){
	if(curMenu != null){
		Menus[curMenu].hideIt();
		curMenu = null;
	}
}
endMenu = function(){
	 return ns4 ? '<\/layer>' : '<\/div>';
}
createCenterMenu = function(name,left,top,num){
	Menus[name] = new CenterMenu(name,left,top,num);
}

Menus = new Object();
var curMenu = null;
var pageWidth = 768;

// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
// set display numbers
num1 = 148;
num2 = 360;

if ( (safari) || (iex) ) {
num1 = 148;
num2 = 362;
}

// Build Menu Structure

createCenterMenu('submenu1', 0,  118, 0);
createCenterMenu('submenu2', num1,  118, 1);
createCenterMenu('submenu3', 0,  118, 2);
createCenterMenu('submenu4', num2, 118, 3);
createCenterMenu('submenu5', 0,  118, 4);
createCenterMenu('submenu6', 0,  118, 5);

// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

