
function validateForm( )
{
	var objFV = new FormValidator("frmMailingList");
	
	if (!objFV.validate("newsletter_subscription_first_name", "B", "Please enter Your First Name."))
		return false;

	if (!objFV.validate("newsletter_subscription_last_name", "B", "Please enter Your Last Name."))
		return false;
		
	if (!objFV.validate("newsletter_subscription_country", "B", "Please select your Country."))
		return false;
		
	if (!objFV.validate("newsletter_subscription_email", "B,E", "Please enter Your Email Address."))
		return false;
		
	return true;
}

function addFavorite()
{
	if (window.external)
		{
		external.AddFavorite('http://www.saeamerica.org', 'SAE - N. & S. America Region')
		}

	else
    	{
		alert("Unfortunately your browser doesn't support this automated feature.\n" +
        	"To manually add our site to your favorites click on\n" +
        	"the menu  Bookmarks and then selecting Add Bookmark");
	}
}

function OpenPopupWin(page)
{
		
	// Check the checkbox
	document.getElementsByName('register')[0].checked=window.showModalDialog('contest_rules.html#top?rnd=' + Math.random(), "", "dialogWidth:530px; dialogHeight:450px; scroll:auto; edge:raised; center:yes; help:no; resizable:yes; status:no");
}

function display_states()
{
	country_list = document.getElementById("newsletter_subscription_country");
	country_name = country_list[country_list.selectedIndex].value
	document.getElementById("us_state_list").style.display = "none";
	document.getElementById("canada_state_list").style.display = "none";

	if(country_name == "United States")
	{
		document.getElementById("us_state_list").style.display = "block";
	}else if(country_name == "Canada")
	{
		document.getElementById("canada_state_list").style.display = "block";
	}
}