﻿
   
    var itemindex="";      //id
    var series="";           //选中系列
    var p_Guid="";         //套餐产品Guid
    var p_Name="";       //套餐产品名称
    var p_Price="";        //购买的套餐价格  
    var p_Promotion="";//套餐的促销类型 
    //初始化AJAX引擎
        function createXMLHttpRequest()
        {
	        if(window.XMLHttpRequest) return new XMLHttpRequest();
	        try{return new ActiveXObject('MSXML2.XMLHTTP.4.0');}
	        catch(e){try{return new ActiveXObject('MSXML2.XMLHTTP.3.0');}
	        catch(e){try{return new ActiveXObject('MSXML2.XMLHTTP.2.6');}
	        catch(e){try{return new ActiveXObject('MSXML2.XMLHTTP');}
	        catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP');}
	        catch(e){return null;}}}}}
        }
        //根据促销状态获取套餐价格
        function GetPackagePrice(index,s)
        {
        itemindex =index;
        series =s;
        var protype;
        if(s=="AR"){protype=document .getElementById ("ARpkg"+index);p_Guid=document .getElementById ("ARpkgid_"+index).value;}
        p_Promotion=parseInt(protype.value==""?"3":protype.value,10);
        XMLHTTP=createXMLHttpRequest ();
        if(XMLHTTP == null)
        {
        alert ("对不起你的浏览器不支持XMLHTTP,请升级");
        return ;
        }
        XMLHTTP .onreadystatechange=SetPackagePrice;
        XMLHTTP .open("GET","/ItemPriceOutPut.aspx?id="+p_Guid +"&type="+p_Promotion );
        XMLHTTP .send(null);
        }
        //设置套餐价格
        function SetPackagePrice()
        {
        if(XMLHTTP.readyState!=4)
        return ;
        p_Price=XMLHTTP.responseText;
        if(p_Price !=null&&p_Price !="")
        {
          document .getElementById ("ARpkgpirce"+itemindex).innerText="Price:$"+p_Price ;
          document.getElementById ("AR_Price_"+itemindex).value=p_Price 
          document.getElementById ("AR_Promotion_"+itemindex).value=p_Promotion;
        }
        }
       
