//setup states
	var states = new Array();

	states[0] = new Array('N/A', 'N/A');

	states[1] = new Array(
	'PL','Please Select',
	'AL','Alabama',
	'AK','Alaska',
	'AZ','Arizona',
	'AR','Arkansas',
	'CA','California',
	'CO','Colorado',
	'CT','Connecticut',
	'DE','Delaware',
	'DC','District of Columbia',
	'FL','Florida',
	'GA','Georgia',
	'HI','Hawaii',
	'ID','Idaho',
	'IL','Illinois',
	'IN','Indiana',
	'IA','Iowa',
	'KS','Kansas',
	'KY','Kentucky',
	'LA','Louisiana',
	'ME','Maine',
	'MD','Maryland',
	'MA','Massachusetts',
	'MI','Michigan',
	'MN','Minnesota',
	'MS','Mississippi',
	'MO','Missouri',
	'MT','Montana',
	'NE','Nebraska',
	'NV','Nevada',
	'NH','New Hampshire',
	'NJ','New Jersey',
	'NM','New Mexico',
	'NY','New York',
	'NC','North Carolina',
	'ND','North Dakota',
	'OH','Ohio',
	'OK','Oklahoma',
	'OR','Oregon',
	'PA','Pennsylvania',
	'PR','Puerto Rico',
	'RI','Rhode Island',
	'SC','South Carolina',
	'SD','South Dakota',
	'TN','Tennessee',
	'TX','Texas',
	'UT','Utah',
	'VT','Vermont',
	'VA','Virginia',
    'VI','U.S. Virgin Islands',
	'WA','Washington',
	'WV','West Virginia',
	'WI','Wisconsin',
	'WY','Wyoming'
    );

    states[2] = new Array(
	'PL','Please Select',
    'AB','Alberta',
	'BC','British Columbia',
	'MB','Manitoba',
	'NB','New Brunswick',
	'NF','Newfoundland',
	'NWT','Northwest Territories',
	'NS','Nova Scotia',
	'NU','Nunavut',
	'ON','Ontario',
	'PE','Prince Edward Island',
	'PQ','Quebec',
	'SK','Saskatchewan',
	'YT','Yukon Territory'
	);

	function populate()
	{
		countryId=0;
		document.EOIvoi107.state.disabled=true;
		if(document.EOIvoi107.country.value=='United States of America'){
			document.EOIvoi107.state.disabled=false;
			countryId=1;
		}

		if(document.EOIvoi107.country.value=='Canada'){
			document.EOIvoi107.state.disabled=false;
			countryId=2;
		}

		var list = states[countryId];
		var box2 = document.EOIvoi107.state;
		box2.options.length = 0;
		for(i=0;i<list.length;i+=2)
		{
			box2.options[i/2] = new Option(list[i+1],list[i]);
		}
	}

// form validation
	function checkForm(){
		//function that checks the validity of the form
		//checks for empty required fields and if the emails equal
		
		var bolOK = true;		
		var radio = false;
		for (counter = 0; counter < document.EOIvoi107.Interested_In.length; counter++)		
		if(bolOK)
		{
			if(document.EOIvoi107.Interested_In[counter].checked)
			radio = true;
			bolOK = true;
		}
		if(!radio)
		{
			alert("Please choose an interest.");
			bolOK=false;
		}		
		if(bolOK)
		{
			bolOK = notEmpty('custom','EOIvoi107','fname','A first name is required.','lname','A last name is required.','address','A street address is required.','city','A city is required.', 'state','A state is required.','country','A country is required.');
		}
		if(bolOK)
		{
			if(document.EOIvoi107.state[document.EOIvoi107.state.selectedIndex].value == 'PL')
			{
				bolOK=false;
				alert("Please choose a state.");
				eval("document.EOIvoi107.state.focus();");
			}

		}
		if(bolOK)
		{
			bolOK=notEmpty('custom','EOIvoi107', 'postal', 'Please enter a postal code.', 'phoneNum', 'Please enter your phone number.');
		}
		if(bolOK)
		{
			bolOK = checkEmailNoAlerts(document.EOIvoi107.email.value);
			if(!bolOK)
			{
				alert('An email address is required.');
				eval("document.EOIvoi107.email.focus();");
			}
		}
		if(bolOK)
		{
			if(document.EOIvoi107.VacationChoice_1[document.EOIvoi107.VacationChoice_1.selectedIndex].value == 'PL')
			{
				bolOK=false;
				alert("Please choose at least one destination of interest.");
				eval("document.EOIvoi107.VacationChoice_1.focus();");
			}

		}
		if(bolOK)
		{
			if(document.EOIvoi107.SVO_Owner[document.EOIvoi107.SVO_Owner.selectedIndex].value == 'PL')
			{
				bolOK=false;
				alert("Please tell us if you presently own vacation ownership or timeshare real estate interest(s).");
				eval("document.EOIvoi107.SVO_Owner.focus();");
			}

		}
		if(bolOK)
		{
			if(document.EOIvoi107.HomeOwnership[document.EOIvoi107.HomeOwnership.selectedIndex].value == 'PL')
			{
				bolOK=false;
				alert("Please tell us if you are a home owner.");
				eval("document.EOIvoi107.HomeOwnership.focus();");
			}

		}
		if(bolOK)
		{
			if(document.EOIvoi107.Income_of_Household[document.EOIvoi107.Income_of_Household.selectedIndex].value == 'PL')
			{
				bolOK=false;
				alert("Please tell us your annual household income.");
				eval("document.EOIvoi107.Income_of_Household.focus();");
			}

		}
		return bolOK;
	}
	
// text counter

	function textCounter(theField, charsLeft, maxChars) {
			if (theField.value.length > maxChars) {
				theField.value = theField.value.substring(0, maxChars);
			} else {
				charsLeft.value = maxChars - theField.value.length;
			}
		}

//  show/hide destination "other" field

function showDestField()
    {
        var choice = document.EOIvoi107.VacationChoice_1.options[document.EOIvoi107.VacationChoice_1.selectedIndex].value;

        if(choice == "OtherDestination")
        {
            document.getElementById('otherDest-div').style.display = "";           
		   
        }
		else
		{
			document.getElementById('otherDest-div').style.display = "none";           
			   
		}
    }
		
// show/hide timeshare owner question

	function showOwnerField()
    {
        var choice = document.EOIvoi107.SVO_Owner.options[document.EOIvoi107.SVO_Owner.selectedIndex].value;

        if(choice == "Yes")
        {
            document.getElementById('OwnerField-div').style.display = "";
		   
        }
		else if(choice == "No")
        {
            document.getElementById('OwnerField-div').style.display = "none";
		   
        }
		else
			{
			document.getElementById('OwnerField-div').style.display = "none";			   
			}
    }