function ValidateDropdowns(source, arguments) {

	if (arguments.Value == "null")

		arguments.IsValid = false;

	else

		arguments.IsValid = true; 

}



function ValidateLengths(source, arguments) {

	if (arguments.Value.length < 6 || arguments.Value.length > 40)

		arguments.IsValid = false;

	else

		arguments.IsValid = true; 

}



function ValidateStateDropdown(source, arguments) {

	if (document.MembershipFormID.CountryDropdown.options[document.MembershipFormID.CountryDropdown.selectedIndex].value == "US" && arguments.Value == "null")

		arguments.IsValid = false;

	else

		arguments.IsValid = true; 

}



function ValidateStreet(source, arguments) {

	if (document.MembershipFormID.StreetTeamCheck.checked && document.MembershipFormID.AddressInput.value.length == 0)

		arguments.IsValid = false;

	else

		arguments.IsValid = true; 

}



function ValidateEmail(source, arguments) {

	var re = /^[a-zA-Z-_0-9]+(\.[a-zA-Z-_0-9]+)*@[a-zA-Z-_0-9]+(\.\w+)+$/;

	if (re.test(arguments.Value))

		arguments.IsValid = true;

	else

		arguments.IsValid = false;

}



function GetMail(elementName, joinFormUrl) {

	window.document.location.href = joinFormUrl + GetRef(elementName).value;

}



function HideShowElement(checkboxName, fieldName, tableName) {

	var formCheckbox = GetRef(checkboxName);

	var formField = GetRef(fieldName);

	var formTable = GetRef(tableName);



	if ( !formCheckbox || !formField || !formTable ) {

		return;

	}



	if ( formCheckbox.checked || formField.value.length != 0 ) {

		formTable.style.display = "inline";

	}

	else {

		formTable.style.display = "none";

	}

}



function GetRef(elementName) {

	if (!document.getElementById)

		return document[elementName];

	else

		return document.getElementById(elementName);

}



function ClearMemberImage(fieldName, imageName, buttonName){

     GetRef(fieldName).value = 'true';

     GetRef(imageName).style.display = "none";

	 GetRef(buttonName).style.display = "none";

}



function ShowMemberImage(fieldName, imageName, buttonName){

     GetRef(fieldName).value = 'false';

     GetRef(imageName).style.display = "inline";

	 GetRef(buttonName).style.display = "inline";

}



function ConfirmSubmit()

{

var agree=confirm("Are you sure you wish to continue?");

if (agree)

	return true ;

else

	return false ;

}

