<!--
function ShipFill() {
	if (document.form.ship_same.checked) 
	{
		document.form.firstname.value = document.form.ship_firstname.value;
		document.form.lastname.value = document.form.ship_lastname.value;
		document.form.company.value = document.form.ship_company.value;
		document.form.address1.value = document.form.ship_address1.value;
		document.form.address2.value = document.form.ship_address2.value;
		document.form.city.value = document.form.ship_city.value;
		document.form.state.value = document.form.ship_state.value;
		PrintStates(document.form.ship_country.value, document.form.ship_state.value, "BillingAddress");
		document.form.zipcode.value = document.form.ship_zipcode.value;
		document.form.country.value = document.form.ship_country.value;
		document.form.phone.value = document.form.ship_phone.value;
		document.form.email.value = document.form.ship_email.value;
		
	}
}



function getUSAStates(strSelectedState, strAddressType) {
		
	var strStates = ""
	
	if (strAddressType == "ShippingAddress")
		strStates = strStates + "<SELECT id='ship_state' name='ship_state'>"
	else
		strStates = strStates + "<SELECT id='state' name='state'>"
	
	if (strSelectedState != '' && strSelectedState != undefined)
		strStates = strStates + "<OPTION VALUE='" + strSelectedState + "'>" + strSelectedState + "</OPTION>"
	
	strStates = strStates + "<OPTION VALUE='AK'>AK</OPTION>"
	strStates = strStates + "<OPTION VALUE='AL'>AL</OPTION>"
	strStates = strStates + "<OPTION VALUE='AZ'>AZ</OPTION>"
	strStates = strStates + "<OPTION VALUE='AR'>AR</OPTION>"
	strStates = strStates + "<OPTION VALUE='CA'>CA</OPTION>"
	strStates = strStates + "<OPTION VALUE='CO'>CO</OPTION>"
	strStates = strStates + "<OPTION VALUE='CT'>CT</OPTION>"
	strStates = strStates + "<OPTION VALUE='DE'>DE</OPTION>"
	strStates = strStates + "<OPTION VALUE='DC'>DC</OPTION>"
	strStates = strStates + "<OPTION VALUE='FL'>FL</OPTION>"
	strStates = strStates + "<OPTION VALUE='GA'>GA</OPTION>"
	strStates = strStates + "<OPTION VALUE='HI'>HI</OPTION>"
	strStates = strStates + "<OPTION VALUE='IN'>IN</OPTION>"
	strStates = strStates + "<OPTION VALUE='ID'>ID</OPTION>"
	strStates = strStates + "<OPTION VALUE='IL'>IL</OPTION>"
	strStates = strStates + "<OPTION VALUE='IA'>IA</OPTION>"
	strStates = strStates + "<OPTION VALUE='KS'>KS</OPTION>"
	strStates = strStates + "<OPTION VALUE='KY'>KY</OPTION>"
	strStates = strStates + "<OPTION VALUE='LA'>LA</OPTION>"
	strStates = strStates + "<OPTION VALUE='ME'>ME</OPTION>"
	strStates = strStates + "<OPTION VALUE='MD'>MD</OPTION>"
	strStates = strStates + "<OPTION VALUE='MA'>MA</OPTION>"
	strStates = strStates + "<OPTION VALUE='MI'>MI</OPTION>"
	strStates = strStates + "<OPTION VALUE='MN'>MN</OPTION>"
	strStates = strStates + "<OPTION VALUE='MS'>MS</OPTION>"
	strStates = strStates + "<OPTION VALUE='MO'>MO</OPTION>"
	strStates = strStates + "<OPTION VALUE='MT'>MT</OPTION>"
	strStates = strStates + "<OPTION VALUE='NE'>NE</OPTION>"
	strStates = strStates + "<OPTION VALUE='NV'>NV</OPTION>"
	strStates = strStates + "<OPTION VALUE='NH'>NH</OPTION>"
	strStates = strStates + "<OPTION VALUE='NJ'>NJ</OPTION>"
	strStates = strStates + "<OPTION VALUE='NM'>NM</OPTION>"
	strStates = strStates + "<OPTION VALUE='NY'>NY</OPTION>"
	strStates = strStates + "<OPTION VALUE='NC'>NC</OPTION>"
	strStates = strStates + "<OPTION VALUE='ND'>ND</OPTION>"
	strStates = strStates + "<OPTION VALUE='OH'>OH</OPTION>"
	strStates = strStates + "<OPTION VALUE='OK'>OK</OPTION>"
	strStates = strStates + "<OPTION VALUE='OR'>OR</OPTION>"
	strStates = strStates + "<OPTION VALUE='PA'>PA</OPTION>"
	strStates = strStates + "<OPTION VALUE='RI'>RI</OPTION>"
	strStates = strStates + "<OPTION VALUE='SC'>SC</OPTION>"
	strStates = strStates + "<OPTION VALUE='SD'>SD</OPTION>"
	strStates = strStates + "<OPTION VALUE='TN'>TN</OPTION>"
	strStates = strStates + "<OPTION VALUE='TX'>TX</OPTION>"
	strStates = strStates + "<OPTION VALUE='UT'>UT</OPTION>"
	strStates = strStates + "<OPTION VALUE='VT'>VT</OPTION>"
	strStates = strStates + "<OPTION VALUE='VA'>VA</OPTION>"
	strStates = strStates + "<OPTION VALUE='WA'>WA</OPTION>"
	strStates = strStates + "<OPTION VALUE='WV'>WV</OPTION>"
	strStates = strStates + "<OPTION VALUE='WI'>WI</OPTION>"
	strStates = strStates + "<OPTION VALUE='WY'>WY</OPTION>"
	strStates = strStates + "</SELECT>";
	
	return strStates;
	
}


