
// 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 openCash()
{
	if( getCookies( "IL" ) == "1"  )
	{
		window.open('http://cash.nexon.com/NX/Page/CashFillPopup.aspx', null, 'height=600, width=480, resizable=0')
	}
	else
	{
		alert("·Î±×ÀÎ ÈÄ »ç¿ëÇÏ¼¼¿ä.");
	}
	
	window.event.cancelBubble = 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;
	}
}
