/*	Form ¹®¾È¿¡¼­ ÁöÁ¤µÈ Radio ¹öÆ°(strNameOfRadio)¿¡ ÁöÁ¤µÈ °ªÀ¸·Î ¼³Á¤
	Konqueror ¿¡¼­ Form ¾È¿¡ radio Ã¼Å© ÇÏ´Âµ¥ ¹®Á¦ ÀÖ¾î¼­ »ç¿ë
*/
function utilCheckInRadio(objForm, strNameOfRadio, nNumber, nValue)
{
	var i, nNumberInForm = 0;

	for(i=0; i<objForm.length; i++) {

		if(objForm.elements[i].type == "radio" && objForm.elements[i].name == strNameOfRadio) {
			if(nNumberInForm == nNumber) break;
			else nNumberInForm ++;
		}
	}

	if((i<objForm.length) && (objForm.elements[i].type == "radio" && objForm.elements[i].name == strNameOfRadio)) {
		objForm.elements[i].checked = nValue;
	}
}


/*	Form ¹®¾È¿¡¼­ ÁöÁ¤µÈ Radio ¹öÆ°(strNameOfRadio)ÀÌ ´­·È´ÂÁö »ç¿ë
	Konqueror ¿¡¼­ Form ¾È¿¡ radio Ã¼Å© ÇÏ´Âµ¥ ¹®Á¦ ÀÖ¾î¼­ »ç¿ë
*/
function utilIsCheckInRadio(objForm, strNameOfRadio, nNumber)
{
	var i, nNumberInForm = 0;

	for(i=0; i<objForm.length; i++) {

		if(objForm.elements[i].type == "radio" && objForm.elements[i].name == strNameOfRadio) {

			if(nNumberInForm == nNumber) break;
			else nNumberInForm ++;
		}
	}

	if((i<objForm.length) && (objForm.elements[i].type == "radio" && objForm.elements[i].name == strNameOfRadio)) {
		return objForm.elements[i].checked;
	}

	return false;
}


/*	Form ¹®¾È¿¡¼­ ÁöÁ¤µÈ Radio ¹öÆ°(strNameOfRadio) ±×·ìÁß ÇÏ³ª¶óµµ ´­·È´ÂÁö È®ÀÎ ÈÄ ´­¸° ¹öÆ°ÀÇ °ª Àü´Þ
	Konqueror ¿¡¼­ Form ¾È¿¡ radio Ã¼Å© ÇÏ´Âµ¥ ¹®Á¦ ÀÖ¾î¼­ »ç¿ë
*/
function utilIsCheckInAllRadio(objForm, strNameOfRadio)
{
	var i, nChecked = false;

	for(i=0; i<objForm.length; i++) {
		if(objForm.elements[i].type == "radio" && objForm.elements[i].name == strNameOfRadio) {

			if(objForm.elements[i].checked == true) {
				nChecked = objForm.elements[i].value;
				break;
			}
		}
	}

	return nChecked;
}


function utilStripValue(strValue, strSeperator)
{
	strTemp = new String(strValue);
	return strTemp.split(strSeperator);
}


function utilDateCheck(strDate)
{
	var nYear  = null;
	var nMonth = null;
	var nDay   = null;	

	var arrayMonthDate = new Array(31,28,31,30,31,30,31,31,30,31,30,31);

	if(strDate.length == 0 || strDate == "") return false;
	arrayDate = this.utilStripValue(strDate, '-');
	
	nYear = parseInt(arrayDate[0]);
	if((nYear%4 == 0) && (nYear%100 != 0) || (nYear%400 == 0)) arrayMonthDate[1] = 29;

	nMonth = parseInt(arrayDate[1], 10);
	
	if(nMonth < 1 || nMonth > 12) return false;
	
	nDay = parseInt(arrayDate[2], 10);
	
	if(nDay < 1 || nDay > arrayMonthDate[nMonth-1]) return false;

	return true;
	
}


function utilGetMaxMonthDay(strDate)
{

	var nYear = null;
	var nMonth = null;
	var nDay = null;

	var arrayMonthDate = new Array(31,28,31,30,31,30,31,31,30,31,30,31);

	arrayDate = this.utilStripValue(strDate, '-');
	
	nYear = parseInt(arrayDate[0]);
	if((nYear%4 == 0) && (nYear%100 != 0) || (nYear%400 == 0)) arrayMonthDate[1] = 29;

	nMonth = parseInt(arrayDate[1], 10);
	
	nMaxMonthDay =  arrayMonthDate[nMonth-1];
	
	return nMaxMonthDay;
	
}


function utilCheckEmail(strEmail) 
{

	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strEmail)){
		return true;
	}

	return false;
}


function utilRemoveSpaceInString(strData)
{

	var i, strReturn;
	var strTemp = new String(strData);

	strReturn = "";
	for(i=0; i<strTemp.length; i++) {

		ch = strTemp.substr(i, 1);
		if(ch != " ") strReturn += ch;	
	}

	return strReturn;

}

