//get ÆÄ¶ó¸ÞÅÍ °ª ±¸ÇÏ±â
//delPara·Î ³Ñ¾î¿À´Â ¹®ÀÚ¿­¿¡ Æ÷ÇÔµÇ´Â ÆÄ¶ó¸ÞÅÍ´Â Á¦°Å ÇÏ°í ¸®ÅÏ
function getCurrentParaMeta(delPara) {
	var pageUrl =  "";
	var urlAddress = window.location.search.split("?");
	var temp = "";
	if (delPara == null) delPara = "";
	if (delPara != "")	  delPara = delPara.toLowerCase();
	
	 if(urlAddress.length > 1){
		 getValue = "?";
		  urlQuery=urlAddress[1].split("&");  //%26
		  arrUrlCount = urlQuery.length; 
		  arrUrlKeys = new Array(arrUrlCount);
		  arrUrlValues = new Array(arrUrlCount);
		  for(i=0;i< arrUrlCount;i++){
			   urlparam = urlQuery[i].split("=");

				if (typeof(urlparam[1]) != "undefined")		{
					if (delPara != "")	{
						 temp = "";
					     temp = urlparam[0].toLowerCase() + ",";
						if (delPara.indexOf(temp) == -1)	{
							getValue += urlparam[0] + "=" +  urlparam[1] + "&";
						}
					} else {
						getValue += urlparam[0] + "=" +  urlparam[1] + "&";
					}
				}
		  }

		getValue = getValue.substring(0, getValue.length-1);
	   pageUrl +=  getValue;
   } 
	return pageUrl;
}

//³»¿ëº¸±â ÆäÀÌÁö ¸í ±¸ÇÏ±â(expert_Li.asp = > expert_Vw.asp) ¸íÀ¸·Î º¯È¯ÇÏ¿© ¸®ÅÏ
//oldString ¹®ÀÚ¸¦ newString·Î º¯È¯
//oldStringÀº ¼Ò¹®ÀÚ·Î 
function getReplaceFileName(oldString, newString) {
	var currenPage, replaceURL, replaceURL1, replaceURL2, currenPageExt;
	var comaLastIndex, cutMinusLength;
	 replaceURL = "";														//¸®ÅÏµÇ´Â ÆÄÀÏ¸í
	 currenPage = window.location.pathname;
	 oldString = oldString.toLowerCase();
	comaLastIndex = currenPage.lastIndexOf(".");
	currenPageExt = currenPage.substring(comaLastIndex, currenPage.length);
	cutMinusLength = currenPageExt.length + oldString.length;

	 replaceURL1 =  currenPage.substring(0, currenPage.length - cutMinusLength);
	 replaceURL2 =  currenPage.replace(replaceURL1, "").replace(currenPageExt, "");
	 replaceURL2 =  replaceURL2.toLowerCase().replace(oldString, newString);	

//	 replaceURL =  replaceURL1 + replaceURL2 + currenPageExt;

	 replaceURL = "http://" + window.location.host + replaceURL1 + replaceURL2 + currenPageExt;

	 return replaceURL;
}


//´Þ·Â ¶ç¿ì±â
//strDisplayBoxName : ¼±ÅÃ °ªÀ» ¸®ÅÏ ¹ÞÀ»  Form Tag Item Name (text, hidden Type) 
function fnSelectDay2(strDisplayBoxName) {
	var iScreenX=screen.Width;
	var iScreenY=screen.Height;
	iScreenX=iScreenX/2-120;
	iScreenY=iScreenY/2-150;
	var selectDayURL="/INC/selectCalendar2.html?strDisplayBoxName="+strDisplayBoxName;
	a = window.open (selectDayURL, "select_date", "width=210, height=265, top="+iScreenY+", left="+iScreenX);
	a.focus();
}

