﻿
//----------------------------------------------------------------------------
//(2002.08.23 �����)
//----------------------------------------------------------------------------
function trimall (str) {
  if (str == null) return "";

  var dest = str;

  for (; dest.indexOf(" ") != -1 ;) {
     dest = dest.replace(" ","") ;
  }
  return dest;
}
//----------------------------------------------------------------------------

function popwin(url,w_name,w,h) {

	var win_1;
	var left_pos = screen.width/2 - w/2;
	var top_pos = screen.height/2 - h/2;

	var option = "width=" + w + ",height=" + h + ",left=" + left_pos + ",top=" + top_pos + ",titlebar=no,toolbar=no,status=no,menubar=no,resizable=no,scrollbars=yes";
	win_1 = window.open(url,w_name,option);

}

function popwin2(url,w_name,w,h) {

	var win_2;
	var left_pos = screen.width/2 - w/2;
	var top_pos = screen.height/2 - h/2;

	var option = "width=" + w + ",height=" + h + ",left=" + left_pos + ",top=" + top_pos + ",titlebar=no,toolbar=no,status=no,menubar=no,resizable=yes,scrollbars=yes";
	win_2 = window.open(url,w_name,option);

}

function newWindow(obj)
{
	if( obj.value == null || obj.value == "" ) return;
	window.open(obj.value);
}

function EmptyChk(obj) {
	var lvString;
	lvString = obj.value;
	for( i = 0 ; i < lvString.length ; i++)
	{
		if(lvString.charAt(i) != " ")
			return true;
	}
	return false;
}

function ValidateNumber(obj){

	var num="0123456789";

	var cnt_chk=0;
	for (var i=0;obj.value != null && i< obj.value.length;i++){

		if (-1 == num.indexOf(obj.value.charAt(i))){
			cnt_chk += 1;
		}
	}
	if(cnt_chk > 0){
		return false;
	}
	else{
		return true;
	}

}

function ValidateDate(value) {
	var Date = value;
	var daysInMonth = new Array("31", "28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31");

	var lvYear = "";
	var lvMonth = "";
	var lvDay = "";

	lvYear = Date.substring(0,4);
	lvMonth = Date.substring(4,6);
	lvDay = Date.substring(6,8);

	if(eval(lvYear)%4 == 0) daysInMonth[1] = "29";
	else daysInMonth[1] = "28";

	if(eval(lvDay) > 0 && eval(lvDay) <= eval(daysInMonth[eval(lvMonth)-1])) {
		return true;
	} else return false;
}


function fun_bussno_chk(bussno) {

	chkval = new Array(9);

	chkval[0] = 1;
	chkval[1] = 3;
	chkval[2] = 7;
	chkval[3] = 1;
	chkval[4] = 3;
	chkval[5] = 7;
	chkval[6] = 1;
	chkval[7] = 3;
	chkval[8] = 5;

	var sum = 0;
	var flag;

	for (var i=0; i<8; i++) {

		sum = sum + (chkval[i] * parseInt(bussno.charAt(i)));

	}

	imsi = chkval[8] * parseInt(bussno.charAt(8));

	s_imsi = new String(imsi);

	if (s_imsi.length == 2)
		sum = sum + parseInt(s_imsi.substring(0,1)) + parseInt(s_imsi.substring(1,2));
	else
		sum = sum + parseInt(s_imsi);

	remainder = sum % 10;

	if (remainder==0)
		bussno_chk = 0;
	else
		bussno_chk = 10 - remainder;

	if (bussno_chk == parseInt(bussno.charAt(9)))
		flag = "true";
	else
		flag = "false";

	return flag;

}

