document.write("<img src='/referer.php?refer="+escape(document.referrer)+"&url="+escape(document.URL)+"' style='display:none'/>");
function buygold(o){location=o.parentNode.parentNode.cells[0].childNodes[0].href;}

var Divshow=function(obj){
    var divs=[obj,''];
   return function(obj){
    divs.unshift($(this.title));
    divs.length=2;
    $(this.title).style.display='';
     divs[1].style.display='none';
   }
}
window.onload=function(){
        var selServer = document.getElementById("selServer");
        var btnBuyGold = document.getElementById("btnBuyGold"); 
		var btnbuyServer = document.getElementById("btnserver");
		var btnGo=document .getElementById ("btngo");
		var selgame=document.getElementById ("games1");
		var gamevalue=document.getElementById("gamevalue");
        if(selServer){
            selServer.onchange=function(){
            if(gamevalue!=null)
                top.window.location ="?code="+this.value+"&n="+this.options[this.selectedIndex].text+"&g="+gamevalue.value;
                else 
                  top.window.location ="?code="+this.value+"&n="+this.options[this.selectedIndex].text;
            }

        }
		
        if(btnBuyGold){
            btnBuyGold.onclick=function(){
                top.window.location ="buy_game_gold.php?code="+selServer.value+"&n="+selServer.options[selServer.selectedIndex].text+"&g="+gamevalue.value;;
            }
        }
		
		  if(btnbuyServer){
            btnbuyServer.onclick=function(){
                top.window.location ="buy_game_gold.php?code="+selServer.value+"&n="+selServer.options[selServer.selectedIndex].text+"&g="+gamevalue.value;;
            }
        }
        if(btnGo )
        {
            btnGo .onclick=function (){
            var ss=selgame.options[selgame.selectedIndex].text;
            top.window.location  ="powerleveling.php?gamecode="+selgame .value+"&gamename="+ss;
            }
        }
		
}


 function copylist() {
           var sl=$('serverlist');
            if($('tmplist').innerHTML==""){
            $('tmplist').innerHTML=sl.innerHTML;
            }
            $('searchlist').value='';
        }
 function filterlist(){
           var sl=$('serverlist');
           var k=$('searchlist').value;
           var re=new RegExp(">"+k+"[^<]+<","ig");
           var arr=[];
           for(var i=0;li=$('tmplist').childNodes[i];i++){
             if(re.test(li.innerHTML)){
             arr.push('<li>'+li.innerHTML+"</li>");
             }
           }
           sl.innerHTML=arr.join("")
               arr=null;
               delete arr;
}