//´Þ·Â ¶ç¿ì±â
//strDisplayBoxName : ¼±ÅÃ °ªÀ» ¸®ÅÏ ¹ÞÀ»  Form Tag Item Name (text, hidden Type) 
function fnSelectDay3(strDisplayBoxName) {
	var iScreenX=screen.Width;
	var iScreenY=screen.Height;
	iScreenX=iScreenX/2-120;
	iScreenY=iScreenY/2-150;
	var selectDayURL="/INC/selectCalendar3.html?strDisplayBoxName="+strDisplayBoxName;
	a = window.open (selectDayURL, "select_date", "width=210, height=265, top="+iScreenY+", left="+iScreenX);
	a.focus();
}

function setSelectBoxClear(argObj) {
   for (i = argObj.length-1; i>=0; i--) {
 	  argObj.options[i] = null;
   }
}

//¹è¿­¿¡¼­ °ª°ú ÀÏÄ¡ÇÏ´Â Ã¹¹øÂ° ¹è¿­Å°°ª ¸®ÅÏ(¹è¿­, Ã£À»°ª)
function getArrSameFirstKey(arrData, strFind) {
	var rtnKey = "";
	if (typeof(arrData) == "object")	{
		 for(var i  in arrData){
			if (arrData[i] == strFind)  {
				rtnKey = i;
				break;
			}
		}
	}
	return rtnKey;
}


