<!--

//-------------------------------------------------------------------//
// À¥ºê¶ó¿ìÀú ¹öÀü Ã¼Å©ÇÏ´Â ºÎºÐ...                                   //
//-------------------------------------------------------------------//
<!--

String.prototype.trim = function()
 {
  return this.replace(/(^\s*)|(\s*$)/g, "");
 }

function bName() {
  // return 1 for Internet Explorer
  if (navigator.appName == "Microsoft Internet Explorer")
    return 1;

  // return 2 for Navigator
  if (navigator.appName == "Netscape")
    return 2;

  // return 0 for other browsers
  return 0;
}

function bVer() {
  // return version number (e.g., 4.03)
  return parseFloat(navigator.appVersion)
}

var nameCode = bName();
var versionCode = bVer();

if ((nameCode == 1) && (versionCode >= 4))
{
	var IEYES = 1;
}


//-------------------------------------------------------------------//
//  °ø¹éÁ¦°ÅÈÄ ±æÀÌ Ã¼Å© (±æÀÌ¹ÝÈ¯)                                  //
//-------------------------------------------------------------------//
function ReplaceStr(strOriginal, strFind, strChange)
{
	var position, strOri_Length;
  position = strOriginal.indexOf(strFind);  
    
  while (position != -1)
  {
		strOriginal = strOriginal.replace(strFind, strChange);
    position    = strOriginal.indexOf(strFind);
  }
  
  strOri_Length = strOriginal.length;
  return strOri_Length;
}


//-------------------------------------------------------------------//
//  ¹®ÀÚ¿­¿¡¼­ ÁöÁ¤µÈ ¹®ÀÚ À¯¹« Ã¼Å© (À§Ä¡°ª¹ÝÈ¯)                    //
//-------------------------------------------------------------------//
function Checkstr(strOriginal, strFind)
{    
  var position;
  position = strOriginal.indexOf(strFind); 
    
  return position;
}


//-------------------------------------------------------------------//
//  ÀÔ·ÂÅ°°ª ¼ýÀÚ¿©ºÎ Ã¼Å© (true,false¹ÝÈ¯)                          //
//-------------------------------------------------------------------//
function onlynumber()
{
	if((event.keyCode<48) || (event.keyCode>57))
	event.returnValue=false;
}


//-------------------------------------------------------------------//
//  ÁöÁ¤µÈ °´Ã¼ÀÇ ¹®ÀÚ¿­ÀÇ ±æÀÌ¸¦ °è»êÇÏ´Â ºÎºÐ                      //
//-------------------------------------------------------------------//
function CheckByte(str)
{
    var strByte;
    var strLen = str.length;

    if(IEYES == 1)     // IE4.0 ÀÌ»ó
    {
        for(var i=0, strByte=0;i<strLen;i++)
        {
            if(str.charAt(i) >= ' ' && str.charAt(i) <= '~' )
                strByte++;
            else
                strByte += 2;
        }
        return strByte;
    }
    else               // NetscapeÀÏ °æ¿ì
    {
        return strLen;
    }
}


//-------------------------------------------------------------------//
//  ¹®ÀÚ¿­ÀÇ ±æÀÌ¿¡ µû¸¥ Ã³¸® ÇÔ¼ö                                    //
//------------------------------------------------------------------//
function check_length(comp, str, len)
{
    if ( comp.value.length > len ) {  // ÀÌ¹Ì ÃÊ°ú ÇÏ¿´´Ù¸é...
        alert(str + ' ' + len + 'ÀÚ(Byte)¸¦ ÃÊ°úÇÒ¼ö ¾ø½À´Ï´Ù.');
        comp.focus();
        return false;
    }
    complen = CheckByte(comp.value);
    if ( complen > len )
    {
        alert(str + ' ' + len + 'ÀÚ(Byte)¸¦ ÃÊ°úÇÒ¼ö ¾ø½À´Ï´Ù. ÇöÀç ' + (complen) + '±ÛÀÚ(Byte)ÀÔ´Ï´Ù.');
        comp.focus();
        return false;
    }
    return true;
}


