function jumpTo(URL_List){
   var URL = URL_List.options[URL_List.selectedIndex].value;
   window.location.href = URL;
}

function validateForgotPass(f) {
	haveerrors = 0;
	emailaddress = document.forgotpass.emailaddress.value;
	if (emailaddress.search("@") == -1 || emailaddress.search("[.*]") == -1){
		document.getElementById("emailaddressError").style.display = "inline";
		document.forgotpass.emailaddress.select();
		document.forgotpass.emailaddress.focus();
	  	haveerrors = 1;
	}
	if (haveerrors == 0)
		document.forgotpass.submit(f);
	else
		return false;
}

function validateLogin(f) {
	haveerrors = 0;
	username = document.loginform.username.value;
	password = document.loginform.password.value;
	if (username.search("@") == -1 || username.search("[.*]") == -1){
		document.getElementById("usernameError").style.display = "inline";
		document.loginform.username.select();
		document.loginform.username.focus();
	  	haveerrors = 1;
	}
	if (password == "") {
		document.getElementById("passwordError").style.display = "inline";
		document.loginform.password.select();
		document.loginform.password.focus();
	  	haveerrors = 1;
	  } 
	if (haveerrors == 1) {
	 	return false;
	 }
	 else {
		document.getElementById("usernameError").style.display = "none"
		document.getElementById("passwordError").style.display = "none"
	  	document.loginform.submit(f);
	  	}
}

function validateSignUp(f) {
	firstname = document.signup.firstname.value;
	lastname = document.signup.lastname.value;
	emailaddress = document.signup.emailaddress.value;
	password = document.signup.password.value;
	passwordConfirm = document.signup.passwordConfirm.value;
	haveerrors = 0;
	if (firstname == "") {
		document.getElementById("firstnameError").style.display = "inline";
		document.signup.firstname.select();
		document.signup.firstname.focus();
		haveerrors = 1;
	  } 
	if (lastname == "") {
		document.getElementById("lastnameError").style.display = "inline";
		document.signup.lastname.select();
		document.signup.lastname.focus();
	  	haveerrors = 1;
	  } 
	if (emailaddress.search("@") == -1 || emailaddress.search("[.*]") == -1)        {
		document.getElementById("emailaddressError").style.display = "inline";
		document.signup.emailaddress.select();
		document.signup.emailaddress.focus();
	  	haveerrors = 1;
	  } 
	if (password.length < 5) {
		document.getElementById("passwordError").style.display = "inline";
		document.signup.password.select();
		document.signup.password.focus();
		haveerrors = 1;
	  }
	  
	if (password != passwordConfirm) {
		alert ("\nYou did not enter the same password twice. Please re-enter your password.")
		haveerrors = 1;
	  }

	  
	 if (haveerrors == 1) {
	 	return false;
	 }
	 else {
		document.getElementById("firstnameError").style.display = "none"
		document.getElementById("lastnameError").style.display = "none"
		document.getElementById("emailaddressError").style.display = "none"
		document.getElementById("passwordError").style.display = "none"
	  	document.signup.submit(f);
	  	}
}

function openfriend(url)
{
	window.open(url,"mywindow","menubar=1,resizable=1,width=650,height=500");
}

function opencustompage(url)
{
	window.open(url,"mywindow","menubar=1,resizable=1,width=750,height=500");
}
