function changeIndSegment() {
	
	Ind = document.AForm.Industry
	IndSegment = document.AForm.IndustrySegment
	
	with (Ind) {
		switch (selectedIndex){
			//default option 
			case 1:
				//history.go(0)
				//Auto Dealers
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Auto Dealers","1")
				IndSegment.options[2] = new Option("Auto Parts Retail and Distribution","2")
				IndSegment.options[3] = new Option("Auto Rental","3")
				IndSegment.options[4] = new Option("Auto Repair","4")
				IndSegment.options[5] = new Option("Car Wash","5")
				IndSegment.options[6] = new Option("Gas Station","6")
				IndSegment.options[7] = new Option("Other Auto Related","7")
				IndSegment.options[0].selected = true;
				break
			case 2:
				//Agriculture
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Agriculture and Supplies","8")
				IndSegment.options[2] = new Option("Farms","9")
				IndSegment.options[3] = new Option("Other Agriculture","10")
				IndSegment.options[0].selected = true;
				break
			case 3:
				//Bars and Nightclubs
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Bars and Pubs","11")
				IndSegment.options[2] = new Option("Nightclubs","12")
				IndSegment.options[3] = new Option("Other Bars and Nightclubs","13")
				IndSegment.options[0].selected = true;
				break
			case 4:
				//Business Services
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Advertising and Marketing","14")
				IndSegment.options[2] = new Option("Architecture and Interior Design","15")
				IndSegment.options[3] = new Option("Commercial Cleaning","16")
				IndSegment.options[4] = new Option("Construction","17")
				IndSegment.options[5] = new Option("Equipment Rental and Leasing","18")
				IndSegment.options[6] = new Option("Financial","19")
				IndSegment.options[7] = new Option("Graphic Design","20")
				IndSegment.options[8] = new Option("House and Garden Maintenance","21")
				IndSegment.options[9] = new Option("Laundry","22")
				IndSegment.options[10] = new Option("Locksmiths","23")
				IndSegment.options[11] = new Option("Pet Care","24")
				IndSegment.options[12] = new Option("Postal and Messenger Services","25")
				IndSegment.options[13] = new Option("Printing Service","26")
				IndSegment.options[14] = new Option("Security and Protection Services","27")
				IndSegment.options[15] = new Option("Staffing","28")
				IndSegment.options[16] = new Option("Towing","29")
				IndSegment.options[17] = new Option("Transportation – Airplane, Taxi, and Limousine","30")
				IndSegment.options[18] = new Option("Waste Services","31")
				IndSegment.options[19] = new Option("Other Services","32")
				IndSegment.options[0].selected = true;
				break		
			case 5:
				//Educational
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Day Care Centers","33")
				IndSegment.options[2] = new Option("Schools","34")
				IndSegment.options[3] = new Option("Seminars","35")
				IndSegment.options[4] = new Option("Test Preparation","36")
				IndSegment.options[5] = new Option("Other Educational","37")
				IndSegment.options[0].selected = true;
				break		
			case 6:
				//Entertainment and Leisure
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Amusement Parks","38")
				IndSegment.options[2] = new Option("Art Galleries and Museums","39")
				IndSegment.options[3] = new Option("Billiards and Bowling","40")
				IndSegment.options[4] = new Option("Casinos","41")
				IndSegment.options[5] = new Option("Movie Theaters","42")
				IndSegment.options[6] = new Option("Other Entertainment and Leisure","43")				
				IndSegment.options[0].selected = true;
				break	
			case 7:
				//Food and Beverage
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Catering Services","44")
				IndSegment.options[2] = new Option("Food Production and Packaging","45")
				IndSegment.options[3] = new Option("Grocery and Supermarkets","46")
				IndSegment.options[4] = new Option("Liquor Stores","47")
				IndSegment.options[5] = new Option("Restaurants and Fast Food (Non-Franchise)","48")
				IndSegment.options[6] = new Option("Vending Machines","49")				
				IndSegment.options[7] = new Option("Other Food and Beverage","50")	
				IndSegment.options[0].selected = true;
				break		
			case 8:
				//Franchises
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Food and Beverages","51")
				IndSegment.options[2] = new Option("Retail","52")
				IndSegment.options[3] = new Option("Service","53")
				IndSegment.options[4] = new Option("Other Franchises","54")	
				IndSegment.options[0].selected = true;
				break		
			case 9:
				//Hair and Beauty
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Beauty Salons and Barber Shops","55")
				IndSegment.options[2] = new Option("Hair and Beauty Supplies Retail and Distribution","56")
				IndSegment.options[3] = new Option("Tanning Salons","57")
				IndSegment.options[4] = new Option("Other Hair and Beauty","58")	
				IndSegment.options[0].selected = true;
				break	
			case 10:
				//Health and Medical
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Chiropractic Practices","59")
				IndSegment.options[2] = new Option("Dental Practices","60")
				IndSegment.options[3] = new Option("Health Clubs and Spas","61")
				IndSegment.options[4] = new Option("Long-Term Care Facilities","62")
				IndSegment.options[5] = new Option("Medical and Dental Labs","63")	
				IndSegment.options[6] = new Option("Medical Clinics","64")	
				IndSegment.options[7] = new Option("Medical Devices","65")	
				IndSegment.options[8] = new Option("Medical Practices","66")	
				IndSegment.options[9] = new Option("Optometry","67")	
				IndSegment.options[10] = new Option("Pharmacy","68")	
				IndSegment.options[11] = new Option("Other Health and Medical","69")		
				IndSegment.options[0].selected = true;
				break	
			case 11:
				//Hotels & Holiday Accom
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Camping and Parks","70")
				IndSegment.options[2] = new Option("Guest Houses / Bed and Breakfast","71")
				IndSegment.options[3] = new Option("Holiday Resorts","72")
				IndSegment.options[4] = new Option("Hotels","73")
				IndSegment.options[5] = new Option("Motels","74")	
				IndSegment.options[6] = new Option("Other Hotels and Holiday Accommodation","75")			
				IndSegment.options[0].selected = true;
				break		
			case 12:
				//Manufacturing
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Airplane and Boating Manufacturing","76")
				IndSegment.options[2] = new Option("Auto Parts Manufacturing","77")
				IndSegment.options[3] = new Option("Chemical Manufacturing","78")
				IndSegment.options[4] = new Option("Clothing and Footwear Manufacturing","79")
				IndSegment.options[5] = new Option("Computers and Electronic Equipment Manufacturing","80")	
				IndSegment.options[6] = new Option("Furniture Manufacturing","81")
				IndSegment.options[7] = new Option("Lighting Products Manufacturing","82")			
				IndSegment.options[8] = new Option("Machinery Manufacturing","83")			
				IndSegment.options[9] = new Option("Medical Device Manufacturing","84")			
				IndSegment.options[10] = new Option("Metals Manufacturing","85")			
				IndSegment.options[11] = new Option("Paper and Packaging Manufacturing","86")			
				IndSegment.options[12] = new Option("Plastics Manufacturing","87")			
				IndSegment.options[13] = new Option("Textiles and Materials Manufacturing","88")			
				IndSegment.options[14] = new Option("Wood Products Manufacturing","89")			
				IndSegment.options[15] = new Option("Other Manufacturing","90")						
				IndSegment.options[0].selected = true;
				break
			case 13:
				//Media and Communication
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Film","91")
				IndSegment.options[2] = new Option("Internet Publishers","92")
				IndSegment.options[3] = new Option("Newspapers","93")
				IndSegment.options[4] = new Option("Periodicals and Magazine Publishers","94")
				IndSegment.options[5] = new Option("Printing and Typesetting","95")	
				IndSegment.options[6] = new Option("Telecom and Networking","96")
				IndSegment.options[7] = new Option("Telephone and Wireless Carriers","97")			
				IndSegment.options[8] = new Option("Television and Radio","98")			
				IndSegment.options[9] = new Option("Other Media and Communication","99")								
				IndSegment.options[0].selected = true;
				break	
			case 14:
				//Professional Services
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Accounting and Legal","100")
				IndSegment.options[2] = new Option("Consulting","101")
				IndSegment.options[3] = new Option("Other Professional Services","102")							
				IndSegment.options[0].selected = true;
				break	
			case 15:
				//Real Estate
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Commercial and Residential Real Estate Brokers","103")
				IndSegment.options[2] = new Option("Mortgage Brokers","104")
				IndSegment.options[3] = new Option("Title and Escrow","105")
				IndSegment.options[4] = new Option("Other Real Estate","106")							
				IndSegment.options[0].selected = true;
				break
			case 16:
				//Retail
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Catalog and Mail Order Retail","107")
				IndSegment.options[2] = new Option("Clothing and Footwear Retail","108")
				IndSegment.options[3] = new Option("Computers and Electronic Equipment Retail","109")
				IndSegment.options[4] = new Option("Convenience Stores Retail","110")
				IndSegment.options[5] = new Option("Florist Retail","111")	
				IndSegment.options[6] = new Option("Health and Beauty Supplies Retail","112")
				IndSegment.options[7] = new Option("Home and Garden Retail","113")			
				IndSegment.options[8] = new Option("Movie Rental","114")			
				IndSegment.options[9] = new Option("Wedding / Formal Rental","115")								
				IndSegment.options[10] = new Option("Other Retail","116")	
				IndSegment.options[0].selected = true;
				break	
			case 17:
				//Technology - Internet Related
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Application Service Providers","117")
				IndSegment.options[2] = new Option("E-Commerce and E-Tailers","118")
				IndSegment.options[3] = new Option("Internet Service Providers","119")
				IndSegment.options[4] = new Option("Web Design and Software Development","120")
				IndSegment.options[5] = new Option("Other Technology – Internet Related","121")		
				IndSegment.options[0].selected = true;
				break
			case 18:
				//Wholesale and Distribution
				for (var i = IndSegment.options.length; i > 0; i--) {
					IndSegment.options[i] = null;
				}
				IndSegment.options[0] = new Option("Select an Industry Segment","")
				IndSegment.options[1] = new Option("Wholesale and Distribution","112")	
				IndSegment.options[0].selected = true;
				break																																										
		}
	}	
}

