// JavaScript Document
function Validate_Login(theForm) {
	// This function validates that the Polaris dealer number entered is of the right format.
	
	var testString;
	
	if (theForm.txtDealerNum.value == "") {
		alert("You must enter your 5-digit Polaris dealer number to continue.");
		theForm.txtDealerNum.focus();
		return (false);
	}
	
	testString = new String(theForm.txtDealerNum.value);
	
	if (testString.length != 5) {
		alert("The Polaris dealer number must be 5 digits in length.");
		theForm.txtDealerNum.focus();
		return (false);
	}
	
	if (testString.valueOf() == '55555')	// ATV Dealer Only
		return (true);
		
	if (testString.valueOf() == '44444')	// Victory Dealer Only
		return (true);	
		
	if (testString.valueOf() == '66666')	// Victory AND ATV Dealer
		return (true);		
		
	if (testString.valueOf() == '77777')	// GEM Dealer
		return (true);		
		
	if ((testString.charAt(0) != "1") && (testString.charAt(0) != "2")) {
		alert("The Polaris dealer number is invalid.  The dealer number must begin with a 1 or a 2.");
		theForm.txtDealerNum.focus();
		return (false);
	}
		
	return (true);
}	
