function GoMenu( iNum ) {

	switch( iNum ) {
		case 1:
			GoFlashGame(2);
			break;
		case 2:
			GoFlashGame(3);
			break;
		case 3:
			GoFlashRank();
			break;
		case 4:
			try{
			if( bLogin ) GoMySumPop(sLogin);
			else LoginAsk();
			}catch(e){}
			break;
		default:
			GoFlashGame();
			break;
	}
}

function GoPoisoningList( iCgNo ) {
	var sSort='';
	if( arguments[1] ) sSort = '&sort=' + arguments[1];

	location.href = '/game/poisoning_game.php?cg=' + iCgNo + sSort;
}  

function GoRankingList( iCgNo ) {
	var sSort='';
	if( arguments[1] ) sSort = '&sort=' + arguments[1];

	location.href = '/game/ranking_game.php?cg=' + iCgNo + sSort;
}

function GoGmRank( iNo ) {
	location.href = '/rank/detail_game_rank.php?f=t&no=' + iNo;
}

var bPrevNum = -1;
function LayerView(sSubId, evt, iNum) {
try{
	var iPLeft, iPTop;
	iPLeft = 9; // ÅøÆÁ°ú ¸µÅ©¿ÍÀÇ ¿ÞÂÊ °£°Ý
	iPTop = 19; // ÅøÆÁ°ú ¸µÅ©¿ÍÀÇ »ó´Ü °£°Ý

	if( bPrevNum != iNum ) {
		GetSummary( iNum );
		bPrevNum = iNum;
	}

	if(document.all || document.getElementById) {
		if(document.all) {
			obj = document.all[sSubId];
			obj.style.left = (evt.clientX + document.documentElement.scrollLeft + iPLeft) + 'px';
			obj.style.top = (evt.clientY + document.documentElement.scrollTop + iPTop) + 'px';
		} else {
			obj = document.getElementById(sSubId);
			obj.style.left = (evt.clientX + window.scrollX + iPLeft) + 'px';
			obj.style.top = (evt.clientY + window.scrollY + iPTop) + 'px';
		}

		obj.style.visibility = "visible";
	} else{
		obj = document.layers[sSubId];
		obj.visibility = "visible";
		obj.left = (evt.pageX + iPLeft) + 'px';
		obj.top = (evt.pageY + iPTop) + 'px';
	}
}catch(e){}
}

function LayerHide(sSubId) {
	if(document.all || document.getElementById) {
		if(document.all) {
			obj = document.all[sSubId];
		} else {
			obj = document.getElementById(sSubId);
		}

		obj.style.visibility = "hidden";
	} else{
		obj = document.layers[sSubId];
		obj.visibility = "hidden";
	}
}


var arrSummary = new Array();
var iSummaryNo = 0;
var bHttpSummary = false;
function GetSummary( iNo ) {
	if( bHttpSummary ) {
		//alert( 'Á¤º¸¸¦ °¡Á®¿À´Â ÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ½Ê½Ã¿À.' );
		return;
	}
	
	if( arrSummary[iNo] == undefined ) {
		iSummaryNo = iNo;
		bHttpSummary = true;
		HttpSock( 'Get', '/game/game_summary_old.php?no=' + iNo, '', '', CheckGetSummary );
	}
	else {
		try{
		ShowSummary( iNo );
		}catch(e){}
	}
}

function CheckGetSummary( sResponseText ) {
	bHttpSummary = false;
	if ( sResponseText == 'E' ) {
                alert( '½Ã½ºÅÛ¿¡ Àå¾Ö°¡ ÀÖ½À´Ï´Ù.' );
        }
        else {

		try{
			eval( sResponseText );
			
			ShowSummary( iSummaryNo );
		}catch(e) {
                	alert( '½Ã½ºÅÛ¿¡ Àå¾Ö°¡ ÀÖ½À´Ï´Ù.' );
		}
        }

	iSummaryNo = 0;
}