function fun_input_chk(str, len) {
	var cc=0;
	var dbcs=0;

	for(var i=0; i<str.length; i++)		{
		if( str.charCodeAt(i) >= 12288 )    {	// UNICODE
			if( dbcs == 0 )   {
				dbcs = 1;
				cc++;
			}
			cc+=2;
		}
		else   {		//
			if( dbcs == 1 )   {
				dbcs = 0;
				cc++;
			}
			cc++;
		}
	}
	if( dbcs == 1 )
		cc++;

	if( cc > len )
		return false;
	return true;
}



function fun_input_trim(str, len) {
	var cc=0;
	var dbcs=0;
	var cvt="";

	for(var i=0; i<str.length; i++)		{
		if( str.charCodeAt(i) >= 12288 )    {	// UNICODE
			if( dbcs == 0 )   {
				dbcs = 1;
				cc++;
			}
			cc+=2;
			if( ( cc + 1 ) > len )
				break;
			cvt = cvt + str.charAt(i);
		}
		else   {		//
			if( dbcs == 1 )   {
				dbcs = 0;
				cc++;
			}
			cc++;
			if( cc > len )
				break;
			cvt = cvt + str.charAt(i);
		}
	}
	if( dbcs == 1 )
		cc++;

	return cvt;
}


function setOnBlur(userObj) {
	userObj.value = trim(userObj.value);
	if (userObj.value == '' ){
		userObj.value = 0;
		userObj.focus();
		return;
	}

	var zeroCount = 0;
	for(var i = 0 ; i < userObj.value.length ; i++)
	{
		if(userObj.value.charAt(i) == '0')
			zeroCount++;
		else
			break;
	}

	if(zeroCount == userObj.value.length)
	{
		userObj.value = '0';
	}else
	{
		userObj.value = userObj.value.substring(zeroCount);
	}

	var txtValue = removeComma(userObj.value);

	if ( isDigitType(txtValue)  == false ) {
		alert("�ݾ� ������ �ڷῡ ���ڰ� �ԷµǾ�4ϴ�.");
		userObj.value = 0;
		userObj.focus();
		return;
	}  else if ( txtValue.length > 0 ) {
		if ( txtValue.substring(0, 1) == "-" ) {
			userObj.value = txtValue.length > 4 ? "-" +getWon(txtValue.substring(1)) : txtValue;
		} else {
			userObj.value = txtValue.length > 3 ? getWon(txtValue) : txtValue;
		}
	}
}


function setOnFocus(userObj)
{
	userObj.value = removeComma(userObj.value);
}



function removeComma(str) {
   var value = "";
   for ( var i = 0; i < str.length; i++ ) {
	  var ch = str.charAt(i);
	  if ( ch != ',' ) value = value + ch;
   }
   return value;
}


function getWon(str) {
   var nam = str.length % 3;
   var value = "";
   for ( var i = 0; i < str.length; i++ ) {
	  var ch = str.charAt(i);
	  for ( var k = 0; k<str.length/3; k++ ) {
		 if ( i == nam + 3 * k && i != 0 ) value =  value + ',';
	  }
	  value = value + ch;
   }
   return value;
}

function isDigitType(str)
{
   if ( str.length > 1 && str.substring(0, 1) == "-" )
	  {
		str = str.substring(1);
	  }
		else if ( str.length == 1 && str.substring(0, 1) == "-" )
		{
			return false;
		}

			var oneAt = "";
			for (var i = 0; i < str.length; i++)
				{
					oneAt = str.charAt(i);
					if (oneAt < "0" || oneAt > "9")
					{
						return false;
					}
				}
			 return true;
}



/**
 *
 */
function isValidDate(strYear, strMonth, strDay) {
	if(!isNumeric(strYear) || !isNumeric(strMonth) || !isNumeric(strDay)) {
		return false;
	}

	iYear = eval(strYear);
	iMonth = eval(strMonth);
	iDay = eval(strDay);

	if(iMonth >= 1 && iMonth <=12) {
		if(iMonth == 2) {
			//
			if(iYear%4 == 0 && (iYear%100 != 0 || iYear%400 ==0)) {
				if(iDay >= 1 && iDay <=29) {
					 return true;
				}
			} else {
				if(iDay >= 1 && iDay <=28) {
					 return true;
				}
			}
		} else if((iMonth%2 == 0 && iMonth>=8) || (iMonth%2 == 1 && iMonth<=7)){
			//
			if(iDay >= 1 && iDay <= 31){
				return true;
			}
		} else {
			//
			if(iDay >= 1 && iDay <= 30){
				return true;
			}
		}
	}

	return false;

}

