/**
 * @author Lee Quarella
 */

function validateCheckOutForm(){
	if ($('cardNumber').value == "" || $('cardNumber').value.length < 5){
       	 alert("Please enter a valid credit card number.")
       	 return false;
        }

		if($('csv').value == ""){
			alert("Please enter your credit card's 3 digit CSV code.  This code is found on the back of your card, usually next to the signature box.")
       	    return false;
		}
		
		if($('email').value == ""){
			alert("Please enter your email address.")
       	    return false;
		}
		
		if($('phone').value ==""){
			alert("Please enter your phone number.")
       	    return false;
		}
		
		if ($('shipping_name').value == "" || $('shipping_address').value == "" || $('shipping_city').value == "" || $('shipping_state').value == "" || $('shipping_zip').value == ""){
       	 alert("Please enter your complete shipping address.")
       	 return false;
        }
		
		if ($('billing_name').value == "" || $('billing_address').value == "" || $('billing_city').value == "" || $('billing_state').value == "" || $('billing_zip').value == ""){
       	 alert("Please enter your complete billing address.")
       	 return false;
        }
		if ($('expMonth').value == "na" || $('expYear').value == "na"){
			alert("Please enter a valid experation date for your credit card.")
       	 	return false;
		}
		return true;
}
	 
function validateCheckOutForm2(){
		if ($('terms').checked == false){
       	 alert("Please read and acknowledge agreement with terms and conditions of sale.")
       	 return false;
        }
		return true;
}
	 
	 
	 
function sameAsShipping(){
	$('billing_name').value = $('shipping_name').value 
	$('billing_business_name').value = $('shipping_business_name').value 
	$('billing_address').value = $('shipping_address').value
	$('billing_address2').value = $('shipping_address2').value
	$('billing_city').value = $('shipping_city').value
	$('billing_state').value = $('shipping_state').value
	$('billing_zip').value = $('shipping_zip').value 
 }