//-------------------------------------------------------------------//
//         °´Ã¼¿¡¼­ ¹®ÀÚ ÀÔ·Â½Ã ¿À·ù¸Þ½ÃÁö(¼ýÀÚ¸¸ ÀÔ·Â°¡´É)             //
//-------------------------------------------------------------------//
function isValidNum(comp)
{	
	if(!check_digit2(comp.value)) 
	{
		alert('¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù');
		comp.value='';
		comp.focus();
		return;
	} 
	return true;
}

function isValidInt(comp)      // - ºÎÈ£ Æ÷ÇÔ
{	
	if(!check_digit_Int(comp.value)) 
	{
		alert('¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù');
		comp.value='';
		comp.focus();
		return;
	} 
	return true;
}


//-------------------------------------------------------------------//
//    °´Ã¼¿¡¼­ ¹®ÀÚ ÀÔ·Â½Ã ¿À·ù¸Þ½ÃÁö(¼ýÀÚ¸¸ ÀÔ·Â°¡´É) - ¼Ò¼öÁ¡ Çã¿ë    //
//-------------------------------------------------------------------//
function isValidFloat(comp)
{	
	if(!check_digit3(comp.value)) 
	{
		alert('ÀÔ·Â°ªÀº ¾çÀÇ Á¤¼ö¿Í ¼Ò¼ö¸¸ °¡´ÉÇÕ´Ï´Ù.');
//		comp.value='';
		comp.focus();
		return;
	} 
	return true;
}


//-------------------------------------------------------------------//
//            ¼ýÀÚ·Î ±¸¼ºµÈ ¹®ÀÚ¿­ÀÎ°¡¸¦ Ã¼Å©ÇÏ´Â ÇÔ¼ö                 //
//-------------------------------------------------------------------//
function check_digit(name) 
{
	var name = name.toString();
	var ch = '\0';
	var flag = true;
	
	for (var i = 0, ch = name.charAt(i); (i < name.length) && (flag); ch = name.charAt(++i)) 
	{
		if ((ch >= '0') && (ch <= '9')) flag = true;
		else flag = false;
	}
	return flag;
}


//-------------------------------------------------------------------//
//            ¼ýÀÚ·Î ±¸¼ºµÈ ¹®ÀÚ¿­ÀÎ°¡¸¦ Ã¼Å©ÇÏ´Â ÇÔ¼ö               //
//-------------------------------------------------------------------//
function check_digit2(str)  //¹®ÀÚ·Î ¹ÞÀ½
{
	var ch   = "\0";
	var flag = true;
	
	for (var i = 0, ch = str.charAt(i); (i <str.length) && (flag); ch = str.charAt(++i)) 
	{
		if (((ch >= '0') && (ch <= '9')) || ch == '-');
		else flag = false;
	}
	return flag;
}

function check_digit_Int(str)  //¹®ÀÚ·Î ¹ÞÀ½
{
	var ch   = "\0";
	var flag = true;
	
	for (var i = 0, ch = str.charAt(i); (i <str.length) && (flag); ch = str.charAt(++i)) 
	{
		if (((ch >= '0') && (ch <= '9')) || ch == '-');
		else flag = false;
	}
	return flag;
}


//-------------------------------------------------------------------//
//    °´Ã¼¿¡¼­ ¹®ÀÚ ÀÔ·Â½Ã ¿À·ù¸Þ½ÃÁö(¼ýÀÚ¸¸ ÀÔ·Â°¡´É) - ¼Ò¼öÁ¡ Çã¿ë    //
//-------------------------------------------------------------------//
function check_digit3(chkstr) 
{	
	var i;
	var isNum = true;
	var dotcount = 0;
	if ( ((chkstr).length == 1) && (chkstr == ".") ) {
		isNum = false ;
	}else {
		for (i = 0; i < (chkstr).length; i++){
			ch = (chkstr).charAt(i);
			if (!(ch >= "0" && ch <= "9")) {
				if (ch == ".") {
					dotcount = dotcount + 1;
					if (dotcount > 1) {
						isNum = false ;
						break ;
					}
				} else {
					isNum = false ;
					break ;
				}
			}
		}
	}
	return isNum;
}