/**
 *
 */
function isNumeric(strTarget) {
	for(iIndex = 0; iIndex < strTarget.length; iIndex++) {

		if(strTarget.charAt(iIndex) < '0' || strTarget.charAt(iIndex) > '9') {
			return false;
		}
	}

	return true;
}



	function round(num, point){
		if (point == 1) {
			return Math.round(num);
		} else {
			var sNum = String(num);
			var index = sNum.indexOf(".");
			var num1 = sNum.split(".")[0];
			var num2 = sNum.split(".")[1];

			if (index < 0) return sNum;

			if(point > num2.length){
				return num;
			} else {
				var tmpNum = String(Math.round(num1 + num2.substring(0,point-1) + "." + num2.substring(point-1)));
				var result = tmpNum / 10;

				return result;
			}
		}
	}



function onlyNumber() {
    if( (event.keyCode<48)||(event.keyCode>57) ) event.returnValue=false;
}

function KeyInput(strResidNo1,strResidNo2)
{
    if((strResidNo1.value.length == 6) && (strResidNo2.value.length != 7))
	    strResidNo2.focus();
}


function removeHyphen(str) {
   var value = "";
   for ( var i = 0; i < str.length; i++ ) {
	  var ch = str.charAt(i);
	  if ( ch != '-' ) value = value + ch;
   }
   return value;
}

function checkHyphen(str) {
   for ( var i = 0; i < str.length; i++ ) {
	  var ch = str.charAt(i);
	  if ( ch == '-' )
		return true;
   }

   return false;
}

function checkReqItem(item1, itemname, minsize, maxsize)
{
	if(item1.value == '')
	{
		alert(itemname + '');
		item1.focus();
		return false;
	}

	if(minsize > 0 && item1.value.length < minsize)
	{
		alert(itemname + ' ' + minsize);
		item1.focus();
		return false;
	}

	if(maxsize > 0 && item1.value.length > maxsize)
	{
		alert(itemname + ' ' + maxsize);
		item1.focus();
		return false;
	}

	return true;
}

function checkFormatItem(item1, itemname, format)
{
	if(item1.value == '')
	{
		alert(itemname + '');
		item1.focus();
		return false;
	}

	if(!containsCharsOnly(item1.value, format))
	{
		alert(itemname + '');
		item1.focus();
		return false;
	}

	return true;
}

	function containsCharsOnly(input,chars) {
		for (var inx = 0; inx < input.length; inx++) {
		   if (chars.indexOf(input.charAt(inx)) == -1)
			   return false;
		}
		return true;
	}

    function checkId(str) {
        var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
		var bcheck = containsCharsOnly(str, chars);
		var engChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
		var numChars = "1234567890";
		var ncheck = false;
		var echeck = false;

		for (var inx = 0; inx < str.length; inx++) {
			if( ncheck == false && containsCharsOnly(str.charAt(inx), numChars ) )
				ncheck = true;

			if( echeck == false && containsCharsOnly(str.charAt(inx), engChars ) )
				echeck = true;
		}

		if(ncheck == false) bcheck = false;
		if(echeck == false) bcheck = false;

		return bcheck;
    }


    function isValidFormat(input, format) {
        if (input.search(format) != -1) {
            return true;
        }
        return false;
    }

    function isValidEmail(input) {
        var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
        return isValidFormat(input,format);
    }

