

function switchstates(objCountry)
{		
		var usercountry = objCountry.value;
		var usstatediv;
		var otherstatediv;
		
		if(objCountry.id == 'country')
		{	
			usstatediv = 'us_state_div';
			otherstatediv = 'other_state_div';				
		}
		else if(objCountry.id == 'scountry')
		{
			usstatediv = 'us_sstate_div';
			otherstatediv = 'other_sstate_div';				
		}			
		
		if(usercountry == 1)
		{
				$(usstatediv).style.display = 'block';
				$(otherstatediv).style.display = 'none';
		}
		else 
		{
				$(usstatediv).style.display = 'none';
				$(otherstatediv).style.display = 'block';
		}
		
		return ;

}


function reloadStates()
{
		if($('country').value == 1)
		{
				$('us_state_div').style.display = 'block';
				$('other_state_div').style.display = 'none';
		}
		else 
		{
				$('us_state_div').style.display = 'none';
				$('other_state_div').style.display = 'block';
		}
		
		if($('scountry').value == 1)
		{
				$('us_sstate_div').style.display = 'block';
				$('other_sstate_div').style.display = 'none';
		}
		else 
		{
				$('us_sstate_div').style.display = 'none';
				$('other_sstate_div').style.display = 'block';
		}
}function SameShippingAddress(val){
			
			if(document.form_signup.person_bill_address.checked){						
						document.form_signup.sfirst_name.value = document.form_signup.first_name.value;
						document.form_signup.slast_name.value = document.form_signup.last_name.value;			
						document.form_signup.saddress1.value = document.form_signup.address1.value;
						document.form_signup.saddress2.value = document.form_signup.address2.value;
						document.form_signup.scity.value = document.form_signup.city.value;
						if($('us_state_div').style.display == 'block'){
							$('other_sstate_div').style.display = 'none';
							$('us_sstate_div').style.display = 'block';
							document.form_signup.sstate.value = document.form_signup.state.value;
							}
						else{
							$('other_sstate_div').style.display = 'block';
							$('us_sstate_div').style.display = 'none';
							document.form_signup.sother_state.value = document.form_signup.other_state.value;
							}
						document.form_signup.szipcode.value = document.form_signup.zip.value;
						document.form_signup.semail.value = document.form_signup.email.value;
						document.form_signup.scountry.value = document.form_signup.country.value;
			}
			else{
						document.form_signup.sfirst_name.value = "";
						document.form_signup.slast_name.value = "";					
						document.form_signup.saddress1.value = "";
						document.form_signup.saddress2.value = "";
						document.form_signup.scity.value = "";
						if($('us_state_div').style.display == 'block'){
							$('other_sstate_div').style.display = 'none';
							$('us_sstate_div').style.display = 'block';
							document.form_signup.sstate.value = '';
						}
						else{
							$('other_sstate_div').style.display = 'block';
							$('us_sstate_div').style.display = 'none';
							document.form_signup.sother_state.value = '';
						}	
						document.form_signup.szipcode.value = "";
						document.form_signup.scountry.value = "";
						document.form_signup.semail.value ="";
			} 
}