function changeRegionStProv() {
	
	BizCoun = document.AForm.BizCountry
	//alert ("BizCoun:" + BizCoun);
	BizRSP = document.AForm.BizState

	//change BizArea to ----- if country is changed
	BizArea = document.AForm.BizArea
	
	for (var i = BizArea.options.length; i > 0; i--) {
		BizArea.options[i] = null;
	}	
	document.AForm.BizArea.options[0] = new Option("-----","")
		
	with (BizCoun) {
		switch (selectedIndex){
			//Canada
			//case 39:
			case 2:
				for (var i = BizRSP.options.length; i > 0; i--) {
					BizRSP.options[i] = null;
				}
				BizRSP.options[0] = new Option("Select a Province","")
				BizRSP.options[1] = new Option("Alberta","Alberta")
				BizRSP.options[2] = new Option("British Columbia","British Columbia")
				BizRSP.options[3] = new Option("Manitoba","Manitoba")
				BizRSP.options[4] = new Option("New Brunswick","New Brunswick")
				BizRSP.options[5] = new Option("Newfoundland","Newfoundland")
				BizRSP.options[6] = new Option("Northwest Territories","Northwest Territories")
				BizRSP.options[7] = new Option("Nova Scotia","Nova Scotia")
				BizRSP.options[8] = new Option("Nunavut","Nunavut")
				BizRSP.options[9] = new Option("Ontario","Ontario")
				BizRSP.options[10] = new Option("Prince Edward Island","Prince Edward Island")
				BizRSP.options[11] = new Option("Quebec","Quebec")
				BizRSP.options[12] = new Option("Saskatchewan","Saskatchewan")
				BizRSP.options[13] = new Option("Yukon Territory","Yukon Territory")
				BizRSP.options[0].selected = true;
				break
			//United States	
			//case 235:
			case 1:
				for (var i = BizRSP.options.length; i > 0; i--) {
					BizRSP.options[i] = null;
				}
				BizRSP.options[0] = new Option("Select a State","")
				BizRSP.options[1] = new Option("Alabama","Alabama")
				BizRSP.options[2] = new Option("Alaska","Alaska")
				BizRSP.options[3] = new Option("Arizona","Arizona")
				BizRSP.options[4] = new Option("Arkansas","Arkansas")
				BizRSP.options[5] = new Option("California","California")
				BizRSP.options[6] = new Option("Colorado","Colorado")
				BizRSP.options[7] = new Option("Connecticut","Connecticut")
				BizRSP.options[8] = new Option("Delaware","Delaware")
				BizRSP.options[9] = new Option("Dist. of Columbia","Dist. of Columbia")
				BizRSP.options[10] = new Option("Florida","Florida")
				BizRSP.options[11] = new Option("Georgia","Georgia")
				BizRSP.options[12] = new Option("Hawaii","Hawaii")
				BizRSP.options[13] = new Option("Idaho","Idaho")
				BizRSP.options[14] = new Option("Illinois","Illinois")
				BizRSP.options[15] = new Option("Indiana","Indiana")
				BizRSP.options[16] = new Option("Iowa","Iowa")
				BizRSP.options[17] = new Option("Kansas","Kansas")
				BizRSP.options[18] = new Option("Kentucky","Kentucky")
				BizRSP.options[19] = new Option("Louisiana","Louisiana")
				BizRSP.options[20] = new Option("Maine","Maine")
				BizRSP.options[21] = new Option("Maryland","Maryland")
				BizRSP.options[22] = new Option("Massachusetts","Massachusetts")
				BizRSP.options[23] = new Option("Michigan","Michigan")
				BizRSP.options[24] = new Option("Minnesota","Minnesota")
				BizRSP.options[25] = new Option("Mississippi","Mississippi")
				BizRSP.options[26] = new Option("Missouri","Missouri")
				BizRSP.options[27] = new Option("Montana","Montana")
				BizRSP.options[28] = new Option("Nebraska","Nebraska")
				BizRSP.options[29] = new Option("Nevada","Nevada")
				BizRSP.options[30] = new Option("New Hampshire","New Hampshire")
				BizRSP.options[31] = new Option("New Jersey","New Jersey")
				BizRSP.options[32] = new Option("New Mexico","New Mexico")
				BizRSP.options[33] = new Option("New York","New York")
				BizRSP.options[34] = new Option("North Carolina","North Carolina")
				BizRSP.options[35] = new Option("North Dakota","North Dakota")
				BizRSP.options[36] = new Option("Ohio","Ohio")
				BizRSP.options[37] = new Option("Oklahoma","Oklahoma")
				BizRSP.options[38] = new Option("Oregon","Oregon")
				BizRSP.options[39] = new Option("Pennsylvania","Pennsylvania")
				BizRSP.options[40] = new Option("Rhode Island","Rhode Island")
				BizRSP.options[41] = new Option("South Carolina","South Carolina")
				BizRSP.options[42] = new Option("South Dakota","South Dakota")
				BizRSP.options[43] = new Option("Tennessee","Tennessee")
				BizRSP.options[44] = new Option("Texas","Texas")
				BizRSP.options[45] = new Option("Utah","Utah")
				BizRSP.options[46] = new Option("Vermont","Vermont")
				BizRSP.options[47] = new Option("Virginia","Virginia")
				BizRSP.options[48] = new Option("Washington","Washington")
				BizRSP.options[49] = new Option("West Virginia","West Virginia")
				BizRSP.options[50] = new Option("Wisconsin","Wisconsin")
				BizRSP.options[51] = new Option("Wyoming","Wyoming")
				BizRSP.options[0].selected = true;
				break		
			default:
				for (var i = BizRSP.options.length; i >= 0; i--) {
					BizRSP.options[i] = null;
				}
				BizRSP.options[0] = new Option("-----","")				
				break
		}
	}
}

