function checkBillingInformation()
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	var return_string;
	var error_count = 0;
	
	if ($("#b_first_name").val()=="")
	{
		$("#b_first_name").attr("style","border: 1px solid red;");
		$("#b_first_name_error").fadeIn("slow");
		$("#b_first_name_error").html("Enter your first name");
		error_count++;
	} else
	{
		$("#b_first_name").attr("style","border: 1px solid #DDDDDD;");		
		$("#b_first_name_error").fadeOut("slow");
	}
	
	
	if ($("#b_last_name").val()=="")
	{
		$("#b_last_name").attr("style","border: 1px solid red;")	
		$("#b_last_name_error").fadeIn("slow");
		$("#b_last_name_error").html("Enter your last name");
		error_count++;
	} else
	{
		$("#b_last_name").attr("style","border: 1px solid #DDDDDD;");			
		$("#b_last_name_error").fadeOut("slow");
	}	
	
	
	if ($("#b_address1").val()=="")
	{
		$("#b_address1").attr("style","border: 1px solid red;")	
		$("#b_address1_error").fadeIn("slow");
		$("#b_address1_error").html("Enter your address");
		error_count++;
	} else
	{
		$("#b_address1").attr("style","border: 1px solid #DDDDDD;");				
		$("#b_address1_error").fadeOut("slow");
	}	
	
	if ($("#b_city").val()=="")
	{
		$("#b_city").attr("style","border: 1px solid red;")	
		$("#b_city_error").fadeIn("slow");
		$("#b_city_error").html("Enter your city");
		error_count++;
	} else
	{
		$("#b_city").attr("style","border: 1px solid #DDDDDD;");					
		$("#b_city_error").fadeOut("slow");
	}	

	if ($("#b_state").val()=="")
	{
		$("#b_state").attr("style","border: 1px solid red;")	
		$("#b_state_error").fadeIn("slow");
		$("#b_state_error").html("Enter your state");
		error_count++;
	} else
	{
		$("#b_state").attr("style","border: 1px solid #DDDDDD;");						
		$("#b_state_error").fadeOut("slow");
	}	

	if ($("#b_zip").val()=="")
	{
		$("#b_zip").attr("style","border: 1px solid red;")	
		$("#b_zip_error").fadeIn("slow");
		$("#b_zip_error").html("Enter your zip code");
		error_count++;
	} else
	{
		$("#b_zip").attr("style","border: 1px solid #DDDDDD;");
		$("#b_zip_error").fadeOut("slow");
	}
	
	if ($("#b_phone1").val()=="" || $("#b_phone2").val()=="" || $("#b_phone3").val()=="")
	{
		if ($("#b_phone2").val()=="")
		{	
			$("#b_phone2").attr("style","border: 1px solid red;")	
		}
		if ($("#b_phone3").val()=="")
		{	
			$("#b_phone3").attr("style","border: 1px solid red;")	
		}	
		if ($("#b_phone1").val()=="")
		{	
			$("#b_phone1").attr("style","border: 1px solid red;")	
		}	
	
		$("#b_phone_error").fadeIn("slow");
		$("#b_phone_error").html("Enter your phone number");
		error_count++;
	} else
	{
		$("#b_phone1").attr("style","border: 1px solid #DDDDDD;");	
		$("#b_phone2").attr("style","border: 1px solid #DDDDDD;");		
		$("#b_phone3").attr("style","border: 1px solid #DDDDDD;");
		$("#b_phone_error").fadeOut("slow");
	}	
	
	var email_value = $("#customer_email").val();
	var email_pass = false;
	if (email_value.indexOf("@")>-1 && email_value.indexOf(".")>-1)
	{
		email_pass = true;
	} else 
	{
		email_pass = false;
	}
	
	if ($("#customer_email").val()=="" || !email_pass)
	{
		$("#customer_email").attr("style","border: 1px solid red;")
		$("#customer_email_error").fadeIn("slow");
		$("#customer_email_error").html("Please enter a valid Email.");
		error_count++;
	} else 
	{
		$("#customer_email_error").fadeOut("slow");
	}	

	if ($("#b_cc_name").val()=="")
	{
		$("#b_cc_name").attr("style","border: 1px solid red;")		
		$("#b_cc_name_error").fadeIn("slow");
		$("#b_cc_name_error").html("Enter the name on your card");
		error_count++;
	} else
	{
		$("#b_cc_name").attr("style","border: 1px solid #DDDDDD;");	
		$("#b_cc_name_error").fadeOut("slow");
	}	
	
	if ($("#b_cc_type").val()=="")
	{
		$("#b_cc_type").attr("style","border: 1px solid red;")		
		$("#b_cc_type_error").fadeIn("slow");
		$("#b_cc_type_error").html("Choose a credit card type");
		error_count++;
	} else
	{
		$("#b_cc_type").attr("style","border: 1px solid #DDDDDD;");
		$("#b_cc_type_error").fadeOut("slow");
	}	
	
	var cc = $("#b_cc_number").val();
	
	if ($("#b_cc_number").val()=="" || cc.length <"15")
	{
		$("#b_cc_number").attr("style","border: 1px solid red;")		
		$("#b_cc_number_error").fadeIn("slow");
		$("#b_cc_number_error").html("Please enter a valid credit card number");
		error_count++;
	} else
	{
		$("#b_cc_number").attr("style","border: 1px solid #DDDDDD;");	
		$("#b_cc_number_error").fadeOut("slow");
	}	
	
	if ($("#cc_exp_m").val()=="" )
	{
		$("#cc_exp_m").attr("style","border: 1px solid red;")		
		$("#b_cc_exp_error").fadeIn("slow");
		$("#b_cc_exp_error").html("Please enter your credtit card expiration");
		error_count++;
	} else
	{
		$("#cc_exp_m").attr("style","border: 1px solid #DDDDDD;");
		$("#b_cc_exp_error").fadeOut("slow");
	}	
	
	if ($("#cc_exp_y").val()=="" )
	{
		$("#cc_exp_y").attr("style","border: 1px solid red;")		
		$("#b_cc_exp_error").fadeIn("slow");
		$("#b_cc_exp_error").html("Please enter your credtit card expiration");
		error_count++;
	} else
	{
		$("#cc_exp_y").attr("style","border: 1px solid #DDDDDD;");
		$("#b_cc_exp_error").fadeOut("slow");
	}	


	
	
	if (error_count>0)
		return ;
	else
		xProcessCheckoutBilling();
}