function ShowSummary( iNo ) {
	try{
	$('SM_IMG').src = arrSummary[iNo].fimg;
	$('SM_TIT').innerHTML = arrSummary[iNo].ftit;
	$('SM_RANK').innerHTML = arrSummary[iNo].rank;
	$('SM_DESC').innerHTML = arrSummary[iNo].desc;

	if( arrSummary[iNo].rch > 0 ) {
		$('SM_CRI').src = $('SM_CRI').src.replace(/icon_.+\.gif/, 'icon_up.gif');
		$('SM_CR').innerText = ' ' + arrSummary[iNo].rch;
	}
	else if( arrSummary[iNo].rch == 0 ) {
		$('SM_CRI').src = $('SM_CRI').src.replace(/icon_.+\.gif/, 'icon_stay.gif');
		$('SM_CR').innerText = '';
	}
	else {
		$('SM_CRI').src = $('SM_CRI').src.replace(/icon_.+\.gif/, 'icon_down.gif');
		$('SM_CR').innerText = ' ' + Math.abs( arrSummary[iNo].rch );
	}
	}catch(e){}
}
var bGameComment = false;
var sCommentDesc = '';
var sCommentName = '';

function SetGameCmt( iNo ) {
	if( !bLogin ) {
		LoginAsk();
		return;
	}

	if( bGameComment ) {
		alert( '´ñ±Û °ü·Ã Ã³¸®¸¦ ÇÏ´Â Áß ÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ½Ê½Ã¿À.' );
		return;
	}

	sCommentDesc = $('memo').value;
	sCommentName = $('name').value;

	var iLen = sCommentDesc.length;
	var arrMatch, exp;

	if( iLen <= 0 ) {
		alert( '´ñ±ÛÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.' );
		return;
	}
	else if( iLen >= 300 ) {
		alert( 'ÃÖ´ë 300ÀÚ±îÁö¸¸ ÀÔ·Â °¡´ÉÇÏ½Ê´Ï´Ù.' );
		return;
	}	

	try{
		exp = new RegExp('\\n','g');
		if( arrMatch = sCommentDesc.match(exp) ) {
			if( arrMatch.length >= 10 ) {
				alert('10ÁÙ±îÁö¸¸ ÀÔ·Â °¡´ÉÇÏ½Ê´Ï´Ù.');
				return;
			}
		}
	}catch(e){}

	bGameComment = true;

	HttpSock( 'Post', 'comment_prc.php', '', 'FrmComment', CheckGameCmt );
}

function CheckGameCmt( sResponseText ) {
	bGameComment = false;
	if(/^ *success ([0-9]+) - ([0-9\.]+ [0-9\:]+) - (.*) *$/.exec(sResponseText)) {
		var re1 = RegExp.$1;
		var re2 = RegExp.$2;
		var re3 = RegExp.$3;
		sCommentDesc = sCommentDesc.replace( /&/g, '&amp;' );
		sCommentDesc = sCommentDesc.replace( /</g, '&lt;' );
		sCommentDesc = sCommentDesc.replace( />/g, '&gt;' );
		sCommentDesc = sCommentDesc.replace( /\n/g, '<br/>' );

		var ObjTb = $('COMMENT_BOX');
		var ObjFirstTr = ObjTb.getElementsByTagName('tr')[0];

		var ObjTr = document.createElement('TR');
		ObjFirstTr.parentNode.insertBefore( ObjTr, ObjFirstTr );
		//ObjTb.appendChild( ObjTr );
		var oCellImg = document.createElement('TD');
		var oCellDesc = document.createElement('TD');
		var oCellDate = document.createElement('TD');
		ObjTr.appendChild( oCellImg );
		ObjTr.appendChild( oCellDesc );
		ObjTr.appendChild( oCellDate );
		try{
			ObjTr.setAttribute( 'className', 'comment_tr' );
			oCellImg.setAttribute( 'className', 'comment_img' );
			oCellDesc.setAttribute( 'className', 'comment_desc' );
			oCellDate.setAttribute( 'className', 'num' );
		}catch(e){
		}
		try{
			ObjTr.setAttribute( 'class', 'comment_tr' );
			oCellImg.setAttribute( 'class', 'comment_img' );
			oCellDesc.setAttribute( 'class', 'comment_desc' );
			oCellDate.setAttribute( 'class', 'num' );
		}catch(e){}

		ObjTr.setAttribute( 'id', 'comment_' + re1 );
		oCellImg.setAttribute( 'width', '9%' );
		oCellDate.setAttribute( 'width', '12%' );

		oCellImg.innerHTML = '<img src="' + re3.strip() + '" width="40" height="50" onerror="errProfileS(this);" onclick="GoMySumPop(\'' + sLogin + '\');" class="btn" />';
		oCellDesc.innerHTML = '<span class="comment_nm" onclick="GoMySumPop(\'' + sLogin + '\');">' + sCommentName + '</span><div class="comment_ds" style="width:650px; margin:0 auto; word-break:break-all; overflow:hidden;">' + sCommentDesc + ' <img src="' + sBaseImgPath + '/PoisnGame/btn_del.gif" width="10" height="10" align="absmiddle" class="btn" onclick="DelGameCmt(\'' + $('org_no').value + '\', \'' + re1 + '\');" /></div>';
		oCellDate.innerHTML = re2;

		sCommentDesc = '';
		sCommentName = '';

		$('memo').value = '';
	}
	else{
		alert('´ñ±ÛÀ» Ã³¸®ÇÏ´Â µ¿¾È ¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù. Àá½Ã ÈÄ ´Ù½Ã ½ÃµµÇØÁÖ½Ê½Ã¿À.');
	}
}

