
// string ÀÇ ±æÀÌ °¡Á®¿È 
function Hlen( paramString )
{
	var	hlen=0;
	for (t=0; t<paramString.length; t++)
	{
	    if (paramString.charCodeAt(t) > 255)
		{
			hlen=hlen+2;
		}
	    	else
		{
    		hlen=hlen+1;
		}
	}
	return hlen;
}

function checkHTMLValidityAsUserInput( str )
{
	var n4Len = str.length;
	var n4Pos1 = str.indexOf( '<' );
	var n4Pos2 = str.indexOf( '>' );
	var strCheckBlock = '';

	for ( ; n4Pos1 > -1; n4Pos1 = str.indexOf( '<', n4Pos2 + 1 ), n4Pos2 = str.indexOf( '>', n4Pos2 + 1 ) )
	{
		if ( n4Pos2 < n4Pos1 || ( n4Pos1 == -1 && n4Pos > -1 ) )
			return false;

		strCheckBlock = str.substring( n4Pos1 + 1, n4Pos2 );
		if ( strCheckBlock.indexOf( '<' ) != -1 )
		{
			return false;
		}
		if ( strCheckBlock.indexOf( 'script' ) != -1 )
		{
			return false;
		}
		if ( strCheckBlock.indexOf( 'object' ) != -1 )
		{
			return false;
		}
	}

	return true;
}



/*==================================================

	* ¿ÍÀÌÁî·Î±× ¼¼ÆÃ °ü·Ã
	
==================================================*/

function submitForIFrame( strUrl, MainCat, SubCat, Value )
{
	var objIFrame = eval("document.all.formForWiseLog" );
	var iframeUrl = strUrl;
	
	if ( MainCat != '' )
		iframeUrl += "&MainCat=" + MainCat;
		
	if ( SubCat != '' )
		iframeUrl += "&SubCat=" + SubCat;
		
	if ( Value != '' )
		iframeUrl += "&Value=" + Value;
	
	objIFrame.src = iframeUrl;
}

var m_isCopyTag = false;
var m_isFirst = false;
function CopyClipboard( strContent, strAlertMessage )
{
	if( !m_isCopyTag )
	{
		m_isCopyTag = true;
		if( !m_isFirst )
		{
			objInput = document.createElement( "<input type='hidden' name='txtCopyBoardTag' value='' >" );
			document.forms[0].appendChild( objInput );
		}
		document.forms[0].txtCopyBoardTag.value= strContent;

		m_isFirst = true;
		textRange = document.forms[0].txtCopyBoardTag.createTextRange();
		textRange.execCommand( 'RemoveFormat' );
		textRange.execCommand( 'Copy' );  

		alert( strAlertMessage ); // 'Å¬¸³º¸µå¿¡ ³»¿ëÀÌ º¹»çµÇ¾ú½À´Ï´Ù. Ctrl+V·Î º¹»çÇÏ½Å ³»¿ëÀ» ºÙ¿©³ÖÀ¸½Ç ¼ö ÀÖ½À´Ï´Ù.'
		m_isCopyTag = false;
	}
}

/*==================================================

	* ±æµå³×ÀÓº¯°æ
	
==================================================*/
function GuildNameApply()
{
	window.open('http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=event/GuildName/GuildNameApply','GuildNameApply','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,copyhistory=no,width=560,height=400');
	return false;
}

function GuildUniteNameApply()
{
	window.open('http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=event/GuildName/GuildUniteNameApply','GuildUniteNameApply','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,copyhistory=no,width=560,height=400');
	return false;
}

/*==================================================

	* °øÁö¿¡¼­ »ç¿ë »óÁ¡ ÆË¾÷
	
==================================================*/
function shop_popup_detail(value)
{
	window.open( 'GnxPopup.aspx?URL=Shop/pop_detail&n4ProductNo='+value ,'BuyCart','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizeable=no, copyhistory=no, width=550, height=300' );
	return false;
}

function shop_popup_detail_buy(value)
{
	window.open( 'GnxPopup.aspx?URL=Shop/pop_detail&maskType=1&ProductsNo='+value ,'BuyCart','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizeable=no, copyhistory=no, width=550, height=300' );
	return false;
}

function shop_popup_detail_present(value)
{
	window.open( 'GnxPopup.aspx?URL=Shop/pop_detail&maskType=2&ProductsNo='+value ,'BuyCart','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizeable=no, copyhistory=no, width=550, height=300' );
	return false;
}

/*==================================================

	* ·Î±×ÀÎ ÇÏ½Å ÈÄ¿¡ »ç¿ëÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù ÆË¾÷
	
==================================================*/
function func_pop_login01(value)
{
	window.open( 'GnxPopup.aspx?URL=Common/pop_login01&LoginValue='+value ,'pop_login01','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizeable=no, copyhistory=no, width=284, height=172' );
	return false;
}

/*==================================================

	* 20081223 ¼³¹®Á¶»ç »ç¿ë
	
==================================================*/
function func_pop_research2008()
{
	window.open( 'GnxPopup.aspx?URL=event/research2008/event2' ,'research2008','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizeable=no, copyhistory=no, width=1, height=1' );
	return false;
}