//-------------------------------------------------------------------//
//  ¿µ¹® ´ë¹®ÀÚ·Î º¯È¯ÇÏ´Â ÇÔ¼ö                                      //
//-------------------------------------------------------------------//
function ToUpper(comp) 
{
	var strNew; 
	var str = comp.value;
	
	if (comp.value != 0) 
	{
		for( var i =0 ; i<str.length; i++ )
		{
			if( str.charAt(i) >= 'a' && str.charAt(i) <= 'z' )
				strNew = strNew + str.charAt(i).toUpperCase() ;
			else
				strNew = strNew + str.charAt(i);
		}
		comp.value = strNew.substring(9);
	}
	return;
}


//-------------------------------------------------------------------//
//  ¿µ¹® ¼Ò¹®ÀÚ·Î º¯È¯ÇÏ´Â ÇÔ¼ö                                      //
//-------------------------------------------------------------------//
function ToLower(comp) 
{
	var strNew; 
	var str = comp.value;
	
	if (comp.value != 0) 
	{
		for( var i =0 ; i<str.length; i++ )
		{
			if( str.charAt(i) >= 'A' && str.charAt(i) <= 'Z' )
				strNew = strNew + str.charAt(i).toLowerCase() ;
			else
				strNew = strNew + str.charAt(i);
		}
		comp.value = strNew.substring(9);
	}
	return;
}


//-------------------------------------------------------------------//
//  ÅëÈ­Ç¥½Ã ÇÔ¼ö                                                    //
//-------------------------------------------------------------------//
function formatCurrency(comp)
{
	var num = comp.value ;
	
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num)) num = "0"; 
	cents = Math.floor((num*100+0.5)%100); 
	num = Math.floor((num*100+0.5)/100).toString(); 
	if(cents < 10) cents = "0" + cents; 
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) 
	num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3)); 
	
	comp.value = num ;
	return ;
}


//-------------------------------------------------------------------//
//  ¼Ò¼öÁ¡ÀÌÇÏ ¹Ý¿Ã¸² ÇÔ¼ö                                           //
//-------------------------------------------------------------------//
function point_round(num, len)
{	
	num = eval(num) ;
	len = eval(len) ;
	
	plus_value = "0." ;
	for(i=0; i<len; i++)
	{
		plus_value = plus_value + "0" ;
	}
	plus_value = plus_value + "5" ;
	plus_value = eval(plus_value) ;
	
	temp  = num + plus_value ;
	temp  = temp + "" ;
	temp  = temp.split(".") ;
	temp1 = temp[0] ;
	temp2 = temp[1] ;
	temp2 = temp2.substring(0,len) ;
	temp  = temp1 + "." + temp2 ;
	return temp;
}


//-------------------------------------------------------------------//
//  ¼Ò¼öÁ¡ÀÌÇÏ ÀÚ¸£±â ÇÔ¼ö                                           //
//-------------------------------------------------------------------//
function point_cut(num, len)
{	
	num = eval(num) ;
	len = eval(len) ;
	
	temp  = num ;
	temp  = temp + "" ;
	imsi  = temp.split(".") ;
	if ( imsi.length == 1 )
	{
		temp1 = temp ;
		temp2 = "" ;
		for(i=0; i<len; i++)
		{
			temp2 = temp2 + "0" ;
		}
	}
	else
	{
		temp1 = imsi[0];
		temp2 = imsi[1] ;
		for(i=temp2.length; i<len; i++)
		{
			temp2 = temp2 + "0" ;
		}
		temp2 = temp2.substring(0,len) ;
	}
	temp  = temp1 + "." + temp2 ;
	return temp;
}