function DelGameCmt( iOrgNo, iNo ) {
	if( !bLogin ) {
		LoginAsk();
		return;
	}

	if( bGameComment ) {
		alert( '´ñ±Û °ü·Ã Ã³¸®¸¦ ÇÏ´Â Áß ÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ½Ê½Ã¿À.' );
		return;
	}
	if( confirm( 'ÇØ´ç ´ñ±ÛÀ» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?' ) ) {
		bGameComment = true;
		HttpSock( 'Get', 'comment_prc.php?mode=delete&no=' + iNo + '&org_no=' + iOrgNo, '', '', CheckDelGameCmt );
	}
}

function CheckDelGameCmt( sResponseText ) {
	bGameComment = false;
	if(/^ *success ([0-9]+) *$/.exec(sResponseText)) {
		$('comment_' + RegExp.$1).parentNode.removeChild( $('comment_' + RegExp.$1 ) );
	}
	else{
		alert('´ñ±ÛÀ» »èÁ¦ÇÏ´Â µ¿¾È ¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù. Àá½Ã ÈÄ ´Ù½Ã ½ÃµµÇØÁÖ½Ê½Ã¿À.');
	}
}


function GameRecommend( iNo ) {
	if( !bLogin ) {
		LoginAsk();
		return;
	}

	if( confirm("ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ½Ã°Ú½À´Ï±î? ÅõÇ¥´Â ÇÑ °ÔÀÓ ´ç ÇÑ¹ø¸¸ µË´Ï´Ù.") ) {
		HttpSock( 'Get', 'update_recommend.php?no=' + iNo, '', '', CheckGamePoll2 );
	}
}

function CheckGamePoll2( sResponseText ) {
	if( sResponseText == 'S' ) {
		$('RECOMMEND').innerHTML = parseInt( $('RECOMMEND').innerHTML.replace( /,/g, '') ) + 1;
		//$('OPPOSITE').innerHTML = parseInt( $('OPPOSITE').innerHTML.replace( /,/g, '') ) + 1;
		$('RECOMMEND_BTN').onclick = function() { alert('ÀÌ¹Ì ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ¼Ì½À´Ï´Ù.'); }
		$('OPPOSITE_BTN').onclick = function() { alert('ÀÌ¹Ì ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ¼Ì½À´Ï´Ù.'); }
		alert( 'ÅõÇ¥°¡ ¿Ï·áµÇ¾ú½À´Ï´Ù. Âü¿©ÇØ ÁÖ¼Å¼­ °¨»çÇÕ´Ï´Ù.' ) ;
	}
	else if( sResponseText == 'E' ) {
		alert( 'ÀÌ¹Ì ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ¼Ì½À´Ï´Ù.' ) ;
		$('RECOMMEND_BTN').onclick = function() { alert('ÀÌ¹Ì ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ¼Ì½À´Ï´Ù.'); }
		$('OPPOSITE_BTN').onclick = function() { alert('ÀÌ¹Ì ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ¼Ì½À´Ï´Ù.'); }
	}
}


