window.onresize= hideLoginBox;

function hideLoginBox() {
   var obj = document.getElementById('login-container');
	//obj.style.visibility = "hidden";
}

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
	
	var pos = document.getElementById("container");
	var loginBox = document.getElementById("login-container"); 
	var xpos = pos.offsetLeft;
	//alert(xpos);

    if(document.layers)	   //NN4+
    {
      // document.layers[szDivID].visibility = iState ? "show" : "hide";
	  alert("Your browser is not supported. Please upgrade your browser.");
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
     
		if (obj.style.visibility=="visible") 
			{
				obj.style.visibility = "hidden";
			}
		else 
			{
				obj.style.visibility = "visible";
				loginBox.style.left = xpos + 572 + "px";
			}
    }
	
    else if(document.all)	// IE 4
    {
        //document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
		alert("Your browser is not supported. Please upgrade your browser.");
    }
}

function clearInput(obj, theText)
{
	if (obj.value == "") 
		{
			obj.value = theText;
		}
	else
		{
			obj.value = "";
		}
}

//javascript login info validation

function isEmail(strValue) {
var objRegExp  = /(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{2})$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{2})(\.[a-z]{2})*$)/i;

 return objRegExp.test(strValue);
}

function validate(emailStr, passStr){
	
	var errorString="";
	
    if(emailStr == "" || !isEmail(emailStr))
		{
			errorString ="Please enter a valid email address.\n";
		}
		
	if(passStr.length < 2)
		{
			errorString +="Please enter a password.\n";
		}
	
	if (errorString != "")
		{
			var errorHeader="Please enter the following information:\n";
			errorHeader +="=======================\n";
			alert(errorHeader + errorString);
			return false;
		}
	else
		{
			return true;
		}

}


//list menu selected index change navigation script
function jumpMenu(targ,selObj,restore){ //v3.0
	//uncomment out the alert function below when moving this script into production
  //alert("When a user selects an item it should redirect them to the selected items HTML page: " + selObj.options[selObj.selectedIndex].value);
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//e-mail address verification
function check(form) {
pw1 = form.Email.value;
pw2 = form.Email2.value;

if (pw1 != pw2) {
alert ("Your e-mail address does not match the confirmation address.\n\nPlease make sure you've entered this information correctly, and that both fields match")
return false;
}
else return true;
}