//-------------------------------------------------------------------//
//  ÀÚ¸®¼ö ¹Ý¿Ã¸² ÇÔ¼ö                                               //
//-------------------------------------------------------------------//
function money_round(num, len)
{	
	num = eval(num) ;
	len = eval(len) ;
	
	plus_value = (len/10) * 5
	
	temp  = num + plus_value ;
	temp  = temp / len ;
	temp  = temp + "" ;
	temp  = temp.split(".") ;
	temp  = temp[0] ;
	temp  = eval(temp) * len ;
	return temp;
}


//-------------------------------------------------------------------//
//  ÀÚ¸®¼ö ÀÚ¸£±â ÇÔ¼ö                                               //
//-------------------------------------------------------------------//
function money_cut(num, len)
{	
	num = eval(num) ;
	len = eval(len) ;
	
	temp  = num / len ;
	temp  = temp + "" ;
	temp  = temp.split(".") ;
	temp  = temp[0] ;
	temp  = eval(temp) * len ;
	return temp;
}


//-------------------------------------------------------------------//
//  ³¯ÀÚ ºñ±³ ÇÔ¼ö                                                   //
//-------------------------------------------------------------------//
function Date_Compare(y1, m1, d1, y2, m2, d2)
{
	var MinMilli = 1000 * 60         //º¯¼ö¸¦ ÃÊ±âÈ­ÇÕ´Ï´Ù.
	var HrMilli  = MinMilli * 60
	var DyMilli  = HrMilli * 24

	d = new Date;

	d1 = new Date(y1, m1-1, d1);
	d2 = new Date(y2, m2-1, d2);

	d3 = d1 - d2;

	r = Math.round(d3 / DyMilli);
	
	return r ;
}


