      var xmlHttpAP;
	  var xmlHttpApSign;
	  var xmlHttpHotProduct;
	  try
        {
        // Firefox, Opera 8.0+, Safari
        xmlHttpAP=new XMLHttpRequest();
		xmlHttpApSign=new XMLHttpRequest();
		xmlHttpHotProduct=new XMLHttpRequest();
		}
      catch (e)
        {
        // Internet Explorer
        try
          {
          xmlHttpAP=new ActiveXObject("Msxml2.XMLHTTP");
		  xmlHttpApSign=new ActiveXObject("Msxml2.XMLHTTP");
		  xmlHttpHotProduct=new ActiveXObject("Msxml2.XMLHTTP");
		  }
        catch (e)
          {
          try
            {
            xmlHttpAP=new ActiveXObject("Microsoft.XMLHTTP");
			xmlHttpApSign=new ActiveXObject("Microsoft.XMLHTTP");
			xmlHttpHotProduct=new ActiveXObject("Microsoft.XMLHTTP");
			}
          catch (e)
            {
            alert("Your browser does not support AJAX!");
            }
          }
        }

    function accountManager(returnPara) {
        var requestUri = document.URL.split("/");
		hostCheck = new RegExp("[a-z0-9]+\.asianproducts\.com");
		if (hostCheck.test(requestUri[2]))
		{
			var url = requestUri[0]+"//"+requestUri[2]+"/check_account.php?"+returnPara;
			xmlHttpAP.open("GET", url, true);
			xmlHttpAP.onreadystatechange = updatePage;
			xmlHttpAP.send(null);
		}
    }

    function updatePage() {
        if (xmlHttpAP.readyState == 4) {
            var response = xmlHttpAP.responseText;
            document.getElementById("showhere").innerHTML = response;
        }
    }

    function isSign(login) {
        var requestUri = document.URL.split("/");
		var url = requestUri[0]+"//"+requestUri[2]+"/check_sign.php?login="+login;
		xmlHttpApSign.open("GET", url, true);
		xmlHttpApSign.onreadystatechange = updateSignBlock;
		xmlHttpApSign.send(null);
    }

    function updateSignBlock() {
        if (xmlHttpApSign.readyState == 4) {
            var response = xmlHttpApSign.responseText;
            document.getElementById("signbox").innerHTML = response;
        }
    }

	function hotProduct(page) {
        var requestUri = document.URL.split("/");
		var url = requestUri[0]+"//"+requestUri[2]+"/homepage_hotproducts.php?p="+page;
		xmlHttpHotProduct.open("GET", url, true);
		xmlHttpHotProduct.onreadystatechange = updateHotProduct;
		xmlHttpHotProduct.send(null);
	}

	function updateHotProduct() {
        if (xmlHttpHotProduct.readyState == 4) {
            var response = xmlHttpHotProduct.responseText;
            document.getElementById("showHotProducts").innerHTML = response;
        }
	}

function ltrim(instr){
return instr.replace(/^[\s]*/gi,"");
}

//去除字串右邊的空白虛格
function rtrim(instr){
return instr.replace(/[\s]*$/gi,"");
}

//去除字串前後的空白虛格
function trim(instr){
instr = ltrim(instr);
instr = rtrim(instr);
return instr;
}