// DETECT BROWSER + VERSION
ie = false;
netscape = false;
if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Microsoft Internet Explorer") 
	   ie = true;
	if (navigator.appName == "Netscape") {
	   netscape = true;
	   alert ("This site was designed for IE4+ - some content may not display correctly!");
	}
} else { alert ("This site was designed for version 4 & newer browsers- some content may not display correctly!") }

// MENU BUTTONS
btn_home = new Image();
btn_home.src = "images/btn_home.gif";
btn_home_O = new Image();
btn_home_O.src = "images/btn_home_O.gif";

btn_profile = new Image();
btn_profile.src = "images/btn_profile.gif";
btn_profile_O = new Image();
btn_profile_O.src = "images/btn_profile_O.gif";

btn_services = new Image();
btn_services.src = "images/btn_services.gif";
btn_services_O = new Image();
btn_services_O.src = "images/btn_services_O.gif";

btn_why = new Image();
btn_why.src = "images/btn_why.gif";
btn_why_O = new Image();
btn_why_O.src = "images/btn_why_O.gif";
		
btn_contact = new Image();
btn_contact.src = "images/btn_contact.gif";	
btn_contact_O = new Image();
btn_contact_O.src = "images/btn_contact_O.gif";	

// WHY MENU
why_1 = new Image();
why_1.src = "images/why_1.gif"
why_1_O = new Image();
why_1_O.src = "images/why_1_O.gif"

why_2 = new Image();
why_2.src = "images/why_2.gif"
why_2_O = new Image();
why_2_O.src = "images/why_2_O.gif"

why_3 = new Image();
why_3.src = "images/why_3.gif"
why_3_O = new Image();
why_3_O.src = "images/why_3_O.gif"

why_4 = new Image();
why_4.src = "images/why_4.gif"
why_4_O = new Image();
why_4_O.src = "images/why_4_O.gif"

why_5 = new Image();
why_5.src = "images/why_5.gif"
why_5_O = new Image();
why_5_O.src = "images/why_5_O.gif"

ie=document.all?1:0
n=document.layers?1:0

//Hide all other submenus when another clicked
var hideAll=true

// Object constructor
function makeMenuBar(obj,nest,vis){
    nest=(!nest) ? '':'document.'+nest+'.'
    this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')
	this.hideIt=b_hideIt;	this.showIt=b_showIt; this.vis=b_vis						
	if(ie && vis) this.css.visibility='hidden'
	this.state=1
	this.go=0
	this.height=n?this.css.document.height:eval(obj+'.offsetHeight')
	this.top=b_gettop
    this.obj = obj + "Object"; 	eval(this.obj + "=this")	
}
//Get's the top position.
function b_gettop(){
	var gleft=(n) ? eval(this.css.top):eval(this.css.pixelTop);
	return gleft;
}
//The functions for showing and hiding
function b_showIt(){
	this.css.visibility="visible"
}
function b_hideIt(){
	this.css.visibility="hidden"
}
function b_vis(){
	if(this.css.visibility=="hidden" || this.css.visibility=="hide") return true;
}

// Inits the page, makes the menu object, moves it to the right place, show it.
function menuBarInit(){
	oSub=new Array()
	//Change it here if you want more or less submenus.
	oSub[0]=new makeMenuBar('divSub0','menu',1)
	oSub[1]=new makeMenuBar('divSub1','menu',1)
	oSub[2]=new makeMenuBar('divSub2','menu',1)
	oSub[3]=new makeMenuBar('divSub3','menu',1)
	oSub[4]=new makeMenuBar('divSub4','menu',1)
}

// Shows and hides the submenus
function extract(num){
	if(hideAll){
		for(i=0;i<oSub.length;i++){
			if(num!=i) oSub[i].hideIt()
		}
	}
	!oSub[num].vis()?oSub[num].hideIt():oSub[num].showIt();
}

onload=menuBarInit;

function rollOver(img, file) {
	document.images[img].src = file;
}