function changeArea() {
	
	BizCoun = document.AForm.BizCountry
	BizRSP = document.AForm.BizState
	BizArea = document.AForm.BizArea
	
	with (BizRSP) {
		switch (selectedIndex){
			//California
			case 5:
				//to eliminate neufy
				if (BizRSP.value == "California")
				{
					for (var i = BizArea.options.length; i > 0; i--) {
						BizArea.options[i] = null;
					}
					BizArea.options[0] = new Option("Select an Area","")
					BizArea.options[1] = new Option("Northern California - All Northern California","Northern California - All Northern California")
					BizArea.options[2] = new Option("Northern California - Bay Area","Northern California - Bay Area")
					BizArea.options[3] = new Option("Southern California - All Southern California","Southern California - All Southern California")
					BizArea.options[4] = new Option("Southern California - Los Angeles Area","Southern California - Los Angeles Area")
					BizArea.options[5] = new Option("Southern California - San Deigo Area","Southern California - San Deigo Area")
					BizArea.options[0].selected = true;
					break
				}
				else
				{
				for (var i = BizArea.options.length; i > 0; i--) {
					BizArea.options[i] = null;
				}
				BizArea.options[0] = new Option("-----","")
				break
				}
			//New York
			case 33:
				for (var i = BizArea.options.length; i > 0; i--) {
					BizArea.options[i] = null;
				}
				BizArea.options[0] = new Option("Select an Area","")
				BizArea.options[1] = new Option("All of New York","All of New York")
				BizArea.options[2] = new Option("New York City Area","New York City Area")
				BizArea.options[3] = new Option("Upstate New York","Upstate New York")
				BizArea.options[4] = new Option("Other New York","Other New York")
				BizArea.options[0].selected = true;
				break
			//Texas
			case 44:
				for (var i = BizArea.options.length; i > 0; i--) {
					BizArea.options[i] = null;
				}
				BizArea.options[0] = new Option("Select an Area","")
				BizArea.options[1] = new Option("Austin","Austin")
				BizArea.options[2] = new Option("Central Texas","Central Texas")
				BizArea.options[3] = new Option("Dallas/Fort Worth","Dallas/Fort Worth")
				BizArea.options[4] = new Option("East Texas","East Texas")
				BizArea.options[5] = new Option("Houston","Houston")
				BizArea.options[6] = new Option("San Antonio","San Antonio")
				BizArea.options[7] = new Option("West Texas","West Texas")
				BizArea.options[0].selected = true;
				break
			default:
				for (var i = BizArea.options.length; i > 0; i--) {
					BizArea.options[i] = null;
				}
				BizArea.options[0] = new Option("-----","")
				break
		}
	}
}


