function freeitem()
{
	var pwidth = 468;
	var pheight = 440;
	
	var leftp=(screen.width)?(screen.width-pwidth)/2:100;
	var topp=(screen.height)?(screen.height-pheight)/2:100;
	
	window.open ("http://www.sf.in.th/itemcode/Default.aspx","_blank", "width=" + pwidth + ",height=" + pheight + ",scrollbars=0,top=" + topp + ",left=" + leftp);
}

function itemcode()
{
	var pwidth = 471;
	var pheight = 457;
	
	var leftp=(screen.width)?(screen.width-pwidth)/2:100;
	var topp=(screen.height)?(screen.height-pheight)/2:100;
	
	window.open ("http://www.sf.in.th/itemcode/Default.aspx","_blank", "width=" + pwidth + ",height=" + pheight + ",scrollbars=0,top=" + topp + ",left=" + leftp);
}

function dserial()
{
	var pwidth = 659;
	var pheight = 600;
	
	var leftp=(screen.width)?(screen.width-pwidth)/2:100;
	var topp=(screen.height)?(screen.height-pheight)/2:100;
	
	window.open ("http://www.gg.in.th/dserial/agreement.aspx?picgametype=1","_blank", "width=" + pwidth + ",height=" + pheight + ",scrollbars=0,top=" + topp + ",left=" + leftp);
}

function popupsfvote()
{
	var pwidth = 471;
	var pheight = 457;
	
	var leftp=(screen.width)?(screen.width-pwidth)/2:100;
	var topp=(screen.height)?(screen.height-pheight)/2:100;
	
	window.open ("http://www.sf.in.th/Vote/Default.aspx?VoteID=8","_blank", "width=" + pwidth + ",height=" + pheight + ",scrollbars=0,top=" + topp + ",left=" + leftp);
}

function register()
{
	if(registerdown != 1)
	window.open ("http://www.gg.in.th/account_register/pop_regisstep.aspx", "_blank", "width=680", "height=720", "toolbar=no", "location=no","directories=no","status=no","menubar=no","scrollbars=no","copyhistory=no"," resizable=no","");
	else
	msgRegister();
}

function caferegister()
{
	if(caferegisterdown != 1)
	window.open ("http://www.sf.in.th/cafe/index.aspx", "_blank", "");
	else
	msgRegisterCafe();
}

function refillde()
{
	if(refilldedown != 1)
	window.open ("https://bill.gg.in.th/", "_blank", "");
	else
	msgRefill();
}

function startgame()
{
	var pwidth = 514;
	var pheight = 406;
	
	var leftp=(screen.width)?(screen.width-pwidth)/2:100;
	var topp=(screen.height)?(screen.height-pheight)/2:100;
	
	if(startgamedown != 1)
	window.open ("/member/logon.aspx?s=21&d="+datahash+"","_blank", "width=" + pwidth + ",height=" + pheight + ",scrollbars=0,top=" + topp + ",left=" + leftp);
	else
	msgStartgame();
}

function editprofile()
{
	var pwidth = 500;
	var pheight = 100;
	
	var leftp=(screen.width)?(screen.width-pwidth)/2:100;
	var topp=(screen.height)?(screen.height-pheight)/2:100;
	
	if(editprofiledown != 1)
		window.open ("http://www.gg.in.th/home/home.aspx", "_blank", "");
		//window.open ("https://secure.sf.in.th/member_profile/member_logon.aspx", "",				"width=" + pwidth + ",height=" + pheight + ",scrollbars=1,top=" + topp + ",left=" + leftp);
	else
	msgProfile();
}




function gotopage(si,alertx)
{

	if(alertx == 1)
	{
			switch(si)
			{
				case	 'register':
				register();
				break;

				case	 'caferegister':
				caferegister();
				break;

				case	 'startgame':
				startgame();
				break;

				case	 'editprofile':
				editprofile();
				break;

				case	 'refillde':
				refillde();
				break;
			}
	}
	else
	{
		
			switch(si)
			{
				case	 'register':
				msgRegister();
				break;

				case	 'caferegister':
				msgRegisterCafe();
				break;

				case	 'startgame':
				msgStartgame();
				break;

				case	 'editprofile':
				msgProfile();
				break;

				case	 'refillde':
				msgRefill();
				break;
			}

	}

}





function hidethumbx(){
	taoraongx.style.visibility='hidden';
}

function showthumbx(text1,text2){
	var x = event.x+document.body.scrollLeft; 
	var y = event.y+document.body.scrollTop+5;
	var text1
	var text2
	var txt
	var style
	if (y < 0)
		y = y + 170;
	if(x > 200)
		x = x - 305;
	if(x < 0)
		x = x + 30 ;
	
	//if(style ==  "Red")
style = "style='position: absolute; top:0; left:0; width:300; height:160; border:2px solid black; font:normal 10pt tahoma;  filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#6600CC, EndColorStr=#FFFFFF); padding:10px'";


	taoraongx.style.left = x;
	taoraongx.style.top = y;
	taoraongx.style.visibility =  "visible";


	txt = '<DIV ><div  '+style+' >';
	txt = txt + '<b>'+text1+'</b>';
    txt = txt + '<hr size=1 style="border:1px solid black; ">'+text2+'</div></div>';


	document.all["taoraongx"].innerHTML = txt;

}


function alert_error()
{
alert('ระบบปิดปรับปรุงชั่วคราว');
}