function CheckAddToCart()
{
	var stext = document.getElementById("store_status_text");
	if (document.getElementById("quantity").value=="" || !IsNumeric(document.getElementById("quantity").value))
	{
		stext.innerHTML = "Please enter a valid quantity to continue.";
		document.getElementById("store_status_window").style.display = "none";
		
		document.getElementById("store_status_window").style.top = (current_mouse_y-50)+"px";
		document.getElementById("store_status_window").style.left = (current_mouse_x+60)+"px";
		$("#store_status_window").fadeIn("slow");   
		document.getElementById("quantity").focus();
		StatusCloseInit();
		return false;
	} else
	{
		return true;
	}
}

var status_timer;
function StatusCloseInit()
{
	//setTimeout("StatusClose()",2200);
}

function StatusClose()
{
	$("#store_status_window").fadeOut("slow");
}


function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
}



function CalculateOptionPrice(pid,poid)
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	var return_string;
	
	if (poid!="")
	{
		//MouseCoords();
		
		try{
			// Opera 8.0+, Firefox, Safari
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// Internet Explorer Browsers
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// Something went wrong
					alert("Your browser broke!");
					return false;
				}
			}
		}
		// Create a function that will receive data sent from the server
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4)
			{
				
				document.getElementById("product_price").innerHTML = ajaxRequest.responseText;
			}
		}
		var queryString = "?pid="+pid+"&poid="+poid;
		ajaxRequest.open("GET", "/global/ajax/cart_grab_product_option_price.php" + queryString, true);
		ajaxRequest.send(null); 
	}
}



var current_mouse_x;
var current_mouse_y;
	var IE = document.all?true:false;
	if (!IE) document.captureEvents(Event.MOUSEMOVE)
	document.onmousemove = getMouseXY;
	var tempX = 0;
	var tempY = 0;
	function getMouseXY(e) {
	if (IE)
	{ // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft;
		tempY = event.clientY + document.body.scrollTop;
	}
	else
	{  // grab the x-y pos.s if browser is NS
		tempX = e.pageX;
		tempY = e.pageY;
	}  
	if (tempX < 0){tempX = 0;}
	if (tempY < 0){tempY = 0;}  
	current_mouse_x = tempX;
	current_mouse_y = tempY;
	return true;
	}
	
	
	
	
function UpdateQuantity(line_item)
{

	
	if (document.getElementById("quantity_"+line_item).value=="" || !IsNumeric(document.getElementById("quantity_"+line_item).value))
	{
		document.getElementById("quantity_"+line_item).value = "";
		document.getElementById("store_status_text").innerHTML = "Please enter a valid quantity to continue.";
		document.getElementById("store_status_window").style.display = "none";
		
		document.getElementById("store_status_window").style.top = (current_mouse_y-50)+"px";
		document.getElementById("store_status_window").style.left = (current_mouse_x+60)+"px";
		$("#store_status_window").fadeIn("slow");   
		document.getElementById("quantity_"+line_item).focus();
		StatusCloseInit();
		return false;
	}
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	var return_string;
	
	//MouseCoords();
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4)
		{
			document.getElementById("store_status_window").style.top = current_mouse_y+"px";
			document.getElementById("store_status_window").style.left = current_mouse_x+"px";
			$("#store_status_window").fadeIn("slow");
			document.getElementById("store_status_text").innerHTML = "Quantity Was Updated.";
			StatusCloseInit();
			//document.getElementById("price_"+line_item).innerHTML = ajaxRequest.responseText;
			GetCartSubTotal();
			
			GetCartGrandTotal();
			GetCartLineItem(line_item);
		}
	}
	var queryString = "?q="+document.getElementById("quantity_"+line_item).value;
	queryString+="&li="+line_item;
	
	ajaxRequest.open("GET", "/global/ajax/cart_update_quantity.php" + queryString, true);
	ajaxRequest.send(null); 
}
 
 
 
 
 
