<!--

//
// Sub ID		: doResize
// Description	: iFrame Size Á¶Àý
// Param		: 
// Return		: 
//
function doResize(){	
	myheight = document.body.scrollHeight;
	mywidth = document.body.scrollWidth;

	window.resizeTo(mywidth,myheight);
}
function ifmeResize(obj){
	obj.height = eval(obj.name + ".document.body.scrollHeight");
}

//
// Sub ID		: isId
// Description	: 3~12ÀÚÀÇ ¿µ¹®(¼Ò¹®ÀÚ), ¼ýÀÚ¿Í Æ¯¼ö±âÈ£(_)¸¸ÀÇ Á¶ÇÕ
// Param		: str	- Id
// Return		: true or false
//
function isId(str) {
  // regular expression Áö¿ø ¿©ºÎ Á¡°Ë
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.length > 2) && (str.length < 13);
  var r1 = new RegExp("[^a-z0-9_]");
  var r2 = new RegExp("[a-z0-9_]{3,12}");
  return (!r1.test(str) && r2.test(str) && str.length > 2 && str.length < 13);
}

//
// Sub ID		: isPassword
// Description	: 6~12ÀÚÀÇ ¿µ¹®(¼Ò¹®ÀÚ)¿Í ¼ýÀÚ¸¸ÀÇ Á¶ÇÕ
// Param		: str	- Password
// Return		: true or false
//
function isPassword(str) {
  // regular expression Áö¿ø ¿©ºÎ Á¡°Ë
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.length > 5) && (str.length < 13);
  var r1 = new RegExp("[^A-Za-z0-9]");
  var r2 = new RegExp("[A-Za-z0-9]{6,12}");
  return (!r1.test(str) && r2.test(str) && str.length > 5 && str.length < 13);
}

//
// Sub ID		: isEmail
// Description	: Email Format Check
// Param		: str	- Email Address
// Return		: true or false
//
function isEmail(str) {
  // regular expression Áö¿ø ¿©ºÎ Á¡°Ë
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}

//
// Sub ID		: isSsn
// Description	: ÁÖ¹Î¹øÈ£ Sum Check
// Param		: s		- ÁÖ¹Î¹øÈ£
// Return		: true or false
//
function isSsn(s) {
	if( s.charAt(6) == 1 || s.charAt(6) == 2 ){
		if( s.charAt(12) ==	(( 11 - ((s.charAt(0)*2+s.charAt(1)*3+s.charAt(2)*4
			 +s.charAt(3)*5+s.charAt(4)*6+s.charAt(5)*7
			 +s.charAt(6)*8+s.charAt(7)*9+s.charAt(8)*2
			 +s.charAt(9)*3+s.charAt(10)*4+s.charAt(11)*5)
			% 11)))%10)
			return true;
	}
	return false;
}

//
// Sub ID		: isNumVal
// Description	: Number Format Check
// Param		: Num	- number
// Return		: true or false
//
function isNumVal(NUM) {
	for(var i=0;i<NUM.length;i++){
		achar = NUM.substring(i,i+1);
		if( achar < "0" || achar > "9" ){
			return false;
		}
	}
	return true;
}

// 
// Sub ID		: isNumObj
// Description	: ¼ýÀÚ¸¸ ÀÔ·Â¹Þµµ·Ï
// Param		: obj	- text
// Return		: true or false
//
function isNumObj(obj)
{
	for (var i = 0; i < obj.value.length ; i++){
		chr = obj.value.substr(i,1);		
		chr = escape(chr);
		key_eg = chr.charAt(1);
		if (key_eg == 'u'){
			key_num = chr.substr(i,(chr.length-1));			
			if((key_num < "AC00") || (key_num > "D7A3")) { 
				event.returnValue = false;
			} 			
		}
	}
	if (event.keyCode >= 48 && event.keyCode <= 57) {
		
	} else {
		event.returnValue = false;
	}
}

// 
// Sub ID		: isMaxLength
// Description	: ¹®ÀÚ¿­ÀÇ ÃÖ´ëÅ©±â
// Param		: str	- ¹®ÀÚ¿­
// Param		: len	- ÃÖ´ëÅ©±â
// Return		: true or false
//
function isMaxLength(str,len){
	var strlen = 0;
	for (var i = 0; i < str.length ; i++){
		chr = escape(str.substr(i,1));
		key_eg = chr.charAt(1);
		if (key_eg == 'u'){
			strlen+=2;
		} else {
			strlen++;
		}
	}
	if(strlen > len){
		return true;
	} else {
		return false;
	}
}

//
// Sub ID		: isCheckBox
// Description	: Check Box Check À¯¹«
// Param		: obj	- checkbox object
// Return		: true or false
//
function isCheckBox(obj) {
	if (obj.length > 1) {
		for(i=0;i<obj.length;i++) if (obj[i].checked) return true;
	} else {
		return obj.checked;
	}
	return false;
}

//
// Sub ID		: CheckBoxChoiceAll
// Description	: ÇØ´ç CheckBox ¸ðµÎ ¼±ÅÃ
// Param		: obj		- checkbox object
// Param		: objKey	- checkbox object
// Return		: true or false
//
function CheckBoxChoiceAll(obj,objKey){
	if(obj){
		if(obj.length){
			for(i=0;i<obj.length;i++){
				obj[i].checked = objKey.checked;
			}
		} else {
			obj.checked = objKey.checked;
		}
	}
}

