function updateCart() {
   $('formAction').value = 'updateCart';
   $('mainForm').submit();
}

function copyShippingToBilling() {
  $('bill_name_first').value = $F('ship_name_first');
  $('bill_name_last').value = $F('ship_name_last');
  $('bill_company').value = $F('ship_company');
  $('bill_address1').value = $F('ship_address1');
  $('bill_address2').value = $F('ship_address2');
  $('bill_city').value = $F('ship_city');
  $('bill_state').value = $F('ship_state');
  $('bill_postal_code').value = $F('ship_postal_code');
  $('bill_country').value = $F('ship_country');
  $('bill_phone').value = $F('ship_phone');
  $('bill_email').value = $F('email');
  $('bill_fax').value = $F('ship_fax');
}




              	
function mySubmitForm(form)
{
	if ( ValidateForm(form) == true ){
		form.submit()
	}
}
	
	
function ValidateForm(form)
{
	
	
	
	
	if(form.ship_name_first.value == '') 
	{ 
	  alert('You have not entered a shipping First Name.') 
	  form.ship_name_first.focus(); 
	  return false; 
	}
	
	if(form.ship_name_last.value == '') 
	{ 
	  alert('You have not entered a shipping Last Name.') 
	  form.ship_name_last.focus(); 
	  return false; 
	} 
	
	if( form.ship_address1.value == '') 
	{ 
	  alert('You have not entered a shipping Address.') 
	  form.ship_address1.focus(); 
	  return false; 
	} 
	
	if( form.ship_city.value == '') 
	{ 
	  alert('You have not entered a shipping City.') 
	  form.ship_city.focus(); 
	  return false; 
	} 
	
	if( form.ship_state.value == '') 
	{ 
	  alert('You have not entered a shipping State.') 
	  form.ship_state.focus(); 
	  return false; 
	} 
	
	if( form.ship_postal_code.value == '') 
	{ 
	  alert('You have not entered a shipping Postal Code.') 
	  form.ship_postal_code.focus(); 
	  return false; 
	} 
	
	
	
	if( form.ship_phone.value == '') 
	{ 
	  alert('You have not entered a shipping Phone Number.') 
	  form.ship_phone.focus(); 
	  return false; 
	}
	

	
		
	
	
	
	
	
	
	if( form.bill_name_first.value == '') 
	{ 
	  alert('You have not entered a billing First Name.') 
	  form.bill_name_first.focus(); 
	  return false; 
	}
	
	if( form.bill_name_last.value == '') 
	{ 
	  alert('You have not entered a billing Last Name.') 
	  form.bill_name_last.focus(); 
	  return false; 
	} 
	
	if( form.bill_address1.value == '') 
	{ 
	  alert('You have not entered a billing Address.') 
	  form.bill_address1.focus(); 
	  return false; 
	} 
	
	if( form.bill_city.value == '') 
	{ 
	  alert('You have not entered a billing City.') 
	  form.bill_city.focus(); 
	  return false; 
	} 
	
	if( form.bill_state.value == '') 
	{ 
	  alert('You have not entered a billing State.') 
	  form.bill_state.focus(); 
	  return false; 
	} 
	
	if( form.bill_postal_code.value == '') 
	{ 
	  alert('You have not entered a billing Postal Code.') 
	  form.bill_postal_code.focus(); 
	  return false; 
	} 
	
	
	if( form.bill_phone.value == '') 
	{ 
	  alert('You have not entered a billing Phone Number.') 
	  form.bill_phone.focus(); 
	  return false; 
	}
	
	
	
	if( form.non48ShippingFlag.value == 1) 
	{ 
		if( form.bill_email.value == "") 
		{
	  		alert('You must provide a billing email address.') 
	  		form.bill_email.focus(); 
	  		return false; 
		}
		
		if( form.email.value == "") 
		{
	  		alert('You must provide a shipping email address.') 
	  		form.email.focus(); 
	  		return false; 
		}
	}
	
	
	
	return true;
	
} 