function HtmlWord2Js(strValue) {
	if (strValue.replace(/\s/gi,"") !="" )	{
		strValue = strValue.replace(/\'\'/gi, "'");
		strValue = strValue.replace(/\r\n/gi, "<br>");
		strValue = strValue.replace(/\n/gi, "&nbsp;");
	} else {
		strValue = "";
	}
	
	return strValue;
}

function openWindow(name, url, width,height) {
	left = (screen.width) ? (screen.width-width)/2 : 0;
	toppo = (screen.height) ? (screen.height-height)/2 : 0;

	a = window.open(url, name, 'left='+left+',top='+toppo+',width='+width+',height='+height);
	a.focus();
}

//¶óµð¿À ¹öÆ° Ã¼Å© ¿©ºÎ
function getRadioChecked(arg) {
  var chkCount = 0;
  var argLength= arg.length;

  for(i=0; i < argLength; i++) {
    if(arg[i].checked == true)   {
	   chkCount +=1;
    }
  }
	
  if (chkCount == 0)
	 return false;
  else 
	return true;
}

//Ã¼Å©¹Ú½º¿¡ Ã¼Å©µÈ ¹Ú½º ¼ö
function getCheckCount(arg) {
  var chkCount = 0;
  var argLength= arg.length;

  for(i=0; i < argLength; i++) {
    if(arg[i].checked == true)   {
	   chkCount +=1;
    }
  }
	 return chkCount;
}

//ÆÄÀÏÀÌ¸§¸í ±¸ÇÏ±â
function fileName(upFile){
	var upFileSub = upFile.lastIndexOf("\\");
	var upFileLen = upFile.length;
	var upFileName = upFile.substring((upFileSub+1), upFileLen);

	return upFileName;
}

//ÆÄÀÏÀÌ¸§À¸·Î ÆÄÀÏ È®ÀåÀÚ ±¸ÇÏ±â
function fileFormat(upFileName){
	var typeSub = upFileName.lastIndexOf(".");
	var typeLen =  upFileName.length;
	var typeName = upFileName.substring((typeSub+1), typeLen);
	    typeName = typeName.toLowerCase();

	return typeName;
}

//ÀÌ¹ÌÁö ÆÄÀÏ¸í Çü½Ä  Ã¼Å©
function checkImgFile(arg) {
	var upfile = arg.value;
	var upfileName = fileName(upfile);
	var upfileType = fileFormat(upfileName);

	if (upfileType != "gif" && upfileType != "jpeg" && upfileType != "jpg" && upfileType != "png") return false;
	return true;
}

//±ÝÁö ÆÄÀÏ Çü½Ä Ã¼Å©
function checkForbidFile(arg) {
	var upfile = arg.value;
	var upfileName = fileName(upfile);
	var upfileType = fileFormat(upfileName);

	if (upfileType == "aspx" || upfileType == "php" || upfileType == "html" || upfileType == "php3" || upfileType == "htm" || upfileType == "asp"  || upfileType == "jsp" || upfileType == "phtml" || upfileType == "cgi" || upfileType == "jhtml" || upfileType == "exe" || upfileType == "js") {
		return true;
	}
	return false;
}


//¹®ÀÚ¿­ ¹ÙÀÌÆ® ¼ö ±¸ÇÏ±â
 function getByteLength(s){
        var len = 0;
       if ( s == null ) return 0;
       for(var i=0;i<s.length;i++){
          var c = escape(s.charAt(i));
          if ( c.length == 1 ) len ++;
          else if ( c.indexOf("%u") != -1 ) len += 2;
          else if ( c.indexOf("%") != -1 ) len += c.length/3;
       }
       return len;
}

//Æû ÇÊµå °ø¹é¿©ºÎ Ã¼Å©
function formIsNull(arg) {
	if (arg.value.replace(/\s/gi,"")=="")	return true;
	return false;
}

//ÀÌ¹ÌÁö ¸®»çÀÌÂ¡
function setResizeImage(strID, intMax) {
	var intWidth =document.getElementById(strID).width;
	if (intWidth <=0) {
		bolTime = window.setTimeout("setResizeImage('"+strID+"'," + intMax + ")",10);
	} else  	{
		if (parseInt(intWidth) > parseInt(intMax))
			document.getElementById(strID).width = intMax;
	}
}

//ºñÀ²¿¡ µû¶ó ÀÌ¹ÌÁö ¸®»çÀÌÂ¡
function resizeImage(strID, rW, rH) {
	var intWidth =document.getElementById(strID).width;
	if (intWidth <=0) {
		bolTime = window.setTimeout("resizeImage('"+strID+"'," + rW + ", " + rH + ")",10);
	} else  	{
		var iW = document.getElementById(strID).width;
		var iH = document.getElementById(strID).height;
		var g = new Array;

		if(iW < rW && iH < rH) { // °¡·Î¼¼·Î°¡ Ãà¼ÒÇÒ °ªº¸´Ù ÀÛÀ» °æ¿ì
			g[0] = iW; 
			g[1] = iH; 
		} else {
			if(iW > iH) { // ¿øÅ©±â °¡·Î°¡ ¼¼·Îº¸´Ù Å©¸é
					g[0] = rW;
					g[1] = Math.ceil(iH * rW / iW);
			} else if(iW <  img.height) { //¿øÅ©±âÀÇ ¼¼·Î°¡ °¡·Îº¸´Ù Å©¸é
					g[0] = Math.ceil(iW * rH / iH);
					g[1] = rH;
			} else {
					g[0] = rW;
					g[1] = rH;
			}

			if(g[0] > rW) { // ±¸ÇØÁø °¡·Î°ªÀÌ Ãà¼Ò °¡·Îº¸´Ù Å©¸é
				g[0] = rW;
				g[1] = Math.ceil(iH * rW / iW);
			}

			if(g[1] > rH) { // ±¸ÇØÁø ¼¼·Î°ªÀÌ Ãà¼Ò ¼¼·Î°ª°¡·Îº¸´Ù Å©¸é
				g[0] = Math.ceil(iW * rH / iH);
				g[1] = rH;
			}
		}
		document.getElementById(strID).width = g[0];
		document.getElementById(strID).height = g[1];
	}
}

//¹®ÀÚ Á¸Àç¿©ºÎÆÇº°
function notChars(input,chars) {
	for (var inx = 0; inx < input.value.length; inx++) {
		if (chars.indexOf(input.value.charAt(inx)) == -1) 	return true;
	}
	return false;
}

//¼ýÀÚ ¿©ºÎ Ã¼Å©
function formOnlyNum(input) {
	var chars = "0123456789";
	return notChars(input, chars);
}


//¿µ¹®ÀÚ¿Í ¼ý»ç¿©ºÎ Ã¼Å©
function onlyAlphaNum(input) {
	var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	return notChars(input, chars);
}

//¿Ï¼ºÇü ÇÑ±Û Ã¼Å©
function checkCompleteKorean(arg) {
	arg.value = arg.value.replace(/\s/gi,"");

	 for (var i = 0; i < arg.value.length; i++)  {
         if (arg.value.charCodeAt(i) != 32 && (arg.value.charCodeAt(i) < 44032 || arg.value.charCodeAt(i) > 55203))
             return true;
     }
     return  false;
}

//ÅØ½ºÇÁ ÇÊµåÀÇ °ª ¼³Á¤ÇÏ±â
function setTextValue(arg, string) {
		arg.value = string;
}

function setFocusToFirstTextField(form) {
	if ( typeof form == 'undefined' ) return;
	var count = form.elements.length;
		for ( var i = 0; i < count; i++ ) {
			if ( form.elements[i].type == "text" || form.elements[i].type == "password" ) {
				form.elements[i].focus();
				return;
			}
		}
}

function autoTab(input,len, e) {
		var isNN = (navigator.appName.indexOf("Netscape")!=-1);
		var keyCode = (isNN) ? e.which : e.keyCode;
		var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];

		if(input.value.length >= len && !containsElement(filter,keyCode)) {
			input.value = input.value.slice(0, len);
			input.form[(getIndex(input)+1) % input.form.length].focus();
		}

		function containsElement(arr, ele) {
			var found = false, index = 0;

			while(!found && index < arr.length){
				if(arr[index] == ele) {
					found = true;
				} else {
					 index++;
				}
			}
			return found;
		}
		function getIndex(input) {
			var index = -1, i = 0, found = false;

			while (i < input.form.length && index == -1){
				if (input.form[i] == input) {
					index = i;
				} else {
					i++;
				}
			}
			return index;
		}
	return true;
}

