// JavaScript Document

//DHTML navigation scripts

//Nav Imgs object
function nav_img (id, onPath, offPath, overPath){
	this.id = id;
	this.onPath = onPath;
	this.offPath = offPath;
	this.overPath = overPath;
}

//Nav Img Array
var navArray = new Array();

//add img objs to the nav array
navArray[0] = new nav_img("navimg_personal", "/images/nav_tab_personal_on.gif", "/images/nav_tab_personal_off.gif", "/images/nav_tab_personal_over.gif");
navArray[1] = new nav_img("navimg_business", "/images/nav_tab_business_on.gif", "/images/nav_tab_business_off.gif", "/images/nav_tab_business_over.gif");
navArray[2] = new nav_img("navimg_about", "/images/nav_tab_about_on.gif", "/images/nav_tab_about_off.gif", "/images/nav_tab_about_over.gif");
navArray[3] = new nav_img("navimg_contact", "/images/nav_tab_contact_on.gif", "/images/nav_tab_contact_off.gif", "/images/nav_tab_contact_over.gif");
navArray[4] = new nav_img("navimg_press", "/images/nav_tab_media_on.gif", "/images/nav_tab_media_off.gif", "/images/nav_tab_media_over.gif");
navArray[5] = new nav_img("navimg_globalweb", "/images/nav_tab_globalweb_on.gif", "/images/nav_tab_globalweb_off.gif", "/images/nav_tab_globalweb_over.gif");



function nav_rollover(imgObj, divObj, menuid){
	
	//alert("Rollover called ("+imgObj+", "+divObj+", "+menuid+")");
	
	// change graphic to over state
	for (i=0; i < navArray.length; i++){
			
			if (imgObj == navArray[i].id){
				//alert("imgs = "+navArray[i].overPath);
				document.images[imgObj].src = navArray[i].overPath;
			}
			
	}
	
	//get position of the nav item
	//posTop = getObjectTop(divObj);
	//posLeft = getObjectLeft(divObj);
	//get the height for displaying menu underneath nav item
	//navHeight = getObjectHeight(divObj);
	//navWidth = getObjectWidth(divObj);
	//alert("img position: top="+posTop+", left="+posLeft+" : Img height="+navHeight );
	//set the new top position of the popup menu.
	//newTop = posTop + navHeight
	//use the posLeft value on menu
	//set the new position of menu item with shiftTo API
	//shiftTo(menuid, posLeft, posTop);
	//show the menu in its new position
	//setZIndex(menuid, 100);
	//show(menuid);
}

function nav_rollout(imgObj, menuid){
	
	//rollout the image
	// change graphic to over state
	for (i=0; i < navArray.length; i++){
			
			if (imgObj == navArray[i].id){
				//alert("imgs = "+navArray[i].overPath);
				document.images[imgObj].src = navArray[i].offPath;
			}
			
	}
	//hide the menu
	//hide(menuid);
	//setZIndex(menuid, 0);
			
}