//
// Sub ID		: isCheckBoxChoice
// Description	: Ã¼Å©¹Ú½º ¼±ÅÃ¿©ºÎ
// Param		: obj	- checkbox object
// Return		: true or false
//
function isCheckBoxChoice(obj){
	if(obj){
		if(obj.length){
			for(i=0;i<obj.length;i++){
				if(obj[i].checked == true){ return true; }
			}
			return false;
		} else {
			return obj.checked;
		}
	} else { return false; }
}

//
// Sub ID		: isRadio
// Description	: Radio ¼±ÅÃÀ¯¹«
// Param		: obj	- radio object
// Return		: true or false
//
function isRadio(obj) {
	if (obj.length > 1) {
		for(i=0;i<obj.length;i++) if (obj[i].checked) return true;
	} else {
		return obj.checked;
	}
	return false;
}


// 
// Sub ID		: moveObject
// Description	: ÀÏÁ¤Å©±âÀÇ °ªÀ» ¹Þ¾ÒÀ»¶§ ´Ù¸¥ object·Î ÀÌµ¿
// Param		: obj	- ÇØ´ç obj
// Param		: len	- ±æÀÌ
// Param		: nobj	- ÀÌµ¿ÇÒ obj
// Return		: true or false
//
function moveObject(obj,len,nobj){
	if(obj.value.length == len){
		nobj.focus();
		return true;
	}
	return false;
}

// 
// Sub ID		: openWindow
// Description	: ÆË¾÷À©µµ¿ì ¿­±â
// Param		: theURL	- ÆË¾÷À¸·Î ¿­¸± URL
// Param		: winName	- ÆË¾÷À©µµ¿ì ÀÌ¸§
// Param		: features	- ÆË¾÷Ã¢ÀÇ ¼Ó¼º(location=1, directoryies=1, resizable=1, status=1, toolbar=1, menubar=1, scrollbars=1, left=int, top=int)
// Param		: myWidth	- ÆË¾÷Ã¢ÀÇÆø
// Param		: myHeight	- ÆË¾÷Ã¢ÀÇ³ôÀÌ
// Param		: isCenter	- ÆË¾÷Ã¢ÀÇ Áß¾Ó Á¤·Ä ¿©ºÎ
//
function openWindow(theURL,winName,features, myWidth, myHeight, isCenter) 
{
	if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	openWin = window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
	openWin.focus();
}

//
// Sub ID		: getRadioValue
// Description	: Ã¼Å©µÈ ¶óµð¿À¹öÆ° °ª
// Param		: obj	- RadioButton object
// Return		: Ã¼Å©µÈ ¶óµð¿À¹öÆ° °ª
//
function getRadioValue(obj){
	if(obj){
		if(obj.length){
			for(i=0;i<obj.length;i++){
				if(obj[i].checked == true){ 
					return obj[i].value;
				}
			}

		}else{
			return obj.value;
		}
	} else { return false; }
}

function getFileSize(path){
	var img = new Image();
	img.dynsrc = path;
	return img.fileSize;
}
			
function chkMaxLen(maxLen, inObj, outObj){
	var curLen = inObj.value.length;
	if(curLen > maxLen){
		alert("Can't write anymore.");
		inObj.value = inObj.value.substring(0,parseInt(maxLen));
		outObj.innerHTML = maxLen;
		return false;
	}			
	outObj.innerHTML = curLen;
}

function getFileType(str){
	if(str.indexOf(".")){
		var pStr = str.split(".");
		var pLen = pStr.length;
		
		var ftype = pStr[parseInt(pLen)-1];
		return ftype.toLowerCase();
	}else{
		return false;
	}
}
function isFilled(obj, msg) {	// text box.
	if (obj.value == null || obj.value.length == 0) {
		alert(msg);
		obj.focus();		
		return false;
	}
	return true;
}

function isSelected(obj, msg) {	// drop box.
	
	if (obj.value == null || obj.value.length == 0) {
		alert(msg);
		obj.focus();
		return false;
	}
	return true;
}

function isChecked(obj, msg) {	// radio button.
	var val = false;
	for (var i=0; i<obj.length; i++) {
		if (obj[i].checked == true) val = true;
	}
	if(val==false) alert(msg);
	return val;
}
function getElement(id){
	if(document.all)	return document.all[id];
	if(document.layers)	return	document.layers[id];
	if(document.getElementById)	return document.getElementById(id);
}

//
// Sub ID		: displayLoading
// Description	: ÆäÀÌÁö ·Îµù½Ã º¸¿©ÁÖ´Â ÆäÀÌÁö
// Param		: 
// Return		: 
// Source		: ¾Æ·¡¿Í °°ÀÌ »ç¿ë
//
//	[body onload="displayLoading()"]
//	[script language=javascript]
//		if(document.all || document.layers) document.write('<div id="Load" style="position:absolute;width:100%;height:100%;top:0;left:0;background-color:#ffffff;z-index:5">ÆäÀÌÁö ·ÎµùÁß º¸¿©ÁÙ ³»¿ë</div>') 
//	[/script]
//	[/body]
function displayLoading(){ 
	if(document.all || document.layers || document.getElementById){
		getElement('Load').style.visibility = "hidden";
		getElement('Body').style.visibility = "visible";
	} 
} 
//-->