// JavaScript Document
var xmlHttp
function showCustomer_coun(str,str1,p_coun,action) //修改商品订购数量
{ 
var url="getOrder.asp?sid=" + Math.random() + "&p_size=" + str + "&p_id=" + str1 + "&p_coun=" + TestRgexp(p_coun) + "&action=" + action
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}
function showCustomer(str,str1,p_coun,action) //修改商品尺寸
{ 
var url="getOrder.asp?sid=" + Math.random() + "&p_size=" + str + "&p_id=" + str1 + "&p_coun=" + p_coun + "&action=" + action
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}
function showRegion_F(str,action) //通过国家求运费
{ 
var url="getOrder.asp?sid=" + Math.random() + "&Country=" + str + "&action=" + action
xmlHttp=GetXmlHttpObject(stateRegion)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}
function showmember(firstName,lastname,Address,City,State,Postalcode,Phone,message) //修改资料
{ 
var url="getOrder.asp?sid=" + Math.random() + "&firstName=" + firstName + "&lastname=" + lastname + "&Address=" + Address + "&City=" + City + "&State=" + State + "&Postalcode=" + Postalcode + "&Phone=" + Phone + "&message=" + message
xmlHttp=GetXmlHttpObject(statemember)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}

function TestRgexp(s){  // 参数说明 re 为正则表达式   s 为要判断的字符
    var   re   =   /^[0-9]*[1-9][0-9]*$/　　//正整数  
	var ms,rems	
	if (s<=0 || s=="")
	{
		ms=1	
	}
	else
	{
		ms=s	
	}
	return ms
}


function statemember() 
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("txtHint").innerHTML=xmlHttp.responseText
//window.self.location.href='ConfirmOrder.asp'
}
}
function stateRegion() 
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//document.getElementById("txtHint").innerHTML=xmlHttp.responseText
window.self.location.href='shopcart_Order.asp'
}
}
function stateChanged() 
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//document.getElementById("txtHint").innerHTML=xmlHttp.responseText
window.self.location.href='shopcart.asp'
}
}
function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null
if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return; 
}

if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled")
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 
