$("#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);
	});
		

$(document).ready(function(){				   
	var nShowImgID = 1;
	var m_tAutoImgShow;
	$(document).ready(function(){
	$.extend({
	   show:function(){
			nShowImgID++;
			if ( nShowImgID > 3)
				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_aboutus").bind("click",function()
 {
 	$("#aboutus").css("display","");
	$("#Article").css("display","none");
	$("#faq").css("display","none");
});

 $("#img_article").bind('click',function()
 {
 	$("#aboutus").css("display","none");
	$("#Article").css("display","");
	$("#faq").css("display","none");
});

 $("#img_faq").bind('click',function()
 {
 	$("#aboutus").css("display","none");
	$("#Article").css("display","none");
	$("#faq").css("display","");
});
 
 $("#divmore").bind('click', function()
	{
	   $("#ulmore").css("display","");
	   $("#divmore").css("display","none");
	   $("#divmore1").css("display","");
	});
 
  $("#divmore1").bind('click', function()
	{
	   $("#ulmore").css("display","none");
	   $("#divmore").css("display","");
	   $("#divmore1").css("display","none");
	});
