﻿
	function validateLogin() {	
		if (isWhitespace(document.Login.ScreenName.value)) {
			alert("Please enter your login name.")
			document.Login.ScreenName.focus()
			return false;
		}
		if (isWhitespace(document.Login.Password.value)) {
			alert("Please enter your password.")
			document.Login.Password.focus()
			return false;
		}
 
		return true;
	}
	
	function validateSearch(){
		if (isWhitespace(document.SearchForm.tplHome_zip.value)) {
				alert("Please enter a zip code.")
				document.SearchForm.tplHome_zip.focus()
				return false;
			}
	}
	
	function isWhitespace(s)
		{
			var whitespace = ' \t\n\r';
			var i;
			if(isEmpty(s)) return true;
			for (i = 0; i < s.length; i++)
			{
				var c = s.charAt(i);
				if (whitespace.indexOf(c) == -1) return false;
			}
			return true;
		}
		
	function isEmpty(s)
	{
		return ((s == null) || (s.length == 0))
	}
			
	function launchWin(which){
 
		window.open(which, 'CSWin', 'width=550,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
 
	}
	
	function forgotPassword() {
	
		window.open('/forgot_password.aspx', 'ForgotPassword', 'top=1, left=1, height=200, width=350, scrolling=no, scrollbars=no, toolbar=no');
			
	}
	
	function switchImage(which, where) {
	
		document.getElementById(where).src = which;
	
	}
