	var validNumbers = '0123456789.-'; // define valid numbers
	var validLetters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-.,/()&#! '; //define valid letters
	var checkMore = true;
	
	function checkForm() {
		if ( emailCheck(document.forms[0].Email.value) ) {
			if ( passwordCheck(document.forms[0].Password1.value, document.forms[0].Password1.value) ) {
				return true;
			}
		}
		return false;
	}

	
	NS4 = (document.layers) ? true : false;
	function checkEnter(event)
	{ 	
		var code = 0;
		
		if (NS4)
			code = event.which;
		else
			code = event.keyCode;
		if (code==13)
			checkForm();
	}
	
	function passwordCheck(passStr1, passStr2) {
		if (passStr1 != null && passStr1.length >= 4 && passStr1.length <= 14) {
			if (passStr1 == passStr2) {
			return true;
			} else {
				alert('Passwords do not match, please re-enter.');
			}
		} else {
			alert('Password must be between 4 and 12 characters');
			return false;
		}
	}

	function genericPopup(url, windowname, wide, high) {
		window.open(url,windowname,'width='+ wide +',height=' + high);
		//<a class=tenPoint href="javascript: genericPopup('apartmentPicture2.asp','win002',449,320) ">
		//window.open(url,windowname,'menubar='+ menu +',scrollbar='+ bars +',width='+ wide +',height=' + high',toolbar='+ tools +);
	}
	
	function checkFieldBlank() {
	if (document.forms[0].blob.value == "") {
			alert("You must specify an image. If you have no image click the I have no image button.");
			return false; 
		}
		return true;
	}
	
	function checkFieldBlankGeneric() {
	if (document.forms[0].blob.value == "") {
			alert('You must fill in the field to continue.');
			return false; 
		}
		return true;
	}
	
	function emailCheck(emailStr)
	{
			var emailPat = /^(([^<>()[\]\\~.,;:\s@\"]+(\.[^<>()[\]\\~.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
			var matchArray = emailPat.test(emailStr);
			if (matchArray == true)
			{
				return true;
			} else {
				alert("Invalid e-mail address")
				return false;
			}
	}
	
	function stringCheck(textStr, allowed, errorMsg) {
		if (textStr.length == 0 || textStr == 0) {
			alert('You must fill in the ' + errorMsg + ' field to continue.');
			return false;
		}
	
		for (var i=0; i< textStr.length; i++) {
	       if (allowed.indexOf(textStr.charAt(i)) == -1) {
	       	alert('Invalid ' + errorMsg + ', please correct the error and try again.');
				return false;
			}
	    }
	
	    return true;
	}
	
	function numberCheck(string,allowed, errorMsg) {
		if (string.length == 0 || string == 0) {
			alert('Invalid ' + errorMsg + ', please correct the error and try again.');
			return false;
		}
		for (var i=0; i< string.length; i++) {
			if ( (allowed.indexOf(string.charAt(i)) == -1) || (string.indexOf("..") > 0 ) ) {
				alert('Invalid ' + errorMsg + ', please correct the error and try again.');
				return false;
			}
		}
		return true;
	}
	
	function sendPassword()
	{
		var strEmail = document.forms[0].Email.value;
		if (strEmail != "" && emailCheck(strEmail))
		{
			popupWindow('../Help/sendpassword.asp?email=' + strEmail,200,150);
		}
		else
		{
			alert('Email address cannot be empty.');
		}
	}
	
	/*
	add user to mailing list.
	*/
	function addToEmailList()
	{
		function emailCheck (emailStr) {
				var emailPat=/^(.+)@(.+)$/
				var matchArray=emailStr.match(emailPat)
				if (matchArray==null) {
					alert("Invalid e-mail address")
					return false
				} else
					return true;
		}
		
		var strEmail = document.forms[0].NewsEmail.value;
		if (strEmail != "" && emailCheck(strEmail))
		{
			popupWindow('/WS1/News/addToEmailList.asp?email=' + strEmail,400,250);
		}
		else
		{
			alert('Email address cannot be empty.');
		}
	}