 ///// »õÃ¢ ¶Ù¿ì±â 
function Open_WIndow(gourl,windowname,sizewidth,sizeheight)
{
	var setWin;
	setWin=winSetting(sizewidth,sizeheight);
	window.open(gourl,windowname, setWin);
	
}	

function lib(url, width, height) 
{
		var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=auto,menubar=no,status=no' );
}

///// »õÃ¢ ¶Ù¿ì±â ½ºÅ©·Ñ Å¸ÀÔ ÁÖ±â
 function Open_WIndowscroll(gourl,windowname,sizewidth,sizeheight,scrollType)
{
	var setWin;
	setWin=winSetting(sizewidth,sizeheight,scrollType);
	window.open(gourl,windowname, setWin);
	
}	

///// À©µµ ¿ÀÇÂ ¼ÂÆÃ	 
function winSetting(sizewidth,sizeheight){
	var LeftPosition;
	var TopPosition;
	var settings;

	LeftPosition = (screen.width) ? (screen.width-sizewidth)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-sizeheight)/2 : 0; 
	settings ='top='+TopPosition+',left='+LeftPosition+',width='+sizewidth+',height='+sizeheight+',fullscreen=no,titlebar=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'; 
	return settings;
} 

//À©µµ¿ì¸¦ °¡¿îµ¥ À§Ä¡ÇÏ°Ô ÇÑ´Ù.
function winCenter(){
	var docWidth  = document.body.clientWidth;
	var docHeight = document.body.clientHeight;
	var winWidth  = screen.width;
	var winHeight = screen.height;
	self.moveTo((winWidth-docWidth)/2, (winHeight-docHeight+20)/2)
}

/////////////////////¸¶¿ì½º¿À¹ö ÀÌ¹ÌÁö Ã¼ÀÎÁö Start ////////////////////////////
function overImg(menu, url) {
		menu.src = url
	}
function outImg(menu, url) {
		menu.src = url
	}
/////////////////////¸¶¿ì½º¿À¹ö ÀÌ¹ÌÁö Ã¼ÀÎÁö End ////////////////////////////

//////////////////// ShowHideLayer function Start ///////////////////////////////
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  return;
}

//////////////////// ShowHideLayer function End ///////////////////////////////


///String °ü·ÃÇÔ¼ö///
///¹®ÀÚ¿­ÀÇ ¹ÙÀÌÆ® ¹ÝÈ¯ÇÑ´Ù.
function toByte(aquery) 
{
	var tmpStr;
	var temp=0;
	var onechar;
	var tcount;
	tcount = 0;
	 
	tmpStr = new String(aquery);
	temp = tmpStr.length;

	for (k=0;k<temp;k++)
	{
		onechar = tmpStr.charAt(k);

		if (escape(onechar).length > 4) {
			tcount += 2;
		}
		else if (onechar!='\r') {
			tcount++;
		}
	}
	return tcount;
}

///TrimÇÔ¼ö
function trim(inputString) {
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") {
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") {
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf(" ") != -1) { 
      retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); 
   }
   return retValue; 
}

//input text ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°Ô
//onKeyPress="return inputNumber(this);"
function inputNumber(intxt) {
	//keyCode
	//189,109 : -
	//48 ~ 57 : '0' ~ '9'
	//46 : '.'
	//8 : backspace
	//9 : tab
	//alert(event.keyCode)
	var moveKey = false;
	if (event.keyCode>95&&event.keyCode<106)
	{	
		moveKey = true; 
	}
	if (moveKey || (event.keyCode >= 48 && event.keyCode <= 57) ||  event.keyCode == 189 || event.keyCode == 109 || event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9) {
		return true;
	}else {
		return false;
	}
}

function isNumeric(str){
	count=0;
	if (str.length < 1) 
		return false;
	for (i=0;i<str.length;i++){
		if(str.charAt(i)<'0' || str.charAt(i)>'9') count++;
	}
	if(count!=0)
		return false;
	else 
		return true;
}

/*¼ýÀÚ¸é true ¾ÆÀÎ¸é false*/
function isNumber(str){
	count=0;
	if (str.length < 1) 
		return false;
	for (i=0;i<str.length;i++){
		if(str.charAt(i)<'0' || str.charAt(i)>'9') count++;
	}
	if(count!=0)
		return false;
	else 
		return true;
}


function checkEmailAddress(val) {
	var goodEmail = val.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.pe.kr)|(\.co.kr)|(\.org)|(\..{2,2}))$)\b/gi);
	if (goodEmail)
		return true;
	else 
		return false;
}

