//
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function sendrequest()
{
  var new_window;
  new_window = window.open('forgotpwd.html','waitWindow','toolbar=no,location=0,directories=no,status=no,menubar=0,scrollbars=yes,resizable=yes,copyhistory=0,width=425,height=420,left=133,top=317');
}

function CheckCompany(){	

		 var varname,AlphaName

		 varname = document.form1.agency_name.value		

		 AlphaName = ""								  							  

		 for (k = 0; k < varname.length; k++) {

			 ch = varname.substring(k, k+1);				

			 if ((ch >= "0" && ch <= "9" ) ||(ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z" ) || (ch = " ") ) {
			   AlphaName+= ch;

			}

		}								  	


		 if (varname == ""){

		      alert("Company Name is Required" )

		      return;

		}else if (AlphaName != varname){

		      alert(" Company is an ALPHANUMERIC field only. Special Characters like QUOTES,COMMA,APOSTROPHEE etc. are NOT ALLOWED" )

		      return;									

		}					

	}

	

function validate_form() {

		 x=0;
		 var agency_user;

		 if (document.form1.agency_user1.value == "" ||
                     document.form1.agency_user2.value == "" ||
                     document.form1.agency_user3.value == "") {

			 alert("You must enter a complete user name.")

			 return false;

		    }

		 if( (document.form1.agency_user1.value.search(/\\S\\s/) != -1) || (document.form1.agency_user1.value.search(/\\s\\S/) != -1) ||
                     (document.form1.agency_user2.value.search(/\\S\\s/) != -1) || (document.form1.agency_user2.value.search(/\\s\\S/) != -1) ||
                     (document.form1.agency_user3.value.search(/\\S\\s/) != -1) || (document.form1.agency_user3.value.search(/\\s\\S/) != -1)) {

			 alert("Please no whitespace in login name.")

			 return false;

		}

                agency_user=document.form1.agency_user1.value+
                             document.form1.agency_user2.value+
                              document.form1.agency_user3.value;

                 if(agency_user.length < 10) {

                         alert("User name must be 10 digits long.")

                         return false;

                }

		// TempLogin = document.form1.agency_user.value
		TempLogin = document.form1.agency_user1.value + document.form1.agency_user2.value + document.form1.agency_user3.value;

		 index = TempLogin.indexOf("'")

		 if  (index != -1 ) {

			 alert("Please no punctuation marks in Login Name.")

			 return false;

		}

                index = TempLogin.indexOf("\#")

                 if  (index != -1 ) {

                         alert("Please no square (\#) in Login Name.")

                         return false;

                }

                 if  (! Number(TempLogin) ) {

                         alert("Agency user must be numeric only.")

                         return false;

                }


		 if (document.form1.agency_pwd.value == "") {

			 alert("You must enter a password.")
                         document.form1.agency_pwd.focus();

			 return false;

		}

		

		 TempPassword = document.form1.agency_pwd.value

		 index = TempPassword.indexOf("'")

		 if  (index != -1 ) {

			 alert("Please no punctuation marks in Password.")
                         document.form1.agency_pwd.focus();

			 return false;

		}

                index = TempPassword.indexOf("\#")

                 if  (index != -1 ) {

                         alert("Please no square (\#) in Password.")
                         document.form1.agency_pwd.focus();

                         return false;

                }

		 if( (document.form1.agency_pwd.value.search(/\\S\\s/) != -1) || (document.form1.agency_pwd.value.search(/\\s\\S/) != -1) ) {

			 alert("Please no whitespace in password.")
                         document.form1.agency_pwd.focus();

			 return false;

		}

		 if ( document.form1.agency_pwd.value != document.form1.agency_pwd1.value) {

			 alert("You must enter the same password twice.")
                         document.form1.agency_pwd1.focus();

			 return false;

		}

		

		 if ( document.form1.agency_pwd.length <5 ) {


			 alert("Password must be at least 5 letters.")
                         document.form1.agency_pwd.focus();

			 return false;

		}

		 if (document.form1.firstname.value == "") {

			 alert("You must enter the First Name.")
                         document.form1.firstname.focus();

			 return false;

		}

		 if (document.form1.lastname.value == "") {

			 alert("You must enter the Last Name.")
                         document.form1.lastname.focus();

			 return false;

		}

		 if (document.form1.agency_name.value == "") {

			 alert("You must enter the travel agency name.")
                         document.form1.agency_name.focus();

			 return false;

		}

		 if (document.form1.agency_address.value == "") {

			 alert("You must enter the Street Address.")
                         document.form1.agency_address.focus();

			 return false;

		}

		 if (document.form1.agency_city.value == "") {

			 alert("You must enter the city.")
                         document.form1.agency_city.focus();

			 return false;

		}

																		

		 if (document.form1.agency_zip_code.value == "") {

			 alert("You must enter the zip.")
                         document.form1.agency_zip_code.focus();

			 return false;

		}										

		 if (document.form1.agency_country.selectedIndex < 1) {

			 alert("You must select a country.")
                         document.form1.agency_country.focus();

			 return false;

		}
		 if (document.form1.agency_fax.value == "") {

			 alert("You must enter the fax number.")
                         document.form1.agency_fax.focus();

			 return false;

		}

                 var TempFax = document.form1.agency_fax.value;

                 if  (! Number(TempFax) ) {

                         alert("Fax number must be numeric only.")
                         document.form1.agency_fax.focus();

                         return false;

                }

		 if (document.form1.agency_admin_contact.value == "") {

			 alert("You must enter the administrator name.")
                         document.form1.agency_admin_contact.focus();

			 return false;

		}

		 if (document.form1.agency_admin_email.value == "") {

			 alert("You must enter the administrator email.")
                         document.form1.agency_admin_email.focus();

			 return false;

		}													


                if(document.form1.agency_admin_email.value.length>0&&(document.form1.agency_admin_email.value.indexOf("@",0)==-1||document.form1.agency_admin_email.value.indexOf(".",0)==-1))
                {
                                alert("Please enter a valid E-mail address");
                                document.form1.agency_admin_email.focus();
                         	return false;
		}


		 if ( (document.form1.agency_pcc.value == "" && document.form1.agency_gds_info.selectedIndex == 1) ) {

			 alert("As a Galileo customer, you must provide a PCC")

			 return false;

		}

                 if (document.form1.agency_ask1.value == "") {

                         alert("Please tell us how you did hear about this Web site")

                         return false;

                }

		 document.form1.submit();

	}


//