function CheckGamePoll1( sResponseText ) {
	if( sResponseText == 'S' ) {
		//$('RECOMMEND').innerHTML = parseInt( $('RECOMMEND').innerHTML.replace( /,/g, '') ) + 1;
		$('OPPOSITE').innerHTML = parseInt( $('OPPOSITE').innerHTML.replace( /,/g, '') ) + 1;
		$('RECOMMEND_BTN').onclick = function() { alert('ÀÌ¹Ì ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ¼Ì½À´Ï´Ù.'); }
		$('OPPOSITE_BTN').onclick = function() { alert('ÀÌ¹Ì ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ¼Ì½À´Ï´Ù.'); }
		alert( 'ÅõÇ¥°¡ ¿Ï·áµÇ¾ú½À´Ï´Ù. Âü¿©ÇØ ÁÖ¼Å¼­ °¨»çÇÕ´Ï´Ù.' ) ;
	}
	else if( sResponseText == 'E' ) {
		alert( 'ÀÌ¹Ì ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ¼Ì½À´Ï´Ù.' ) ;
		$('RECOMMEND_BTN').onclick = function() { alert('ÀÌ¹Ì ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ¼Ì½À´Ï´Ù.'); }
		$('OPPOSITE_BTN').onclick = function() { alert('ÀÌ¹Ì ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ¼Ì½À´Ï´Ù.'); }
	}
}

function GameOpposite( iNo ) {
	if( !bLogin ) {
		LoginAsk();
		return;
	}
	if( confirm("ÀÌ °ÔÀÓ¿¡ ÅõÇ¥ÇÏ½Ã°Ú½À´Ï±î? ÅõÇ¥´Â ÇÑ °ÔÀÓ ´ç ÇÑ¹ø¸¸ µË´Ï´Ù.") ) {
		HttpSock( 'Get', 'update_opposite.php?no=' + iNo, '', '', CheckGamePoll1 );
	}
}

function ShowPlayHelp() {
	openWindow( '/game/play_help.php', 'ph', 400, 415 );
/*
	if( $('POP_HELP') == null ) {
		HttpSock( 'Get', 'popup.php?kind=help', '', '', ShowPopup );
	}
	else {
		$('POP_HELP').style.display = '';
	}
*/
}
function ShowSetMyGame( iCgNo, iNo, sTit ) {
	if( !bLogin ) {
		if( arguments[3] == true ) return;
		LoginAsk('gput');
		return;
	}
	openWindow( '/game/mygame.php?cno='+iCgNo+'&no='+iNo+'&tit='+sTit, 'gs', 400, 310 );
/*
	if( $('POPUP_MYGAME') == null ) {
		HttpSock( 'Get', 'popup.php?kind=mygame&cno='+iCgNo+'&no='+iNo, '', '', ShowMyGamePopup );
	}
	else {
		$('POPUP_MYGAME').style.display = '';
	}
*/
}

function HidScrapBtn() {
	$('MYGAME_BTN').onclick = function() { alert('ÀÌ¹Ì °ÔÀÓ ´ã±â¸¦ ÇÏ¼Ì½À´Ï´Ù.'); }
}

function EndScrap() {
	try{
	opener.HidScrapBtn();
	}catch(e){}
	self.close();
}

function ScrapAfterMysum( sId, iScrap ) {
	if( GoMySumGameCg( sId, iScrap, true) == null ) {
		try{
		opener.location.href = GetMySumUrl( sId );
		}catch(e){}
	}
}

function SetFlashScrap( ObjRadio, iCgNo, iNo ) {
	if( !bLogin ) {
		LoginAsk();
		return;
	}

	var iPoint = 0;
	for( var i=0; i < ObjRadio.length; i++) {
		if( ObjRadio[i].checked ) {
			iPoint = ObjRadio[i].value;
		}
	}
	if( iPoint <= 0 ) {
		alert( 'ÃßÃµ Á¡¼ö¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.' );
		return;
	}
	
	HttpSock( 'Get', '/game/game_scrap.php?cno=' + iCgNo + '&no=' + iNo + '&point=' + iPoint, '', '', CheckScrap );
}

function CheckScrap( sResponseText ) {
	if( sResponseText == 'S' ) {
		$('POPUP_MYGAME_CF').style.display = '';
	}
	else {
		alert( '°ÔÀÓ ´ã±â¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. Àá½Ã ÈÄ ´Ù½Ã ½ÃµµÇØ ÁÖ½Ê½Ã¿À.' );
		self.close();
	}
}

function ShowPsBigPlay( iNo ) {
	var iWidth = window.screen.width;
	var iHeight = window.screen.height;

	openWindow( '/game/big_game_play.php?dv=2&no='+iNo, 'bg', iWidth, iHeight );
}

function ShowRkBigPlay( iNo ) {
	var iWidth = window.screen.width;
	var iHeight = window.screen.height;

	openWindow( '/game/big_game_play.php?dv=3&no='+iNo, 'bg', iWidth, iHeight );
}

