﻿<!--
/*
##########################################################################################################################
#                                     
#  Active-X IE 설계변경관련 스크립트  
#
#  작성자 : 이주형 
#
#  작성일 : 2006년 4월 3일
#
###########################################################################################################################
*/
 

function docwrite(str) {
	document.write(str);
}

/*
###########################################################################################################################
# 
# 플래쉬 관련
# 
# <script language="javascript"> FlashCommon( "idF1", "main_flash.swf", "370", "236" ); </script>
# 
###########################################################################################################################
*/
function FlashCommon( id, ObjUrl, vWidth, vHeight ) {

	var str = "";
	str  = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + vWidth + '" height="' + vHeight + ' id="' + id + '" align="middle">';
	str += '<param name="movie" value="' + ObjUrl + '">';
	str += '<param name="quality" value="high">';
	str += '<param name="wmode" value="transparent">';
	str += '<param name="bgcolor" value="#ffffff">';
	str += '<param name="allowScriptAccess" value="naver">';
	str += '<param name="allownetworking" value="internal">';
	str += '<embed src="' + ObjUrl + '" quality="high" wmode="transparent" bgcolor="#ffffff" width="' + vWidth + '" height="' + vHeight + '" id="' + id + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="naver" allownetworking="internal"></embed>';
	str += '</object>';

	document.writeln(str);
}

/*
###########################################################################################################################
# 
# EMBED 관련
# 
# <script language="javascript"> MediaCommon( "idM1", "movie.wmv", "320", "240" ); </script>
# 
###########################################################################################################################
*/

function EmbedCommon( id, ObjUrl, vWidth, vHeight ) {

	var str = "";
	str  = '<embed id="' + id + '" src="' + ObjUrl + '" width="' + vWidth + '" height="' + vHeight + '"  type=application/x-shockwave-flash allowScriptAccess=naver allownetworking=internal></embed>';
	document.writeln(str);
}



function trim(s){
    s = s.replace(/^\s*/,'').replace(/\s*S/, '');
    return s;
}

function trimL(s){
    s = s.replace(/^\s*/,' ').replace(/\s*S/, ' ');
    return s;
}

function OpenDetailPhoto (menuID, fileName)
{
	Photo = window.open("/Board/OpenDetailPhoto.aspx?menuID="+ menuID +"&fileName=" + fileName , "Photo", "toolbar=no, menubar=no, scrollbars=yes, width=410,height=300")
	Photo.focus();
}

// 로그인 메인화면에서 select 에서 사용됨.
function MyURL(value)
{
	location.href=value;
}


/*
###########################################################################################################################
# 
# 폼 체크 관련
#
###########################################################################################################################
*/

function FormSubmitJoinStep1(obj)
{

	var objAddress = document.getElementById(obj+"txtMailAddress");
	var objDomain = document.getElementById(obj+"txtMailDomain");
	

	if ( trim(objAddress.value).length == 0 )
	{
		alert("メールアドレスを入力してください。");
		objAddress.focus();
		return false;
	}
	
	if ( trim(objDomain.value).length == 0 )
	{
		alert("メールアドレスのドメインを入力してください。");
		objDomain.focus();
		return false;
	}
	
	
	if (!CheckMailAddress(trim(objAddress.value)+"@"+trim(objDomain.value)))
	{
		alert("メールアドレスが正しくありません。");
		objAddress.focus();
		return false;
	}
    
}

function FormSubmitChangeMemberStep2(obj)
{


	if(document.getElementById(obj+"txtNickName") != null)
	{

		var len = calculateBytes(document.getElementById(obj+"txtNickName").value);
		
		if (len <4 || len > 16)
		{
			alert("ニックネームを全角2～8文字(半角4～16文字)以内で入力してください。");
			document.getElementById(obj+"txtNickName").focus();
			return false;
		}
		
		
		
		if(document.getElementById(obj+"hdnflgCheckNick").value == "false")
		{
			alert("ニックネームを確認してください。");
			document.getElementById(obj+"txtNickName").focus();
			return false;
		}
	    
	 }   
  
    
	var objAddress = document.getElementById(obj+"txtMailAddress");
	var objDomain = document.getElementById(obj+"txtMailDomain");
	

	if ( trim(objAddress.value).length == 0 )
	{
		alert("メールアドレスを入力してください。");
		objAddress.focus();
		return false;
	}
	
	if ( trim(objDomain.value).length == 0 )
	{
		alert("メールアドレスのドメインを入力してください。");
		objDomain.focus();
		return false;
	}
	
	
	if (!CheckMailAddress(trim(objAddress.value)+"@"+trim(objDomain.value)))
	{
		alert("メールアドレスが正しくありません。");
		objAddress.focus();
		return false;
	}
    
}

function ChangeMailDomain(obj) {

	var objDomain = document.getElementById(obj+"ddlMailDomain");
	var objTxtDomain = document.getElementById(obj+"txtMailDomain");
    
  
  if(objDomain.value=="") {
    objTxtDomain.value = '';
    objTxtDomain.readOnly=false
    objTxtDomain.focus();
    
  } else if(objDomain.value == "none") {
    objTxtDomain.value = '';
    objTxtDomain.readOnly=true
  } else {
    objTxtDomain.value = objDomain.value;
    objTxtDomain.readOnly=true
	}
}


