﻿function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function drawShadowTable1(w_table,h_title,color_title,bg_title)
{

	document.writeln("<table width='"+(w_table+18)+"' border='0' cellspacing='0' cellpadding='0'>");
	document.writeln("	<tr>");
	document.writeln("		<td width='5' height='5' background='/images/common/shaodw_lt.jpg'></td>");
	document.writeln("		<td width='"+w_table+"' height='5'>");
	document.writeln("			<table width='"+w_table+"' height='100%' border='0' cellspacing='0' cellpadding='0'>");
	document.writeln("				<tr>");
	document.writeln("					<td width='20' height='5' background='/images/common/shaodw_t1.jpg'></td>");
	document.writeln("					<td width='"+(w_table-40)+"' height='5' background='/images/common/shaodw_t2.jpg'></td>");
	document.writeln("					<td width='20' height='5' background='/images/common/shaodw_t3.jpg'></td>");
	document.writeln("				</tr>");
	document.writeln("			</table>");
	document.writeln("		</td>");
	document.writeln("		<td width='13' height='5' background='/images/common/shaodw_rt.jpg'></td>");
	document.writeln("	</tr>");

	if(h_title>0){
		document.writeln("	<tr>");
		document.writeln("		<td width='5' height='"+h_title+"'><img height='100%' width='5' src='/images/common/shaodw_lt2.jpg'/></td>");
		document.writeln("		<td width='"+w_table+"' height='"+h_title+"'"+(color_title.length>0?(" bgcolor='"+color_title+"'"):"")+(bg_title.length>0?(" style=\"width:100%; height:100%; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+bg_title+"', sizingMethod='scale');\""):"")+"  style='position:relative;'>");
	}

}

function drawShadowTable2(w_table,color_table,bg_table,h_title)
{
	if(h_title>0){
		document.writeln("		</td>");
		document.writeln("		<td width='13' height='"+h_title+"'><img height='100%' width='13' src='/images/common/shaodw_rt2.jpg'/></td>");
		document.writeln("	</tr>");
	}

	document.writeln("	<tr>");
	document.writeln("		<td width='5' background='/images/common/shaodw_l.jpg'></td>");
	document.writeln("		<td width='"+w_table+"' valign='top' "+(color_table.length>0?(" bgcolor='"+color_table+"'"):"")+(bg_table.length>0?(" style=\"width:100%; height:100%; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+bg_table+"', sizingMethod='scale');\""):"")+">");

	document.writeln("			<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'>");
	if(h_title>0){
		document.writeln("				<tr>");
		document.writeln("					<td width='100%' height='8' background='/images/common/shaodw_b_8.jpg'></td>");
		document.writeln("				</tr>");
	}
	document.writeln("				<tr>");
	document.writeln("					<td width='"+w_table+"' style='position:relative;'>");

}

function drawShadowTable3(w_table)
{

	document.writeln("					</td>");
	document.writeln("				</tr>");
	document.writeln("			</table>");

	document.writeln("		</td>");
	document.writeln("		<td width='13' background='/images/common/shaodw_r.jpg'></td>");
	document.writeln("	</tr>");
	document.writeln("	<tr>");
	document.writeln("		<td width='5' height='13' background='/images/common/shaodw_lb.jpg'></td>");
	document.writeln("		<td width='"+w_table+"' height='13'>");
	document.writeln("			<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
	document.writeln("				<tr>");
	document.writeln("					<td width='20' height='13' background='/images/common/shaodw_b1.jpg'></td>");
	document.writeln("					<td width='"+(w_table-40)+"' height='13' background='/images/common/shaodw_b2.jpg'></td>");
	document.writeln("					<td width='20' height='13' background='/images/common/shaodw_b3.jpg'></td>");
	document.writeln("				</tr>");
	document.writeln("			</table>");
	document.writeln("		</td>");
	document.writeln("		<td width='13' height='13' background='/images/common/shaodw_rb.jpg'></td>");
	document.writeln("	</tr>");
	document.writeln("</table>");
}


function drawShadowTableString1(w_table,h_title,color_title,bg_title)
{
	var str = "";
	str		+=	("<table width='"+(w_table+18)+"' border='0' cellspacing='0' cellpadding='0'>");
	str		+=	("	<tr>");
	str		+=	("		<td width='5' height='5' background='/images/common/shaodw_lt.jpg'></td>");
	str		+=	("		<td width='"+w_table+"' height='5'>");
	str		+=	("			<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'>");
	str		+=	("				<tr>");
	str		+=	("					<td width='20' height='5' background='/images/common/shaodw_t1.jpg'></td>");
	str		+=	("					<td width='"+(w_table-40)+"' height='5' background='/images/common/shaodw_t2.jpg'></td>");
	str		+=	("					<td width='20' height='5' background='/images/common/shaodw_t3.jpg'></td>");
	str		+=	("				</tr>");
	str		+=	("			</table>");
	str		+=	("		</td>");
	str		+=	("		<td width='13' height='5' background='/images/common/shaodw_rt.jpg'></td>");
	str		+=	("	</tr>");

	if(h_title>0){
		str		+=	("	<tr>");
		str		+=	("		<td width='5' height='"+h_title+"'><img height='100%' width='5' src='/images/common/shaodw_lt2.jpg'/></td>");
		str		+=	("		<td width='"+w_table+"' height='"+h_title+"'"+(color_title.length>0?(" bgcolor='"+color_title+"'"):"")+(bg_title.length>0?(" style=\"width:100%; height:100%; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+bg_title+"', sizingMethod='scale');\""):"")+"  style='position:relative;'>");
	}
	return str;
}
function drawShadowTableString7(w_table,h_title,color_title,bg_title)
{
	var str = "";
	str		+=	("<table width='"+(w_table)+"' border='0' cellspacing='0' cellpadding='0'>");
	str		+=	("	<tr>");

	str		+=	("		<td width='"+w_table+"' height='5'>");
	str		+=	("			<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'>");
	str		+=	("				<tr>");
	str		+=	("					<td width='20' height='5' background='/images/common/shaodw_t1.jpg'></td>");
	str		+=	("					<td width='"+(w_table-40)+"' height='5' background='/images/common/shaodw_t2.jpg'></td>");
	str		+=	("					<td width='20' height='5' background='/images/common/shaodw_t3.jpg'></td>");
	str		+=	("				</tr>");
	str		+=	("			</table>");
	str		+=	("		</td>");
	str		+=	("		<td width='13' height='5' background='/images/common/shaodw_rt.jpg'></td>");
	str		+=	("	</tr>");

	if(h_title>0){
		str		+=	("	<tr>");

		str		+=	("		<td width='"+w_table+"' height='"+h_title+"'"+(color_title.length>0?(" bgcolor='"+color_title+"'"):"")+(bg_title.length>0?(" style=\"width:100%; height:100%; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+bg_title+"', sizingMethod='scale');\""):"")+"  style='position:relative;'>");
	}
	return str;
}

function drawShadowTableString2(w_table,color_table,bg_table,h_title)
{
	var str = "";
	if(h_title>0){
		str		+=	("		</td>");
		str		+=	("		<td width='13' height='"+h_title+"'><img height='100%' width='13' src='/images/common/shaodw_rt2.jpg'/></td>");
		str		+=	("	</tr>");
	}

	str		+=	("	<tr>");
	str		+=	("		<td width='5' background='/images/common/shaodw_l.jpg'></td>");
	str		+=	("		<td width='"+w_table+"' valign='top' "+(color_table.length>0?(" bgcolor='"+color_table+"'"):"")+(bg_table.length>0?(" style=\"width:100%; height:100%; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+bg_table+"', sizingMethod='scale');\""):"")+">");

	str		+=	("			<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'>");
	if(h_title>0){
		str		+=	("				<tr>");
		str		+=	("					<td width='100%' height='8' background='/images/common/shaodw_b_8.jpg'></td>");
		str		+=	("				</tr>");
	}
	str		+=	("				<tr>");
	str		+=	("					<td width='"+w_table+"' style='position:relative;'>");
	return str;
}

function drawShadowTableString3(w_table)
{
	var str = "";
	str		+=	("					</td>");
	str		+=	("				</tr>");
	str		+=	("			</table>");

	str		+=	("		</td>");
	str		+=	("		<td width='13' background='/images/common/shaodw_r.jpg'></td>");
	str		+=	("	</tr>");
	str		+=	("	<tr>");
	str		+=	("		<td width='5' height='13' background='/images/common/shaodw_lb.jpg'></td>");
	str		+=	("		<td width='"+w_table+"' height='13'>");
	str		+=	("			<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
	str		+=	("				<tr>");
	str		+=	("					<td width='20' height='13' background='/images/common/shaodw_b1.jpg'></td>");
	str		+=	("					<td width='"+(w_table-40)+"' height='13' background='/images/common/shaodw_b2.jpg'></td>");
	str		+=	("					<td width='20' height='13' background='/images/common/shaodw_b3.jpg'></td>");
	str		+=	("				</tr>");
	str		+=	("			</table>");
	str		+=	("		</td>");
	str		+=	("		<td width='13' height='13' background='/images/common/shaodw_rb.jpg'></td>");
	str		+=	("	</tr>");
	str		+=	("</table>");
	return str;
}

function replaceComma(str)
{
	if(str==null || str.length==0) return "";
	while(str.indexOf(",")>-1){
		str = str.replace(",","");
	}
	return str;
}
function numChk(num)
{
	var rightchar = replaceComma(num.value);
	var moneychar="";
	for(index=rightchar.length-1;index>=0;index--){
		splitchar = rightchar.charAt(index);
		if(isNaN(splitchar)){
			alert(splitchar+"숫자가 아닙니다.\n다시 입력해주십시오.");
			num.value="";
			num.focus();
			return false;
		}
		moneychar = splitchar+moneychar;
		if(index%3==rightchar.length%3 && index  !=0) {
			moneychar = ','+moneychar;
		}
	}
	num.value = moneychar;
	return true;
}

function goMenu(idx)
{
	if(idx == 0) location.href="index.php";
	if(idx == 10) location.href="game.php";
	if(idx == 11) location.href="game2.php";
	if(idx == 12) location.href="game3.php";
	if(idx == 20) location.href="result.php";
	if(idx == 21) location.href="result2.php";
	if(idx == 22) location.href="result3.php";
	if(idx == 30) location.href="dlqpsxm.php";
	if(idx == 40) location.href="bbs.php";
	if(idx == 50) location.href="index.php?act=message_list";
	if(idx == 60) location.href="6.htm";
	if(idx == 70) location.href="index.php?act=account_deposit";
	if(idx == 71) location.href="index.php?act=account_log";
	if(idx == 80) location.href="index.php?act=account_raply";
	if(idx == 81) location.href="index.php?act=exaccount_log";
	if(idx == 90) location.href="betting.php";
	if(idx == 110) location.href="message.php";
	if(idx == 120) location.href="bbs.php?act=bbs_write";
	if(idx == 130) location.href="game4.php";
}
function notice(str)
{
	alert(str);
}
//숫자만
function checkDigitOnly( digitChar )
{
	if ( digitChar == null ) return false ;

	for(var i=0;i<digitChar.length;i++){
		var c=digitChar.charCodeAt(i);
		if( !(  0x30 <= c && c <= 0x39 )){
			return false ;
		}
	}
	return true ;
}
//한글만
function checkKoreanOnly( koreanChar )
{
	if ( koreanChar == null ) return false ;

	for(var i=0; i < koreanChar.length; i++){ 
		var c=koreanChar.charCodeAt(i); 
		//( 0xAC00 <= c && c <= 0xD7A3 ) 초중종성이 모인 한글자 
		//( 0x3131 <= c && c <= 0x318E ) 자음 모음 
		if( !( ( 0xAC00 <= c && c <= 0xD7A3 ) || ( 0x3131 <= c && c <= 0x318E ) ) ) {
			return false ; 
		}
	}
	return true ;
}
//영문만
function checkEnglishOnly( englishChar )
{

	if ( englishChar == null ) return false ;

	for( var i=0; i < englishChar.length;i++){
		var c=englishChar.charCodeAt(i);
		if( !( (  0x61 <= c && c <= 0x7A ) || ( 0x41 <= c && c <= 0x5A ) ) ) {
			return false ;       
		}
	}
	return true ;
}
//영숫자만
function checkEnglishDigitOnly( englishChar )
{

	if ( englishChar == null ) return false ;

	for( var i=0; i < englishChar.length;i++){
		var c=englishChar.charCodeAt(i);
		if(!((0x61 <= c && c <= 0x7A ) || ( 0x41 <= c && c <= 0x5A )) && !(0x30 <= c && c <= 0x39))
		{
			return false ;       
		}
	}
	return true ;
}
//한글숫자만
function checkKoreanDigitOnly( koreanChar )
{
	if ( koreanChar == null ) return false ;

	for(var i=0; i < koreanChar.length; i++){ 
		var c=koreanChar.charCodeAt(i); 
		//( 0xAC00 <= c && c <= 0xD7A3 ) 초중종성이 모인 한글자 
		//( 0x3131 <= c && c <= 0x318E ) 자음 모음 
		if( !((0xAC00 <= c && c <= 0xD7A3 ) || ( 0x3131 <= c && c <= 0x318E)) && !(0x30 <= c && c <= 0x39)) {
			return false ;
		}
	}
	return true ;
}