function GetCartLineItem(line_item)
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	var return_string;
	
	//MouseCoords();
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4)
		{
			
			document.getElementById("price_"+line_item).innerHTML = ajaxRequest.responseText;
		}
	}
	var queryString = "?copid="+line_item;
	ajaxRequest.open("GET", "/global/ajax/cart_grab_lineitem_total.php" + queryString, true);
	ajaxRequest.send(null); 
}

 
 
function GetCartSubTotal()
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	var return_string;
	
	//MouseCoords();
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4)
		{
			
			document.getElementById("sub_total").innerHTML = ajaxRequest.responseText;
		}
	}
	var queryString = "";
	ajaxRequest.open("GET", "/global/ajax/cart_grab_subtotal.php" + queryString, true);
	ajaxRequest.send(null); 
}




function GetCartGrandTotal()
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	var return_string;
	
	//MouseCoords();
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4)
		{
			
			document.getElementById("grand_total").innerHTML = ajaxRequest.responseText;
		}
	}
	var queryString = "";
	ajaxRequest.open("GET", "/global/ajax/cart_grab_grandtotal.php" + queryString, true);
	ajaxRequest.send(null); 
}	



function GetCartTaxTotal()
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	var return_string;
	
	//MouseCoords();
	
	
	var s = document.getElementById("b_state").value;
	
	
	if (s=="")
	{
		
		document.getElementById("tax_total").innerHTML = "TBD";
	} else 
	{
	
		try{
			// Opera 8.0+, Firefox, Safari
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// Internet Explorer Browsers
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// Something went wrong
					alert("Your browser broke!");
					return false;
				}
			}
		}
		// Create a function that will receive data sent from the server
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4)
			{
				document.getElementById("tax_total").innerHTML = ajaxRequest.responseText;
				GetCartGrandTotal();
			}
		}
		var queryString = "?s="+escape(s);
		ajaxRequest.open("GET", "/global/ajax/cart_grab_tax_total.php" + queryString, true);
		ajaxRequest.send(null); 
	}
}	





function DeleteCartItemConfirm(line_item)
{
	var ques;
	ques = "Delete this item?<br /><a href=\"javascript: void(0);\" onclick=\"DeleteCartItem("+line_item+")\" style=\"font-size: 10pt;\">YES</a>";
	ques += "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript: void(0);\" onclick=\"StatusClose()\" style=\"font-size: 10pt;\">NO</a>";
	
	document.getElementById("store_status_window").style.top = current_mouse_y+"px";
	document.getElementById("store_status_window").style.left = current_mouse_x+"px";
	document.getElementById("store_status_text").innerHTML = ques;
	$("#store_status_window").fadeIn("slow");
	
}


function DeleteCartItem(line_item)
{
	var line_row = document.getElementById("row_"+line_item);
	
	if (line_row)
	{
		
	
	
		var ajaxRequest;  // The variable that makes Ajax possible!
		var return_string;
		
		//MouseCoords();
		
		try{
			// Opera 8.0+, Firefox, Safari
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// Internet Explorer Browsers
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// Something went wrong
					alert("Your browser broke!");
					return false;
				}
			}
		}
		// Create a function that will receive data sent from the server
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4)
			{
				$("#row_"+line_item).fadeOut("slow");
				StatusClose();
				GetCartSubTotal();
				GetCartGrandTotal();
			}
		}
		var queryString = "?li="+line_item;
		ajaxRequest.open("GET", "/global/ajax/cart_remove_item.php" + queryString, true);
		ajaxRequest.send(null); 
	}
}
	

	
function ShowAccountType(cur)
{
	var eles = document.getElementsByName("checkout_type");
	
	document.getElementById("login_form").style.display = "none";
	document.getElementById("register_form").style.display = "none";
	document.getElementById("guest_form").style.display = "none";
	
	if (eles[0].checked) $("#login_form").fadeIn("slow");
	if (eles[1].checked) $("#register_form").fadeIn("slow");
	if (eles[2].checked) $("#guest_form").fadeIn("slow");
		
}


