// validates the register form
function validateRegisterForm(myform) 
{
	if (!isFilled(myform.firstname)) {	
		alert("Please enter your First Name and try again.");
		return false;
	} else if (!isFilled(myform.lastname)) {	
		alert("Please enter your Last Name and try again.");
		return false;						
	} else if (!isFilled(myform.email)) {	
		alert("Please enter your Email address and try again.");
		return false;						
	} else if (!isFilled(myform.city)) {	
		alert("Please enter your City and try again.");
		return false;		
	} else if (!isFilled(myform.state)) {	
		alert("Please choose your State and try again.");
		return false;				
	} else if (!isFilled(myform.zipcode) || !(myform.zipcode.value.length >= 5)) {	
		alert("Please enter a valid Zipcode and try again.");
		return false;						
	} else {
	    return true;
	}
}

function isFilled(elm) {
	if (elm.value == "" || elm.value == " " || elm.value == null) 
		return false;
	else 
		return true;
}

// Popout a new window with URL and size params
function launch(URL, width, height){
	var winLeft = (screen.width - width) / 2;
	var winUp = (screen.height - height) / 2;

	newWindow = window.open(URL,"newwindow","width="+width+",height="+height+",top="+winUp+",left="+winLeft+",scrollbars=yes,toolbar=no,menubar=no,status=no,resizable=yes");
	newWindow.focus();
}