function SetGameHit( iNo ) {
	HttpSock( 'Get', '/game/game_hit.php?no=' + iNo, '', '', CheckGameHit );
}

function CheckGameHit( sResponseText ) {}

var arrPrList = new Array();
function GetPalyRankList( iNo, callbackFun ) {
	
	if( arrPrList[iNo] == undefined ) {
		var ObjScript = document.createElement("script");
		ObjScript.setAttribute( 'language', 'javascript' );
		ObjScript.setAttribute( 'src', '/game/play_rank_list.php?no=' + iNo + '&fun=' + callbackFun );
		
		document.body.appendChild(ObjScript);	
	}
	else {
		eval( callbackFun + '(' + iNo + ')' );
	}
}

function SetPrList( callbackFun, iNo ) {
	callbackFun( iNo );
}

function DefaultFun( iNo ){}

function GetTemplate1( sTplId ) {
        var sTemplate;
        sTemplate = document.getElementById(sTplId).innerHTML;

        return sTemplate.replace(/(^\s*<!--(\/\/)?Template\s*|\s*(\/\/)?-->\s*$)/gi, "");
}


function ShowBestMaintain() {

	var sTemplate = GetTemplate1( 'BestMtTpl' );
	
	var sHtml = '';

	var iLen = arrRank1.length;
	var iMax = arguments[0] > 0 ? arguments[0] : 10;

	if( iLen > iMax ) iLen = iMax;
	
	for( var i = 0; i < iLen; i++ ){
		sHtml += sTemplate.replace( new RegExp( "-@t@-", "g" ), arrRank1[i].ftit).replace( new RegExp( "-@s@-", "g" ), number_format(arrRank1[i].score) ).replace( new RegExp( "-@gn@-", "g" ), arrRank1[i].fno ).replace( new RegExp( "-@mi@-", "g" ), arrRank1[i].mid).replace( new RegExp( "-@n@-", "g" ), crop(arrRank1[i].mnick,5,'..') ).replace( new RegExp( "-@i@-", "g" ), arrRank1[i].fimg ).replace( new RegExp( "-@md@-", "g" ), arrRank1[i].maintain );
	}

	if( sHtml ) {
		document.getElementById('BEST_MT_LIST').innerHTML = sHtml;
	}
}

function ShowRankGameList() {
	var ObjSel =document.getElementById('rgame_list');
	for( var i = 0; i < arrJson94.length; i++ ) {
		ObjSel.options[i] = new Option( arrJson94[i].ftit, arrJson94[i].fno );
	}
	var r = Math.round(Math.random()*(arrJson94.length-1));
	ObjSel.options[r].selected = 'true';
}

function ShowPlayRankList( iNo ) {
	var ObjTb =document.getElementById('PLAY_RANK');
	var ObjTrList =document.getElementById('PLAY_RANK').getElementsByTagName('tr');
	var iTrLen = ObjTrList.length;

	for( var i=iTrLen-1; i > 0; i-- ) {
		if( isIE ) 
			ObjTb.deleteRow(i);
		else 
			ObjTb.removeChild(ObjTrList[i]);		
	}

	for( var i=0; i < arrPrList[iNo].length; i++ ) {
		if( isIE ) {
			var oRow = ObjTb.insertRow();
			var oCellNo = oRow.insertCell();
			var oCellName = oRow.insertCell();
			var oCellScore = oRow.insertCell();
			oRow.className = 'line';
		} else {
			var ObjTr = document.createElement('TR');
			ObjTb.appendChild( ObjTr );
			ObjTr.setAttribute( 'class', 'line' );
			var oCellNo = document.createElement('TD');
			var oCellName = document.createElement('TD');
			var oCellScore= document.createElement('TD');
			ObjTr.appendChild( oCellNo);
			ObjTr.appendChild( oCellName);
			ObjTr.appendChild( oCellScore);
		}

		oCellNo.width = '20px';
		oCellName.width = '89px';
		oCellScore.width = '60px';
		oCellScore.style.textAlign = 'right';

		oCellNo.innerHTML = '&nbsp;<span class="num"><strong>' + arrPrList[iNo][i].rank + '</strong></span>';
		oCellName.innerHTML = '<span onclick="GoMySumPop(\'' + arrPrList[iNo][i]['mid'] + '\')" class="btn">' + arrPrList[iNo][i].mnick + '</span>';
		oCellScore.innerHTML = '<span class="num">' + number_format(arrPrList[iNo][i].score) + '</span>Á¡';
	}
}