function FormSubmitJoinStep2(obj)
{
	

	if ( trim(document.getElementById(obj+"txtID").value).length < 4 ||  trim(document.getElementById(obj+"txtID").value).length > 12)
	{
		alert("ご希望のIDを半角小英数4~12文字以内で入力してください。");
		document.getElementById(obj+"txtID").focus();
		return false;
	}
	
	
	
	if(document.getElementById(obj+"hdnflgCheckID").value == "false")
	{
	    alert("IDを確認してください。");
		document.getElementById(obj+"txtID").focus();
		return false;
	}
	
	var len = calculateBytes(document.getElementById(obj+"txtNickName").value);
	
	if (len <4 || len > 16)
	{
		alert("ニックネームを全角2～8文字(半角4～16文字)以内で入力してください。");
		document.getElementById(obj+"txtNickName").focus();
		return false;
	}
	
	
	
	if(document.getElementById(obj+"hdnflgCheckNick").value == "false")
	{
	    alert("ニックネームを確認してください。");
		document.getElementById(obj+"txtNickName").focus();
		return false;
	}
	
	if ( trim(document.getElementById(obj+"txtPW").value).length < 6 ||  trim(document.getElementById(obj+"txtPW").value).length > 16)
	{
		alert("パスワードを6~16文字以内で入力してください。");
		document.getElementById(obj+"txtPW").focus();
		return false;
	}
	
	
	//if (checkNumeric(trim(document.getElementById(obj+"txtPW").value)))
	//{
	//	alert("数字のみのパスワードはご利用できません。");
	//	document.getElementById(obj+"txtPW").focus();
	//	return false;
	//}
	
	if ( trim(document.getElementById(obj+"txtPW").value) != trim(document.getElementById(obj+"txtRePW").value)){
	    alert("パスワードが一致しません。");
		document.getElementById(obj+"txtRePW").focus();
		return false;
	}
	
	if (!trim(document.getElementById(obj+"txtRePW").value) || trim(document.getElementById(obj+"txtRePW").value) == ""){
	    alert("パスワード確認のため再度ご入力ください。");
		document.getElementById(obj+"txtRePW").focus();
		return false;
	}
	
	
	
	if (trim(document.getElementById(obj+"txtPW").value) == trim(document.getElementById(obj+"txtID").value)){
	    alert("IDと同じ文字列はパスワードに使用できません。");
		document.getElementById(obj+"txtPW").focus();
		return false;
	}
	
	if ( trim(document.getElementById(obj+"txtCaptcha").value).length == 0)
	{
		alert("画像認証を入力してください。");
		document.getElementById(obj+"txtCaptcha").focus();
		return false;
	}
	
	if (trim(document.getElementById(obj+"txtNameKatakana").value) != ""){
	    if(!CheckKatakana(trim(document.getElementById(obj+"txtNameKatakana").value))){
	        alert("お名前は全角カタカナで入力してください。");
		    document.getElementById(obj+"txtNameKatakana").focus();
	        return false;
	    }
	
	}
	
	
	if (trim(document.getElementById(obj+"txtZipcode1").value) != "")
	{
		if(!nr_num_int(document.getElementById(obj+"txtZipcode1").value))
		{
			alert("郵便番号を確認してください。");
		    document.getElementById(obj+"txtZipcode1").focus();
			return false;
		}
	}
	
	if (trim(document.getElementById(obj+"txtZipcode2").value) != "")
	{
		if(!nr_num_int(document.getElementById(obj+"txtZipcode2").value))
		{
			alert("郵便番号を確認してください。");
		    document.getElementById(obj+"txtZipcode2").focus();
			return false;
		}
	}
    
}

//Login Check
function FormSubmitLogin(obj)
{

	var objID = document.getElementById(obj+"txtPortalID");
	var objPW = document.getElementById(obj+"txtPortalPW");
	
	

	if ( trim(objID.value).length == 0 )
	{
		alert("IDを入力してください。");
		objID.focus();
		return false;
	}else if ( trim(objID.value).length < 4 || trim(objID.value).length > 12 )
	{
		alert("IDを半角小英数4~12文字以内入力してください。");
		objID.focus();
		return false;
	}
	//else if (checkNumeric(trim(objID.value)))
	//{
	//	alert("数字のみのIDは入力できません。");
	//	objID.focus();
	//	return false;
	//} else if (checkNumeric(trim(objID.value).charAt(0)))
	//{
	//	alert("IDの頭文字は英文小文字(a～z)のみ使用可能です。");
	//	objID.focus();
	//	return false;
	//}
 else if (checkAlphaNumeric(objID.value) && !checkLowAlphaNumeric(objID.value)) 
	{
		alert("アルファベット大文字はご利用できません。");
		objID.focus();
		return false;
	}else if (!checkLowAlphaNumeric(objID.value)) 
	{
		alert("入力された内容に禁止されている文字があります。");
		objID.focus();
		return false;
	}	

	if ( trim(objPW.value).length == 0 )
	{
		alert("パスワードを入力してください。");
		objPW.focus();
		return false;
	}else if ( trim(objPW.value).length < 6 || trim(objPW.value).length > 16 )
	{
		alert("6~16文字を入力してください。");
		objPW.focus();
		return false;
	}


	return true;
    
}


