
function PopUp(u, w, h, n, p) {
	if(!u) return;
	if(!h) h = 600;
	if(!w) w = 800;
		
	if(p == 1) {
		p = "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,width=" + w + ",height=" + h;
	} else if(!p) {
		p = "status=no,scrollbars=yes,resizable=yes,width=" + w + ",height=" + h;
	}
	if(!n) n = "popup";
	
	var popup = window.open(u,n,p);
	popup.focus();	
}

function GoToURL(u) {
	window.location = u;
}

function HelpPop(id) {
	PopUp('/commonAdmin/HelpPop.asp?infoID=' + id, 300, 500, 'help');
}

/* LOGIN MENUS AT TOP */
var inactivecolor = "#441B52";
var inactivetext = "#FFF";
var activecolor = "#00006C";
var activetext = "#FFF";
var loginClicked = false;
function loginOver() {
	document.getElementById("username").style.backgroundColor = activecolor;
	document.getElementById("username").style.color = activetext;
	document.getElementById("password").style.backgroundColor = activecolor;
	document.getElementById("password").style.color = activetext;
}
function loginOut() {
	if(!document.login.username.value && !document.login.password.value && !loginClicked) {
		document.getElementById("username").style.backgroundColor = inactivecolor;
		document.getElementById("username").style.color = inactivetext;
		document.getElementById("password").style.backgroundColor = inactivecolor;
		document.getElementById("password").style.color = inactivetext;
	}
}
function loginClick() {
	loginClicked = true;
	searchClicked = false;
	searchOut();
}

var searchClicked = false;
function searchOver() {
	document.getElementById("searchstr").style.backgroundColor = activecolor;
	document.getElementById("searchstr").style.color = activetext;
}

function searchOut() {
	if(!document.searchform.searchstr.value && !searchClicked) {
		document.getElementById("searchstr").style.backgroundColor = inactivecolor;
		document.getElementById("searchstr").style.color = inactivetext;
	}
}
function searchClick() {
	loginClicked = false;
	searchClicked = true;
	loginOut();
}

function do_onload() {
	
	document.getElementById("username").onmouseover = loginOver;
	document.getElementById("password").onmouseover = loginOver;	
	document.getElementById("username").onmouseout = loginOut;
	document.getElementById("password").onmouseout = loginOut;
	document.getElementById("username").onclick = loginClick;
	document.getElementById("password").onclick = loginClick;
	
	document.getElementById("searchstr").onmouseover = searchOver;	
	document.getElementById("searchstr").onmouseout = searchOut;
	document.getElementById("searchstr").onclick = searchClick;
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

/* END LOGIN MENUS */