function CheckStoreLogin()
{
	if ( document.getElementById("login_email").value=="" || 
			document.getElementById("login_pw").value=="" )
	{
		
		document.getElementById("store_status_window").style.top = current_mouse_y+"px";
		document.getElementById("store_status_window").style.left = current_mouse_x+"px";
		document.getElementById("store_status_text").innerHTML = "Email and Password are required.";
		$("#store_status_window").fadeIn("slow");
		
		StatusCloseInit();
		return false;
	} else
	{
		return true;
	}
			
		
}




function CheckStoreRegister()
{
	if ( document.getElementById("first_name").value=="" || 
			document.getElementById("last_name").value=="" ||
			document.getElementById("email").value=="" ||
			document.getElementById("password").value=="")
	{
		
		document.getElementById("store_status_window").style.top = current_mouse_y+"px";
		document.getElementById("store_status_window").style.left = current_mouse_x+"px";
		document.getElementById("store_status_text").innerHTML = "All Fields are Required to Register.";
		$("#store_status_window").fadeIn("slow");
		
		StatusCloseInit();
		return false;
	} else
	{
		return true;
	}
			
		
}



function CheckStoreShipping()
{
	if ( document.getElementById("first_name").value=="" || 
			document.getElementById("last_name").value=="" ||
			document.getElementById("address").value=="" ||
			document.getElementById("city").value=="" ||
			document.getElementById("state").value=="" ||
			document.getElementById("zip").value=="" ||
			document.getElementById("phone1").value=="" ||
			document.getElementById("phone2").value=="" ||
			document.getElementById("phone3").value=="")
	{
		
		document.getElementById("store_status_window").style.top = current_mouse_y+"px";
		document.getElementById("store_status_window").style.left = current_mouse_x+"px";
		document.getElementById("store_status_text").innerHTML = "All * Fields are Required.";
		$("#store_status_window").fadeIn("slow");
		
		StatusCloseInit();
		return false;
	} else
	{
		return true;
	}
}



function update_costs(ele, stype)
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	var return_string;
	
	//MouseCoords();
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4)
		{
			document.getElementById("shipping_total").innerHTML = ajaxRequest.responseText;
			GetCartGrandTotal();
		}
	}
	var queryString = "?sc="+ele.value+"&st="+stype;
	ajaxRequest.open("GET", "/global/ajax/cart_update_shipping.php" + queryString, true);
	ajaxRequest.send(null); 
}



function ShippingRates(r)
{
	
	if (r=="rates")
	{
		if (document.getElementById("first_name").value=="" ||
			document.getElementById("last_name").value=="" ||
			document.getElementById("address").value=="" ||
			document.getElementById("city").value=="" ||
			document.getElementById("state").value=="" ||
			document.getElementById("zip").value=="")
		{
			
				document.getElementById("store_status_window").style.top = (current_mouse_y-100)+"px";
			document.getElementById("store_status_window").style.left = (current_mouse_x-120)+"px";
			document.getElementById("store_status_text").innerHTML = "Please enter your Shipping Information to continue.";
			$("#store_status_window").fadeIn("slow");
			
			StatusCloseInit();
			
			return;
		}
	}		
	
	document.getElementById("shipping_rates").innerHTML = "<p align=\"center\"><img src=\"/global/images/ajax_loading.gif\" /></p>";
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	var return_string;
	
	
	
	var c = escape(document.getElementById("city").value);
	var s= escape(document.getElementById("state").value);
	var z = escape(document.getElementById("zip").value);
	
	//MouseCoords();
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4)
		{
			document.getElementById("shipping_rates").innerHTML = ajaxRequest.responseText;
			if (r=="rates")
			{
				var sts = document.getElementsByName("UPSservice[]");
				
			}
		}
	}
	
	var queryString = "?show="+r+"&c="+c+"&s="+s+"&z="+z;
	ajaxRequest.open("GET", "/global/ajax/cart_shipping_method.php" + queryString, true);
	ajaxRequest.send(null); 
}