var requiredFields = new Array("txtName", "txtEmail", "txtEAPassword");
var fieldNames = new Array("Email Alert Name", "Contact Email", "Password");   
var FormOK = NameOK = EmailOK = PasswordOK = true;
	
function checkFields(input) {
	indus = (document.AForm.Industry.selectedIndex)-0;
	if (indus == 0){
		if (document.AForm.Industry.value == "") { alert("The Business Industry field requires valid input"); return false;  }
	}
	indusSeg = (document.AForm.IndustrySegment.selectedIndex)-0;
	if (indusSeg == 0){
		if (document.AForm.IndustrySegment.value == "") { alert("The Business Industry Segment field requires valid input"); return false;  }
	}
	bizCoun = (document.AForm.BizCountry.selectedIndex)-0;
	if (bizCoun == 0){
		if (document.AForm.BizCountry.value == "") { alert("The Country field requires valid input"); return false;  }
	}
	/*	
	askPrice = (document.AForm.AskingPrice.selectedIndex)-0;
	if (askPrice == 0){
		if (document.AForm.AskingPrice.value == "") { alert("The Asking Price Range field requires valid input"); return false;  }
	}
	*/	
	//if (document.AForm.txtEmail.value == "") { alert("The Contact Email field requires valid input"); return false;  }

	//if sign up new alert after authenticated
	//if (document.AForm.txtName.value == "") { alert("The Email Alert Name field requires valid input"); return false;  }
	
	for (b = 0; b < document.AForm.txtEAPassword.length; b++) {
        ch = document.AForm.txtEAPassword.substring(b, b+1);
		if ( (ch==" ") || (ch=="'") )
			{
				alert('Do not use Spaces or AlphaNumeric Characters in the Password field');  
				document.AForm.txtEAPassword.value = "" ;  	
				return(false);
			}
	}	
	
		
	if (!(checkRequiredFieldsBC(input))) {return false;}	
	if (!(NameOK)) { alert("The Email Alert Name field requires valid input"); return false; }
	if (!(EmailOK)) { alert("The Email Address field requires valid input"); return false; }
	if (!(PasswordOK)) { alert("The Password field requires valid input"); return false; }
	else {
	return true; 
	}
		
}