//-------------------------------------------------------------------//
//  ¾÷·Îµå ÁøÇàÀ² Ç¥½Ã±â ÇÔ¼ö                                        //
//-------------------------------------------------------------------//
function ShowProgress(a) 
{ 
	strAppVersion = navigator.appVersion; 
	if (a != "")
	{
		if (strAppVersion.indexOf('MSIE')!=-1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
		{
			winstyle = "dialogWidth=385px; dialogHeight:150px; center:yes"; 
			window.showModelessDialog("/SHOW-PROGRESS/show_progress.asp?nav=ie", null, winstyle); 
		} 
		else
		{ 
			winpos = "left=" + ((window.screen.width-380)/2)+",top=" + ((window.screen.height-110)/2); 
			winstyle = "width=380,height=110,status=no,toolbar=no,menubar=no," + "location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos; 
			window.open("/SHOW-PROGRESS/show_progress.asp",null,winstyle); 
		} 
	}
	
	return true; 
}


//-------------------------------------------------------------------//
//  È®ÀåÀÚ Ã¼Å© ÇÔ¼ö                                                 //
//-------------------------------------------------------------------//
function uploadfile_check(a)
{
	var str_value,str_low,str_dotlocation,str_ext_low;
	str_value=a;
	str_low=str_value.toLowerCase(str_value);
	str_dotlocation=str_low.lastIndexOf(".");
	str_ext=str_low.substring(str_dotlocation+1);
	
	switch(str_ext)
	{
		case "asp":
		case "ASP":
		case "php":
		case "PHP":
		case "html":
		case "HTML":
		case "htm":
		case "HTM":
		alert("¹®¼­ÆÄÀÏÀÌ³ª ÀÌ¹ÌÁöÆÄÀÏÀ» ¿Ã¸®¼¼¿ä.");
		return false;
		break;
		default:		
		return true;
	}
}


//-------------------------------------------------------------------//
//  ÀÌ¹ÌÁö Ã¼Å© ÇÔ¼ö                                                 //
//-------------------------------------------------------------------//
function imagefile_check(a)
{
	var str_value,str_low,str_dotlocation,str_ext_low;
	str_value=a;
	str_low=str_value.toLowerCase(str_value);
	str_dotlocation=str_low.lastIndexOf(".");
	str_ext=str_low.substring(str_dotlocation+1);
	
	switch(str_ext)
	{
		case "jpg":
		case "jpeg":
		case "JPG":
		case "JPEG":
		case "GIF":
		case "gif":
		case "BMP":
		case "bmp":
		return true;
		break;
		default:
		alert("ÀÌ¹ÌÁö ÆÄÀÏ·Î ¿Ã¸®¼¼¿ä.");
		return false;
	}
}


//-------------------------------------------------------------------//
//  ÀÔ·Â ´ÙÀ½Ç×¸ñ Æ÷Ä¿½ºÀÌµ¿ ÇÔ¼ö                                    //
//-------------------------------------------------------------------//
function focus_next()
{
	if(event.keyCode==13)
	{
		event.keyCode = 9 ;
	}
}


//-------------------------------------------------------------------//
//  ÀÔ·Â ´ÙÀ½Ç×¸ñ Æ÷Ä¿½ºÀÌµ¿ ÇÔ¼ö (¶óµð¿À¹Ú½º¿¡¼­)                   //
//-------------------------------------------------------------------//
function focus_next1(a)
{
	if(event.keyCode==13)
	{
		document.all[a].focus();
		return true;
	}
	return;
}


//-------------------------------------------------------------------//
//  ÀÔ·Â ´ÙÀ½Ç×¸ñ Æ÷Ä¿½ºÀÌµ¿ ÇÔ¼ö                   //
//-------------------------------------------------------------------//
function focus_next2(com, order, max, next)
{
	temp = com.elements[order].value;
	if(temp.length >= max)
	{
		com.elements[next].focus() ;
	}
}


//-------------------------------------------------------------------//
//  ¿ìÆí¹øÈ£ÀÔ·ÂÄ­ Å¬¸¯½Ã ½ÇÇà  ÇÔ¼ö                                 //
//-------------------------------------------------------------------//
function Bchk()
{
	alert("¿ìÆí¹øÈ£ °Ë»ö¹öÆ°À» »ç¿ëÇØ ÁÖ½Ê½Ã¿ä.");
	return;
}


//-------------------------------------------------------------------//
//  ÀÌ¹ÌÁöÆÄÀÏ Ã¼Å©  ÇÔ¼ö                                            //
//-------------------------------------------------------------------//
function checkImgType(comp)
{
	var img = comp.value ;
	
	if(img.match(/(.[jJ][pP][eE]?[gG]|.[gG][iI][fF]|.[pP][nN][gG])/))
	{
		//document.images["checkImg"].src= img;
	}
	else
	{
		if ( img.trim() != "" )
		{
			alert("¾÷·ÎµåÇÒ ÀÌ¹ÌÁö Çü½ÄÀÌ Àß¸ø µÇ¾ú½À´Ï´Ù.");
			comp.value = "" ;
			comp.focus();
			return ;
		}
	}
}


//-------------------------------------------------------------------//
//  ¾÷·ÎµåÆÄÀÏÅ©±â Ã¼Å©  ÇÔ¼ö                                        //
//-------------------------------------------------------------------//
function checkFileSize(a)
{
	if (document.checkImg.fileSize > (1048576 * a))
	{
		form.imgval.value = 2;
		alert("¾÷·Îµå ÇÒ ¼ö ÀÖ´Â ÃÖ´ë ÀÌ¹ÌÁö »çÀÌÁî´Â " + Math.round(1048576 * a / 1000000) + "MB ÀÔ´Ï´Ù.");
	}
}


//-------------------------------------------------------------------//
//  ¹®ÀåÀÇ ¾Õ°ú µÚÀÇ °ø¹é Á¦°Å  ÇÔ¼ö                                 //
//-------------------------------------------------------------------//
String.prototype.trim = function()
{
	return this.replace(/^\s*(\b.*\b|)\s*$/, "$1");
}


//-------------------------------------------------------------------//
//  ÀÍ½ºÇÃ·Î¾î Ã¼Å©                                                  //
//-------------------------------------------------------------------//
var AGT = navigator.userAgent.toLowerCase();

isWIN = ( AGT.indexOf('win') != -1 ) ? true : false;
isMAC = ( AGT.indexOf('mac') != -1 ) ? true : false;

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;


//-------------------------------------------------------------------//
//  °³Ã¼ ¾ò±â                                                        //
//-------------------------------------------------------------------//
function getObj(idname)
{
	if (isNS4)
	{
		elm = document.layers[idname];
	}
	else if (isIE4)
	{
		elm = document.all[idname];
	}
	else if (isIE5 || isNS6)
	{
		elm = document.getElementById(idname);
	}
	return elm;
}


//-------------------------------------------------------------------//
//  ¹®ÀÚ¿­ Ã¼Å© ÇÔ¼ö                                                 //
//-------------------------------------------------------------------//
function Check(keyword) 
{
	var st_num, key_len;
	st_num = keyword.indexOf(" ");	
	while (st_num != -1)
	{
		keyword = keyword.replace(" ", "");
		st_num  = keyword.indexOf(" ");
	}
	key_len=keyword.length;
	return key_len;
}


//-------------------------------------------------------------------//
//  ¹®ÀÚ¿­ Ã¼Å© ÇÔ¼ö                                                 //
//-------------------------------------------------------------------//
function checkEN(str)
{ 
	var check = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-.';
	var temp; 
	
	for (var i=0; i<str.length; i++) 
	{
		temp = '' + str.substring(i, i+1); 
		if (check.indexOf(temp) == '-1'){ 
			return false;
		}
	} 
	return true;
}


//-------------------------------------------------------------------//
//  ÀÌ¹ÌÁö¸í Ã¼Å© ÇÔ¼ö                                                 //
//-------------------------------------------------------------------//
function imgNameCk(theText)
{
	var filename = theText.value.toString();
	var filelen = filename.length;
	var imgName;
	var ch = 0;
	var temp = "";
	var retemp = "";
	
	//filename = filename.toUpperCase();

	for (ch=filelen-1;ch>=0;ch--)
	{
		if (filename.charAt(ch)=="\\")
		{
			break;
		}
		else
		{
			temp = temp + '' + filename.charAt(ch)
		}
	}

	for (ch=temp.length-1;ch>=0;ch--)
	{
		retemp = retemp + '' + temp.charAt(ch)
	}

	if (!checkEN(retemp))
	{
		return false;
	}
	return true;
}


//-------------------------------------------------------------------//
//  ÀÌ¹ÌÁöÆÄÀÏÀÎÁö Ã¼Å© ÇÔ¼ö                                                 //
//-------------------------------------------------------------------//
function CheckImageFile(theForm)
{
	var filename = theForm.value;
	var filelen = filename.length;
	var imgName;

	if (Check(filename) == 0)  // ÆÄÀÏ ¼±ÅÃÀ» ¾ÈÇÑ°æ¿ì
	{
		return true;
	}
	else	// ÆÄÀÏ¼±ÅÃÀ» ÇÑ °æ¿ì
	{
		imgName = filename.substring(filelen-4,filelen)

		if (imgName.toUpperCase() == ".GIF" || imgName.toUpperCase() == ".JPG")
		{
			return true;
		}
		else
		{
			return false;
		}
	}
}


//-------------------------------------------------------------------//
//  ÇÃ·¡½Ã player ÇÔ¼ö                                                 //
//-------------------------------------------------------------------//
function __ShowFlash(efile,ewidth,eheight,equality,ename,ewmode)
{
	fval  = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ ewidth +'" height="'+ eheight +'" id="'+ ename +'">';
	fval += '<param name="movie" value="'+ efile +'">';
	fval += '<param name="quality" value="'+ equality +'">';
	fval += '<param name="wmode" value="'+ ewmode +'">';
	fval += '<embed src="'+ efile +'" width="'+ ewidth +'" height="'+ eheight +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>';
	fval += '</object>';
	
	document.write(fval);
}

//-->