function checkShippingInformation()
{

	var ajaxRequest;  // The variable that makes Ajax possible!
	var return_string;
	var error_count = 0;

	if ($("#first_name").val()=="")
	{
		$("#first_name").attr("style","border: 1px solid red;");
		$("#first_name_error").fadeIn("slow");
		$("#first_name_error").html("Enter your first name");
		error_count++;
	} else
	{
		$("#first_name").attr("style","border: 1px solid #DDDDDD;");		
		$("#first_name_error").fadeOut("slow");
	}
	
	
	if ($("#last_name").val()=="")
	{
		$("#last_name").attr("style","border: 1px solid red;")	
		$("#last_name_error").fadeIn("slow");
		$("#last_name_error").html("Enter your last name");
		error_count++;
	} else
	{
		$("#last_name").attr("style","border: 1px solid #DDDDDD;");			
		$("#last_name_error").fadeOut("slow");
	}	
	
	
	if ($("#address").val()=="")
	{
		$("#address").attr("style","border: 1px solid red;")	
		$("#address_error").fadeIn("slow");
		$("#address_error").html("Enter your address");
		error_count++;
	} else
	{
		$("#address").attr("style","border: 1px solid #DDDDDD;");				
		$("#address_error").fadeOut("slow");
	}	
	
	if ($("#city").val()=="")
	{
		$("#city").attr("style","border: 1px solid red;")	
		$("#city_error").fadeIn("slow");
		$("#city_error").html("Enter your city");
		error_count++;
	} else
	{
		$("#city").attr("style","border: 1px solid #DDDDDD;");					
		$("#city_error").fadeOut("slow");
	}	

	if ($("#state").val()=="")
	{
		$("#state").attr("style","border: 1px solid red;")	
		$("#state_error").fadeIn("slow");
		$("#state_error").html("Enter your state");
		error_count++;
	} else
	{
		$("#state").attr("style","border: 1px solid #DDDDDD;");						
		$("#state_error").fadeOut("slow");
	}	

	if ($("#zip").val()=="")
	{
		$("#zip").attr("style","border: 1px solid red;")	
		$("#zip_error").fadeIn("slow");
		$("#zip_error").html("Enter your zip code");
		error_count++;
	} else
	{
		$("#zip").attr("style","border: 1px solid #DDDDDD;");
	}
	
	
	/*var radios = document.getElementsByName("ups_rate");
	var radio_pass = "no";
	
	for (x=0;x<radios.length;x++)
	{
		if (radios[x].checked) radio_pass = "yes";
	}
	
	if (radio_pass =="no")
	{
		error_count++;
		$("#shipping_click_error").fadeIn("slow");
	} else
	{
			$("#shipping_click_error").fadeOut("slow");
	}*/
	

	if (error_count>0)
		return ;
	else
		xProcessCheckShipping();

}