//¼¼ÀÚ¸® ¸¶´Ù ÄÞ¸¶ Âï¾î Ç¥½ÃÇÏ±â 
function printMoneyFormat(sMny){
	var i, ii, y;
	y = "";
	sMny = String(sMny);
	for (i=sMny.length-1;i >= 0;i--)	{
		ii = sMny.length-1-i;
		flag = (ii+1) % 3;
		if ((flag == 0) && ( ii != sMny.length-1 ))
			y = "," + sMny.charAt(i) + y;
		else
			y = sMny.charAt(i) + y;
	}

	document.write(y);
}

//¼¼ÀÚ¸®¸¶´Ù ÄÞ¸¶ Âï¾î °ª ¸®ÅÏ
function getMoneyFormat(sMny){
	var i, ii, y;
	y = "";
	sMny = String(sMny);
	for (i=sMny.length-1;i >= 0;i--)	{
		ii = sMny.length-1-i;
		flag = (ii+1) % 3;
		if ((flag == 0) && ( ii != sMny.length-1 ))
			y = "," + sMny.charAt(i) + y;
		else
			y = sMny.charAt(i) + y;
	}

	return y;
}


//ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
function checkSSN(input1, input2) {
 var	no1 = input1.value;
 var 	no2 = input2.value;

	if (no1.length != 6){
		return false;

	}	else if (no2.length != 7){
		return true;

	}	else {
		var str_serial1 = no1;
		var str_serial2 = no2;

		var digit=0
		for (var i=0;i<str_serial1.length;i++){
			var str_dig=str_serial1.substring(i,i+1);
			if (str_dig<'0' || str_dig>'9'){
				digit=digit+1
			}
		}

		if ((str_serial1 == '') || ( digit != 0 )){
			return false;
		}

		var digit1=0
		for (var i=0;i<str_serial2.length;i++){
			var str_dig1=str_serial2.substring(i,i+1);
			if (str_dig1<'0' || str_dig1>'9'){
				digit1=digit1+1
			}
		}

		if ((str_serial2 == '') || ( digit1 != 0 )){
			return false;
		}

		if (str_serial1.substring(2,3) > 1){
			return false;
		}

		if (str_serial1.substring(4,5) > 3){
			return false;
		}

		if (str_serial2.substring(0,1) > 4 || str_serial2.substring(0,1) == 0){
			return false;
		}

		var a1=str_serial1.substring(0,1)
		var a2=str_serial1.substring(1,2)
		var a3=str_serial1.substring(2,3)
		var a4=str_serial1.substring(3,4)
		var a5=str_serial1.substring(4,5)
		var a6=str_serial1.substring(5,6)

		var check_digit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7

		var b1=str_serial2.substring(0,1)
		var b2=str_serial2.substring(1,2)
		var b3=str_serial2.substring(2,3)
		var b4=str_serial2.substring(3,4)
		var b5=str_serial2.substring(4,5)
		var b6=str_serial2.substring(5,6)
		var b7=str_serial2.substring(6,7)

		var check_digit=check_digit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5

		check_digit = check_digit%11
		check_digit = 11 - check_digit
		check_digit = check_digit%10

		if (check_digit != b7){
			return false;
		}else{
			return true;
		}
	}
}

