$(document).ready(function() {
	// copy billing to shipping
	$('input#copyinfo').click(function() {
	     // If checked
	     if ($(this).is(":checked")) {
	         //for each input field
	         $('input.shipinfo', ':visible', document.body).each(function(i) {
	
	             //copy the values from the billing inputs
	             //to the equiv inputs on the shipping inputs
	             $(this).val($("input.billinfo").eq(i).val());
	         });
	         
	         //won't work on drop downs, so get those values
	         var billingState = $("select#state").val();
	         // special for the select
	         $('select#shipping_state option[value=' + billingState + ']').attr('selected', 'selected');
	
	     }
	     else {
	         //for each input field
	         $('input.shipinfo', ':visible', document.body).each(function(i) {
	             // put default values back
	             $(this).val($(this)[0].defaultValue);
	         });
	         // special for the select
	         $('select#shipping_state option[value=""]').attr('selected', 'selected');
	
	     } // end if else
	
	}); // end copy bill to ship function
}); // end ready