function FormSubmitLoginMain()
{

	var objID = document.getElementById("txtPortalID");
	var objPW = document.getElementById("txtPortalPW");
	
	

	if ( trim(objID.value).length == 0 )
	{
		alert("IDを入力してください。");
		objID.focus();
		return false;
	}else if ( trim(objID.value).length < 4 || trim(objID.value).length > 12 )
	{
		alert("IDを半角小英数4~12文字以内入力してください。");
		objID.focus();
		return false;
	}
	//else if (checkNumeric(trim(objID.value)))
	//{
	//	alert("数字のみのIDは入力できません。");
	//	objID.focus();
	//	return false;
	//} else if (checkNumeric(trim(objID.value).charAt(0)))
	//{
	//	alert("IDの頭文字は英文小文字(a～z)のみ使用可能です。");
	//	objID.focus();
	//	return false;
	//}
 else if (checkAlphaNumeric(objID.value) && !checkLowAlphaNumeric(objID.value)) 
	{
		alert("アルファベット大文字はご利用できません。");
		objID.focus();
		return false;
	}else if (!checkLowAlphaNumeric(objID.value)) 
	{
		alert("入力された内容に禁止されている文字があります。");
		objID.focus();
		return false;
	}	

	if ( trim(objPW.value).length == 0 )
	{
		alert("パスワードを入力してください。");
		objPW.focus();
		return false;
	}else if ( trim(objPW.value).length < 6 || trim(objPW.value).length > 16 )
	{
		alert("6~16文字を入力してください。");
		objPW.focus();
		return false;
	}


	return true;
    
}

//#### 会員情報修正　#### Start ############################################################################################




//FormSubmitMemberEditStep1 Check
function FormSubmitMemberEditStep1(obj)
{

	var objID = document.getElementById(obj+"txtIdStep1");
	var objPW = document.getElementById(obj+"txtPwStep1");
	
	var objAddress = document.getElementById(obj+"txtMailAddress");
	var objDomain = document.getElementById(obj+"txtMailDomain");

	if ( trim(objID.value).length == 0 )
	{
		alert("IDを入力してください。");
		objID.focus();
		return false;
	}else if ( trim(objID.value).length < 4 || trim(objID.value).length > 12 )
	{
		alert("半角小英数4文字以上入力してください。");
		objID.focus();
		return false;
	}else if (checkNumeric(trim(objID.value)))
	{
		alert("数字のみのIDは入力できません。");
		objID.focus();
		return false;
	}
	//else if (checkNumeric(trim(objID.value).charAt(0)))
	//{
	//	alert("IDの頭文字は英文小文字(a～z)のみ使用可能です。");
	//	objID.focus();
	//	return false;
	//} else if (checkAlphaNumeric(objID.value) && !checkLowAlphaNumeric(objID.value)) 
	//{
	//	alert("アルファベット大文字はご利用できません。");
	//	objID.focus();
	//	return false;
	//}
else if (!checkLowAlphaNumeric(objID.value)) 
	{
		alert("入力された内容に禁止されている文字があります。");
		objID.focus();
		return false;
	}	

	if ( trim(objPW.value).length == 0 )
	{
		alert("パスワードを入力してください。");
		objPW.focus();
		return false;
	}else if ( trim(objPW.value).length < 6 || trim(objPW.value).length > 16 )
	{
		alert("6~16文字を入力してください。");
		objPW.focus();
		return false;
	}
	

	

	if ( trim(objAddress.value).length == 0 )
	{
		alert("メールアドレスを入力してください。");
		objAddress.focus();
		return false;
	}
	
	if ( trim(objDomain.value).length == 0 )
	{
		alert("メールアドレスのドメインを入力してください。");
		objDomain.focus();
		return false;
	}
	
	
	if (!CheckMailAddress(trim(objAddress.value)+"@"+trim(objDomain.value)))
	{
		alert("メールアドレスが正しくありません。");
		objAddress.focus();
		return false;
	}
	
	
	return true;
    
}




	
//#### 会員情報修正　#### end ############################################################################################



//Board Search Check
function FormSubmitBoardSearch(obj)
{

	var obj = document.getElementById(obj+"txtSearchWord");
	
	

	if ( trim(obj.value).length == 0 )
	{
		alert("検索語を入力してください。");
		obj.focus();
		return false;
	}else if ( trim(obj.value).length < 2 || trim(obj.value).length > 12 )
	{
		alert("2文字以上入力してください。");
		obj.focus();
		return false;
	}
    
}

