var customerAddresses = [ ]; $(function() { $( "#bill_address1" ).autocomplete({ minLength: 1, source: customerAddresses, select: function( event, ui ) { $( "#bill_address1" ).val( ui.item.address1); $( "#bill_address2" ).val( ui.item.address2 ); $( "#bill_city" ).val( ui.item.city ); $( "#bill_state" ).val( ui.item.state ); $( "#bill_zip" ).val( ui.item.zip ); $( "#bill_country" ).val( ui.item.country ); $( "#phone_number" ).val( ui.item.phone_number ); $( "#email_address" ).val( ui.item.email_address ); return false; } }); $( "#ship_address1" ).autocomplete({ minLength: 1, source: customerAddresses, select: function( event, ui ) { $( "#ship_address1" ).val( ui.item.address1); $( "#ship_address2" ).val( ui.item.address2 ); $( "#ship_city" ).val( ui.item.city ); $( "#ship_state" ).val( ui.item.state ); $( "#ship_zip" ).val( ui.item.zip ); $( "#ship_country" ).val( ui.item.country ); return false; } }); }); function updateCart() { document.shopping_cart.dowhat.value="update_cart"; document.shopping_cart.submit(); } function showCheckout() { $('#shopping_cart_buttons').slideUp('fast'); setTimeout("$('#checkout_form_div').slideDown('slow')",500); } function hideCheckout() { $('#checkout_form_div').slideUp('fast'); setTimeout("$('#shopping_cart_buttons').slideDown('slow')",500); } function submitCart() { $('#checkout_form *').removeClass('inputerror'); $('#shopping_cart_waiting').show(); $.post("/_appajax/shopping/ajax/manageShopping?dowhat=submit_cart", $('#checkout_form').serializeArray(), function(data) { $('#shopping_cart_waiting').hide(); eval(data); }); } var states = []; var country = []; country['bill'] = "US"; country['ship'] = "US"; var ad_types = new Array('bill','ship'); states[0] = new Array("US","AL","Alabama"); states[1] = new Array("US","AK","Alaska"); states[2] = new Array("US","AZ","Arizona"); states[3] = new Array("US","AR","Arkansas"); states[4] = new Array("US","CA","California"); states[5] = new Array("US","CO","Colorado"); states[6] = new Array("US","CT","Connecticut"); states[7] = new Array("US","DE","Delaware"); states[8] = new Array("US","DC","District of Columbia"); states[9] = new Array("US","FL","Florida"); states[10] = new Array("US","GA","Georgia"); states[11] = new Array("US","HI","Hawaii"); states[12] = new Array("US","ID","Idaho"); states[13] = new Array("US","IL","Illinois"); states[14] = new Array("US","IN","Indiana"); states[15] = new Array("US","IA","Iowa"); states[16] = new Array("US","KS","Kansas"); states[17] = new Array("US","KY","Kentucky"); states[18] = new Array("US","LA","Louisiana"); states[19] = new Array("US","ME","Maine"); states[20] = new Array("US","MD","Maryland"); states[21] = new Array("US","MA","Massachusetts"); states[22] = new Array("US","MI","Michigan"); states[23] = new Array("US","MN","Minnesota"); states[24] = new Array("US","MS","Mississippi"); states[25] = new Array("US","MO","Missouri"); states[26] = new Array("US","MT","Montana"); states[27] = new Array("US","NE","Nebraska"); states[28] = new Array("US","NV","Nevada"); states[29] = new Array("US","NH","New Hampshire"); states[30] = new Array("US","NJ","New Jersey"); states[31] = new Array("US","NM","New Mexico"); states[32] = new Array("US","NY","New York"); states[33] = new Array("US","NC","North Carolina"); states[34] = new Array("US","ND","North Dakota"); states[35] = new Array("US","OH","Ohio"); states[36] = new Array("US","OK","Oklahoma"); states[37] = new Array("US","OR","Oregon"); states[38] = new Array("US","PA","Pennsylvania"); states[39] = new Array("US","RI","Rhode Island"); states[40] = new Array("US","SC","South Carolina"); states[41] = new Array("US","SD","South Dakota"); states[42] = new Array("US","TN","Tennessee"); states[43] = new Array("US","TX","Texas"); states[44] = new Array("US","UT","Utah"); states[45] = new Array("US","VT","Vermont"); states[46] = new Array("US","VA","Virginia"); states[47] = new Array("US","WA","Washington"); states[48] = new Array("US","WV","West Virginia"); states[49] = new Array("US","WI","Wisconsin"); states[50] = new Array("US","WY","Wyoming"); states[51] = new Array("CA","AB","Alberta"); states[52] = new Array("CA","BC","British Columbia"); states[53] = new Array("CA","MB","Manitoba"); states[54] = new Array("CA","NF","Newfoundland"); states[55] = new Array("CA","NB","New Brunswick"); states[56] = new Array("CA","NS","Nova Scotia"); states[57] = new Array("CA","NT","Northwest Territories"); states[58] = new Array("CA","NU","Nunavut"); states[59] = new Array("CA","ON","Ontario"); states[60] = new Array("CA","PE","Prince Edward Island"); states[61] = new Array("CA","QC","Quebec"); states[62] = new Array("CA","SK","Saskatchewan"); states[63] = new Array("CA","YT","Yukon Territory"); function setStates() { for(i=0;i