$(function(){
	
	$('#cboUS').change(function(){
		Populate($('#cboUS'));
		$('#internationalTop').hide();
		document.getElementById('cboInternational').selectedIndex = 0;
	});
	
	$('#cboInternational').change(function(){
		document.getElementById('cboUS').selectedIndex = 0;
		Populate($('#cboInternational'));
		$('#internationalTop').show();
	});
	
	if($('#cboUS').val() != "")
		$('#cboUS').change();
		
	if($('#cboInternational').val() != "")
		$('#cboInternational').change();
	
});

function Populate(jCombo){
	$('#findADealer-main-top').show();
	$('#findADealer-main-mid').show();
	$('#findADealer-main-bottom').show();
	
	//alert("shown 3 part boxes");
	
	$('#txtYourWoodAndSyntheticExpert').show();
	$('#txtYourConnorRepresentative').show();
	
	//alert("shown heading texts");
	
	$('.topHalf').hide();
	$('.bottomHalf').hide();
	
	//alert("hidden all addresses");
	
	$('#' + jCombo.val() + 'Top').show();
	$('#' + jCombo.val() + 'Mid1').show();
	$('#' + jCombo.val() + 'Mid2').show();
	$('#' + jCombo.val() + 'Bottom').show();
	
	//alert("shown selected values");
	
	$('#txtYourWoodAndSyntheticExpert').show();
	$('#txtYourConnorRepresentative').show();
	
	//alert("shown heading texts again");
	if($('#cboUS').val() == ""){
		$('#' + jCombo.val() + 'CTop').hide();
		$('#txtYourConnorRepresentative').hide();		
	}
	
	if(jCombo.val() == ""){
		$('#txtYourWoodAndSyntheticExpert').hide();
		$('#txtYourConnorRepresentative').hide();
		$('#findADealer-main-top').hide();
		$('#findADealer-main-mid').hide();
		$('#findADealer-main-bottom').hide();
	}
}