/**************************************************
Form Validation
**************************************************/
function checkrequired(which) {
var pass=true;
if (document.images) {
	for (i=0;i<which.length;i++) {
		var tempobj=which.elements[i];
		if (tempobj.name.substring(0,8)=="required") {
			if (((tempobj.type=="text"||tempobj.type=="textarea")&&
				tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
				tempobj.selectedIndex==0)) {
				pass=false;
				break;
			 }
		  }
	   }
	   
	}
	if (!pass) {
	shortFieldName=tempobj.name.substring(8,30).toUpperCase();
	alert("Please make sure all the fields marked as required were properly completed.\nUse the 'Back' button to complete the required fields");
	return false;
	} else {
		if(document.order.ShippingSameAsBilling.checked) {
			document.order.required_shipping_address_1.value=document.order.required_billing_address_1.value;
			document.order.shipping_address_2.value=document.order.billing_address_2.value;
			document.order.required_shipping_country.value=document.order.required_billing_country.value;
			document.order.required_shipping_city.value=document.order.required_billing_city.value;
			document.order.required_shipping_state.value=document.order.required_billing_state.value;
			document.order.required_shipping_zip.value=document.order.required_billing_zip.value;
		} 
		return true;
	}
}