pageLoaded = 0;				// Prevent access to layers until they're loaded

// Set the pageLoaded variable to denote that the layers are ready to be used 
function doLoadProc() {
	pageLoaded = 1;
}

// swapImg - swaps an image for another that has already been preloaded.
function swapImg(imgName, preloadedImgName) {
	document[imgName].src = eval(preloadedImgName).src;
}

function preload(imgSrc) {
	img = new Image();
	img.src = imgSrc;
	return img;
}

function dropdownGo(selBox) {
	if (selBox.options[selBox.selectedIndex].value != "") {
		var loc = "";
		if (selBox.options[selBox.selectedIndex].href) {
			loc = selBox.options[selBox.selectedIndex].href;
		} else {
			loc = selBox.options[selBox.selectedIndex].attributes.href.nodeValue;
		}
		if (loc != "") {
			document.location = loc;
		} else {
			document.location = selBox.options[selBox.selectedIndex].value;
		}
	}
}

function logonCheck(form) {
        httpsRegEx = /https/
        document.loginForm.action = document.loginForm.action.replace(httpsRegEx, "http");
    if (form.USERID == null || !form.USERID.value.length)
    {
        alert('Logon ID is required');
        form.USERID.focus();
                return false;
    }
    if (form.PASSWORD == null || !form.PASSWORD.value.length)
    {
        alert('Password is required');
        form.PASSWORD.focus();
                return false;
    }
    return true;
}

function secureLogon() {
        httpRegEx = /http/
        if (logonCheck(document.loginForm)) {
                document.loginForm.action = document.loginForm.action.replace(httpRegEx, "https");
                document.loginForm.submit();
        }
}
