function resetColor () {
	
	var coll = document.all.item("maingraphic");
	for (i=0;i<coll.length;i++) {
		var graphic = "Images/"+coll(i).getAttribute("offgraphic")
   		coll(i).src=graphic;
   	}
   	var menucoll = document.all.item("submenu");
   	for (i=0;i<menucoll.length;i++) {
   		menucoll(i).style.display = "none";
   	}
}

function dropdown (MenuItem) {
	resetColor()
	if (MenuItem != 0) {
		var menu = document.all.item("submenu",MenuItem);
		if (window.screen.width <= "800") {
			menu.style.posTop = document.all.item("menuentry",MenuItem).offsetTop+28;
			menu.style.posLeft = document.all.item("menuentry",MenuItem).offsetLeft+3;
		}
		else {
			menu.style.posTop = document.all.item("menuentry",MenuItem).offsetTop+35;
			menu.style.posLeft = document.all.item("menuentry",MenuItem).offsetLeft+3;
		}
		menu.style.backgroundColor = "black";
		//menu.style.border = "solid thin red";
		//menu.style.width = "150%";
		menu.style.display = "block";
		menu.setAttribute("state","1");
	}
	var graphic = "Images/"+document.all.item("maingraphic",MenuItem).getAttribute("overgraphic");
	event.srcElement.src = graphic;

}

function linkto (linkdoc, MenuItem) {
	var parentwin = parent
	if (parentwin.name == "main") {
		parentwin = parentwin.parent
	}
	parentwin.frames("main").document.location = linkdoc;
//	var currentmenu = "";
// 	var menucoll = document.all.item("currentmenu");
// 	for (i=0;i<menucoll.length;i++) {
// 		menucoll(i).style.display = "none";
// 	}
//	document.all.item("currentmenu",MenuItem).style.display = "block";
	if (MenuItem == "21") {
		if (window.screen.width <= "800") {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannerda800";
		}
		else {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannerda";
		}
	}
	else if (MenuItem == "22") {
		if (window.screen.width <= "800") {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannertv800";
		}
		else {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannertv";
		}
	}
	else if (MenuItem == "4") {
		if (window.screen.width <= "800") {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannergsa800";
		}
		else {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannergsa";
		}
	}
	else if (MenuItem == "17") {
		if (window.screen.width <= "800") {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannerseaport800";
		}
		else {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannerseaport";
		}
	}
	else if (MenuItem == "1") {
		if (window.screen.width <= "800") {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannertl800";
		}
		else {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannertl";
		}
	}
	else if (MenuItem == "11" || MenuItem == "12" || MenuItem == "13" || MenuItem == "14" || MenuItem == "15" || MenuItem == "16") {
		if (window.screen.width <= "800") {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannertl800";
		}
		else {
			parentwin.frames("banner").document.all.item("banner","0").className = "bannertl";
		}
	}
	else if (MenuItem == "99") {
		if (window.screen.width <= "800") {
			parentwin.frames("banner").document.all.item("banner","0").className = "banner800";
			if (parentwin.frames("main").document.readyState == "complete") {
				parentwin.frames("main").document.all.item("homemain","0").className = "homemain800";
			}
		}
		else {
			parentwin.frames("banner").document.all.item("banner","0").className = "banner";
		}
	}
	else {
		if (window.screen.width <= "800") {
			parentwin.frames("banner").document.all.item("banner","0").className = "banner800";
		}
		else {
			parentwin.frames("banner").document.all.item("banner","0").className = "banner";
		}
	}
	if (parentwin.frames("main").document.readyState == "complete") {
		var frmst = parentwin.document.all.item("mainwindow","0")
		if (window.screen.width <= "800") {
			frmst.rows = "120, *"
		}
	}
	
	var menucoll = parentwin.frames("banner").document.all.item("submenu");
   	for (i=0;i<menucoll.length;i++) {
   		menucoll(i).style.display = "none";
   	}
}

function resetlocalbanner(MenuItem) {
	var parentwin = parent
	if (MenuItem == "11") {
		if (window.screen.width <= "800") {
			var frmst = parentwin.document.all.item("main","0")
			frmst.rows = "137, *"
			parentwin.frames("gebanner").document.location = "../Images/GECustomerBanner800.jpg";
		}
		else {
			parentwin.frames("gebanner").document.location = "../Images/GECustomerBanner.jpg";
		}
	}
	if (MenuItem == "12") {
		if (window.screen.width <= "800") {
			var frmst = parentwin.document.all.item("main","0")
			frmst.rows = "137, *"
			parentwin.frames("e6banner").document.location = "../Images/E6BCustomerBanner800.jpg";
		}
		else {
			parentwin.frames("e6banner").document.location = "../Images/E6BCustomerBanner.jpg";
		}
	}
	if (MenuItem == "13") {
		if (window.screen.width <= "800") {
			var frmst = parentwin.document.all.item("main","0")
			frmst.rows = "183, *"
			parentwin.frames("f14banner").document.location = "../Images/F14CustomerBanner800.jpg";
		}
		else {
			parentwin.frames("f14banner").document.location = "../Images/F14CustomerBanner.jpg";
		}
	}
	if (MenuItem == "14") {
		if (window.screen.width <= "800") {
			var frmst = parentwin.document.all.item("main","0")
			frmst.rows = "137, *"
			parentwin.frames("nlmbanner").document.location = "../Images/NLMCustomerBanner800.jpg";
		}
		else {
			parentwin.frames("nlmbanner").document.location = "../Images/NLMCustomerBanner.jpg";
		}
	}
	if (MenuItem == "15") {
		if (window.screen.width <= "800") {
			var frmst = parentwin.document.all.item("main","0")
			frmst.rows = "137, *"
			parentwin.frames("delphibanner").document.location = "../Images/DelphiCustomerBanner800.jpg";
		}
		else {
			parentwin.frames("delphibanner").document.location = "../Images/DelphiCustomerBanner.jpg";
		}
	}
	if (MenuItem == "16") {
		if (window.screen.width <= "800") {
			var frmst = parentwin.document.all.item("main","0")
			frmst.rows = "137, *"
			parentwin.frames("usafbanner").document.location = "../Images/USAFCustomerBanner800.jpg";
		}
		else {
			parentwin.frames("usafbanner").document.location = "../Images/USAFCustomerBanner.jpg";
		}
	}
}