function ShowNewGame() {
	var iJson97Len = arrJson97.length;
	var arrRand97 = new Array();
	var iMaxLoop = 8;
	if( iMaxLoop > iJson97Len ) iMaxLoop = iJson97Len;
	iJson97Len--;

	var sJson97Text = '';
	for( var i = 0; i < iMaxLoop; i++ ) {
		do {
			r = Math.round(Math.random()*iJson97Len);
		}while( arrRand97[r] != null );
		arrRand97[r] = true;
		sJson97Text = sJson97Text + '<div class="sum_box1"><ul><li onclick="GoFlashGamePlay('+arrJson97[r].fno+',\'\',\'y\')" class="btn"><img src="'+arrJson97[r].fimg+'" class="sum_img" width="54" height="34" /></li><li class="sum_tit1">'+crop(arrJson97[r].ftit,7,'..')+'</li></ul></div>';
	}

	if( sJson97Text ) $('NEW_GAME_LIST').innerHTML = sJson97Text;
}

function ShowHotGame() {
	var iJson96Len = arrJson96.length;
	var arrRand96 = new Array();
	var iMaxLoop = 8;
	if( iMaxLoop > iJson96Len ) iMaxLoop = iJson96Len;
	iJson96Len--;

	var sJson96Text = '';
	for( var i = 0; i < iMaxLoop; i++ ) {
		do {
			r = Math.round(Math.random()*iJson96Len);
		}while( arrRand96[r] != null );
		arrRand96[r] = true;
		sJson96Text = sJson96Text + '<div class="sum_box2"><ul><li onclick="GoFlashGamePlay('+arrJson96[r].fno+',\'\',\'y\')" class="btn"><img src="'+arrJson96[r].fimg+'" class="sum_img2" width="54" height="34" /></li><li class="sum_tit2">'+crop(arrJson96[r].ftit,7,'..')+'</li></ul></div>';
	}

	if( sJson96Text ) $('HOT_GAME_LIST').innerHTML = sJson96Text;
}

function GetPagingHtml( sUrl, iPage, iTCnt, iLen, sOther ) {
	HttpSock( 'Get', '/rank/paging.php?page=' + iPage + '&cnt=' + iTCnt + '&len=' + iLen + '&url=' + sUrl + sOther, '', '', ShowPagingHtml );
}
function ShowPagingHtml( sResponseText ) {
	$( 'paging_box' ).innerHTML = sResponseText;
}

function LogRankGame( iNo, sF, sA ) { 
	var sQue = '';
	if(arguments[3]) sQue = '&a2=' + arguments[3];
	HttpSock( 'Get', '/game/log_play.php?no=' + iNo + '&f=' + sF + '&a=' + sA + sQue, '', '', CheckLogRank );
}

function CheckLogRank( sResponseText ) {}

function flashGame(FlashIDName, FlashFileName, FlashWidth, FlashHeight, DNSSetting, WMODESetting, FlashBGColor, QSetting, FlashAlign) {	
	document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('CODEBASE="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=9,0,0,0" ');
	document.write(' ID="'+FlashIDName+'" WIDTH="' + FlashWidth + '" HEIGHT="' + FlashHeight + '" ALIGN="wmode">');
	document.write('<PARAM NAME="movie" VALUE="'+ FlashFileName +'">');
	document.write('<PARAM NAME="quality" VALUE="high">');
	document.write('<PARAM NAME="bgcolor" VALUE="'+FlashBGColor+'">');
	document.write('<PARAM NAME="wmode" VALUE="">');
	document.write('<PARAM NAME="allowScriptAccess" VALUE="always">');
	document.write('<PARAM NAME="volume" VALUE="70">');
	document.write('<EMBED SRC="'+ FlashFileName +'"  NAME="'+FlashIDName+'"');
	document.write(' WIDTH="' + FlashWidth + '" HEIGHT="' + FlashHeight + '" QUALITY="high" BGCOLOR="'+FlashBGColor+'"');
	document.write(' ALLOWSCRIPTACCESS="always" ALIGN="wmode" WMODE="" TYPE="application/x-shockwave-flash" VOLUME="70"');
	document.write(' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" >');
	document.write('</EMBED>');
	document.write('</OBJECT>');
}