//ID체크
	function checkID (val)	{
		return /^[A-Za-z0-9_\-]{4,}$/.test(val);
	}

    function getcookValue (offset) {
		var finstr = document.cookie.indexOf (";", offset);
		if (finstr == -1)
			finstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, finstr));
    }

    function GetCookie (name) {
		var arg = name + "=";
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;
		while (i < clen) {
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg)
				return getcookValue (j);
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
		return null;
    }

    function SetCookie (name, value) {
		var argv = SetCookie.arguments;
		var argc = SetCookie.arguments.length;
		var expires = (argc > 2) ? argv[2] : null;
		var path = (argc > 3) ? argv[3] : null;
		var domain = (argc > 4) ? argv[4] : null;
		var secure = (argc > 5) ? argv[5] : false;
		document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
    }

	function getCookie365(name){
		var client_name = name + "=";
		var set = document.cookie;

		if (set.length > 0) {
			begin = set.indexOf(client_name);
			if (begin != -1) {
				begin += client_name.length;
				end = set.indexOf(";", begin);
				if (end == -1) end = set.length;
				return unescape(set.substring(begin, end));
			}
		}
		return null;
	}

	function setCookie365(name, value) {
		var now = new Date();
		var then = new Date(now.getTime() + 31536000000);//
		document.cookie = name + "=" + escape(value) + "; expires=" + then.toGMTString() + "; path=/";
	}
/*
    function DeleteCookie(name) {
		var exp = new Date();
		FixCookieDate (exp);
		exp.setTime (exp.getTime() - 1);
		var cval = GetCookie (name);
		if (cval != null)
		document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
    }
*/
function setCookie1Day(name, value) {
  var now = new Date();
  now.setDate( now.getDate() + 1 );
  document.cookie = name + "=" + escape(value) + "; expires=" + now.toGMTString() + "; path=/";
 }


    function deleteCookie(name) {
  var exp = new Date();
  exp.setTime (exp.getTime() - 1);
  var cval = GetCookie (name);
       if (cval != null) {
       document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
      }
   }

function pop(url ,windowName, siz){
	if(url == '' || url == 'about:blank')
			window.open(url, windowName, siz);
	else
		window.open(url, windowName, siz);
		//XecureNavigate(url, windowName, siz);
}

function topWin(url, windowName, L, T, W, H, appendStyle){

	var styleattr = '';
	if (document.all&&window.print)
	{
		styleattr = '"help:0;resizable:1;dialogWidth:'+W+'px;dialogHeight:'+H+'px"';
		//"help:0;resizable:1;resizable=1;scrollbars=1;dialogWidth:" + W + "px;dialogHeight:" + H + "px;dialogTop:" + T + "px;dialogLeft:" + L + "px;" + appendStyle;
		//eval('window.showModelessDialog(url,windowName, styleattr)');
		eval('window.showModelessDialog(url,windowName, "help:0;resizable:1;dialogWidth:100px;dialogHeight:200px")')
	}else
	{
		styleattr = "top=" + T + ", left=" + L + ", width=" + W + "px,height=" + H + "px,;" + appendStyle;
		eval('window.open(url,windowName, styleattr)');
	}

function topWin1(url,W,H){
if (document.all&&window.print)
eval('window.showModelessDialog(url,"","help:0;resizable:1;dialogWidth:'+W+'px;dialogHeight:'+H+'px")')
else
eval('window.open(url,"","width='+W+'px,height='+H+'px,resizable=1,scrollbars=1")')
}

}



function winLink(obj)
{
	XecureLink(obj);
}


function getArrayLength(formObj, objName)
{
	var objSize = 0;
	for(var i = 0 ; i < formObj.length ; i++)
	{
		if(formObj.elements[i].name == objName)
		{
			objSize++;
		}
	}

	return objSize;
}