// ÇÑ¿µ ±¸ºÐÇØ¼­ »çÀÌÁî Àü´Þ
function utilGetStringLength(strData)
{
	var i, nLen;
	var strTemp = new String(strData);
		
	for(nLen=0, i=0; i<strTemp.length; i++) {
	
		if(strTemp.charCodeAt(i) > 255) {		
			nLen = nLen + 2;
		}
		else {
			nLen = nLen+1;
		}
		
	}
	
	return nLen;

}


function utilInputOnlyNumber(objElement)
{

	var i, ch, isInput = true;
	var objInput = objElement.value;
	
	for(i=0; i<objInput.length; i++) {
	
		ch = objInput.charCodeAt(i);

		if(((ch > 96) && (ch < 124)) || ((ch > 64) && (ch < 91)) || ((ch > 31) && (ch < 58))) isInput = true;
		else {
			isInput = false;
			break;
		}
	}

	return isInput;
}


function utilIsHangulString(strString)
{

	var i;

	for(i=0; i<strString.length; i++) {

		if(strString.charCodeAt(i) > 255) return true;
	}
	
	return false;
}

/*¼ýÀÚ¿Í ¿µ¹®ÀÌ¿ÜÀÇ ¹®ÀÚ°¡ µé¾îÀÖÀ¸¸é FALSE Return*/
function utilCheckString(strString) 
{
	var i;
	var boolCheck = true;
	var nTemp;
	
	for(i=0; i<strString.length; i++) {
		nTemp = strString.charCodeAt(i);
		
		if(nTemp < 48 || ( nTemp > 57 && nTemp < 65) || (nTemp > 90 && nTemp < 97) || nTemp > 122)
			boolCheck = false;
	}
	
	return boolCheck;
}

/*¼ýÀÚ¿Í ¿µ¹®ÀÌ¿ÜÀÇ ¹®ÀÚ°¡ µé¾îÀÖÀ¸¸é FALSE Return*/
function utilCheckID(strString) 
{
	var i;
	var boolCheck = true;
	var nTemp;
	
	for(i=0; i<strString.length; i++) {
		nTemp = strString.charCodeAt(i);
		
		if(nTemp < 48 || ( nTemp > 57 && nTemp < 65) || (nTemp > 90 && nTemp < 95) || nTemp == 96 || nTemp > 122)
		boolCheck = false;
	}
	
	return boolCheck;
}


function utilGetBrowserType()
{
	var isType;
	var strAppName = navigator.appName;

	if(strAppName == "Netscape") isType = 1;
	else if(strAppName == "Microsoft Internet Explorer")  isType = 2;
	else isType = 0;

	return isType;
}


function utilGetBrowserVer()
{
	// return version number (e.g., 4.03)
	return parseFloat(navigator.appVersion);
}


function utilGetCookie(strName)
{

	var strArg = new String(strName + "=");
	var nArgLen, nCookieLen, nEnd;
	var i = 0, j;

	nArgLen    = strArg.length;
	nCookieLen = document.cookie.length;

	if(nCookieLen > 0) {

		while(i < nCookieLen) {

			j = i + nArgLen;

			if(document.cookie.substring(i, j) == strArg) {

				nEnd = document.cookie.indexOf (";", j);

				if(nEnd == -1) nEnd = document.cookie.length;

				return unescape(document.cookie.substring(j, nEnd));

			}

			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
	}

	return null;
}


function utilSetCookie(strName, strValue, dateExpires, strPath, strDomain, isSecure)
{

	var strCookie;

	if(strName == "") return ;

	strCookie = strName + "=" + escape(strValue) +
		    ((dateExpires) ? "; expires=" + dateExpires.toGMTString() : "")  +
	      	    ((strPath)     ? "; path="    + strPath : "") +
	      	    ((strDomain)   ? "; domain="  + strDomain : "") +
		    ((isSecure)    ? "; secure" : "");

	document.cookie = strCookie;

}

function utilUrlEncode(strValue)
{
	//if(this.utilGetBrowserType() == 2) {

		var i, ch, strReturn;

		strReturn = "";
		for(i=0; i<strValue.length; i++) {

			ch = strValue.substr(i, 1);

			if(ch == " ")       ch = "+";
			else if(ch == "\"") ch = "%22";
			else if(ch == "<")  ch = "%3C";
			else if(ch == ">")  ch = "%3E";
			else if(ch == "#")  ch = "%23";
			else if(ch == "%")  ch = "%25";
			else if(ch == "{")  ch = "%7B";
			else if(ch == "}")  ch = "%7D";
			else if(ch == "|")  ch = "%7C";
			else if(ch == "\\") ch = "%5C";
			else if(ch == "^")  ch = "%5E";
			else if(ch == "~")  ch = "%7E";
			else if(ch == "[")  ch = "%5B";
			else if(ch == "]")  ch = "%5D";
			else if(ch == "'")  ch = "%60";
			else if(ch == "+")  ch = "%2b";
			else if(ch == "/")  ch = "%2f";
			else if(ch == "=")  ch = "%3d";
			else if(ch == "&")  ch = "%26";

			strReturn += ch;
		}

		return strReturn;
	//}

	//return strValue;
}

function _utilDelayTime()
{
	return ;
}


