/************************************************************************
	Javascript RARSFest Ticket Database Functions
	by K4HM - Hank Montgomery       k4hm@arrl.net
************************************************************************/


	

/   <!-- Original:  Eric King (eric_andrew_king@hotmail.com) -->       /
/    <!-- Web Site:  http:\\redrival.com\eak -->                       /
/    <!-- This script and many more are available free online at -->   /
/    <!-- The JavaScript Source!! http:\\javascript.internet.com -->   /

      function NewWindow(mypage, myname, w, h, scroll) {
        var winl = (screen.width - w) / 2;
        var wint = (screen.height - h) / 2;
        winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
        win = window.open(mypage, myname, winprops)
        if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
      }


function xnewwindow() 
{ 
window.open('help.html','jav','width=300,height=200,resizable=yes'); 
} 



/********************************************************
** vallogin()  Verifies user provided userid and password                                                                        
********************************************************/
function vallogin(s)
	{
  	/* alert("Checking for blank Passwword or UseerID"); */
		var txtPass = s.tryPassword.value;
		var txtUser = s.tryUserid.value;
		if (txtPass == '' || txtUser == '') {
 	  	alert("A blank Userid or Password is not allowed.");
 	  	s.screen.value = "";
		  s.tryUserid.focus();
			return false;
		} else {
			return true;
		}
	}


/********************************************************
** valGetPwd()  Verifies user gave userid to get password                                                                        
********************************************************/
    function valGetPwd(s)
    {
			var txtUser = s.tryUserid.value;
			if (txtUser.length == 0)
			  {
				alert("Please enter your Userid");
				s.tryUserid.focus();
				return false;
			  }
      s.screen.value = "GetPwd";
      return true;
    }  	
	
/**********************************************************
** valSearch()  Verifies user provided some search criteria                                                                        
**********************************************************/
function valSearch(s) {
	var txtCall = s.txtCallsign.value;
	if (txtCall.length == 0) {
		var txtName = s.txtName.value;
		if (txtName.length == 0) {
			alert("You must enter something in the callsign or name field.");
			s.txt.CallSign.focus();
			return false;
			}
		}
	return true;
	}
		


/**********************************************************
** valForm()  Verifies user filled all required fields                                                                        
**********************************************************/
function valForm(s)
	{
//		var txtCall = s.txtCallSign.value;
//		if (txtCall.length == 0) {
//			alert("Please enter a CallSign");
//			s.txtCallSign.focus();
//			return false;
//		}

//				s.txtCall.value = txtCallSign.toUpperCase(); //  Convert Callsign to upper case

		var txt_Name = s.txtName.value;
		if (txt_Name.length == 0) {
			alert("Please enter a name");
			s.txtName.focus();
			return false;
		}

		var txtAddr1 = s.txtAddr1.value;
		if (txtAddr1.length == 0) {
			alert("Please enter an address");
			s.txtAddr1.focus();
			return false;
		}
		var txtCity = s.txtCity.value;
		if (txtCity.length == 0) {
			alert("Please enter a city");
			s.txtCity.focus();
			return false;
		}
		var txtState = s.txtState.value;
		if (txtState.length != 2) {
			alert("Please enter a valid 2-character state code");
			s.txtState.focus();
			return false;
		}
		s.txtState.value = txtState.toUpperCase(); //  Convert State to upper case

		var txtZip = s.txtZip.value;
		if (txtZip.length != 5 && txtZip.length != 10) {
			alert("Please enter a 5-digit or 10-digit zip code");
			s.txtZip.focus();
			return false;
		}
		return true;
	}


/**********************************************************
** valForm()  Verifies user filled all required fields                                                                        
**********************************************************/
function valProfForm(s)
	{
		alert("This is the profile validation function");
		return false;
)
//
//
//		var txtCall = s.txtCallSign.value;
//		if (txtCall.length == 0) {
//			alert("Please enter a CallSign");
//			s.txtCallSign.focus();
//			return false;
//		}

//				s.txtCall.value = txtCallSign.toUpperCase(); //  Convert Callsign to upper case
function dummy(s)
		var txt_Name = s.txtName.value;
		if (txt_Name.length == 0) {
			alert("Please enter a name");
			s.txtName.focus();
			return false;
		}

		var txtAddr1 = s.txtAddr1.value;
		if (txtAddr1.length == 0) {
			alert("Please enter an address");
			s.txtAddr1.focus();
			return false;
		}
		var txtCity = s.txtCity.value;
		if (txtCity.length == 0) {
			alert("Please enter a city");
			s.txtCity.focus();
			return false;
		}
		var txtState = s.txtState.value;
		if (txtState.length != 2) {
			alert("Please enter a valid 2-character state code");
			s.txtState.focus();
			return false;
		}
		s.txtState.value = txtState.toUpperCase(); //  Convert State to upper case

		var txtZip = s.txtZip.value;
		if (txtZip.length != 5 && txtZip.length != 10) {
			alert("Please enter a 5-digit or 10-digit zip code");
			s.txtZip.focus();
			return false;
		}
		return true;
	}