function checkRequiredFieldsBC(input)
{             
   
    var fieldCheck   = true;
    var fieldsNeeded = "\nA value must be entered in the following field(s):\n\n\t";

    for(var fieldNum=0; fieldNum < requiredFields.length; fieldNum++) {
        if ((input.elements[requiredFields[fieldNum]].value == "") ||
            (input.elements[requiredFields[fieldNum]].value == " ")) {

            fieldsNeeded += fieldNames[fieldNum] + "\n\t";
            fieldCheck = false;
        }
    }
  
    if (fieldCheck == true)
    {
		FormOK = true
        return true;
    }

    else
    {
		FormOK = false
        alert(fieldsNeeded);
        return false;
    }
}


// Check whether string s is empty.
function ifEmpty(s)
{   
	return ((s == null) || (s.length == 0))
}

// Returns true if string s is empty or 
// whitespace characters only.

function isWhitespace (s)
{   
	var i;
	var whitespace = " \t\n\r";
	
    // Is s empty?
    if (ifEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
	// Check that current character isn't whitespace.
	var c = s.charAt(i);

	if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}

// isEmail (STRING s [, BOOLEAN emptyOK])
// 
// Email address must be of form a@b.c ... in other words:
// * there must be at least one character before the @
// * there must be at least one character before and after the .
// * the characters @ and . are both required
//
// For explanation of optional argument emptyOK,
// see comments of function isInteger.

function isEmail (s)
{   
	if (ifEmpty(s)) 
       if (isEmail.arguments.length == 1) return alert('Please Enter Email Address');
       else return (isEmail.arguments[1] == true);
   
    // is s whitespace?
    if (isWhitespace(s)) return alert('invalid email1'); //false;
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return alert('Invalid Email Address without  "@" '); //false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return alert('Invalid Email Address without  "." '); //false;
    else return true;
}	


function checkPassword2(checkString) 
{
	//also check for spaces here
	var tot3=0
	
	for (j = 0; j < checkString.length ; j++) 
	{
    	ch2 = checkString.substring(j, j+1);
        
	if (!( (ch2 >= "a" && ch2 <= "z") || (ch2 >= "A" && ch2 <= "Z" )  || (ch2 >="0"  && ch2 <= "9") )  )
		{
	   tot3=tot3+1;
		}
	}
	
	if (tot3>=1)
	{
		alert('Do not use Spaces or AlphaNumeric Characters in the Password field');    	
		document.AForm.txtEAPassword.value = "" ;
	}
	
	if ((checkString.length >= 4) && (checkString.length <=8)) 
		{ return checkString; }
	else
		{ 
		 alert('Invalid Password, Password must be 4 - 8 characters in length');
		 document.AForm.txtEAPassword.value = "" ;
		////return (''); 
		}	
}