function getCanadaStates(strSelectedState, strAddressType) {
	
	var strStates = ""
	
	if (strAddressType == "ShippingAddress")
		strStates = strStates + "<SELECT id='ship_state' name='ship_state'>"
	else
		strStates = strStates + "<SELECT id='state' name='state'>"
		
	if (strSelectedState != "" && strSelectedState != undefined)
		strStates = strStates + "<OPTION VALUE='" + strSelectedState + "'>" + strSelectedState + "</OPTION>"
		
	strStates = strStates + "<OPTION VALUE='AB'>AB</OPTION>"
	strStates = strStates + "<OPTION VALUE='BC'>BC</OPTION>"
	strStates = strStates + "<OPTION VALUE='MB'>MB</OPTION>"
	strStates = strStates + "<OPTION VALUE='NB'>NB</OPTION>"
	strStates = strStates + "<OPTION VALUE='NL'>NL</OPTION>"
	strStates = strStates + "<OPTION VALUE='NT'>NT</OPTION>"
  	strStates = strStates + "<OPTION VALUE='NS'>NS</OPTION>"
	strStates = strStates + "<OPTION VALUE='NU'>NU</OPTION>"
	strStates = strStates + "<OPTION VALUE='ON'>ON</OPTION>"
	strStates = strStates + "<OPTION VALUE='PE'>PE</OPTION>"
	strStates = strStates + "<OPTION VALUE='QC'>QC</OPTION>"
	strStates = strStates + "<OPTION VALUE='SK'>SK</OPTION>"
	strStates = strStates + "<OPTION VALUE='YT'>YT</OPTION>"
	strStates = strStates + "</SELECT>";
	
	return strStates;
}


function getOtherCountryState(strSelectedState, strAddressType) {
	
	if (strSelectedState != undefined) {
		if (strAddressType == "ShippingAddress")
			return "<input id='ship_state' value='" + strSelectedState + "' type='text' name='ship_state' size='20' maxlength='100'>"
		else
			return "<input id='state' value='" + strSelectedState + "' type='text' name='state' size='20' maxlength='100'>"
	}
	else {
		if (strAddressType == "ShippingAddress")
			return "<input id='ship_state' value='' type='text' name='ship_state' size='20' maxlength='100'>"
		else
			return "<input id='state' value='' type='text' name='state' size='20' maxlength='100'>"
	}
}


function PrintStates(strCountry, strSelectedState, strAddressType) {
	var strTempCountry = strCountry
	if (strTempCountry == "")
		strTempCountry = "US";
			
	if (strAddressType == "ShippingAddress") {
		if (strTempCountry == "US") 
			document.getElementById("ship_state_span").innerHTML = getUSAStates(strSelectedState, strAddressType)
		else if (strTempCountry == "CA") 
			document.getElementById("ship_state_span").innerHTML = getCanadaStates(strSelectedState, strAddressType)
		else 
			document.getElementById("ship_state_span").innerHTML = getOtherCountryState(strSelectedState, strAddressType)
	}
	
	else if (strAddressType == "BillingAddress") {
		if (strTempCountry == "US") 
			document.getElementById("state_span").innerHTML = getUSAStates(strSelectedState, strAddressType)
		else if (strTempCountry == "CA") 
			document.getElementById("state_span").innerHTML = getCanadaStates(strSelectedState, strAddressType)
		else 
			document.getElementById("state_span").innerHTML = getOtherCountryState(strSelectedState, strAddressType)
	}
			
}

//-->