//ÀÌ¸ÞÀÏ Ã¼Å©
function checkEmail(arg){
	var atsign = arg.value.indexOf('@');
	var period = arg.value.lastIndexOf('.');
	var space  = arg.value.indexOf(' ');
	var length = arg.value.length - 1;

	if (( atsign < 1 ) || ( period <= atsign + 1 ) || ( period == length ) ||( space  != -1 )) 	{
		return true;
	}
		return false;
}

//ÁÂÇ¥°ª ÀúÀåÇÏ´Â Å¬·¡½º
function setEvent() {
	this.Value = null;
	this.Left = 0;
	this.Top = 0;

	this.setLefttBottom = function (obj) {
		var intX = 0; 	var  intY = 0; 	var intH = obj.offsetHeight;
		 if (obj.offsetParent) {
			 while (obj.offsetParent) {
				 intX += obj.offsetLeft;
				 intY += obj.offsetTop;
				 obj = obj.offsetParent;
			 }
		 } else if (obj.x) {	// nn4 - only works with "a" tags
			 intX += obj.x;
			 intY += obj.y;
		 }
		this.Left = intX;
		this.Top = intY + intH;
	}

	this.setLeftTop = function (obj) {
		var intX = 0; 	var  intY = 0; 
		 if (obj.offsetParent) {
			 while (obj.offsetParent) {
				 intX += obj.offsetLeft;
				 intY += obj.offsetTop;
				 obj = obj.offsetParent;
			 }
		 } else if (obj.x) {	
			 intX += obj.x;
			 intY += obj.y;
		 }
		this.Left = intX;
		this.Top = intY;
	}
}

//¸¶¿ì½º ÁÂÇ¥°ª È®ÀÎ
/*
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

var tempX = 0;
var tempY = 0;

function getMouseXY(e) {
if (IE) { 
	tempX = event.clientX + document.body.scrollLeft;
	tempY = event.clientY + document.body.scrollTop;
}
else {  
	tempX = e.pageX;
	tempY = e.pageY;
}  
if (tempX < 0){tempX = 0;}
if (tempY < 0){tempY = 0;}  
	window.status = "x:  " + tempX + ", Y: " + tempY;
	return true;
}
*/


