	function handleDivTag(divtag){
	   var divtag;
	   return divtag;
	}
	
   function createRequestObject() {
        var req;
        if(window.XMLHttpRequest){
            req = new XMLHttpRequest();
        } else if(window.ActiveXObject) {
            req = new ActiveXObject("Microsoft.XMLHTTP");
        } else {
            alert("There was a problem creating the XMLHttpRequest object");
        }
        return req;
    }
// Make the XMLHttpRequest object
    var http_account = createRequestObject();
	var divhandler_account = new handleDivTag(null);
	function sendRequest_account(more,divtag) {
		if (divtag == "check_email") {
			//document.getElementById(divtag).innerHTML = "Loading...";
			http_account.open("get", "validate_email.php?"+more);
		}
		if (divtag  == "shipping_div") {
			document.getElementById(divtag).innerHTML = "Loading...";
			http_account.open("get", "shipping_forms.php?"+more);
		}
		if (divtag  == "view_orders") {
			document.getElementById(divtag).innerHTML = "Loading...";
			http_account.open("get", "view_orders.php?"+more);
		}
		if (divtag  == "ajax_account") {
			document.getElementById(divtag).innerHTML = "Loading...";
			http_account.open("get", "mini_account.php?"+more);
		}
        http_account.onreadystatechange = handleResponse_account;
		divhandler_account.divtag = divtag;
        http_account.send(null);
    }

    function handleResponse_account() {
		//alert("in handle: "+http.readyState);
        if(http_account.readyState == 4 && http.status == 200){
            // Text returned FROM PHP script
            var response = http_account.responseText;
            if(response) {
                document.getElementById(divhandler_account.divtag).innerHTML = response;
				if (response == "&nbsp;not valid" && divhandler_account.divtag == "check_email") {
					document.getElementById("submit").disabled = true;
				}
				if (response == "&nbsp;" && divhandler_account.divtag == "check_email") {
					document.getElementById("submit").disabled = false;
				}
            }
        }
    }