
//»ý¼ºÀÚ ¸Þ¼­µå
var CommonLib	 = function()
{
	
	//ÇÁ·ÎÆÛÆ¼
	this.version			= "0.0001a"; 
	this.debugMode	= false;

	//°³Ã¼ ÄÃ·º¼Ç
	this.oWindows		= [];


} 


/***************************************
/*	À©µµ¿ì ÀÌº¥Æ® ¸®½º³Ê
***************************************/


  
/***************************************
/*	window Ã³¸®
***************************************/

function openWindow( pURL, pWidth, pHeight, pIsScroll )
{

 
	var nWindowLeft	= (screen.availWidth - pWidth) / 2;
	var nWindowTop	= (screen.availHeight - pHeight) / 2;
	var sIsScroll		= ( pIsScroll ) ? "yes" : "no" ;
 
	this.oWindows	= window.open( pURL ,  "_blank", "width="+pWidth+",height="+pHeight+",top="+nWindowTop+",left="+nWindowLeft+",scrollbars="+sIsScroll+"");

	return this.oWindows;
 
}

/***************************************
/*	¹®ÀÚ¿­ Ã³¸®
***************************************/
 

function getTextLength( pText ) {

	var nLength	 = 0;
	var nLoop;

	var sCharacter;

	for ( nLoop = 0; nLoop < pText.length; nLoop++ ) 
	{

		sCharacter	= pText.charAt( nLoop );

		if( escape( sCharacter ).length > 4 )
			nLength += 2;
		else if( sCharacter!='\r')
           	nLength++;
 
  	}

	return nLength;
}

function getCuttedText( pText, pMaxByte ) {

	var cutStringIndex;
	var tcount = 0;

	var nLength	 = 0;
	var nLoop;

	var sCharacter;
	


	for ( nLoop = 0 ; nLoop < pText.length; nLoop++ ) 
	{

		sCharacter	= pText.charAt( nLoop );

		if( escape( sCharacter ).length > 4 )
			nLength += 2;
		else if( sCharacter!='\r')
           	nLength++;

        if( nLength > pMaxByte )
			break;

  	}

	return getRemove0dText( pText.substring(0, nLoop) );

}

function getRemove0dText( pText ) {

	var sString	= escape( pText );

	if ( sString.lastIndexOf("%0D") >= sString.length - 3 )
		sString	= sString.substring( 0, sString.lastIndexOf("%0D") );

	return unescape( sString );
}

function checkNumeric( pObject ) 
{

	var chrTmp;
	var strTmp = pObject.value;
	var chkAlpha = false;
	var resString = '';

	for (var i=0; i<=strTmp.length; i++) {
	    chrTmp = strTmp.charCodeAt(i);
		if ((chrTmp <=47 && chrTmp > 31) || chrTmp >= 58) {
			chkAlpha = true;
		} else {
			resString = resString + String.fromCharCode(chrTmp);
		}
	}
	if (chkAlpha == true) {
		alert("¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
		pObject.value = resString;
		pObject.focus();
		return false;
	}
	return true;
}


function getMonthDays( pYear, pMonth) 
{
    var oDate	= new Date( pYear, pMonth, 0);

    return oDate.getDate();
}

function onlyNumber() {

	if( (event.keyCode<48)||(event.keyCode>57) )
		event.returnValue=false;

}

function spaceCheck() {
    if (event.keyCode == 32)
        event.returnValue = false;
}