//ÀÌ¹ÌÁö ¸®»çÀÌÂ¡ : °¡·Î »çÀÌÁî ±âÁØÀ¸·Î ¸ÂÃã
function imgResize(imgName,maxWidth){
	var imgnm = eval('document.all.'+imgName);

	if (imgnm) {
		var zimgw = imgnm.width;
		var zimgh = imgnm.height;

		for(var i = 0; 1 ; i++){
				var imgWidth = imgnm.width;
				var imgHeight = imgnm.height;

				if ( (imgWidth > maxWidth) ) {
					imgnm.width = imgnm.width * 0.99;
					imgnm.height = imgnm.height * 0.99;
				}else{
					break
				}

		}
	}
}

function resize_image() 	{
	var imgw;
	var imgh;

	imgw = document.images.type_img1.width;
	imgh = document.images.type_img1.height;

	if (imgw>600) { 
		imgResize('type_img1',600); 
		imgw = document.images.type_img1.width;
		imgh = document.images.type_img1.height;
	}

	window.resizeTo( imgw+60, imgh+90 );	
}


//Null Check Function
function fnNullChk(szInputType, szFormName, szInputName, szAlertMsg) {
  var objName = eval(szInputName);
  var blnRet = true;
  var nRadioChkCnt = 0;

  if (szInputType=='select-one' || szInputType=='radio' || szInputType=='checkbox'  || szInputType=='file' ) {
    szAlertMsg += ' ¼±ÅÃÇØ ÁÖ½Ê½Ã¿ä.     ';
  }else{
    szAlertMsg += ' ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.     ';
  }

  if (szInputType=='select-one'){
	if (objName.selectedIndex < 0)	{
	  blnRet = false; 
	}else{
	  if ( (objName.options[objName.selectedIndex].value)=='' ) { blnRet = false; } 
	}

  }else if (szInputType=='radio' || szInputType=='checkbox' ){
    for(var j=0; j < objName.length; j++) {
      if( objName[j].checked ) nRadioChkCnt++;
    }
    if( nRadioChkCnt==0 ){ blnRet = false; } 
  }else if ( szInputType=='text' || szInputType=='file' || szInputType=='hidden' || szInputType=='textarea' || szInputType=='password' ){  
    if( fnTrim(objName.value) == '' ){ blnRet = false; }
  }
  
  if (szInputType=='file' && blnRet == true ) {
    if ( (objName.value.search(":\\\\") == -1) ){
      blnRet = false;
      szAlertMsg = 'ÆÄÀÏ Çü½ÄÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.     ';
    }
  } 

  if ( ! blnRet ){
    fnAlertFocus(szInputType, szFormName, szInputName, szAlertMsg) ;
    return false;
  }
}



//Email Check Function
function fnEmailChk( objEmail ) {
  var objEmail = eval(objEmail) ;
  var szEmail = objEmail.value ;
  var regDoNot = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
  var regMust = /^[a-zA-Z0-9\-\.\_]+@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3})$/;
  if ( !regDoNot.test(szEmail) && regMust.test(szEmail) ){
    return true;
  }else{
    alert('Àß¸øµÈ E-mailÀÔ´Ï´Ù.     ');
    objEmail.focus() ;
    return false;
  }
}

//Jumin Number Check Function
function fnJuminChk( objJumin, szJumin ) {
  var objJumin = eval(objJumin) ;
  var nIDtot = 0;
  var szIDAdd = '234567892345';
  if (Number(szJumin)==0) {
    alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.     ');
    objJumin.focus() ;
    return false;
  }
  for(var i=0; i < 12; i++) nIDtot = nIDtot + parseInt(szJumin.substring(i, i+1), 10) * parseInt(szIDAdd.substring(i, i+1), 10);
  nIDtot = 11 - ( nIDtot % 11);
  if ( nIDtot == 10) nIDtot = 0;
  else if ( nIDtot == 11) nIDtot = 1;
    if(parseInt(szJumin.substring(12, 13), 10) != nIDtot) {
      alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.     ');
      objJumin.focus() ;
      return false;
    }else{
      return true;
    }
}