//¹®ÀÚ¿­ ¾ÕÂÊÀÇ 0À» Áö¿î´Ù.
//str = "09"  >>  return "9"
function deleteFrontZero(str){
	val = new String(str)
	do {
		if (val.length==1) 
			break;
		if (val.substr(0,1)=='0')
			val = val.substr(1, val.length - 1);
		else
			break;
	} while (true);
	return val
}

///Int ÇüÀ¸·Î º¯È¯
function toInt(val){
	val = deleteFrontZero(val);
	return parseInt(val);
}

//Float ÇüÀ¸·Î º¯È¯
function toFloat(val){
	val = deleteFrontZero(val);
	return parseFloat(val);
}

// object °Ë»ç
function trycatch_func(srtVal) 
{
		try {
			if ( typeof(srtVal) == "object" )				
			  throw true;			
			else
			  throw false;		
		}
		catch(e) {	
			 if (e)
				return true;	
		     else					
				return false;		
		 				
		}		
}

///ÆË¾÷À» Á¾·áÇÑ´Ù.
function selfClose()
{
	if (typeof(self.opener)!="undefined")
		self.opener.focus();
	self.close();
}

function strCDate(strDate){ 
	var iYear = toInt(strDate.substr(0,4));
	var iMonth= toInt(strDate.substr(4,2));
	var iDay  = toInt(strDate.substr(6,2));
	
	//alert(strDate + ':' + strDate.substr(6,2) + "->" + iDay + ", " + parseInt("09"));
	if ( isNaN(iYear) || isNaN(iMonth) || isNaN(iDay) ){
		return null;
	}else{
		//alert(iMonth + "," + iDay);
		if (iMonth < 1 || iMonth > 12) 
			return null;
		if (iDay < 1 || iDay > 31) 
			return null;
			
		return new Date(iYear, iMonth - 1, iDay)
	}
}

function createDate(year, month, day){ 
	var iYear = toInt(year);
	var iMonth= toInt(month);
	var iDay  = toInt(day);
	
	//alert(strDate + ':' + strDate.substr(6,2) + "->" + iDay + ", " + parseInt("09"));
	if ( isNaN(iYear) || isNaN(iMonth) || isNaN(iDay) ){
		return null;
	}else{
		//alert(iMonth + "," + iDay);
		if (iMonth < 1 || iMonth > 12) 
			return null;
		if (iDay < 1 || iDay > 31) 
			return null;
			
		return new Date(iYear, iMonth - 1, iDay)
	}
}

/*
** ³¯Â¥Çü½ÄÀÌ ¿Ã¹Ù¸¥Áö °Ë»ç
*/
function isDate(year, month, day)
{
	
	var arrDate;
	var chkDate
	if (month.length < 2) 
		month = "0" + month;
	if (day.length < 2)
		day = "0" + day;
	chkDate = new Date(year + "/" + month + "/" + day);

	if (isNaN(chkDate) == true || (toInt(month) != chkDate.getMonth() + 1 || toInt(day) != chkDate.getDate()) ) {
		return false;
	}
	
	return true;
}

function IsAlphaNumeric(checkStr) 
{
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	for (i = 0;  i < checkStr.length;  i++) {
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j)) break;
	if (j == checkOK.length) {
		return true;
		break;
	}
  	}
	return false;
}

  // ¼ýÀÚÁß ¾ÕÂÊÀÇ "0" À» Á¦¿ÜÇÏ°í ¹ÝÈ¯
function ZeroCheck(strValue){
		var Result ;
		Result = strValue.substring(strValue.indexOf("0") + 1, strValue.length);
		return Result
}

//³»¿ë: ¹ÙÀÌÆ® Ã¼Å© , °ø¹é Ã¼Å©, ¼ýÀÚ Ã¼Å© , ¼ýÀÚ¸¸ ÀÔ·Â ¹Þ±â, ¾ÕÆÄºª ¼ýÀÚ Ã¼Å©



//IFRAME »çÀÌÁî¸¦  ¹®¼­ÀÇ³»¿ë¿¡ ¸Â°Ô ÀÚµ¿À¸·Î ¼³Á¤ÇÑ´Ù.
var _iframe_autoResize_timer;
var _iframe_autoResize_count=0;
function iframe_autoResize()
{
	_iframe_autoResize_timer = setInterval("iframe_autoResizeProc()", 100)
}