function CheckStoreShippingMethod()
{
	var ra = document.getElementsByName("ups_rate");
	var chk = false;
	
	for (x=0;x<ra.length;x++) if (ra[x].checked) chk = true;
	
	if (chk==false)
	{
		document.getElementById("store_status_window").style.top = current_mouse_y+"px";
		document.getElementById("store_status_window").style.left = current_mouse_x+"px";
		document.getElementById("store_status_text").innerHTML = "Choose a Shipping Method to Continue.";
		$("#store_status_window").fadeIn("slow");
		
		StatusCloseInit();
		return false;
	} else 
	{
		return true;
	}
}


function CheckStoreBilling()
{
	if ( document.getElementById("first_name").value=="" || 
			document.getElementById("last_name").value=="" ||
			document.getElementById("address").value=="" ||
			document.getElementById("city").value=="" ||
			document.getElementById("state").value=="" ||
			document.getElementById("zip").value=="" ||
			document.getElementById("phone1").value=="" ||
			document.getElementById("phone2").value=="" ||
			document.getElementById("phone3").value==""  ||
			document.getElementById("cc_type").value==""  ||
			document.getElementById("cc_number").value==""  ||
			document.getElementById("cc_exp_m").value=="" ||
			document.getElementById("cc_exp_y").value=="")
	{
		
		document.getElementById("store_status_window").style.top = (current_mouse_y-100)+"px";
		document.getElementById("store_status_window").style.left = (current_mouse_x-120)+"px";
		document.getElementById("store_status_text").innerHTML = "All Fields * Fields are Required.";
		$("#store_status_window").fadeIn("slow");
		
		StatusCloseInit();
		return false;
	} else
	{
		return true;
	}
}



function CheckCheckout()
{

	//var ra = document.getElementsByName("ups_rate");
	var chk = false;
	var account_pass = true;
	var country_pass = true;
	
	var error_text = "All * Fields are Required.";
	if (document.getElementById("terms_agree").checked) 
		chk = true;
	else
		error_text += " You Must Agree to the Terms & Conditions.";
	
	
	//account creation
	if (document.getElementById("email_address"))
	{
		var account_pass = false;
		var em = document.getElementById("email_address").value;
		if (em.indexOf("@")>-1 && em.indexOf(".")>-1)
		{
			account_pass = true;
		}
		
		if (account_pass == true)
		{
			if (document.getElementById("password").value!="" && document.getElementById("password2").value!="" &&
				document.getElementById("password").value==document.getElementById("password2").value)
			{
				account_pass = true;
			}  else 
			{
				account_pass = false;
			}
		}
	}
	
	
	if (document.getElementById("b_country").value=="usa" || document.getElementById("b_country").value=="canada")
	{
		if (document.getElementById("b_state").value=="")
		{
			country_pass = false;
		} else 
		{
			country_pass = true;
		}
	} else 
	{
		if (document.getElementById("b_country").value=="")
		{
			country_pass = false;
		} else 
		{
			country_pass = true;
		}
		
	}
	
	/*
	if(country_pass)
		alert('country passed');
	else
		alert('country failed');
	
	if (chk)
		alert("check pass");
	else
		alert("check failed");
		
		if (account_pass)
		alert("accountpass");
	else
		alert("account failed");
	
	alert("1) "+document.getElementById("b_first_name").value+"\n\n2) "+document.getElementById("b_last_name").value+"\n\n3) "+document.getElementById("b_address1").value+"\n\n4) "+document.getElementById("b_city").value+"\n\n5) "+document.getElementById("b_phone1").value+"\n\n6) "+document.getElementById("b_phone2").value+"\n\n7) "+document.getElementById("b_phone3").value+"\n\n8) "+document.getElementById("b_cc_type").value+"\n\n9) "+document.getElementById("b_cc_name").value+"\n\n10) "+document.getElementById("b_cc_number").value+"\n\n11) "+document.getElementById("cc_exp_m").value+"\n\n12) "+document.getElementById("cc_exp_y").value);
	*/
	if (document.getElementById("b_first_name").value=="" ||
			document.getElementById("b_last_name").value=="" ||
			document.getElementById("b_address1").value=="" ||
			document.getElementById("b_city").value=="" ||
			document.getElementById("b_phone1").value=="" |
			document.getElementById("b_phone2").value=="" ||
			document.getElementById("b_phone3").value== "" ||
			document.getElementById("b_cc_type").value=="" ||
			document.getElementById("b_cc_name").value=="" ||
			document.getElementById("b_cc_number").value=="" ||
			document.getElementById("cc_exp_m").value=="" ||
			document.getElementById("cc_exp_y").value=="" ||
			chk==false || account_pass==false ||country_pass==false)
	{
		document.getElementById("store_status_window").style.display="none";
		document.getElementById("store_status_window").style.top = (current_mouse_y-100)+"px";
		document.getElementById("store_status_window").style.left = (current_mouse_x-280)+"px";
		document.getElementById("store_status_text").innerHTML = error_text;
		$("#store_status_window").fadeIn("slow");
		
		StatusCloseInit();
		return false;
	} else {
		return true;
	}
	
}


