﻿// JScript 文件
$(document).ready(function(){
 GetGoldGame();
});

function GetGoldGame(){
  $('#ddlGame').append("<option>--loading--</option>");
   $.ajax({
    url:'GetSiteGame.ashx',
    data:'d=' + d,
    type:'get',
    success:BindGoldGame 
   });
 }
 
 function BindGoldGame(xml)
 { 
   $('#ddlGame').empty();
   $(xml).find('Game').each(function(){
     var gameName = $(this).find('GameName').text();
     var gameCode = $(this).find('GameCode').text();
     gameName = gameName.replace(new RegExp("_","gm")," ");
     $('#ddlGame').append("<option value=\"" + gameCode + "\" >" + gameName + "</option>");
     $('#ddlGame').get(0).selectedIndex = 0;
   });
 } 
 
 function OnGameChange()
 {
   var gameCode = $('#ddlGame').val();
   if(gameCode == '' || gameCode == null)
   return false;
   
   window.location.href = 'BuyGold.aspx?gameid=' + gameCode;
 }