function iframe_autoResizeProc()
{
	var objtb_main;
	try {
		var objBody = self.document.body;
		var i_height = objBody.scrollHeight + (objBody.offsetHeight-objBody.clientHeight);
		var i_width = objBody.scrollWidth + (objBody.offsetWidth-objBody.clientWidth);

		//self.resizeTo(objtb_main.clientWidth, objtb_main.clientHeight);
		var objFrame = self.parent.document.all(self.name);
		objFrame.style.height = i_height;
		objFrame.style.width = i_width;
		clearInterval(_iframe_autoResize_timer);
		_iframe_autoResize_count = 0;
	} catch(e) {}
	
	_iframe_autoResize_count++;
	if(_iframe_autoResize_count>600)
	{
		clearInterval(_iframe_autoResize_timer);
		_iframe_autoResize_count = 0;
	}
}


//ÆË¾÷ »çÀÌÁî¸¦  ¹®¼­ÀÇ³»¿ë¿¡ ¸Â°Ô ÀÚµ¿À¸·Î ¼³Á¤ÇÑ´Ù.
var _popup_autoResize_timer;
var _popup_autoResize_count=0;
function popup_autoResize()
{
	_popup_autoResize_timer = setInterval("_popup_autoResize()", 100)
}

//ÆË¾÷»çÀÌÁî¸¦ ¹®¼­ÀÇ³»¿ë¿¡ ¸Â°Ô ÀÚµ¿À¸·Î Á¶Á¤ÇÑ´Ù.
function _popup_autoResize()
{
	var _HIEIGHT_MARGIN = 29;
	var _WIDTH_MARGIN   = 10;
	var argv = _popup_autoResize.arguments;
	var argc = argv.length;
	
	var win_height;
	var win_width;
	var obj_main = ( argc > 0  ? argv[0] : document.body.children[0]);
	
	win_height  = obj_main.clientHeight + _HIEIGHT_MARGIN;
	win_width	= obj_main.clientWidth  + _WIDTH_MARGIN;
	
	try{
		self.resizeTo(win_width, win_height);
		clearInterval(_popup_autoResize_timer);
		_popup_autoResize_count = 0;
	}catch(e){ }
	
	_popup_autoResize_count++;
	if(_popup_autoResize_count>600)
	{
		clearInterval(_popup_autoResize_timer);
		_popup_autoResize_count = 0;
	}
}

function GetByteLen(s)
{
   var temp;
   var mycount;
   mycount = 0;
   len = s.length;
			    
   for(k=0;k<len;k++){
      temp = s.charAt(k);
      if (escape(temp).length > 4)
         mycount += 2;
      else
         mycount++;
       }
       return mycount;
}

function isEmptyString(strText)
{
	var strCheck = strText + "";
 	if ((strCheck != "") && (strCheck != null)) {
		for (i=0; i < strCheck.length; i++) {
			if(strCheck.substring(i , i+1) == " ") return true;
  		}
		return false;
 	}
 	return true;
}

function replaceText(el, text) 
{
	if (el != null) 
	{
		clearText(el);
		var newNode = document.createTextNode(text);
		el.appendChild(newNode);
	}
}

function clearText(el) 
{
	if (el != null) 
	{
		if (el.childNodes) 
		{
			for (var i = 0; i < el.childNodes.length; i++) 
			{
				var childNode = el.childNodes[i];
				el.removeChild(childNode);
			}
		}
	}
}

function getText(el) 
{
	var text = "";
	if (el != null) 
	{
		if (el.childNodes) 
		{
			for (var i = 0; i < el.childNodes.length; i++) 
			{
				var childNode = el.childNodes[i];
				if (childNode.nodeValue != null) 
				{
					text = text + childNode.nodeValue;
				}
			}
		}
	}
	return text;
}


 // ÀÔ·Â¹ÞÀ»¶§, °ø¹é°ª¸¸ ÀÔ·ÂÇß´ÂÁö..°ªÀÌ ¾ø´ÂÁö  Ã¼Å©
function isEmptyAll(strText)
{
	var str_len=0;  
	for (var i=0; i < strText.length;i++)
	{	
		//var str_temp = strText;
		if (strText.substring(i,i+1) != ' ') 
			str_len=str_len+1;		
	}

	if (strText.length == 0  ||  str_len == 0)  	// °ø¹éÀ» ÀÔ·ÂÇßÀ» °æ¿ì 
		return true;
	else
		return false;
}

function onlyNumber() 
{
	if((event.keyCode < 45 ) || (event.keyCode > 57))
	{
			event.returnValue = false;
	}
}
//ÀÌ¹ÌÁö ·Ñ¿À¹ö
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;