//Only Number Check Function
function fnOnlyNumChk( objNum , szAlertMsg ) {
  var objNum = eval(objNum);
  var szValue = objNum.value;
  szValue = szValue.toUpperCase();
  for(var i=0; i < szValue.length; i++) {
    if (szValue.charAt(i) == ' '){
      alert( szAlertMsg+' ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.     ' );
      objNum.focus();
      return false;
    }else if ((szValue.charAt(i) < '0') || (szValue.charAt(i) > '9'))	{
      alert( szAlertMsg+' ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.     ' );
      objNum.focus();
      return false;
    }
  }
}

//Message Length Check Function
function fnMsgLenChk( objMessage, nLimitLen, szAlertMsg ) {
  var nbytes = 0;
  var objMessage = eval(objMessage) ;
  var szMessage = objMessage.value ;
  for (var i=0; i < szMessage.length; i++) {
    var szChr = szMessage.charAt(i);
    if(escape( szChr ).length > 4) {
      nbytes += 2;
    } else if (szChr == '\n') {
      if (szMessage.charAt(i-1) != '\r')    nbytes += 1;
    } else if (szChr == '<' || szChr == '>' ) {
      nbytes += 4;
    } else if (szChr == "'") {
      nbytes += 2;
    } else {
      nbytes += 1;
    }
  }
  if ( nbytes > nLimitLen ){
    alert( szAlertMsg + ' ³Ê¹« ±æ°Ô ÀÔ·ÂÇÏ¼Ì½À´Ï´Ù.     \n¿µ¹®/¼ýÀÚ´Â '+nLimitLen+'ÀÚ, ÇÑ±ÛÀº '+nLimitLen/2+'ÀÚ ÀÌ³»·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.     ');		
    objMessage.focus();
    return false;
  }
}

//Alert & focus Function
function fnAlertFocus(szInputType, szFormName, szInputName, szAlertMsg) {
  alert(szAlertMsg);
  var objName = eval(szInputName);
  if ( (szInputType=='checkbox' || szInputType=='radio') && (objName.length > 0) ){
    objName = eval(szInputName+'[0]');
  }
  objName.focus();
}

//Trim Function
function fnTrim( szValue ) {
  var szRetVal = '';
  if( szValue == '' )  return false;
  for(var i=0;i<szValue.length;i++) {
    if(szValue.charAt(i) != ' ')    szRetVal = szRetVal + szValue.charAt(i);
  }
  return szRetVal;
}



// ¼ýÀÚ¸¸ ÀÔ·Â (¼Ò¼öÁ¡ Çã¿ë, À½¼ö Çã¿ë)
// »ç¿ë¹ý : onKeyPress = onlyNum();
function onlyNum()
{
	if (event.keyCode < 45 || event.keyCode > 57 || event.keyCode == 47) 
		event.returnValue = false;
}

// ¼ýÀÚ¸¸ ÀÔ·Â (¼Ò¼öÁ¡ Çã¿ë, À½¼ö ºÒ°¡)
// »ç¿ë¹ý : onKeyPress = onlyNum2();
function onlyNum2()
{
	if (event.keyCode < 46 || event.keyCode > 57 || event.keyCode == 47) 
		event.returnValue = false;
}

// ¼ýÀÚ¸¸ ÀÔ·Â (¼Ò¼öÁ¡ ºÒ°¡, À½¼ö Çã¿ë)
// »ç¿ë¹ý : onKeyPress = onlyNum3();
function onlyNum3()
{
	if (event.keyCode < 45 || event.keyCode > 57 || event.keyCode == 46 || event.keyCode == 47)  
		event.returnValue = false;
}

// ¼ýÀÚ¸¸ ÀÔ·Â (¼Ò¼öÁ¡ ºÒ°¡, À½¼ö ºÒ°¡)
// »ç¿ë¹ý : onKeyPress = onlyNum4();
function onlyNum4() 
{
	if (event.keyCode < 48 || event.keyCode > 57)
		event.returnValue=false;
}