function NewShippingAddress()
{
	if (document.checkout_order.new_address.checked)
	{
		document.getElementById("first_name").disabled = false;
		document.getElementById("last_name").disabled = false;
		document.getElementById("address").disabled = false;
		document.getElementById("address2").disabled = false;
		document.getElementById("city").disabled = false;
		document.getElementById("state").disabled = false;
		document.getElementById("zip").disabled = false;
	} else 
	{
		document.getElementById("first_name").disabled = true;
		document.getElementById("last_name").disabled = true;
		document.getElementById("address").disabled = true;
		document.getElementById("address2").disabled = true;
		document.getElementById("city").disabled = true;
		document.getElementById("state").disabled = true;
		document.getElementById("zip").disabled = true;
	}
	
	
	
	
}



function SameAsBilling()
{
	if (document.checkout_order.new_address.checked)
	{
		document.getElementById("first_name").value = document.getElementById("b_first_name").value;
		document.getElementById("last_name").value = document.getElementById("b_last_name").value;
		document.getElementById("address").value = document.getElementById("b_address1").value;
		document.getElementById("address2").value = document.getElementById("b_address2").value;
		document.getElementById("city").value = document.getElementById("b_city").value;
		document.getElementById("state").value = document.getElementById("b_state").value;
		document.getElementById("zip").value = document.getElementById("b_zip").value;
	}
}



function PlaceOrder()
{
	document.getElementById("submit_button").value = "Placing Order ...";
	document.getElementById("submit_button").disabled = true;
}


function PrintOrder(oid)
{
	window.open ("/order_print.php?oid="+oid,"thl_receipt","location=0,status=0,scrollbars=1,width=820,height=620");
}


function FigureDrops(val)
{
	if (val=="other" || val=="canada")
	{
		if (val=="other")
			document.getElementById("b_state").value = "OTHER";
		else 
			document.getElementById("b_state").value = "";
		
		GetCartTaxTotal();
	}
	
	if (val=="other")
	{
		document.getElementById("state_display").style.display = "none";
		
	} else 
	{
		document.getElementById("state_display").style.display = "";
		
		var ajaxRequest;  // The variable that makes Ajax possible!
		var return_string;
		
		//MouseCoords();
		
		try{
			// Opera 8.0+, Firefox, Safari
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// Internet Explorer Browsers
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// Something went wrong
					alert("Your browser broke!");
					return false;
				}
			}
		}
		// Create a function that will receive data sent from the server
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4)
			{
				document.getElementById("state_province_options").innerHTML = ajaxRequest.responseText;
			}
		}
		var queryString = "?c="+val;
		ajaxRequest.open("GET", "/global/ajax/cart_grab_state_prov.php" + queryString, true);
		ajaxRequest.send(null); 
	}
}