$("#img_ad1").bind('click', function()
	{
		
		moveandshowdiv('div_ad',1);
		clearInterval(m_tAutoImgShow);
	});
	
	 $("#img_ad2").bind('click', function()
	{
			moveandshowdiv('div_ad',2);
			clearInterval(m_tAutoImgShow);
	});
	
		$("#img_ad3").bind('click', function()
	{
			moveandshowdiv('div_ad',3);
			clearInterval(m_tAutoImgShow);
	});
		

$("#img_ad4").bind('click', function()
	{
			moveandshowdiv('div_ad',4);
			clearInterval(m_tAutoImgShow);
	});


$(document).ready(function(){
	var nShowImgID = 1;
	var m_tAutoImgShow;
	$(document).ready(function(){
	$.extend({
	   show:function(){
			nShowImgID++;
			if ( nShowImgID > 5)
				nShowImgID = 1;
			moveandshowdiv('div_ad',nShowImgID)
	   }
	});
	m_tAutoImgShow = setInterval("$.show()",8000);
});
	
});


function quickbuy()
{
	if($("#selectGame").val() != 0 && $("#selectBlock").val() != 0)
	{
		window.location.href = "/fillorder/fillgoldorder/"+$("#selectServer").val()+"/"+$("#selectBlock").val()+"/"+$("#selectGame").val();
	}

}

function ajaxAddOptions(url, target, id, text){  
     target.empty();  
     $.getJSON(url, function(json){  
         $(json).each(function(i){  
             var x = json[i];  
             target.append("<option value='" + eval("x." + id) + "'>" + eval("x." + text) + "</option>" );  
         })  
     });  
}

$("#selectGame").bind('change',function()
{
	ajaxAddOptions("/quickbuy/getGameServer/" + $("#selectGame").val() , $("#selectServer"), "id", "text");
	ajaxAddOptions("/quickbuy/getGameFirstBlock/" + $("#selectGame").val()  , $("#selectBlock"), "id", "text");
});

$("#selectServer").bind('change',function()
{
	ajaxAddOptions("/quickbuy/getGameBlock/" + $("#selectGame").val() + "/" + $("#selectServer").val()  , $("#selectBlock"), "id", "text");
});





 $("#img_article").bind('click',function()
 {
	$("#Article").css("display","");
	$("#faq").css("display","none");
});

 $("#img_faq").bind('click',function()
 {
	$("#Article").css("display","none");
	$("#faq").css("display","");
});