//Æ¯¼ö¹®ÀÚ Á¦°Å
function checkSpecialChar(_obj){
    if(_obj.value.search(/[\",\',<,>]/g) >= 0) {
        alert("¹®ÀÚ¿­¿¡ Æ¯¼ö¹®ÀÚ( \",  ',  <,  > )°¡ ÀÖ½À´Ï´Ù.\nÆ¯¼ö¹®ÀÚ¸¦ Á¦°ÅÇÏ¿© ÁÖ½Ê½Ã¿À!");
        _obj.select();
        _obj.focus();
    }
} 


//ÄíÅ°¹Ú±â
function setCookie( name, value, expiredays ) { 
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

//ÄíÅ°ºÒ·¯¿À±â
function getCookie(name) {
	var from_idx = document.cookie.indexOf(name+'=');
	 if (from_idx != -1) {
			from_idx += name.length + 1 ;
			to_idx = document.cookie.indexOf(';', from_idx) ;

			if (to_idx == -1) {
						to_idx = document.cookie.length;
			}
			return unescape(document.cookie.substring(from_idx, to_idx)) ; 
	 }
}

//»õÃ¢ À©µµ¿ì¸¦ È­¸é °¡¿îµ¥·Î ÀÌµ¿ ÇÔ¼ö
function winCenterMove(intwinWidth, intwinHeight){
		var wcenter = (screen.width - parseInt(intwinWidth)) / 2; 
		var hcenter = (screen.height - parseInt(intwinHeight)) / 2; 
		self.moveTo(wcenter,hcenter);
}

//°³ÀÎÁ¤º¸Á¦°ø µ¿ÀÇ ÆË¾÷
function agreePop() {
	win = window.open ("/Helpdesk/Privacy_Agreement_pop.asp", "pop_agree", "width=560,height=440,top=5,left=5,scrollbars=0,resizable=0");
	win.focus();
}

//ÁÖ¼Ò°Ë»ö ÆË¾÷
function postPop() {
	win = window.open ("/Helpdesk/Post_SearchFm.asp", "pop_zipcode", "width=400,height=150,top=5,left=5,scrollbars=1,resizable=1");
	win.focus();
}


//*AJAX
var bustcachevar=1; //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects="";
var rootdomain="http://"+window.location.hostname;
var bustcacheparameter="";

function ajaxpage(url, containerid){
	var page_request = false;
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest();
	else if (window.ActiveXObject){ // if IE
		try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e){
			try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){}
		}
	}
	else
		return false;
		page_request.onreadystatechange=function(){
			loadpage(page_request, containerid);
		}
	if (bustcachevar) //if bust caching of external page
		bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime();
		page_request.open('GET', url+bustcacheparameter, true);
		page_request.send(null);
}

function loadpage(page_request, containerid){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
		document.getElementById(containerid).innerHTML=page_request.responseText;
}

function loadobjs(){
	if (!document.getElementById)
		return;
	for (i=0; i<arguments.length; i++){
		var file=arguments[i];
		var fileref="";
		if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
			if (file.indexOf(".js")!=-1){ //If object is a js file
				fileref=document.createElement('script');
				fileref.setAttribute("type","text/javascript");
				fileref.setAttribute("src", file);
			}
			else if (file.indexOf(".css")!=-1){ //If object is a css file
				fileref=document.createElement("link");
				fileref.setAttribute("rel", "stylesheet");
				fileref.setAttribute("type", "text/css");
				fileref.setAttribute("href", file);
			}
		}
		if (fileref!=""){
			document.getElementsByTagName("head").item(0).appendChild(fileref);
			loadedobjects+=file+" "; //Remember this object as being already added to page
		}
	}
}
//## AJAX */