function MainSwPlayRankList( iNo ) {
	var ObjTb = $('PLAY_RANK');
	var ObjTrList = $('PLAY_RANK').getElementsByTagName('tr');
	var iTrLen = ObjTrList.length;

	for( var i=iTrLen-1; i >= 0; i-- ) {
		if( isIE ) 
			ObjTb.deleteRow(i);
		else 
			ObjTb.removeChild(ObjTrList[i]);		
	}

	try{
		if( arrPrList[iNo].length <= 0 ) {
			$('PLAY_RANK_NONE').style.display = '';
			return;
		}
		else $('PLAY_RANK_NONE').style.display = 'none';
	}catch(e){}

	for( var i=0; i < arrPrList[iNo].length; i++ ) {
		if( isIE ) {
			var oRow = ObjTb.insertRow();
			var oCellNo = oRow.insertCell();
			var oCellName = oRow.insertCell();
			var oCellScore = oRow.insertCell();
		} else {
			var ObjTr = document.createElement('TR');
			ObjTb.appendChild( ObjTr );
			var oCellNo = document.createElement('TD');
			var oCellName = document.createElement('TD');
			var oCellScore= document.createElement('TD');
			ObjTr.appendChild( oCellNo);
			ObjTr.appendChild( oCellName);
			ObjTr.appendChild( oCellScore);
		}
		oCellNo.width = '8%';
		oCellNo.height = '20px';
		oCellName.width = '56%';
		oCellScore.width = '36%';
		oCellScore.className = 'num';

		if( arrPrList[iNo][i].rank <= 3 ) oCellNo.innerHTML = '<img src="' + sImageDir + '/main/b_' + arrPrList[iNo][i].rank + '.gif" width="10" height="13" />';
		else oCellNo.innerHTML = '<strong>' + arrPrList[iNo][i].rank + '</strong>';
		oCellName.innerHTML = '<span onclick="GoMySumPop(\'' + arrPrList[iNo][i]['mid'] + '\')" class="btn">' + arrPrList[iNo][i].mnick + '</span>';
		oCellScore.innerHTML = number_format(arrPrList[iNo][i].score);
	}
}

function flashview(FlashIDName, FlashFileName, FlashWidth, FlashHeight, DNSSetting, WMODESetting, FlashBGColor, QSetting, FlashAlign) {	
	var sHtml = '';
	sHtml += '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	sHtml += 'CODEBASE="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=8,0,22,0" ';
	sHtml += ' ID="'+FlashIDName+'" WIDTH="' + FlashWidth + '" HEIGHT="' + FlashHeight + '" ALIGN="wmode">';
	sHtml += '<PARAM NAME="movie" VALUE="'+ FlashFileName +'">';
	sHtml += '<PARAM NAME="quality" VALUE="high">';
	sHtml += '<PARAM NAME="bgcolor" VALUE="'+FlashBGColor+'">';
	sHtml += '<PARAM NAME="wmode" VALUE="transparent">';
	sHtml += '<PARAM NAME="allowScriptAccess" VALUE="always">';
	sHtml += '<PARAM NAME="volume" VALUE="70">';
	sHtml += '<EMBED SRC="'+ FlashFileName +'"  NAME="'+FlashIDName+'"';
	sHtml += ' WIDTH="' + FlashWidth + '" HEIGHT="' + FlashHeight + '" QUALITY="high" BGCOLOR="'+FlashBGColor+'"';
	sHtml += ' ALLOWSCRIPTACCESS="always" ALIGN="wmode" WMODE="transparent" TYPE="application/x-shockwave-flash" VOLUME="70"';
	sHtml += ' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" >';
	sHtml += '</EMBED>';
	sHtml += '</OBJECT>';
	document.write(sHtml);
}

QuickMenu = function(element, startPoint, endPoint) {

	var STATICMENU = element;
	var stmnScrollSpeed = 1;
	var stmnTimer;

	RefreshStaticMenu = function ()
	{
		var stmnStartPoint = parseInt(STATICMENU.style.top, 10);
		var stmnEndPoint = parseInt(document.documentElement.scrollTop, 10)+endPoint;
		var stmnRefreshTimer = 1;

		if ( stmnStartPoint != stmnEndPoint ) {
				stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 17 );
				STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ) + "px";
				stmnRefreshTimer = stmnScrollSpeed;
		}
		stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
	}
	this.InitializeStaticMenu = function ()
	{
			STATICMENU.style.top = startPoint + "px";
			RefreshStaticMenu();
	}
}
