$(document).ready(function() {

	// Country select menu
	
	var country = $("select#country").val();
	
	if (country == 'US') {
		$("#countryUS").show();
		$("#countryCA").hide();
		$("#countryOther").hide();
	} else if (country == 'CA') {
		$("#countryUS").hide();
		$("#countryCA").show();
		$("#countryOther").hide();
	} else {
		$("#countryUS").hide();
		$("#countryCA").hide();
		$("#countryOther").show();
	}
	
	$("select#country").change(function(){
		country = $("select#country").val();
		
		if (country == 'US') {
			$("#countryUS").show();
			$("#countryCA").hide();
			$("#countryOther").hide();
		} else if (country == 'CA') {
			$("#countryUS").hide();
			$("#countryCA").show();
			$("#countryOther").hide();
		} else {
			$("#countryUS").hide();
			$("#countryCA").hide();
			$("#countryOther").show();
		}
	});
	
	var country = $('#dynamicReportingCountry').val();
	
	if (country == 'US') {
		$(".countryUS").show();
		$(".countryCA").hide();
		$(".countryOther").hide();
	} else if (country == 'CA') {
		$(".countryUS").hide();
		$(".countryCA").show();
		$(".countryOther").hide();
	} else {
		$(".countryUS").hide();
		$(".countryCA").hide();
		$(".countryOther").show();
	}
	
	$('#dynamicReportingCountry').change(function(){
		country = $('#dynamicReportingCountry').val();
		
		if (country == 'US') {
			$(".countryUS").show();
			$(".countryCA").hide();
			$(".countryOther").hide();
		} else if (country == 'CA') {
			$(".countryUS").hide();
			$(".countryCA").show();
			$(".countryOther").hide();
		} else {
			$(".countryUS").hide();
			$(".countryCA").hide();
			$(".countryOther").show();
		}
	});
	
	var country = $("#profileCountry").val();
	
	if (country == 'US') {
		$(".profileCountryUS").show();
		$(".profileCountryCA").hide();
		$(".profileCountryOther").hide();
		$(".profilePostalCode").hide();
		$(".profilePhoneUSCA").show();
	} else if (country == 'CA') {
		$(".profileCountryUS").hide();
		$(".profileCountryCA").show();
		$(".profileCountryOther").hide();
		$(".profilePostalCode").show();
		$(".profilePhoneUSCA").show();
	} else {
		$(".profileCountryUS").hide();
		$(".profileCountryCA").hide();
		$(".profileCountryOther").show();
		$(".profilePostalCode").show();
	}
	
	
	// "Profile Country" select menu
	$("#profileCountry").change(function(){
		country = $("#profileCountry").val();
		
		if (country == 'US') {
			$(".profileCountryUS").show();
			$(".profileCountryCA").hide();
			$(".profileCountryOther").hide();
			$(".profilePostalCode").hide();
			$(".profilePhoneUSCA").show();
		} else if (country == 'CA') {
			$(".profileCountryUS").hide();
			$(".profileCountryCA").show();
			$(".profileCountryOther").hide();
			$(".profilePostalCode").show();
			$(".profilePhoneUSCA").show();
		} else {
			$(".profileCountryUS").hide();
			$(".profileCountryCA").hide();
			$(".profileCountryOther").show();
			$(".profilePostalCode").show();
		}
	});
	
	var country = $("#secondaryProfileCountry").val();
	
	if (country == 'US') {
		$(".secondaryProfileCountryUS").show();
		$(".secondaryProfileCountryCA").hide();
		$(".secondaryProfileCountryOther").hide();
		$(".secondaryProfilePostalCode").hide();
		$(".secondaryProfilePhoneUSCA").show();
	} else if (country == 'CA') {
		$(".secondaryProfileCountryUS").hide();
		$(".secondaryProfileCountryCA").show();
		$(".secondaryProfileCountryOther").hide();
		$(".secondaryProfilePostalCode").show();
		$(".secondaryProfilePhoneUSCA").show();
	} else {
		$(".secondaryProfileCountryUS").hide();
		$(".secondaryProfileCountryCA").hide();
		$(".secondaryProfileCountryOther").show();
		$(".secondaryProfilePostalCode").show();
	}
	
	
	// "secondaryProfile Country" select menu
	$("#secondaryProfileCountry").change(function(){
		country = $("#secondaryProfileCountry").val();
		
		if (country == 'US') {
			$(".secondaryProfileCountryUS").show();
			$(".secondaryProfileCountryCA").hide();
			$(".secondaryProfileCountryOther").hide();
			$(".secondaryProfilePostalCode").hide();
			$(".secondaryProfilePhoneUSCA").show();
		} else if (country == 'CA') {
			$(".secondaryProfileCountryUS").hide();
			$(".secondaryProfileCountryCA").show();
			$(".secondaryProfileCountryOther").hide();
			$(".secondaryProfilePostalCode").show();
			$(".secondaryProfilePhoneUSCA").show();
		} else {
			$(".secondaryProfileCountryUS").hide();
			$(".secondaryProfileCountryCA").hide();
			$(".secondaryProfileCountryOther").show();
			$(".secondaryProfilePostalCode").show();
		}
	});
	
	//eventSearch 
	var country = $("#eventCountry").val();
	
	if (country == 'US') {
		$(".countryUS").show();
		$(".countryCA").hide();
		$(".countryOther").hide();
		$(".countryNonUS").hide();
	} else if (country == 'CA') {
		$(".countryUS").hide();
		$(".countryCA").show();
		$(".countryOther").hide();
		$(".countryNonUS").show();
	} else {
		$(".countryUS").hide();
		$(".countryCA").hide();
		$(".countryOther").show();
		$(".countryNonUS").show();
	}
	
	
	// "Profile Country" select menu
	$("#eventCountry").change(function(){
	country = $("#eventCountry").val();
	
	if (country == 'US') {
		$(".countryUS").show();
		$(".countryCA").hide();
		$(".countryOther").hide();
		$(".countryNonUS").hide();
	} else if (country == 'CA') {
		$(".countryUS").hide();
		$(".countryCA").show();
		$(".countryOther").hide();
		$(".countryNonUS").show();
	} else {
		$(".countryUS").hide();
		$(".countryCA").hide();
		$(".countryOther").show();
		$(".countryNonUS").show();
	}
});
	
});