function getArrayIndex(formObj, obj)
{
	if(!obj) return -1;

	var index = 0;
	var objs = formObj.elements(obj.name);
	var objSize = getArrayLength(formObj, obj.name);

	for(var i = 0 ; i < objSize ; i++)
	{
		if(obj == objs[i])
		{
			index = i;
		}
	}

	return index;
}

//
function getFormArrayObject(formObj, objName, objIndex, zeroValue)
{
	var returnObj;
	var objs = formObj.elements(objName);
	var objSize = getArrayLength(formObj, objName);

	if(objSize <= 1)
	{
		returnObj = objs;
	}else
	{
		if(objSize > objIndex)
			returnObj = objs[objIndex];
		else
		{
			if(zeroValue)
			{
				returnObj = objs[0];
			}
		}
	}

	return returnObj;
}


function getDocumentObject(docObj, tagName, id, index)
{
	var objs = docObj.all.tags(tagName)
	var objSize = objs.length;
	var findIndex = -1;

	if(objSize != null)
	{
		for(i = 0; i < objSize; i++)
		{
			var tempid = objs[i].id;

			if(tempid == id)
			{
				findIndex++;
				if(findIndex == index)
				{
					return objs[i];
				}
			}
		}
	}

	return null;
}


function getDocumentArrayIndex(docObj, tagName, obj)
{
	var objs = docObj.all.tags(tagName)
	var objSize = objs.length;
	var index = -1;

	if(objSize != null)
	{
		for(i = 0; i < objSize; i++)
		{
			var tempid = objs[i].id;
			if(tempid == obj.id)
			{
				index++;
				if(objs[i] == obj)
				{
					return index;
				}
			}
		}
	}
	return -1;
}


function getDocumentObjectLength(docObj, tagName, id)
{
	var objs = docObj.all.tags(tagName)
	var objSize = objs.length;
	var findIndex = 0;

	for(i = 0; objSize != null && i < objSize; i++)
	{
		var tempid = objs[i].id;

		if(tempid == id)
		{
			findIndex++;
		}
	}
	return findIndex;
}

function doSubmit(formObj, xecureCheck, frameName, message)
{
	var tForm = document.templateForm;

	if(message != null)
	{
		if(message == 'wait')
		{
			message = "<br><br><center><font size='4' color='red'><b></b></font><center>";
		}
		var thf = document.all[frameName];
		if(thf)
		{
			thf.style.display = '';
			thf.zIndex = 99;
			thf.innerHTML = message;
		}
	}

	if(xecureCheck == true)
		doXecureSubmit(formObj);
	else
		formObj.submit();

}

function doXecureSubmit(formObj)
{
	XecureSubmit(formObj);
}


function checkReqSelect(item, itemname, checkIndex)
{
	if(item.selectedIndex < checkIndex)
	{
		alert(itemname + '');
		item.focus();
		return false;
	}
	return true;
}


function clearMoneyComma(formObjArray)
{
	var form = document.form;

	for(oi = 0 ; oi < formObjArray.length; oi++)
	{
		var objName = formObjArray[oi];
		var objSize = getArrayLength(form, objName);
		for(i = 0 ; i < objSize; i++)
		{
			var obj = getFormArrayObject(form, formObjArray[oi], i, true);
			obj.value = removeComma(obj.value);
			if(obj.value == '')
				obj.value = '0';
		}
	}
}


function refreshLock(lockObj)
{
	var form = document.form;

	var lockHtml = '	<script language="JavaScript">\nif (document.all) \n	{  \n		document.onkeydown = function ()  \n		{  \n			var VIRTUAL_KEY_F5 = 116; // 116 = F5  \n			if (VIRTUAL_KEY_F5 == event.keyCode)  \n			{  \n				event.keyCode=0;  \n				alert ("��� ���� ȭ�鿡���� ��ΰ�ħ ���; ����� �� ��4ϴ�!");  \n				return false;  \n			}  \n		}  \n	}  \n</script>';

	if( lockObj != null && lockObj.value == 'LOCK' )
	{
		document.write(lockHtml);
	}
}

