// JScript 文件

var xmlHttp
function showHint(str)
{
    var St = str.split(",");
   
    for(i = 0; i < St.length-1; i++)
     {
         showHintPrice(St[i]);
         
     }
}

function showHintPrice(str)
{
    if (str.length==0)
    { 
        return;
    }
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null)
    {
        alert ("您的浏览器不支持AJAX！");
        return;
    }
    var url="Price.aspx";
    url=url+"?ID="+str;
    url = url+"&sid="+Math.random();
    //alert(str);
    var xmlDo=new ActiveXObject("Microsoft.XMLDOM"); 
	xmlDo.async=false;
        
	xmlDo.load(url)
       
    document.getElementById("txtHint"+str).innerHTML=xmlDo.childNodes(1).childNodes(0).childNodes(0).text;

} 

var d_value = '';
function changeDistric(e){
	d_value = e.value;
	var par = d_value.split('|');
	var url = 'GetDelivery.aspx?action=method'
	url += '&prov='+par[0]+'&city='+par[1];
	url += '&random='+Math.random();
	var txt = getTxt(url);
	var arr = evals(txt);
	var xfrm = document.getElementById("HuiboCartTwo_delivery");
	xfrm.innerHTML = '';
	//document.getElementById("delivery").innerHTML = "";
	//xfrm.province.value = par[0];
	//xfrm.city.value = par[1];
	for(var i in arr){
		if(arr[i]){
			var idx = arr[i].idx;
			var txt = unescape(arr[i].txt);
			var op = new Option(txt, idx);
			xfrm.options.add(op);
		}
	}
};

function changeMethod(e){
	var par = d_value.split('|');
	var url = 'method.asp?action=money'
	url += '&deli='+e.value+'&weight={$weight}';
	url += '&prov='+par[0]+'&city='+par[1];
	url += '&random='+Math.random();
	var txt = getTxt(url);
	var arr = evals(txt);
	if(arr[0]){
		document.xfrm.express.value = arr[0];
		$('weightmoney').innerText = arr[0];
	}
};

function GetXmlHttpObject()
{
    var xmlHttp=null;
    try
    {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }
    catch (e)
    {
    // Internet Explorer
    try
    {
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e)
    {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    }
    return xmlHttp;
}