// JavaScript Document

function onRollOver(obj_img){
	obj_img.src = obj_img.src.split("-off").join("-on");
}

function onRollOut(obj_img){
	obj_img.src = obj_img.src.split("-on").join("-off");
}

//check for brwoser width and update menu
var int_global_width = 0;
//alert(int_global_width);
function checkBrowserWidth() {
	//
	//optimize by only running if the width has not been set of is wider than the minimim width
	if ((int_global_width == 0) || (int_global_width > 980)) {
		//alert("2");
	
		var bln_nav_loaded = false;
		var bln_content_loaded = false;
		
		if (document.getElementById("nav")) {
			bln_nav_loaded = true;
			var int_nav_width =  document.getElementById("nav").offsetWidth;
		}
		
		if (document.getElementById("content")) {
			bln_content_loaded = true;
			var int_content_width = document.getElementById("content").offsetWidth;
		}
		
		if ((bln_nav_loaded) && (bln_content_loaded)) {
			
			var int_total_container_width = Number(int_nav_width) + Number(int_content_width);
			
			//only set the width if the div is greater than the 980 limit
			if (int_total_container_width > 980) {
				if (int_global_width != int_total_container_width) {
					int_global_width = int_total_container_width;
					//alert(int_global_width);
				
					if (document.getElementById("menuWidthWrapper")) {
						document.getElementById("menuWidthWrapper").style.width = int_global_width;
					}
	
				}
			}
		}
	}
}

function updateMenuWidth() {
	setInterval("checkBrowserWidth()", 1000);	
}