function selectCheckBox(formObj, objName) {
	var k=0;
	var flag1 = 0;

	var frm = document.form;
	var length = getArrayLength(formObj, objName);

	for(var i = 0 ; i < length; i++)
	{
		var obj = getFormArrayObject(formObj, objName, i, 0);
		if(obj.checked)
		{
			flag1 = 1;
			break;
		}
	}

	if ( flag1 == 0 ) return false;
	else return true;
}

function getCheckBoxValue(formObj, objName) {
	var k=0;

	var frm = document.form;
	var length = getArrayLength(formObj, objName);
	for(var i = 0 ; i < length; i++)
	{
		var obj = getFormArrayObject(formObj, objName, i, 0);
		if(obj.checked)
		{
			return obj.value;
			break;
		}
	}

	return null;
}

function selectAllCheckBox(formObj, objName, check) {
	var k=0;
	var flag1 = 0;

	var frm = document.form;
	var length = getArrayLength(formObj, objName);

	for(var i = 0 ; i < length; i++)
	{
		var obj = getFormArrayObject(formObj, objName, i, 0);
		obj.checked = check;
	}
}

var rot=0;
function rotate(objName, r)
{
	var obj = getDocumentObject(document, 'div', objName, 0);
	rr = rot + r;
	if ( rr < 0 ) rr = 3;
	if ( rr == 4 || rr == rot ) rr = 0;
    obj.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation='+rr+')';
    rot = rr;
}

function getLength(value)
{
	var len = value.length;
	for (i = 0; i < value.length; i++)
		if (value.charCodeAt(i) > 127)
			len++;
	return len;
}

function isEngAndNum(value) {
	if (value.length <= 0)
		return true;

	var result = true;
	for ( var i=0; i<value.length; i++ ) {
		var k = value.charAt(i);
		if (k < '0' || (k > '9' && k < 'A') || (k > 'Z' && k < 'a') || k > 'z') {
			result = false;
		}
	}
	return result;
}

function isNum(value) {
	if (value.length <= 0)
		return true;

	var result = true;
	for ( var i=0; i<value.length; i++ ) {
		var k = value.charAt(i);
		if (k < '0' || k > '9') {
			result = false;
		}
	}
	return result;
}

function isPhoneNumber(value) {
	if (value.length <= 0)
		return true;

	var result = true;
	for ( var i=0; i<value.length; i++ ) {
		var k = value.charAt(i);
		if (k < '0' || k > '9' ) {
			if(k != '-'){
				result = false;
			}
		}
	}
	return result;
}

function callMsn(email)
{
	if(typeof(objMessengerApp) != 'undefined')
	   objMessengerApp.InstantMessage(email);
	else
		alert('MSN');
}

function callMsnWin(email)
{
	var win_1;
	var option = 'width=0,height=0,left=20000,top=0,titlebar=no,toolbar=no,status=no,menubar=no,resizable=no,scrollbars=no';
	win_1 = window.open('',"MSN",option);
	var htmlStr = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">               \n'+
'<HTML><HEAD><TITLE>msn</TITLE>                                           \n'+
'<META http-equiv=Content-Type content="text/html; charset=ks_c_5601-1987">   \n'+
'<LINK href="./style.css" type=text/css rel=stylesheet>                       \n'+
'<SCRIPT language=javascript>                                                 \n'+
'function fMsnQuestion(email){                                                \n'+
'   objMessengerApp.InstantMessage(email);                                    \n'+
'}                                                                            \n'+
'function doClose(){                                                \n'+
'   window.close();                                    \n'+
'}                                                                            \n'+
'</SCRIPT>                                                                    \n'+
'<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>                 \n'+
'<BODY leftMargin=0 topMargin=0 > \n'+
'<OBJECT id=objMessengerApp height=0 codeType=application/x-oleobject width=0 \n'+
'classid=clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28></OBJECT>                 \n'+
'<SCRIPT language=javascript>                                                 \n'+
'   objMessengerApp.InstantMessage(\''+email+'\');                                    \n'+
'   setTimeout(\'doClose()\', 500);                                    \n'+
'</SCRIPT>                                                                    \n'+
'</BODY></HTML>                                                       \n';

	win_1.document.writeln(htmlStr);
}

