var $8t={
	logout: function(infoid){
		$(infoid).load('/home/do_logout/'+(new Date()).getTime());
	},

	popGame: function(event,gmNo){
		var div=$('#popGameFrame');
		var body=$(document.body);
		if (!div.size())
		{
			div = $('<div id="popGameFrame" gno="'+gmNo+'"><div><div class="close"><a href="#" onclick="$(\'#popGameFrame\').hide(\'fast\')">X</a></div>请选择服务器</div><iframe frameborder="0" width="100%" height="100%" border="0" src="http://www.8tgame.com/gamecenter/servers' + (gmNo ? '/'+gmNo : '') + '"></iframe></div>').appendTo(body);
		}
		else if (gmNo && gmNo != div.attr('gno'))
		{
			div.attr('gno', gmNo);
			$(div.children("iframe")).attr('src', 'http://www.8tgame.com/gamecenter/servers/' + gmNo);
		}
		var x=(body.width()-400)/2;
		var y=300;
		div.css({left:x, top:y});
		div.show('fast');
		return false;
	}
};

function copyToClipboard(text){
	if (window.clipboardData){
		window.clipboardData.setData('Text', text);
	}else{
		var div=document.createElement('div');
		div.setAttribute('name', 'divclipboardswf');
		div.setAttribute('id', 'divclipboardswf');
		document.body.appendChild(div);
		div.innerHTML='<embed src="/common/swf/clipboard.swf" FlashVars="clipboard='+encodeURIComponent(text)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
	}
}

$(function(){
	$('.btnS, .btnM, .btnL, .btnXL, .btniS, .btniM, .btniL, .btniXL').hover(
		function () {
			$(this).attr('className', this.className.replace(/(\s?btni?(?:s|m|l|xl))/i, '$1 $1O'));
		},
		function () {
			$(this).attr('className', this.className.replace(/(\s?btni?(?:s|m|l|xl)[O|D])/i, ''));
		}
	).mousedown(
		function () {
			$(this).attr('className', this.className.replace(/(\s?btni?(?:s|m|l|xl))O/i, '$1D'));
		}
	).mouseup(
		function () {
			$(this).attr('className', this.className.replace(/(\s?btni?(?:s|m|l|xl))D/i, '$1O'));
		}
	);
});

document.domain="8tgame.com";