//Board Comment Check
function FormSubmitBoardComment(obj)
{

	var obj = document.getElementById(obj+"txtComment");	

	if ( trim(obj.value).length == 0 )
	{
		alert("コメントの内容を入力してください。");
		obj.focus();
		return false;
	}else if ( trim(obj.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		obj.focus();
		return false;
	}else if( trim(obj.value).length > 1000){
	    alert("1000文字以内に入力してください。");
		obj.focus();
		return false;
	}
    
}


//Board Form Check
function FormSubmitBoard(obj)
{

	var objTitle = document.getElementById(obj+"txtTitle");	
	var objContents = document.getElementById(obj+"txtContents");	
	
	if ( trim(objTitle.value).length == 0 )
	{
		alert("タイトルを入力してください。");
		objTitle.focus();
		return false;
	}else if ( trim(objTitle.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objTitle.focus();
		return false;
	}else if (trim(objTitle.value).length > 50){
	    alert("50文字以内に入力してください。");
	    objTitle.focus();
		return false;
	}
    

	if ( trim(objContents.value).length == 0 )
	{
		alert("内容を入力してください。");
		objContents.focus();
		return false;
	}else if ( trim(objContents.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objContents.focus();
		return false;
	}else if ( trim(objContents.value).length > 2000 ){
	    alert("2000文字以内に入力してください。");
		objContents.focus();
		return false;
	}
    
}



//BoardServer Form Check
function FormSubmitBoardServer(obj)
{

	var objCate0 = document.getElementById(obj+"rblCategory_0");
	var objCate1 = document.getElementById(obj+"rblCategory_1");
	var objCate2 = document.getElementById(obj+"rblCategory_2");
	var objCate3 = document.getElementById(obj+"rblCategory_3");

	var objTitle = document.getElementById(obj+"txtTitle");	
	var objContents = document.getElementById(obj+"txtContents");
	
	if(objCate0.checked != true && objCate1.checked != true && objCate2.checked != true && objCate3.checked != true)
	{
		alert("カテゴリーを選んでください。");
		return false;
	}

	
	if ( trim(objTitle.value).length == 0 )
	{
		alert("タイトルを入力してください。");
		objTitle.focus();
		return false;
	}else if ( trim(objTitle.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objTitle.focus();
		return false;
	}
    

	if ( trim(objContents.value).length == 0 )
	{
		alert("内容を入力してください。");
		objContents.focus();
		return false;
	}else if ( trim(objContents.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objContents.focus();
		return false;
	}
    
}


//FanSite Form Check
function FormSubmitFanSite(obj)
{

	var objSiteName = document.getElementById(obj+"txtSiteName");	
	var objSiteUrl = document.getElementById(obj+"txtSiteUrl");
	var objSiteManager = document.getElementById(obj+"txtSiteManager");
	var objSiteComment = document.getElementById(obj+"txtSiteComment");	
	
	if ( trim(objSiteName.value).length == 0 )
	{
		alert("サイト名を入力してください。");
		objSiteName.focus();
		return false;
	}
	
	if ( trim(objSiteUrl.value).length == 0 )
	{
		alert("サイトURLを入力してください。");
		objSiteUrl.focus();
		return false;
	}else if ( trim(objSiteUrl.value.toLowerCase()).substring(0,7) != "http://")
	{
		alert("必ずhttp://を入力してください。");
		objSiteUrl.focus();
		return false;
	}else if ( trim(objSiteUrl.value).length <= 7 )
	{
		alert("サイトURLを入力してください。");
		objSiteUrl.focus();
		return false;
	}
	
	if ( trim(objSiteManager.value).length == 0 )
	{
		alert("サイト管理者名を入力してください。");
		objSiteManager.focus();
		return false;
	}
    

	if ( trim(objSiteComment.value).length == 0 )
	{
		alert("内容を入力してください。");
		objSiteComment.focus();
		return false;
	}else if ( trim(objSiteComment.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objSiteComment.focus();
		return false;
	}else if ( trim(objSiteComment.value).length > 100 )
	{
		alert("100文字以内に入力してください。");
		objSiteComment.focus();
		return false;
	}
    
}








// #### Support ###########################################


//SupportOpinion Check
function FormSubmitSupportOpinion(obj)
{

	var objTitle = document.getElementById(obj+"txtOpinionTitle");	
	var objCharName = document.getElementById(obj+"txtOpinionCharName");	
	var objContents = document.getElementById(obj+"txtOpinionContents");
	
	if ( trim(objTitle.value).length == 0 )
	{
		alert("タイトルを入力してください。");
		objTitle.focus();
		return false;
	}else if ( trim(objTitle.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objTitle.focus();
		return false;
	}
	
	if ( trim(objCharName.value).length == 0 )
	{
		alert("キャラクター名をを入力してください。");
		objCharName.focus();
		return false;
	}
    

	if ( trim(objContents.value).length == 0 )
	{
		alert("内容を入力してください。");
		objContents.focus();
		return false;
	}else if ( trim(objContents.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objContents.focus();
		return false;
	}else if ( trim(objContents.value).length > 2000 )
	{
		alert("2000文字以下入力してください。");
		objContents.focus();
		return false;
	}
    
}




//SupportQnA Check
function FormSubmitSupportQnA(obj)
{

	var objTitle = document.getElementById(obj+"txtQnATitle");	
	var objCharName = document.getElementById(obj+"txtQnACharName");
	var objCategory = document.getElementById(obj+"ddlQnACategory2");	
	var objInfoSound = document.getElementById(obj+"txtQnaInfoSound");	
	var objContents = document.getElementById(obj+"txtQnAContents");
	
	if ( trim(objTitle.value).length == 0 )
	{
		alert("タイトルを入力してください。");
		objTitle.focus();
		return false;
	}else if ( trim(objTitle.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objTitle.focus();
		return false;
	}
	
	if ( trim(objCharName.value).length == 0 )
	{
		alert("キャラクター名をを入力してください。");
		objCharName.focus();
		return false;
	}
	
	
	if ( objCategory.selectedIndex == 0 )
	{
		alert("カテゴリーを選んでください。");
		return false;
	}
    
    
	
	//if ( trim(objInfoSound.value).length == 0 )
	//{
	//	alert("サウンドカードを入力してください。");
	//	objInfoSound.focus();
	//	return false;
	//}

	if ( trim(objContents.value).length == 0 )
	{
		alert("内容を入力してください。");
		objContents.focus();
		return false;
	}else if ( trim(objContents.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objContents.focus();
		return false;
	}else if ( trim(objContents.value).length > 2000 )
	{
		alert("2000文字以下入力してください。");
		objContents.focus();
		return false;
	}
    
}




//SupportServer Check
function FormSubmitSupportServer(obj)
{

	var objTitle = document.getElementById(obj+"txtServerTitle");	
	var objCharName = document.getElementById(obj+"txtServerCharName");
	var objCategory = document.getElementById(obj+"ddlServerCategory");
	var objCategoryServer = document.getElementById(obj+"ddlServerServerName");
	var objContents = document.getElementById(obj+"txtServerContents");
	
	if ( trim(objTitle.value).length == 0 )
	{
		alert("タイトルを入力してください。");
		objTitle.focus();
		return false;
	}else if ( trim(objTitle.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objTitle.focus();
		return false;
	}
	
	if ( trim(objCharName.value).length == 0 )
	{
		alert("キャラクター名をを入力してください。");
		objCharName.focus();
		return false;
	}
	
	
	if ( objCategory.selectedIndex == 0 )
	{
		alert("カテゴリーを選んでください。");
		return false;
	}
	
	if ( objCategoryServer.selectedIndex == 0 )
	{
		alert("サーバーを選んでください。");
		return false;
	}
        

	if ( trim(objContents.value).length == 0 )
	{
		alert("内容を入力してください。");
		objContents.focus();
		return false;
	}else if ( trim(objContents.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objContents.focus();
		return false;
	}else if ( trim(objContents.value).length > 2000 )
	{
		alert("2000文字以下入力してください。");
		objContents.focus();
		return false;
	}
    
}


// #### Tenke ############################################################################################################


//BoardServer Form Check
function FormSubmitTenke(obj)
{

	var objType0 = document.getElementById(obj+"rblType_0");
	var objType1 = document.getElementById(obj+"rblType_1");
	var objCate = document.getElementById(obj+"ddlCate");
	var objServer = document.getElementById(obj+"ddlServer");

	var objTitle = document.getElementById(obj+"txtTitle");	
	var objContents = document.getElementById(obj+"txtContents");
	
	
	
	if(objType0.checked != true && objType1.checked != true)
	{
		alert("種類を選んでください。");
		return false;
	}

	if ( trim(objCate.value).length == 0 )
	{
		alert("カテゴリーを選んでください。");
		return false;
	}

	if ( trim(objServer.value).length == 0 )
	{
		alert("サーバーを選んでください。");
		return false;
	}
	
	if ( trim(objTitle.value).length == 0 )
	{
		alert("タイトルを入力してください。");
		objTitle.focus();
		return false;
	}else if ( trim(objTitle.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objTitle.focus();
		return false;
	}
    

	if ( trim(objContents.value).length == 0 )
	{
		alert("内容を入力してください。");
		objContents.focus();
		return false;
	}else if ( trim(objContents.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		objContents.focus();
		return false;
	}
    
}


//Tenke Comment Check
function FormSubmitTenkeComment(obj)
{

	var obj = document.getElementById(obj+"txtComment");	

	if ( trim(obj.value).length == 0 )
	{
		alert("コメントの内容を入力してください。");
		obj.focus();
		return false;
	}else if ( trim(obj.value).length < 2 )
	{
		alert("2文字以上入力してください。");
		obj.focus();
		return false;
	}else if( trim(obj.value).length > 1000){
	    alert("1000文字以内に入力してください。");
		obj.focus();
		return false;
	}
    
}

/*
###########################################################################################################################
# 
# 그외 스크립트 관련
# 
#
###########################################################################################################################
*/


// #### Support ###########################################

function OpenSupportOpinion(imageUrl)
{
    document.getElementById("pnlOpinion").style.display = "block";
    document.getElementById("pnlQnA").style.display = "none";
    document.getElementById("pnlTogou").style.display = "none";

	document.getElementById("imgSupportOpinion").src = imageUrl + "/Web/support/tab_qna_01_r.gif";
    document.getElementById("imgSupportQnA").src = imageUrl + "/Web/support/tab_qna_02.gif";
    //document.getElementById("imgSupportTogou").src = imageUrl + "/Web/support/tab_qna_03.gif";

}

function OpenSupportQnA(imageUrl)
{
    document.getElementById("pnlOpinion").style.display = "none";
    document.getElementById("pnlQnA").style.display = "block";
    document.getElementById("pnlTogou").style.display = "none";
  
    document.getElementById("imgSupportOpinion").src = imageUrl + "/Web/support/tab_qna_01.gif";
    document.getElementById("imgSupportQnA").src = imageUrl + "/Web/support/tab_qna_02_r.gif";
    //document.getElementById("imgSupportTogou").src = imageUrl + "/Web/support/tab_qna_03.gif";
}

function OpenSupportTogou(imageUrl)
{
    document.getElementById("pnlOpinion").style.display = "none";
    document.getElementById("pnlQnA").style.display = "none";
    document.getElementById("pnlTogou").style.display = "block";
  
    document.getElementById("imgSupportOpinion").src = imageUrl + "/Web/support/tab_qna_01.gif";
    document.getElementById("imgSupportQnA").src = imageUrl + "/Web/support/tab_qna_02.gif";
    document.getElementById("imgSupportTogou").src = imageUrl + "/Web/support/tab_qna_03_r.gif";
}

function MoreViewJoinStep2()
{ 
       if (document.getElementById("pnlAddMemberInfo").style.display != "none"){
           document.getElementById("pnlAddMemberInfo").style.display = "none";
        }
        else {
        document.getElementById("pnlAddMemberInfo").style.display = "";
        }
}

// #### 20091224 Support start #####################
function OpenMySupportOpinion(imageUrl)
{
    document.getElementById("pnlOpinion").style.display = "block";
    document.getElementById("pnlQnA").style.display = "none";

	document.getElementById("imgSupportOpinion").src = imageUrl + "/Web/support/tab_qna_01_r.gif";
    document.getElementById("imgSupportQnA").src = imageUrl + "/Web/support/tab_qna_02.gif";
}

function OpenMySupportQnA(imageUrl)
{
    document.getElementById("pnlOpinion").style.display = "none";
    document.getElementById("pnlQnA").style.display = "block";
  
    document.getElementById("imgSupportOpinion").src = imageUrl + "/Web/support/tab_qna_01.gif";
    document.getElementById("imgSupportQnA").src = imageUrl + "/Web/support/tab_qna_02_r.gif";
}

// #### 20091224 Support end #####################

/*
###########################################################################################################################
# 
# 새창관련
# 
#
###########################################################################################################################
*/


    function openBeginnerGuide(){
		window.open('/Guide/BeginnerGuide/','BeginnerGuide','width=800, height=600');
    }
    
    function openBoardEventResultList(_menuID, idx){
		window.open('EventResult.aspx?menuID='+_menuID+'&idx='+idx,'BoardEventResultList','toolbar=no, menubar=no, scrollbars=yes, width=445, height=475');
    }
    
    
    
    function openNoticeServer(){
		window.open('/WebEvent/2009/06_Server','NoticeServer','toolbar=no, menubar=no, scrollbars=yes, width=818, height=700');
    }


/*
###########################################################################################################################
# 
# 메뉴 플레쉬 관련
# <script language="javascript"> putFlash( "flash.swf", "980", "218"); </script>  
#
###########################################################################################################################
*/

function putFlash(url,width,height)
{
	var id = "main";
	
	var html='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '+
	'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0" type="application/x-shockwave-flash" '+
	'data="'+url+'" width="'+width+'" height="'+height+'" id="'+id+'" name="'+id+'" hspace="0" vspace="0" align="">'+
	'<param name="allowScriptAccess" value="always" />'+
	'<param name="movie" value="'+url+'" />'+
	'<param name="wmode" value="transparent" />'+
	'<param name="quality" value="high" />'+
	'<param name="scale" value="noborder" />'+
	'<param name="loop" value="false" />'+
	'<param name="menu" value="false" />'+
	'<embed src="'+url+'" width="'+width+'" height="'+height+'" '+
	'id="'+id+'" name="'+id+'" swfLiveConnect=true wmode="transparent" quality="high" align="" allowScriptAccess="always" '+
	'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
	'</embed></object>';
	document.write(html)
}

function flash(url, x, y)
{
	document.writeln("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+x+"' height='"+y+"'>");
	document.writeln("  <param name='movie' value='"+url+"'>");
	document.writeln("	<param name='wmode' VALUE='transparent'>");
	document.writeln("	<param name='menu' VALUE='false'>");
	document.writeln("  <param name='quality' value='high'>");
	document.writeln("  <param name='allowScriptAccess' value='always'>");
	document.writeln("  <embed src='"+url+"' quality='high' wmode=transparent pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' allowScriptAccess='always' width='"+x+"' height='"+y+"'></embed>");
	document.writeln("</object>");
}











    function openUserInfo(){
	    window.open('/About/UserInfo.aspx','UserInfos','width=530, height=305');
    }


	function openMobileInfo(){
	    window.open('/Library/pop_WallpaperHelp.html','MobileInfos','width=500, height=500');
    }
/*
###########################################################################################################################
# 
# 영문 숫자 체크
#
###########################################################################################################################
*/






function addfavorites(){
var favoriteurl="http://makyo.gamecom.jp/"
var favoritetitle="コミカル妖怪活劇「魔境奇談」"
if (document.all)
    {
    
//		//FF
//		if(window.sidebar)
//		{
//			window.sidebar.addPanel(favoritetitle, favoriteurl, "");
//		}
//		
//		//IE
//		else if(window.external)
//		{
//		window.external.AddFavorite(favoriteurl, favoritetitle);
//		}
//		
//		// Opera
//		else if (window.opera && window.print)
//		{
//		return true;
//		}


 if (window.sidebar) { 
        window.sidebar.addPanel(favoritetitle, favoriteurl,""); 
    } else if( document.all ) { 
        window.external.AddFavorite( favoriteurl, favoritetitle); 
    } else if( window.opera && window.print ) { 
        return true; 
    } 

    }
    
}


function nr_numeng(this_s){
	temp_value = this_s.value.toString();
	regexp = /[^0-9a-zA-Z]/g;
	repexp = '';
	temp_value = temp_value.replace(regexp,repexp);
	this_s.value = temp_value;
}

/*-------------------------------------------------------------------------------*/
// 나머지 글자 무시
function nr_num(this_s,type){
	/*
	type
	-> 'int' : 양의 정수
	-> 'float' : 양의 실수
	-> '-int' : 음의 정수 포함
	-> '-int' : 음의 실수 포함
	*/
	temp_value = this_s.value.toString();
	regexp = /[^-\.0-9]/g;
	repexp = '';
	temp_value = temp_value.replace(regexp,repexp);
	regexp = '';
	repexp = '';
	switch(type){
		case 'int':	 regexp = /[^0-9]/g; break;
		case 'float':regexp = /^(-?)([0-9]*)(\.?)([^0-9]*)([0-9]*)([^0-9]*)/; break;
		case '-int':	regexp = /^(-?)([0-9]*)([^0-9]*)([0-9]*)([^0-9]*)/;break;
		case '-float':regexp = /^(-?)([0-9]*)(\.?)([^0-9]*)([0-9]*)([^0-9]*)/; break;
		default : regexp = /[^0-9]/g; break;
	}
	switch(type){
		case 'int':repexp = '';break;
		case 'float':repexp = '$2$3$5';break;
		case '-int':	repexp = '$1$2$4';break;
		case '-float':repexp = '$1$2$3$5'; break;
		default : regexp = /[^0-9]/g; break;
	}
	temp_value = temp_value.replace(regexp,repexp);
	this_s.value = temp_value;
}
// 양의 정수만 입력받기
function nr_num_int(this_s){
	nr_num(this_s,'int');
}
// 양의 실수만 입력받기
function nr_num_float(this_s){
	nr_num(this_s,'float');
}












/*
###########################################################################################################################
# 
# CheckUserId
#
###########################################################################################################################
*/

function checkAlphabet(checkWord) {
  if(checkWord == null) return false;
  
  for(var i = 0; i < checkWord.length; i++) {
    var c = checkWord.charCodeAt(i);
    if(!((65 <= c && c <= 90) || (97 <= c && c <= 122))) {
      return false;
    }
  }
  
  return true;
}

function checkNumeric(checkWord) {
  if(checkWord == null) return false;
  
  for(var i = 0; i < checkWord.length; i++) {
    var c = checkWord.charCodeAt(i);
    if(!(48 <= c && c <= 57)) {
      return false;
    }
  }
  
  return true;
}

function checkAlphaNumeric(checkWord) {
  if(checkWord == null) return false;
  
  for(var i = 0; i < checkWord.length; i++) {
    var c = checkWord.charCodeAt(i);
    if(!(((48 <= c && c <= 57) || (97 <= c && c <= 122) || (65 <= c && c <= 90)))) {
      return false;
    }
  }
  
  return true;
}



function checkLowAlphaNumeric(checkWord) {
  if(checkWord == null) return false;
  
  for(var i = 0; i < checkWord.length; i++) {
    var c = checkWord.charCodeAt(i);
    if(!(((48 <= c && c <= 57) || (97 <= c && c <= 122)))) {
      return false;
    }
  }
  
  return true;
}

function checkUpAlphaNumeric(checkWord) {
  if(checkWord == null) return false;
  
  for(var i = 0; i < checkWord.length; i++) {
    var c = checkWord.charCodeAt(i);
    if(!(((48 <= c && c <= 57) || (65 <= c && c <= 90)))) {
      return false;
    }
  }
  
  return true;
}



function checkIdMsg(obj, masterValue, txtValue) {

  if(obj.responseText == "true")  {
    document.getElementById("idCheck_message").innerHTML = "<font color='green'>『" + txtValue + "』はご利用できます。</font><br />";
    document.getElementById(masterValue + "hdnflgCheckID").value = "true";
  } else {
    document.getElementById("idCheck_message").innerHTML = "<font color='red'>『" + txtValue + "』は他の人が使っています。</font><br />";
    document.getElementById(masterValue + "hdnflgCheckID").value = "false";
  }
}




function CheckUserId(obj, masterValue) {


	if(obj.value.length <= 0)
	{
		document.getElementById("idCheck_message").innerHTML = "";
		document.getElementById(masterValue + "hdnflgCheckID").value = "false";
	} else if(obj.value.length < 4 || obj.value.length > 12) {
		document.getElementById("idCheck_message").innerHTML = "<font color='red'>半角小英数4文字以上入力してください。</font><br />";
		document.getElementById(masterValue + "hdnflgCheckID").value = "false";
	}else
	{
	if(checkNumeric(obj.value)) {
	  document.getElementById("idCheck_message").innerHTML = "<font color='red'>数字のみのIDはご利用できません。</font><br />";
	  document.getElementById(masterValue+ "hdnflgCheckID").value = "false";
	} else if(checkNumeric(obj.value.charAt(0))) {
	  document.getElementById("idCheck_message").innerHTML = "<font color='red'>IDの頭文字は英文小文字(a～z)のみ使用可能です。</font><br />";
	  document.getElementById(masterValue+ "hdnflgCheckID").value = "false";
	} else if(checkAlphaNumeric(obj.value) && !checkLowAlphaNumeric(obj.value)) {
	  document.getElementById("idCheck_message").innerHTML = "<font color='red'>アルファベット大文字はご利用できません。</font><br />";
	  document.getElementById(masterValue + "hdnflgCheckID").value = "false";
	} else if(checkLowAlphaNumeric(obj.value)) {
	  sendRequest(checkIdMsg, masterValue, obj.value,"mode=check_id&strval="+obj.value,"POST", "/Join/CheckUserInfo.aspx", true);
	} else {
	  document.getElementById("idCheck_message").innerHTML = "<font color='red'>入力された内容に禁止されている文字があります。</font><br />";
	  document.getElementById(masterValue + "hdnflgCheckID").value = "false";
	}
	}
	
}




//function checkMailMsg(obj) {
//  var check_id = document.getElementById("txtID").value;
//  
//  if(obj.responseText == "true")  {
//    document.getElementById("idCheck_message").innerHTML = "<font color='green'>『"+check_id+"』はご利用できます。</font>";
//    document.getElementById("hdnflgCheckMail").value = "true";
//  } else {
//    document.getElementById("idCheck_message").innerHTML = "<font color='red'>『"+check_id+"』は他の人が使っています。</font>";
//    document.getElementById("hdnflgCheckMail").value = "false";
//  }
//}
//function CheckUserMail(obj) {

//	if(obj.value.length <= 0)
//	{
//		document.getElementById("idCheck_message").innerHTML = "";
//		document.getElementById("hdnflgCheckID").value = "false";
//	} else if(obj.value.length < 4 || obj.value.length > 12) {
//		document.getElementById("idCheck_message").innerHTML = "<font color='red'>半角小英数4文字以上入力してください。</font>";
//		document.getElementById("hdnflgCheckID").value = "false";
//	}else
//	{
//	if(checkNumeric(obj.value)) {
//      document.getElementById("idCheck_message").innerHTML = "<font color='red'>数字のみのIDはご利用できません。</font>";
//      document.getElementById("hdnflgCheckID").value = "false";
//    } else if(checkNumeric(obj.value.charAt(0))) {
//      document.getElementById("idCheck_message").innerHTML = "<font color='red'>IDの頭文字は英文小文字(a～z)のみ使用可能です。</font>";
//      document.getElementById("hdnflgCheckID").value = "false";
//    } else if(checkAlphaNumeric(obj.value) && !checkLowAlphaNumeric(obj.value)) {
//      document.getElementById("idCheck_message").innerHTML = "<font color='red'>アルファベット大文字はご利用できません。</font>";
//      document.getElementById("hdnflgCheckID").value = "false";
//    } else if(checkLowAlphaNumeric(obj.value)) {
//      sendRequest(checkMailMsg, "mode=check_id&strval="+obj.value,"POST", "/CB/CheckUserInfo.aspx", true);
//    } else {
//      document.getElementById("idCheck_message").innerHTML = "<font color='red'>入力された内容に禁止されている文字があります。</font>";
//      document.getElementById("hdnflgCheckID").value = "false";
//    }
//	}
//	
//}





/*
###########################################################################################################################
# 
# CheckUserNickName
#
###########################################################################################################################
*/

var nonchar11 = '0123456789-'; 
function checkZipcodeStr(str) {
  
  

  for (i=0;i<1;i++ ) {
    ch = str.charAt(i);
    if((i==0) && (nonchar11.indexOf(ch,0) >= 0)) {
      return false;
    }
  }
  return true;
  
}






var bankatakana = "ｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜｦﾝｧｨｩｪｫｬｭｮｯｰ､｡｢｣ﾞﾟ";
var nonchar = '~`!@#$%^&*()-_=+\|<>?,./;:" '; 
nonchar = nonchar + "'";

function checkNickStr(str) {
  if(IsNotbankakakana(str)==false){
    return false;
  }
  
  for (i=0;i<str.length;i++) {
    ch = str.charAt(i);
    if((nonchar.indexOf(ch,0) >= 0)) {
      return false;
    }
  }
  
  return true;
}

function IsNotbankakakana(obj) {
  txt = bankatakana;
  for (i=0; i<obj.length; i++) {
    if (obj.substring(0,1)=="\\") {
      return false;
    }
    if (txt.indexOf(obj.charAt(i),0) >= 0) {
      return false;
    }
  }
  return true;
}



function checkNickMsg(obj, masterValue, txtValue) {
 
  if(obj.responseText == "true")  {
    document.getElementById("nickCheck_message").innerHTML = "<font color='green'>『" + txtValue + "』はご利用できます。</font><br />";
    document.getElementById(masterValue+ "hdnflgCheckNick").value = "true";
  } else {
    document.getElementById("nickCheck_message").innerHTML = "<font color='red'>『" + txtValue + "』は他の人が使っています。</font><br />";
    document.getElementById(masterValue+ "hdnflgCheckNick").value = "false";
  }
}


function CheckNickName(obj, masterValue) {

	var lenCheck = calculateBytes(obj.value);

	if(obj.value.length <= 0) {
		document.getElementById("nickCheck_message").innerHTML = "";
		document.getElementById(masterValue+ "hdnflgCheckNick").value = "false";
	} else if(lenCheck < 4 || lenCheck > 16) {
		document.getElementById("nickCheck_message").innerHTML = "<font color='red'>全角2～8文字(半角4～16文字)で入力してください。</font><br />";
		document.getElementById(masterValue+ "hdnflgCheckNick").value = "false";
	} else {
		if(checkNickStr(obj.value)) {
			sendRequest(checkNickMsg, masterValue, obj.value, "mode=check_nickname&strval="+escape(obj.value),"POST", "/Join/CheckUserInfo.aspx", true);
		} else {
		  document.getElementById("nickCheck_message").innerHTML = "<font color='red'>入力された内容に禁止されている文字があります。</font><br />";
		  document.getElementById(masterValue+ "hdnflgCheckNick").value = "false";
		}
	}
}


//--Word Byte check
function calculateBytes( szValue){
  var tcount = 0;
  var tmpStr = new String(szValue);
  var temp = tmpStr.length;
  var onechar;
  
  for ( k=0; k<temp; k++ )  {
    onechar = tmpStr.charAt(k);
    if (escape(onechar).length > 4) {       tcount += 2;     }
    else {  tcount += 1;  }
  }
  return tcount;
}


function checkIDFormImg(obj){
    obj.style.backgroundImage="";
    obj.onkeydown=obj.onmousedown=null;
}

function returnIDFormImg(obj){
    if(obj.value.length <= 0){
        obj.style.backgroundImage ="url('http://makyoimage.gamecom.jp/Web/login_id.gif')";;
    }
}

function checkPWFormImg(obj){
    obj.style.backgroundImage="";
    obj.onkeydown=obj.onmousedown=null;
}

function returnPWFormImg(obj){
    if(obj.value.length <= 0){
        obj.style.backgroundImage ="url('http://makyoimage.gamecom.jp/Web/login_pw.gif')";;
    }
}


// カタカナチェック
function checkKana(checkWord)
{
	reg = /^([ア-ー]*)$/i;
	if(reg.test(checkWord)) return false;
}


function writeYear(){
    var date = new Date();
    var year = date.getYear();
    if(year<2000){ year += 1900;}
    document.write(year);
}

//-->