function checkGroup(formObj, arrayObj)
{
	var grpNoLength = getArrayLength(formObj, 'grpNo');

	for(var i = 0 ; i < grpNoLength ; i++)
	{
		var grpNo = getFormArrayObject(formObj, 'grpNo', i, 0);

		grpNo.checked = false;

		for(var j = 0 ; j < arrayObj.length ; j++)
		{
			if(grpNo.value == arrayObj[j])
			{
				grpNo.checked = true;
				break;
			}
		}
	}
}

function isCheckGroup()
{

	var formObj = top.selectGroupFrame.form;
	var grpNoLength = getArrayLength(formObj, 'grpNo');

	for(var i = 0 ; i < grpNoLength ; i++)
	{
		var grpNo = getFormArrayObject(formObj, 'grpNo', i, 0);

		if(grpNo.checked == true)
			return true;
	}

	return false;
}

function addHiddenGroup(form)
{
	var formObj = top.selectGroupFrame.form;
	var grpNoLength = getArrayLength(formObj, 'grpNo');

	for(var i = 0 ; i < grpNoLength ; i++)
	{
		var grpNo = getFormArrayObject(formObj, 'grpNo', i, 0);

		if(grpNo.checked)
		{
			var input = document.createElement('input');

			input.name = 'grpNo';
			input.type = 'hidden';
			input.value = grpNo.value;
			form.appendChild(input);
		}
	}
}

function refreshIFrameSize(iframe)
{
	var the_height = iframe.contentWindow.document.body.scrollHeight;
	var the_width = iframe.contentWindow.document.body.scrollWidth;

	iframe.style.height = the_height;
	iframe.style.width = the_width;
}

function refreshIFrameVSize(iframe)
{
	var the_height = iframe.contentWindow.document.body.scrollHeight;

	iframe.style.height = the_height;
}

function getThisTime()
{
	var currentDate = new Date();

	var yearStr = new String(currentDate.getYear());
	var monthStr = new String(currentDate.getMonth() + 1);
	if(monthStr.length < 2) monthStr = '0' + monthStr;
	var dayStr = new String(currentDate.getDate());
	if(dayStr.length < 2) dayStr = '0' + dayStr;
	var hourStr = new String(currentDate.getHours());
	var minuteStr = new String(currentDate.getMinutes());
	var secondStr = new String(currentDate.getSeconds());

	return yearStr + monthStr + dayStr + hourStr + minuteStr + secondStr;
}

function isSSN(front, back) {
	var birthday = front;
	var num = back;

	if(birthday.length != 6) {
		return false;
	}
	if(num.length != 7) {
		return false;
	}
	var hap = 0;
	for(var i=0; i < 6; i++) {
		var temp = birthday.charAt(i) * (i+2);
		hap += temp;
	}

	var n1 = num.charAt(0);
	var n2 = num.charAt(1);
	var n3 = num.charAt(2);
	var n4 = num.charAt(3);
	var n5 = num.charAt(4);
	var n6 = num.charAt(5);
	var n7 = num.charAt(6);

	hap += n1*8+n2*9+n3*2+n4*3+n5*4+n6*5;
	hap %= 11;
	hap = 11 - hap;
	hap %= 10;
	if(hap != n7)
		return false;
	return true;
}

// RaioButton 의 값을 읽어 들인다.
function getRadioValue (obj){
	for(i=0; i< obj.length; i++){
		if(obj[i].checked){
			return (obj[i].value);
		}
	}
	return null;
}
