var NptWindow = new function __NpfWindow()
{
	/* ÇØ»óµµ¿¡ °ü°è¾øÀÌ È­¸é °¡¿îµ¥¿¡ ÆË¾÷À» ¶ç¿ì°Å³ª ÆË¾÷ÀÇ À§Ä¡¸¦ Á¶Á¤ */
	this.OpenWindow = function( url, winname, features) 
	{ 
		if ( features != '' )
		{
			features = NgbString.TrimAll( features.toLowerCase() );
			var arrFeatures = features.split( ',', 10 );
			var width, height, left, top;
			
			width = this.GetValueInFeatures( features, 'width' );
			height = this.GetValueInFeatures( features, 'height' );
			left = this.GetValueInFeatures( features, 'left' );
			top = this.GetValueInFeatures( features, 'top' );
			
			if( width != null && height != null )
			{
				if( left == null )
					left = (screen.width - width) / 2; 
				if( top == null )
					top = (screen.height - height) / 2; 
			}
			else
			{
				if( left == null )
					left = 30;
				if( height == null )
					top = 30;
			}
			
			features = this.SetValueInFeatures( features, 'left', left );
			features = this.SetValueInFeatures( features, 'top', top );
		}
		
		var popwin = window.open( url, winname, features ); 
		
		if( popwin == null ) 
		{
			alert( 'ÆË¾÷Ã¢ ¼³Á¤À» ÇØÁ¦ÇØ ÁÖ¼¼¿ä.' );
			location.href = 'http://help.nexon.com/help/page/nx.aspx?url=etc/popupguide';
			return false;
		}
		popwin.focus();
		return popwin;
	}
	
	
	this.GetValueInFeatures = function( strBase, strName )
	{
		if( strBase.indexOf( strName + '=' ) != -1 )
		{
			var strTail = strBase.substr( strBase.indexOf( strName + '=' ) );
			if( strTail.indexOf( ',' ) != -1 )
				strTail = strTail.substr( 0, strTail.indexOf( ',' ) );
				
			return Number( strTail.substr( strTail.indexOf( '=' ) + 1 ) );
		}
		else 
			return null;
	} 
	
	this.SetValueInFeatures = function( strBase, strName, strValue )
	{
		if( strBase.indexOf( strName + '=' ) != -1 )
		{
			return strBase;
		}
		else 
			return strBase + ',' + strName + '=' + strValue;
	}
}

var NptCheckValidation = new function __NptCheckValidation()
{
	this.CheckSpecialCharacter = function ( strValue ) 
	{ 
		var bReturn = true;
		
		for ( var nLoop = 0; nLoop < strValue.length; nLoop ++ )
		{
			var charValue = strValue.charAt( nLoop );
			
			if (( charValue >= 'A' && charValue <= 'Z') || ( charValue >= 'a' && charValue <='z'))
			{
				continue;//'¿µ¾î';
			}
			else if ( charValue >= '0' && charValue <= '9')
			{
				continue;//'¼ýÀÚ';
			}
			else if ( charValue >= '\uAC00' && charValue <= '\uD7A3')
			{
				continue;//'ÇÑ±Û';
			}
			else if ( charValue == ' ')
			{
				continue; // ' ' (space)
			}
			else
			{
				bReturn = false;//'Áñ
				break;				
			}
		}
		
		return bReturn;
	}
	
	this.CheckNumberOnly = function ( strValue ) 
	{ 
		var bReturn = true;

		for ( var nLoop = 0; nLoop < strValue.length; nLoop ++ )
		{
			var charValue = strValue.charAt( nLoop );
			
			if ( charValue < '0' || charValue > '9' )
			{
				bReturn = false;// Áñ
				break;	
			}
		}

		return bReturn;
	}
	
	this.CheckNumberNAlphabetOnly = function ( strValue ) 
	{ 
		var bReturn = true;

		for ( var nLoop = 0; nLoop < strValue.length; nLoop ++ )
		{
			var charValue = strValue.charAt( nLoop );
			
			if (( charValue >= 'A' && charValue <= 'Z') || ( charValue >= 'a' && charValue <='z'))
			{
				continue;//'¿µ¾î';
			}
			else if ( charValue >= '0' && charValue <= '9')
			{
				continue;//'¼ýÀÚ';
			}
			else
			{
				bReturn = false;//'Áñ
				break;				
			}
		}
		return bReturn;
	}
	
}