// JavaScript Document
function isEmptyField(inputValue) {
	
	var aCharExists = false;
	
	for (var i=0; i <= inputValue.length; i++)
		{
		     if (inputValue.charAt(i) != " " && inputValue.charAt(i) != "")
			 {
				aCharExists = true;
			        break;
			 }
		}

    return aCharExists
}

function checkform() {

  if (!isEmptyField(document.main.REGNAME.value) || document.main.REGNAME.value =="Name") {
   	alert("Please fill in your Name.");
   	document.main.REGNAME.focus();
   	return false;
  }
  if (!isEmptyField(document.main.REGSTREET.value) || document.main.REGSTREET.value == "Street") {
    alert("Please fill in your Address.");
    document.main.REGSTREET.focus();
    return false;
  }
  if (!isEmptyField(document.main.REGCITY.value) || document.main.REGCITY.value == "City") {
  	alert("Please fill in your City.");
   	document.main.REGCITY.focus();
   	return false;
  }
  if (!isEmptyField(document.main.REGSTATE.value) || document.main.REGSTATE.value == "State") {
   	alert("Please fill in your State.");
   	document.main.REGSTATE.focus();
   	return false;
  }
  if (!isEmptyField(document.main.REGZIPCODE.value) || document.main.REGZIPCODE.value == "Zip Code") {
  	alert("Please fill in your Zip Code.");
  	document.main.REGZIPCODE.focus();
  	return false;
  }
  
  if (!isEmptyField(document.main.REGEMAIL.value) || document.main.REGEMAIL.value == "Email Address") {
  	alert("Please provide your email address.");
   	document.main.REGEMAIL.focus();
   	return false;
  }
      

  document.main.submit();

}

function popupRegisteration(N) {
		newWindow = window.open(N, 'popD','toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=no,location=no,width=800,height=600');
}

function closePopUp(){
	self.close();
}