function resetbanner(MenuItem) {
	var parentwin = parent
	if (parentwin.name == "main") {
		if (MenuItem == "11" || MenuItem == "12" || MenuItem == "13" || MenuItem == "14" || MenuItem == "15" || MenuItem == "16") {
			resetlocalbanner(MenuItem)
		}
		parentwin = parentwin.parent
	}
	if (parentwin.frames("banner").document.readyState == "complete") {
		var frmst = parentwin.document.all.item("mainwindow","0")
		if (window.screen.width <= "800") {
			frmst.rows = "120, *"
		}
		if (MenuItem == "21") {
			if (window.screen.width <= "800") {
				parentwin.frames("banner").document.all.item("banner","0").className = "bannerda800";
			}
			else {
				parentwin.frames("banner").document.all.item("banner","0").className = "bannerda";
			}
		}
		else if (MenuItem == "22") {
			if (window.screen.width <= "800") {
				parentwin.frames("banner").document.all.item("banner","0").className = "bannertv800";
			}
			else {
				parentwin.frames("banner").document.all.item("banner","0").className = "bannertv";
			}
		}
		else if (MenuItem == "4") {
			if (window.screen.width <= "800") {
				parentwin.frames("banner").document.all.item("banner","0").className = "bannergsa800";
			}
			else {
				parentwin.frames("banner").document.all.item("banner","0").className = "bannergsa";
			}
		}
		else if (MenuItem == "1") {
			if (window.screen.width <= "800") {
				parentwin.frames("banner").document.all.item("banner","0").className = "bannertl800";
			}
			else {
				parentwin.frames("banner").document.all.item("banner","0").className = "bannertl";
			}
		}
		else if (MenuItem == "11" || MenuItem == "12" || MenuItem == "13" || MenuItem == "14" || MenuItem == "15" || MenuItem == "16") {
			if (window.screen.width <= "800") {
				parentwin.frames("banner").document.all.item("banner","0").className = "bannertl800";
			}
			else {
				parentwin.frames("banner").document.all.item("banner","0").className = "bannertl";
			}
		}
		else if (MenuItem == "99") {
			if (window.screen.width <= "800") {
				parentwin.frames("banner").document.all.item("banner","0").className = "banner800";
				parentwin.frames("main").document.all.item("homemain","0").className = "homemain800";
			}
			else {
				parentwin.frames("banner").document.all.item("banner","0").className = "banner";
			}
		}
		else {
			if (window.screen.width <= "800") {
				parentwin.frames("banner").document.all.item("banner","0").className = "banner800";
			}
			else {
				parentwin.frames("banner").document.all.item("banner","0").className = "banner";
			}
		}
	}
}

function screensize() {
	if (window.screen.width <= "800")
		changegraphics();
}

function changegraphics() {
	if (document.readyState == "complete") {
	
		document.all.item("tlgraphic").style.width="1in";
	   	var graphiccoll = document.all.item("maingraphic");
	   	for (i=0;i<graphiccoll.length;i++) {
	   		//graphiccoll(i).style.width = ".5in";
	   	}
		var coll = document.all.tags("TD");
		for (i=0;i<coll.length;i++) {
			coll(i).className = "submenu800";
		}
		var coll = document.all.tags("TABLE");
		for (i=0;i<coll.length;i++) {
			if (coll(i).className = "submenu")
				coll(i).className = "submenu800";
		}
		var coll = document.all.item("currentmenu");
		if (coll) {
			for (i=0;i<coll.length;i++) {
				coll(i).className = "currentmenu800";
			}
		}
		document.all.item("banner","0").className = "banner800";
		var frmst = parent.document.all.item("mainwindow","0");
		frmst.rows = "120, *";
		parent.frames("main").document.all.item("homemain","0").className = "homemain800";			
	}
}

var oPopup = window.createPopup();

function tip (tiptext) {
    var oPopBody = oPopup.document.body;
    oPopBody.style.backgroundColor = "lightyellow";
    oPopBody.style.border = "solid black 1px";
    oPopBody.style.padding = "3pt";
    oPopBody.innerHTML = "";
    // The following HTML that populates the popup object with a string.
    oPopBody.innerHTML += tiptext;
    oPopBody.innerHTML = "<DIV>"+oPopBody.innerHTML+"</DIV>";

    oPopup.show(0, 0, 0, 0);
    var realHeight = oPopBody.scrollHeight;
    var realWidth = oPopBody.scrollWidth;
    // Hides the dimension detector popup object.
    oPopup.hide();
    // Shows the actual popup object with correct height.
    oPopup.show(15, 10, realWidth, realHeight, event.srcElement);
}

function tiphide () {
	oPopup.hide();
}
