var agent = navigator.userAgent.toLowerCase(); 
var mac = agent.indexOf('mac') != -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){
	this.name = name;
	this.left = left;
	this.top = top;
	this.timer = null;
	this.obj = name+'Object';
	eval(this.obj+'=this');
}
CenterMenu.prototype.show = function(){
	clearTimeout(this.timer);
	var windowWidth1 = iex ? document.body.clientWidth : window.innerWidth;
	var offset = Math.floor((windowWidth1)/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;
}
CenterMenu.prototype.hide = function(){
	this.timer = setTimeout(this.obj+'.hideIt()',1);
}
CenterMenu.prototype.hideIt = function(){
	getStyle(this.name).visibility = 'hidden';
}
CenterMenu.prototype.startMenu = function(){
	var html;
	if(ns4){
		html = '<layer name="'+this.name+'" left="'+this.left+'" top="'+this.top+'" z-index="100000" visibility="hidden" ';
	}else{
		html = '<div id="'+this.name+'" style="position:absolute; left:'+this.left+'px; top:'+this.top+'px; z-index:100000; visibility:hidden" ';
	}
	html += 'onMouseOver="Menus.'+this.name+'.show()">';
	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){
	Menus[name] = new CenterMenu(name,left,top);
}
Menus = new Object();
var curMenu = null;



// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
// Build Menu Structure

var detect = navigator.userAgent.toLowerCase();
var browser;

if(navigator.appName=="Netscape" ){
	 if (checkIt('safari')){
		 
	 // Safari ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~	
	createCenterMenu('submenu1',-450,247);
	createCenterMenu('submenu2',-367,247);
	createCenterMenu('submenu3',-303,247);
	createCenterMenu('submenu4',-486,247);
	createCenterMenu('submenu5',6,247);

	// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~	
	
	 }
	else if (checkIt('firefox'))
	{
	//Firefox~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~	
	createCenterMenu('submenu1',-450,247);
	createCenterMenu('submenu2',-367,247);
	createCenterMenu('submenu3',-303,247);
	createCenterMenu('submenu4',-486,247);
	createCenterMenu('submenu5',6,247);

	// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~	
	}
}
else 
{	// EI~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
	createCenterMenu('submenu1',-442,247);
	createCenterMenu('submenu2',-359,247);
	createCenterMenu('submenu3',-295,247);
	createCenterMenu('submenu4',-477,247);
	createCenterMenu('submenu5',14,247);

	// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
}
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~


