﻿ function CreatXml()
 {
  var str;
  if(window.XMLHttpRequest)
  {
    str=new XMLHttpRequest();
    if(str.overrideMimeType){str.overrideMimeType('text/xml');}
  }
  else if(window.ActiveXObject){
    str=new ActiveXObject("Microsoft.XMLHTTP");
  }
  return str;
}

//自定义选择则代练等级套餐
function changeCurrent()
{ 
    var whichCurrentvalue = document.getElementById("PLCustomizel1_whichCurrent").options[document.getElementById("PLCustomizel1_whichCurrent").selectedIndex].value;
    var whichDesiredvalue = document.getElementById("PLCustomizel1_whichDesired").options[document.getElementById("PLCustomizel1_whichDesired").selectedIndex].value;
    if(parseFloat(whichCurrentvalue) > parseFloat(whichDesiredvalue))
    {
        document.getElementById("PLCustomizel1_whichCurrent").value=parseFloat(whichDesiredvalue)-1;
    }
   changprice()
}
function changeDesired()
{ 
    var whichCurrentvalue = document.getElementById("PLCustomizel1_whichCurrent").options[document.getElementById("PLCustomizel1_whichCurrent").selectedIndex].value;
    var whichDesiredvalue = document.getElementById("PLCustomizel1_whichDesired").options[document.getElementById("PLCustomizel1_whichDesired").selectedIndex].value;
    if(parseFloat(whichCurrentvalue) > parseFloat(whichDesiredvalue))
    {
        document.getElementById("PLCustomizel1_whichDesired").value=parseFloat(whichCurrentvalue)+1;
    }
    changprice()  
}
function changprice()
{
    var whichCurrentvalue = document.getElementById("PLCustomizel1_whichCurrent").options[document.getElementById("PLCustomizel1_whichCurrent").selectedIndex].value;
    var whichDesiredvalue = document.getElementById("PLCustomizel1_whichDesired").options[document.getElementById("PLCustomizel1_whichDesired").selectedIndex].value;
    var respon=Controls_PLCustomizel.GetChangPrice(document.getElementById("PLCustomizel1_tt_gameid").value,whichCurrentvalue,whichDesiredvalue,document.getElementById("PLCustomizel1_InputCurrency").value).value;
    
    document.getElementById("PLCustomizel1_tt_gold").value=respon[0];
    document.getElementById("PLCustomizel1_tt_price").value=respon[1];
    document.getElementById("PLCustomizel1_tt_time").value=respon[2];
     document.getElementById("PLCustomizel1_zprice1").value=respon[3];
}
function getlent()
{

    var whichCurrentvalue = document.getElementById("PLCustomizel1_whichCurrent").options[document.getElementById("PLCustomizel1_whichCurrent").selectedIndex].value;
    var whichDesiredvalue = document.getElementById("PLCustomizel1_whichDesired").options[document.getElementById("PLCustomizel1_whichDesired").selectedIndex].value;
    
    var ExtraGold = document.getElementById("PLCustomizel1_tt_gold").value;
    var ExtraGoldvalue = ExtraGold.substring(0,ExtraGold.indexOf(" "));
    
    var Timevale = document.getElementById("PLCustomizel1_tt_time").value;
    var Pricevalue = document.getElementById("PLCustomizel1_tt_price").value;
    var zprice1value = document.getElementById("PLCustomizel1_zprice1").value;   //人民币价格
    var tt_gameidvalue = document.getElementById("PLCustomizel1_tt_gameid").value;
    var tt_gamenamevalue = document.getElementById("PLCustomizel1_tt_gamename").value;
    var tt_currencyvalue = document.getElementById("PLCustomizel1_tt_currency").value;
    
    ymPrompt.win({title:whichCurrentvalue+' - '+whichDesiredvalue+'  '+ tt_gamenamevalue+' Power Leveling ('+Pricevalue+')',width:560,height:562,fixPosition:true,iframe:{id:'myId',name:'myName',src:'/PLAddToCart.aspx?tt_gameidvalue='+tt_gameidvalue+'&whichCurrentvalue='+whichCurrentvalue+'&whichDesiredvalue='+whichDesiredvalue+'&ExtraGoldvalue='+ExtraGoldvalue+'&Timevale='+Timevale+'&zprice1value='+zprice1value+'&Currency='+tt_currencyvalue+"&tt_gamenamevalue="+tt_gamenamevalue+'&BusinessType=1'}})
}

function gettest()
{
        ymPrompt.doHandler('close');
}
function geturl()
{
       window.location.href="/Register.html";
}