
var maxW,maxH,fromX,fromY,toX,toY,adjX,adjY,zBox,zStep=0,zLink,zNew;
//onclick="zoomBox(event,this,520,600,0,00);return false"
function zoomBox(evt,zlink,maxw,maxh,tox,toy) {
if (arguments.length > 2) zNew=1;
scrollH=(window.pageYOffset!=null)?window.pageYOffset:document.body.scrollTop;
maxW=maxw?maxw:window.innerWidth?innerWidth:document.body.clientWidth;
maxH=maxh?maxh:window.innerHeight?innerHeight:document.body.clientHeight;
toX=tox?tox:0;
toY=(toy?toy:0)+scrollH;
fromX=evt.pageX?evt.pageX:evt.clientX;
fromY=(evt.pageY?evt.pageY:evt.clientY)+(document.all?scrollH:0);
adjX=toX+evt.screenX-fromX;
adjY=toY+evt.screenY-fromY;
if (document.createElement && document.body.appendChild && !zBox) {
	zBox=document.createElement("div");
	zBox.style.position="absolute";
	document.body.appendChild(zBox);
} else if (document.all && !zBox) {
	document.all[document.all.length-1].outerHTML+='<div id="zBoxDiv" style="position:absolute"></div>';
	zBox=document.all.zBoxDiv;
} else if (document.layers && !zBox) {
	zBox=new Layer(maxW);
	zBox.style=zBox;
	}
zLink=zlink;
doZoom();
}

function doZoom() {
zStep+=1;
zPct=(10-zStep)/10
if (document.layers) {
	zBox.moveTo(toX+zPct*(fromX-toX),toY+zPct*(fromY-toY));
	zBox.document.open();
	zBox.document.write("<table width='"+maxW*(1-zPct)+"' height="+maxH*(1-zPct)+" border=2 cellspacing=0><tr><td></td></tr></table>");
	zBox.document.close();
	} else {
	zBox.style.border="2px solid #999999";
	zBox.style.left=toX+zPct*(fromX-toX);
	zBox.style.top=toY+zPct*(fromY-toY);
	zBox.style.width=maxW*(1-zPct);
	zBox.style.height=maxH*(1-zPct);
	}
zBox.style.visibility="visible";
if (zStep < 10) setTimeout("doZoom("+fromX+","+fromY+","+toX+","+toY+")",30);
else {
	zBox.style.visibility='hidden';
	zStep=0;
	//if (zLink && !zNew) location.href=zLink.href;
	//else if (zLink && zNew) {
		//var w=window.open(zLink.href,'','width='+maxW+',height='+maxH+',left='+adjX+',top='+adjY);
		//var w=window.open(zLink,'','width='+maxW+',height='+maxH+',left='+adjX+',top='+adjY);
		PreViewWindow(zLink,maxW,maxH)
		zNew=null;
		//}
	}

}
function commaSplit() 
{
	var frm=document.frmCost;
	var txtNumber = frm.tempPrice.value;
	var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
	var arrNumber = txtNumber.split('.');
	arrNumber[0] += '.';
	
	do{
		arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
	}while (rxSplit.test(arrNumber[0]));
	
	if (arrNumber.length > 1) 
	{
		return arrNumber.join('');
	}
	else 
	{
		return arrNumber[0].split('.')[0];
	}
}
function getDomain()
{
	var Dns=location.href;
			Dns=Dns.split("//");
			Dns=Dns[1];
			Dns=Dns.split("/");
			Dns=Dns[0];
	return Dns;		
}
function getAtDomain()
{
	var Dns=location.href;
			Dns=Dns.split("//");
			Dns=Dns[1];
			Dns=Dns.split("/");
			Dns=Dns[0];
			Dns=Dns.split(".");
			if( typeof Dns[3] != 'undefined' )
			{
				Dns=Dns[1]+"."+Dns[2]+"."+Dns[3];
			}
			else
			{
				Dns=Dns[1]+"."+Dns[2];
			}	
	return Dns;		
}
//=============================wwwºÙÀÌ±â==============================
function www()
{
  if(!searchString(location.href,"www"))
  {
  	document.location.href=Host();
  }
}
//=============================µµ¸ÞÀÎ==============================
function Host()
{
	var Dns;
	Dns=location.href;
	Dns=Dns.split("//");
	Dns="http://www."+Dns[1].substr(0,Dns[1].indexOf("/"))+"/";
	return Dns;
}
//=============================ÇöÀçÆÄÀÏ¸í ==============================
function getFileName(ext)
{
	var fn;
	
	if(ext=="")ext=".htm";
	
	fn=location.href;
	
	fn=fn.split(ext);
	fn=fn[0];
	fn=fn.split("/");
	fn=fn[fn.length-1];
	fn=fn.split("_");
	fn=fn[0]+ext;
	
	return fn;
}

function selectedMemu(fileNM,ext)
{
	if(getFileName(ext)==fileNM)document.write("h");
}
//=============================»óÅÂ¹Ù¿¡ ¸Þ¼¼Áö ==============================
function status_print(msg)
{
	window.status =	"'"+msg+"'";
}
//==============================¾÷·Îµå ¾Ö´Ï¸ÞÀÌ¼ÇÈ¿°ú=========================
//<script language="JavaScript">
//<!-- //
//var tranimg=new Image();
//tranimg.src="/icon/uploading_ani.gif";
//var timer;
//var msg = ""
//
//function scrollMaster() {
//
//	window.status = "¿Ã¸®´Â Áß!!";
//	scrollMe();
//}
//
//function scrollMe() {
//	document.status_img.src=tranimg.src;
//	document.status_img.width=150; //uploading_ani.gif ÀÌ¹ÌÁö Æø
//	document.status_img.height=35; ////uploading_ani.gif ÀÌ¹ÌÁö ³ôÀÌ
//	timer = setTimeout("scrollMe()", 3200);
//}
//// -->
//</script>
//<input type="button" value="»ý ¼º" class="button" onClick="scrollMaster();">
//<img name="status_img" src="0" width="0" height="0" border="0">
// ============================ Cookie °ü·Ã ÇÔ¼ö =============================
function delCookie(name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function setCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

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 getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}
// =========================================================================
//ÆùÆ®¸¦ Å°¿î´Ù
//<body bgcolor="#FFFFFF" style="margin:0;" onLoad="initFont();">
//<div id="articleBody"></div>
// ============================ Font °ü·Ã ÇÔ¼ö =============================
var article_fontSize = parseInt(getCookie("article_fontSize")); 		

function initFont() { 
	if ( (article_fontSize < 10) || (article_fontSize > 18) || (isNaN(article_fontSize) == true)) {
		article_fontSize = 9;	
	}

	setFont(article_fontSize);
}

function setFont(article_fontSize) { 		
	document.getElementById("articleBody").style.fontSize = article_fontSize+"pt";
	setFontCookie(article_fontSize);
}	

function setFontCookie(article_fontSize)
{
	var dom   = replaceStringChange(Host(),"http://","");
	    dom   = replaceStringChange(dom,"/","");
	var expiry = new Date();
	var path = "/";
	var domain = "."+dom;
	var secure = "";


	expiry.setTime(expiry.getTime() + 90 * (24 * 60 * 60 * 1000));

	setCookie("article_fontSize",article_fontSize,expiry,path,domain,secure);
}	
function fontPlus() {		
  if(isNaN(article_fontSize) == true)article_fontSize = 9;
	if (article_fontSize < 17) {
		article_fontSize = article_fontSize + 1; 
		setFont(article_fontSize); 
	}
}
//ÆùÆ®¸¦ ÀÛ°ÔÇÑ´Ù
function fontMinus() {
	if(isNaN(article_fontSize) == true)article_fontSize = 9;
	if (article_fontSize > 9) {
		article_fontSize = article_fontSize - 1; 
		setFont(article_fontSize); 
	}
}	
//½ÃÀÛÆäÀÌÁö·Î ¼³Á¤
//<head><IE:HOMEPAGE ID="SetHomePage" /></head>
function SetHome()  
{  
	if(!SetHomePage.isHomePage(Host()))
	SetHomePage.setHomePage(Host());
	return;
}
//TextArea±ÛÀÚ¼ö Ä«¿îÆ®
function textCounter(inputField, countfield, maxlimit) 
{
	if (inputField.value.length > maxlimit) // if too long...trim it!
	{
		alert(maxlimit+" bytes ±îÁö¸¸ Àü¼ÛÀÌ °¡´ÉÇÕ´Ï´Ù!");
		inputField.value = inputField.value.substring(0,maxlimit);
	}	
	else // ³²Àº±ÛÀÚ¼ö  Ä«¿îÅÍ ºÎºÐ
	{
		//countfield.value = maxlimit - inputField.value.length;
		countfield.value = inputField.value.length;
	}	
}

//¹Ýµå½Ã srcObj°´Ã¼°¡ ¼ýÀÚ·Î ±¸¼ºµÉ¶§ÇØ¾ßÇÑ´Ù
//ascending true  srcObj¿¡¼­ ¼±ÅÃµÈ °ª À§ÀÇ °ªµéÀÌ ³ª¿È
//ascending false srcObj¿¡¼­ ¼±ÅÃµÈ °ª ³·Àº °ªµéÀÌ ³ª¿È
function set_fillOption(srcObj,targetObj,ascending)
{
	var selected_value = srcObj.options[srcObj.selectedIndex].value;
	var last_value     = srcObj.options[srcObj.length-1].value;
	targetObj.length   =0;
	var idx            = 0;
  if(ascending)
  {
  	for (var i=0; i<=srcObj.selectedIndex; i++) 
  	{
  		AddItem(targetObj,srcObj.options[i].value,srcObj.options[i].text,idx);
  		idx++;
  	}	
  }
	else
	{
  	for (var i=srcObj.selectedIndex; i<srcObj.length; i++) 
  	{
  		AddItem(targetObj,srcObj.options[i].value,srcObj.options[i].text,idx);
  		idx++;
  	}	
	}	
  targetObj.selectedIndex=0;
}

function between_month(fromDay,toDay,whereis)
{
	var day1 = replaceString(fromDay.value,'-');
			day1 = replaceString(day1,'/');
			day1 = replaceString(day1,' ');
	var day2 = replaceString(toDay.value,'-');
			day2 = replaceString(day2,'/');
			day2 = replaceString(day2,' ');
	if( strlen(day1)!=8 && strlen(day2)!=8){
		whereis.value= "";
	}
	else if( strlen(fromDay.value)==0 && strlen(toDay.value)==0){
		whereis.value= "";
	}
	else{
		var from_year  = day1.substr(0,4);
	  var from_month = parseFloat(day1.substr(4,2)) - 1; // 1¿ù=0,12¿ù=11
	  var from_day   = day1.substr(6,2);
		var to_year  	 = day2.substr(0,4);
	  var to_month 	 = parseFloat(day2.substr(4,2)) - 1; // 1¿ù=0,12¿ù=11
	  var to_day   	 = day2.substr(6,2);

		if(from_month=="0") from_month="January";
		if(from_month=="1") from_month="February";
		if(from_month=="2") from_month="March";
		if(from_month=="3") from_month="April";
		if(from_month=="4") from_month="May";
		if(from_month=="5") from_month="June";
		if(from_month=="6") from_month="July";
		if(from_month=="7") from_month="August";
		if(from_month=="8") from_month="September";
		if(from_month=="9") from_month="October";
		if(from_month=="10")from_month="November";
		if(from_month=="11")from_month="December";

		if(to_month=="0") to_month="January";
		if(to_month=="1") to_month="February";
		if(to_month=="2") to_month="March";
		if(to_month=="3") to_month="April";
		if(to_month=="4") to_month="May";
		if(to_month=="5") to_month="June";
		if(to_month=="6") to_month="July";
		if(to_month=="7") to_month="August";
		if(to_month=="8") to_month="September";
		if(to_month=="9") to_month="October";
		if(to_month=="10")to_month="November";
		if(to_month=="11")to_month="December";

		var now_cnj  = new Date(from_month + " " + parseFloat(from_day) +"," + from_year);
		var then_cnj = new Date(to_month   + " " + parseFloat(to_day)   +"," + to_year  );
		var hday = then_cnj.getTime()-now_cnj.getTime(); // ÇöÀç³¯Â¥ - ±â³äÀÏ³¯Â¥
		hday = (Math.floor(hday / (1000 * 60 * 60 * 24 )/30)); // ½Ã°£ °è»ê ºÎºÐ


		if(hday<0)
		{
			hday=0;
		}
		//if(isNAN(hday))whereis.value="";
		//else whereis.value=hday;
		whereis.value="";
  }
}
function get_content_body()
{
	var str = this.get_content();
	str = str.substr(str.indexOf("<BODY") + 1);
	str = str.substr(str.indexOf(">") + 1);
	var tmp = str.split("</BODY>");
	str = tmp[0];
	return str;
}
/*
12,123-->12,000
*/
function bakTrim(sVal)
{
	var returnVal = 0;
	var strln     = 0;
	var str_val   = sVal;
	
	if( sVal=="" && parseFloat(sVal)>0 )returnVal=0;
  else if(sVal.length<=3)returnVal=parseFloat(sVal);
	else
	{
	  str_val   = str_val.split('.')[0];
	  str_val   = str_val.substring(0,str_val.length-3)+"000";
		returnVal = str_val;		
	}	
	return returnVal;
}

function isSSN(obj)
{
	if (strlen(obj.value)!=13)
	{
		alert('ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ·ÂÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù!');
		obj.focus();
		return true;
	}
	var checkBit = 0;
	var juminNo = replaceString(obj.value,'-');
	var checkDigit = juminNo.substring(12,13);

	checkBit = checkBit + juminNo.substring(0,1) * 2;
	checkBit = checkBit + juminNo.substring(1,2) * 3
	checkBit = checkBit + juminNo.substring(2,3) * 4;
	checkBit = checkBit + juminNo.substring(3,4) * 5;
	checkBit = checkBit + juminNo.substring(4,5) * 6;
	checkBit = checkBit + juminNo.substring(5,6) * 7;

	checkBit = checkBit + juminNo.substring(6,7) * 8;
	checkBit = checkBit + juminNo.substring(7,8) * 9;
	checkBit = checkBit + juminNo.substring(8,9) * 2;
	checkBit = checkBit + juminNo.substring(9,10) * 3;
	checkBit = checkBit + juminNo.substring(10,11) * 4;
	checkBit = checkBit + juminNo.substring(11,12) * 5;

	checkBit = (11 - (checkBit % 11)) % 10;
	if (checkBit != checkDigit)
	{
		alert('ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ·ÂÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù!');
		//obj.focus();
		return true;
	}
	return false;
}
//±¹¿ÜÀÚ ÁÖ¹ÎÃ¼Å©
function isSSN1(obj1,obj2)
{
	var ssn=obj1.value+obj2.value;
	
	if (strlen(ssn)!=13)
	{
		alert('ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ·ÂÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù!');
		obj1.focus();
		return true;
	}
	var checkBit = 0;
	var juminNo = ssn;
	var checkDigit = juminNo.substring(12,13);

	checkBit = checkBit + juminNo.substring(0,1) * 2;
	checkBit = checkBit + juminNo.substring(1,2) * 3
	checkBit = checkBit + juminNo.substring(2,3) * 4;
	checkBit = checkBit + juminNo.substring(3,4) * 5;
	checkBit = checkBit + juminNo.substring(4,5) * 6;
	checkBit = checkBit + juminNo.substring(5,6) * 7;

	checkBit = checkBit + juminNo.substring(6,7) * 8;
	checkBit = checkBit + juminNo.substring(7,8) * 9;
	checkBit = checkBit + juminNo.substring(8,9) * 2;
	checkBit = checkBit + juminNo.substring(9,10) * 3;
	checkBit = checkBit + juminNo.substring(10,11) * 4;
	checkBit = checkBit + juminNo.substring(11,12) * 5;

	checkBit = (11 - (checkBit % 11)) % 10;
	if (checkBit != checkDigit)
	{
		alert('ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ·ÂÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù!');
		obj1.focus();
		return true;
	}
	return false;
}
/**
 * Radio ButtonÀÇ ÃÊ±â°ª Setting
 *
 * @prarm obj ÆûÀÇ Radio°´Ã¼
 * @prarm str ¼±ÅÃµÇ¾îÁú ObjÀÇ value°ª
**/
function setCheck(obj, str){
	var blnChecked = false;
	for(i=0;i<obj.length;i++){
		if(obj[i].value==str){
			blnChecked = true;
			break;
		}
	}
	if(i>0 && blnChecked) obj[i].checked = true;
	else obj[0].checked = true;
}
/*Æ¯Á¤¹®ÀÚ¿­ Ã£±â*/
function searchString(str,findME)
{
	var r = false;
	temp = "" + str;
	while (temp.indexOf(findME)>-1) 
	{
		r = true;
		break;
	}
	
	return r;
}

/**
 * ¹®ÀÚ¿­ÀÇ ÃÑ ±æÀÌ°¡ lengÀÌ µÇµµ·Ï ¹®ÀÚ¿­ ¾Õ¿¡ 0À» ºÙ¿© return.
 *
 * @prarm str Ã¼Å©ÇÒ String
 * @prarm leng ¹®ÀÚ¿­ÀÇ ±æÀÌ
 * @return ret ¹®ÀÚ¿­ÀÇ ±æÀÌ°¡ lengÀÎ ¹®ÀÚ¿­
**/
function addZero(str, leng) {
    var ret = str;
	if(str!=null && str.length > 0 && str.length < leng){
		for(i=str.length;i<leng;i++){
			ret = "0" + ret;
		}
	}
    return ret;
}

function checkID(obj,str)
{
	var isID = /^[a-z0-9_]{3,12}$/;

	if (strlen(obj.value) == 0)
	{
		alert(str + " ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		obj.focus();
		return true;
	}

	if( !isID.test(obj.value) )
	{
		alert(str + " ÀÔ·ÂÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.[¿µ¹®/¼ýÀÚ Á¶ÇÕ]");
		obj.focus();
		return true;
	}
	return false;
}
/*-----------------------------------------------------------------------------------------------*/
/* <input type="text" name="post_num1" maxlength="3" size="3"                                    */
/*      onkeyup="tab_order(this,document.form_app.post_num2,3);" onkeypress="dotNumber();">    */
/*-----------------------------------------------------------------------------------------------*/

function onlyNumber()
{
	if ((event.keyCode<48)||(event.keyCode>57))
	{
  	event.returnValue=false;
  }
}

// Á¤»óÀûÀ¸·Î ¼ýÀÚ¸¦ ÀÔ·ÂÇß´ÂÁö È®ÀÎ
/*--------  onBlur="javascript:onlyNumber2(this)" ---------*/
function onlyNumber2(obj) {
	  if(obj.value!="")
	  {
		  if(isNaN(obj.value)) {
	        alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
	        obj.focus();
	        obj.select();
	    	}
	  }
}

// ¼ýÀÚ¿Í Æ¯¼ö±âÈ£(-) ¸¸ »ç¿ë°¡´É Ã¤Å©
/*--------  onBlur="javascript:phoneNumber(this);" ---------*/
function phoneNumber(obj){
     var isNum = /^[0-9-]+$/;
     if(obj.value!="")
     {
	     if( !isNum.test(obj.value) ) {
	         alert("¼ýÀÚ,Æ¯¼ö±âÈ£(-)¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
	         obj.focus();
	         obj.select();
	     }
	   }
}

//ÀÚµ¿ÄÞ¸¶¿Í ¼ýÀÚ¸¸ ÀÔ·Â
//<form name="cnjform">
//<input type="text" name="cnj_text" onKeyUp="won(this);">
//</form>
function won(cnj_str) {
	var t_align = "right"; // ÅØ½ºÆ® ÇÊµå Á¤·Ä
  var t_num = cnj_str.value.substring(0,1); // Ã¹±ÛÀÚ È®ÀÎ º¯¼ö
  var num =  /^[/,/,0,1,2,3,4,5,6,7,8,9,/]/; // ¼ýÀÚ¿Í , ¸¸ °¡´É
  var str_val = cnj_str.value;
  var cnjValue = "";
  var cnjValue2 = "";

  if( strlen(cnj_str.value)==0 )return false;
  if (!num.test(cnj_str.value))
  {
	  alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ½Ê½Ã¿À.\nÆ¯¼ö¹®ÀÚ¿Í ÇÑ±Û/¿µ¹®Àº »ç¿ëÇÒ¼ö ¾ø½À´Ï´Ù.");
	  cnj_str.value="";
	  cnj_str.focus();
	  return false;
  }

  if ((t_num < "0" || "9" < t_num)){
	  alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ½Ê½Ã¿À.");
	  cnj_str.value=str_val.substring(0,str_val.length-1);
	  cnj_str.focus();
	  return false;
  }

  for(i=0; i<cnj_str.value.length; i++)
  {
  	if(cnj_str.value.charAt(cnj_str.value.length - i -1) != ",") {
    	cnjValue2 = cnj_str.value.charAt(cnj_str.value.length - i -1) + cnjValue2;
    }
  }

  for(i=0; i<cnjValue2.length; i++)
  {
  	if(i > 0 && (i%3)==0)
  	{
    	cnjValue = cnjValue2.charAt(cnjValue2.length - i -1) + "," + cnjValue;
    }
  	else
  	{
    	cnjValue = cnjValue2.charAt(cnjValue2.length - i -1) + cnjValue;
    }
  }

  cnj_str.value = cnjValue;
  cnj_str.style.textAlign = t_align;
}

function tab_order(arg,obj,len)
{
	if (arg.value.length==len)
	{
  	obj.focus() ;
    return;
  }
}


/**
 * ±ÛÀÚ¼ö Ã¼Å©
 *
 * @prarm obj ÆûÀÇ text°´Ã¼
 * @prarm msg alertÇÒ ¸Þ½ÃÁö
 * @prarm least Ã¼Å©ÇÒ ÃÖ¼Ò±æÀÌ(¼ýÀÚ)
 * @prarm most Ã¼Å©ÇÒ ÃÖ´ë±æÀÌ(¼ýÀÚ)
 * @return text°´Ã¼ÀÇ ±ÛÀÚ¼ö°¡ least¿Í most»çÀÌÀÎ °æ¿ì true ¾Æ´Ï¸é false
 * if(!check_between_leng(document.frm.password,"Password",4,20)) return false;
**/
function check_between_leng(obj, msg, least, most){
	val = obj.value;
	if (strlen(val) < least){
		alert(msg + " ÃÖ¼Ò " + least + " ÀÚ ÀÌ»óÀ¸·Î ÀÔ·ÂÇÏ¼¼¿ä.");
		obj.focus();
		return false;
	}

	if(strlen(val) > most){
		alert(msg + " ÃÖ´ë " + most + " ÀÚ ¹Ì¸¸À¸·Î ÀÔ·ÂÇÏ¼¼¿ä.");
		obj.focus();
		return false;
	}
	return true;
}

/*
<a href="javascript:ErrorMsg('¿¡·¯°¡ ¹ß»ýÇß½À´Ï´Ù.<br> ´Ù½Ã ½ÃµµÇØÁÖ¼¼¿ä.');">ÀÌ°É ´©¸£¸é ¿¡·¯¸Þ½ÃÁö°¡ ³ª¿É´Ï´Ù.</a>
*/
function ErrorMsg(stitle,msg,stype,starget) {
  var myObject = new Object();
  myObject.stitle  = stitle;
	myObject.msg     = msg;
	myObject.stype   = stype;
	myObject.starget = starget;
	window.showModalDialog("/javascript/infoPage.htm",myObject,"dialogWidth:400px; dialogHeight:200px; center=yes; screenTop=yes; scroll=no; status=no; help=no;");
}

function user_showModal(stitle,msg) {
  var myObject = new Object();
  myObject.stitle  = stitle;
	myObject.msg     = msg;
	var retval = window.showModalDialog("/javascript/infoPage.htm",myObject,"dialogWidth:398px; dialogHeight:200px; center=yes; screenTop=yes; scroll=no; status=no; help=no;");

 return retval;
}

function user_showModalPrint(stitle,msg) {
  var myObject = new Object();
  myObject.stitle  = stitle;
	myObject.msg     = msg;
	var retval = window.showModalDialog("/javascript/printPage.htm",myObject,"dialogWidth:398px; dialogHeight:200px; center=yes; screenTop=yes; scroll=no; status=no; help=no;");

 return retval;
}
function user_showModalScroll(pages,stitle,msg,w,h) {
  var myObject = new Object();
  myObject.stitle  = stitle;
	myObject.msg     = msg;
	var retval = window.showModalDialog(pages,myObject,"dialogWidth:"+w+"px; dialogHeight:"+h+"px; center=yes; screenTop=yes; scroll=yes; status=no; help=no;resizable=no");

 return retval;
}

//Å©±â¸¦ Á¶Á¤ºÒ°¡
function user_showModalPrintSize(pages,stitle,msg,w,h) {
  var myObject = new Object();
  myObject.stitle  = stitle;
	myObject.msg     = msg;
	var retval = window.showModalDialog(pages,myObject,"dialogWidth:"+w+"px; dialogHeight:"+h+"px; center=yes; screenTop=yes; scroll=no; status=no; help=no;resizable=no");

 return retval;
}
//Å©±â¸¦ Á¶Á¤°¡´É
function user_showModalPrintResize(pages,stitle,msg,w,h) {
  var myObject = new Object();
  myObject.stitle  = stitle;
	myObject.msg     = msg;
	var retval = window.showModalDialog(pages,myObject,"dialogWidth:"+w+"px; dialogHeight:"+h+"px; center=yes; screenTop=yes; scroll=no; status=no; help=no;resizable=yes");

 return retval;
}

function Modal(titles,mssages,window_parent,targets)
{
	var wp = window_parent;
	var ts = targets;

	if(titles.length!=0)
	{
		var goNext = user_showModal(titles,mssages);

		if(ts.length!=0 && wp.length!=0)
		{
			if(wp == "parent")parent.location.replace(ts);
			if(wp == "window")window.location.replace(ts);
		}
	}
	else
	{
		if(wp == "parent")parent.location.replace(ts);
		if(wp == "window")window.location.replace(ts);
	}
	return;
}

function showModal(stitle,msg,urls,w,h,scroll_yn) {
  var myObject = new Object();
      myObject.stitle  = stitle;
	    myObject.msg     = msg;
	var retval = window.showModalDialog(urls,myObject,"dialogWidth:"+w+"x; dialogHeight:"+h+"x; center=yes; screenTop=yes; scroll="+scroll_yn+"; status=no; help=no;");

 return retval;
}

function extCheck(str) {
ALLOWED = ["jpg","png","gif","bmp"];
str = typeof(str) == "string" ? str : str.value;
for (i in ALLOWED) if (str.split(".").pop().toLowerCase() == ALLOWED[i]) return true;
return false;
}
/*
<form method=post name=upform action="" enctype="multipart/form-data">
<input type=file name='userfile'>
<input type=button name="Submit" value="Upload" onclick="LimitAttach(document.all.userfile.value)">
*/
function LimitAttach(fname)
{
	extArray = new Array(".gif", ".jpg", ".jpeg", ".png");
	
	allowSubmit = true;

	if (!fname) return true;

	while (fname.indexOf("\\") != -1)fname = fname.slice(fname.indexOf("\\") + 1);
	ext = fname.slice(fname.indexOf(".")).toLowerCase();

	for (var i = 0; i < extArray.length; i++)
	{
		if (extArray[i] == ext){ allowSubmit = true; break; }
		else allowSubmit = false;
	}

	if (!allowSubmit)
	{
		alert("ÆÄÀÏÇü½ÄÀ» È®ÀÎÇØº¸½Ã±â ¹Ù¶ø´Ï´Ù.");
		return true;
	}
	else return false;
}

//==========================================================================================
// ÇÔ¼ö¸í: emt_check(name)
// ÀÎ   ¼ö: name
// ±â   ´É: °ª null ¹× space Ã¼Å©
// ¸®ÅÏ°ª: true ==>
//		  false ==>
// ºñ   °í:
//==========================================================================================
function formatcurrency3(num)
{
	var s=num.toString();
	var l=s.length;
	var r="";

	while(l > 3) {
		l-=3;
		r=","+s.substr(l,3)+r;
	}
	if(s.substr(0,l)+r != 0)
	return s.substr(0,l)+r;
	else
	return "";
}

function gohome()
{
	document.location.replace('/');
}

function gourl(theURL)
{
	document.location.replace(theURL);
}
function ahref(theURL)
{
	document.location.href=theURL;
}
function goWindow(theURL)
{
	window.location.replace(theURL);
}

function fullScreen(windowfile){
  var posx=0;
  var posy=0;
  position = "width=full,height=full,scrollbars=yes,top="+posy+",left="+posx;
  var openfile = windowfile
  var openWindow = window.open(openfile,'CommFile', position);
}

/*-------------------------------*/
function serviceStop(flag)
{
	if(flage=="1")
	{
		alert('¼­ºñ½º°¡ Àá½Ã Áß´ÜµÇ¾ú½À´Ï´Ù!');
		history.go(-1);
	}
	else if(flage=="2")
	{
		alert('¼­ºñ½º ÁØºñÁßÀÔ´Ï´Ù!!!');
		return;
	}
}

function strToint(smoney)
{
	var sAmount = smoney;

	sAmount = sAmount.replace(/\,/g,"");

	if(strlen(sAmount)==0)sAmount = 0;
	else sAmount = parseFloat(sAmount);

	return sAmount;
}

function ctrl_click()
{
  if((event.ctrlKey) && (event.keyCode == 67))
  {
  	alert('³»¿ëÀ» ¹«´Üº¹Á¦ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
  }

  if((event.ctrlKey) && (event.keyCode == 68))
  {
    alert('³»¿ëÀ» ¹«´ÜÀ¸·Î ºÏ¸¶Å©ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
  }
  if((event.ctrlKey) && (event.keyCode == 78))
  {
  	alert('»õÃ¢À» ¿­ ¼ö ¾ø½À´Ï´Ù.');
  }
}
//¿©±â¸¦ Ç®¸é ¿À¸¥ÂÊ ¸¶¿ì½º ±â´ÉÀÌ Ç®¸°´Ù
//document.oncontextmenu = nocontextmenu;
//document.onmousedown = norightclick;
//document.onkeydown = ctrl_click;

//Dialoge window
function PreViewWindow(what,w,h)
{
/*
pic = new Image();
var url =what;
pic.src=url;
var PicWidth=eval(pic).width-30;
var PicHeight=eval(pic).height-28;
var sFeatures="dialogHeight:"+PicHeight+"px; dialogWidth:"+PicWidth+"px; center: yes; help: no; resizable: no; scrollbars:no; status: no;";
*/
var sFeatures="dialogHeight:"+h+"px; dialogWidth:"+w+"px; center: yes; help: no; resizable: no; scroll:no; status: no;";
showModelessDialog( what,"img", sFeatures);
}

//input type text¿Í textareaÀ» ¸ðµÎ Å¬¸®¾î
function clearAll(frm)
{
	var count = 0;
	for(i=0; i < frm.elements.length;i++)
	{
  	if( (frm.elements[i].type == 'text') || (frm.elements[i].type == 'textarea') )
  	{
  		frm.elements[i].value = "";
	  }
	}
}


// " " -> &nbsp;
function replaceBlank(str)
{
	var return_value= "";

	if(strlen(str)==0)
	{
		return_value = "&nbsp;";
	}
	else
	{
		return_value = str;
	}

	return return_value;
}

/* replace all '+" by blank
 theMessage = replaceString(theMessage, '+')
*/
function replaceString(a, t){
	for (; a.indexOf(t) != -1 ;)
  {
  	a = a.replace(t,"")
  }
  return a;
}

function replaceStringChange(a, s,t){
	for (; a.indexOf(s) != -1 ;)
  {
  	a = a.replace(s,t)
  }
  return a;
}
//µ¿ÀÏÇÑ ¹®ÀÚ¿­À» ÇÏ³ª¸¸ »èÁ¦ÇÑ´Ù
function replaceStringChangeOneTime(a, s,t){
	for (; a.indexOf(s) != -1 ;)
  {
  	a = a.replace(s,t);
  	break;
  }
  return a;
}

function ToggleCheckAll(formname,button)
{
	var sa=true;
	if(button.checked) sa=false;

	for (var i=0;i<formname.elements.length;i++)
	{
		var e = formname.elements[i];
		if(sa) e.checked=false;
		else e.checked=true;
	}
	if(sa) button.checked=false;
	else button.checked=true;
}

/**
	*if( radio_check(eval("frm.writeBookKind"+i),"Àú¼úÈ°µ¿ °³ÀÎ/°øµ¿Àú¼úÀ» ") ) return false;
	**/
function radio_check(obj, msg)
{
	blnChecked = false;

	for(i=0;i<obj.length;i++)
	{
		if(obj[i].checked)
		{
			blnChecked = true;
			break;
		}
	}

	if(!blnChecked)
	{
		alert(msg+" ¼±ÅÃÇÏ¼¼¿ä");
		obj[0].focus();
		return true;
	}
	else return false;
}

/**
	* radio box¿¡ ¼±ÅÃµÈ °ªÀ» µ¹·ÁÁØ´Ù
	*---------------------------------------------------------------------------------
	* <input type="radio" name="ptOption" value="0" onClick="javascript:fncToggle();">
	* <input type="radio" name="ptOption" value="1" onClick="javascript:fncToggle();">
	*---------------------------------------------------------------------------------
	* radio_check_value(frm.ptOption)
	**/
function radio_check_value(obj)
{
	retValue = "";
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].checked)
		{
			retValue = Trim(obj[i].value);
			break;
		}
	}
	return retValue
}
function get_radio_value(obj)
{
	retValue = "";
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].checked)
		{
			retValue = Trim(obj[i].value);
			break;
		}
	}
	return retValue
}
function get_radio_text(obj)
{
	retValue = "";
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].checked)
		{
			retValue = Trim(obj[i].text);
			break;
		}
	}
	return retValue
}
//¸î¹øÂ° ¶óµð¿À ¹Ú½º°¡ ¼±ÅÃµÇ¾î ÀÖ´ÂÁö È®ÀÎ
function get_radio_index(obj)
{
	retValue = 0;
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].checked)
		{
			retValue = i;
			break;
		}
	}
	return retValue
}

/**
 * Radio¹Ú½ºÀÇ ÃÊ±â°ª Setting
 *
 * @prarm obj ÆûÀÇ Select°´Ã¼
 * @prarm str ¼±ÅÃµÇ¾îÁú ObjÀÇ value°ª
**/
function set_radio(obj, str){
	if(typeof obj == "undefined")return;
	if(typeof obj == "null")return;
	var blnChecked = false;
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].value==str){
			blnChecked = true;
			break;
		}
	}
	if(i>0 && blnChecked) obj[i].checked = true;
	else obj[0].checked = true;
}

function maskPost(str)
{
	var zipcode = AllTrim(str);

	if(str.length == 0)zipcode = "";
	if(str.length == 6)zipcode = zipcode.substring(0,3) + "-" + zipcode.substring(3,6)+" ";

	return zipcode;
}

function maskDate(obj)
{
	var datecode = "";
  var delim    ="-";
  
	if(obj.value.length!= 8)
	{
		return;
	}	
	if(obj.value.length = 8)
	{
		datecode = obj.value.substring(0,4) + delim + obj.value.substring(4,6)+ delim + obj.value.substring(6,8);
		obj.value=datecode;
	}
}


/*³¯Â¥°ËÁõ*/
/* if( !isDate(form.start_date) ) return ;*/
function isDate(obj)
{
	var date_re = /^\d{4}-\d{2}-\d{2}$/;
	if (!obj.value.match(date_re) && strlen(obj.value)!=0)
	{
		alert('³¯Â¥¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À');
		obj.focus();
		return false;
	}
	return true;
}
/*½ÃÀÛ³¯Â¥~Á¾·áÀÏÀÚ°¡ ¿Ã¹Ù¸£°Ô ÀÔ·ÂµÇ¾ú´ÂÁö Ã¼Å©*/
function between_date(from_date_obj, end_date_obj)
{
	var str_from_date = replaceString(from_date_obj.value,'-');
	var str_end_date  = replaceString(end_date_obj.value,'-');

	if(!isDate(from_date_obj))return false;
	if(!isDate(end_date_obj))return false;

	//if(!isNumber(from_date_obj)){alert('³¯Â¥¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À');return false;}
	//if(!isNumber(end_date_obj)){alert('³¯Â¥¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À');return false;}

	if( strToint(str_end_date) - strToint(str_from_date) < 0 )
	{
		alert('±â°£ÀÔ·ÂÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù');
		end_date_obj.focus();
		return false;
	}

	return true;
}

function dotNumber()
{
	if ((event.keyCode!=46&&event.keyCode<48)||(event.keyCode>57))
	{
		event.returnValue=false;
	}
}

function hasspecialchar(target)
{
	var i=0;
	for(i=0; i < target.length; i++)
  {
  	if( (target.charAt(i) == "~") || (target.charAt(i) == "`") ||
        (target.charAt(i) == "!") || (target.charAt(i) == "@") ||
        (target.charAt(i) == "#") || (target.charAt(i) == "$") ||
        (target.charAt(i) == "%") || (target.charAt(i) == "^") ||
        (target.charAt(i) == "&") || (target.charAt(i) == "*") ||
        (target.charAt(i) == "(") || (target.charAt(i) == ")") ||
        (target.charAt(i) == "-") || (target.charAt(i) == "_") ||
        (target.charAt(i) == "+") || (target.charAt(i) == "=") ||
        (target.charAt(i) == "\\") || (target.charAt(i) == "|") ||
        (target.charAt(i) == "{") || (target.charAt(i) == "}") ||
        (target.charAt(i) == "[") || (target.charAt(i) == "]") ||
        (target.charAt(i) == ";") || (target.charAt(i) == ":") ||
        (target.charAt(i) == "'") || (target.charAt(i) == "\"") ||
        (target.charAt(i) == "<") || (target.charAt(i) == ">") ||
        (target.charAt(i) == ",") || (target.charAt(i) == ".") ||
        (target.charAt(i) == "?") || (target.charAt(i) == "/") ||
        (target.charAt(i) == " ") )
     return  true;
  }
  return  false;
}
//<a href="javascript:viewImage('k_kids1.gif')">Image-1</a>
function viewImage(what)
{
	var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=10,height=10');
	imgwin.focus();
	imgwin.document.open();
	imgwin.document.write("<html>\n");
	imgwin.document.write("<head>\n");
	imgwin.document.write("<title>ÀÌ¹ÌÁöº¸±â</title>\n");

	imgwin.document.write("<sc"+"ript>\n");
	imgwin.document.write("function resize() {\n");
	imgwin.document.write("pic = document.il;\n");
	//imgwin.document.write("alert(eval(pic).height);\n");
	imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n");
	imgwin.document.write("  if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 40; myWidth = eval(pic).width + 12;\n");
	imgwin.document.write("  } else { myHeight = eval(pic).height; myWidth = eval(pic).width; }\n");
	imgwin.document.write("  clearTimeout();\n");
	imgwin.document.write("  var height = screen.height;\n");
	imgwin.document.write("  var width = screen.width;\n");
	imgwin.document.write("  var leftpos = width / 2 - myWidth / 2;\n");
	imgwin.document.write("  var toppos = height / 2 - myHeight / 2; \n");
	//imgwin.document.write("  self.moveTo(leftpos, toppos);\n");
	imgwin.document.write("  self.resizeTo(myWidth, myHeight-10);\n");
	imgwin.document.write("}else setTimeOut(resize(), 100);}\n");
	imgwin.document.write("</sc"+"ript>\n");

	imgwin.document.write("</head>\n");
	imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n');

	imgwin.document.write("<img border=0 src="+what+" xwidth=100 xheight=9 name=il onload='resize();' style='cursor:hand;' onClick='javascript:self.close();'>\n");
	imgwin.document.write("</body>\n");
	imgwin.document.close();
}

function redirectWindow(wfile)
{
	parent.location.replace(wfile);
}

/*Ã¢¶ç¿ì±â : ·Î±×ÀÎ, ºñ¹Ð¹øÈ£Ã£±â, ¿ìÆí¹øÈ£Ã£±â==>½ºÅ©·Ñ¹Ù ¾øÀ½*/
function openWindow(windowfile,w,h)
{
  var width=w;
  var height=h;
  var posx=0;
  var posy=0;
  posx = (screen.width-width)/2-1;
  posy = (screen.height-height)/2-1;
  position = "width="+width+",height="+height+",scrollbars=no,top="+posy+",left="+posx;
  var openfile = windowfile
  var openWindow = window.open(openfile,'CommFile', position);
}
function openWindowLeftTop(windowfile,w,h)
{
  var width=w;
  var height=h;
  var posx=0;
  var posy=0;
  position = "width="+width+",height="+height+",scrollbars=no,top="+posy+",left="+posx;
  var openfile = windowfile
  var openWindow = window.open(openfile,'CommFile', position);
}


/*Ã¢¶ç¿ì±â : À©µµ¿ì¸í, ·Î±×ÀÎ, ºñ¹Ð¹øÈ£Ã£±â, ¿ìÆí¹øÈ£Ã£±â==>½ºÅ©·Ñ¹Ù ¾øÀ½*/
/* ÁÖ¼ÒÃ¢¾øÀ½, ¸Þ´º¹Ù¾øÀ½, »óÅÂ¹Ù¾øÀ½ */
function openWindowName(windowTitle,targetFile,w,h)
{
  var width=w;
  var height=h;
  var posx=0;
  var posy=0;
  posx = (screen.width-width)/2-1;
  posy = (screen.height-height)/2-1;
  position = "width="+width+",height="+height+",scrollbars=no,top="+posy+",left="+posx;
  var openfile = targetFile;
  var openWindow = window.open(openfile,windowTitle, position);
  openWindow.focus();
}
function openWindowNameScroll(windowTitle,targetFile,w,h)
{
  var width=w;
  var height=h;
  var posx=0;
  var posy=0;
  posx = (screen.width-width)/2-1;
  posy = (screen.height-height)/2-1;
  position = "width="+width+",height="+height+",scrollbars=yes,top="+posy+",left="+posx;
  var openfile = targetFile;
  var openWindow = window.open(openfile,windowTitle, position);
}

function downWindow(names,windowfile,w,h)
{
  var width=w;
  var height=h;
  var posx=0;
  var posy=0;
  posx = (screen.width-width)/2-1;
  posy = (screen.height-height)/2-1;
  position = "width="+width+",height="+height+",scrollbars=yes,status=no,resizable= yes,location=no,menubar=yes ,top="+posy+",left="+posx;
  var openfile = windowfile
  var openWindow = window.open(openfile,names, position);
}


function openWindowModal(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
	toolbar_str = toolbar ? 'yes' : 'no';
	menubar_str = menubar ? 'yes' : 'no';
	statusbar_str = statusbar ? 'yes' : 'no';
	scrollbar_str = scrollbar ? 'yes' : 'no';
	resizable_str = resizable ? 'yes' : 'no';
	var new_window = url;
	var NSerialNo = 800;
	window.showModalDialog(new_window,NSerialNo,"DialogWidth='+width+'px; DialogHeight='+height+'px,resizable=1,top='+top+',left='+left+',title=°¡ÀüÁ¦Ç°");
}

function Is_nick_name(str)
{
	var form = str;
	for(var i = 0; i < str.length; i++)
	{
		var chr = str.substr(i,1);
		chr = escape(chr);
		if (chr.charAt(1) == "u")
		{
			chr = chr.substr(2, (chr.length - 1));
			if((chr < "AC00") || (chr > "D7A3"))
				return false;
		}
		else
			return false;
	}
	return true;
}

function commaTrim(targetstr)
{
		var strTemp ="";
		for (i = 0; i < targetstr.length; i++ )
		{
		  if (targetstr.charAt(i) != ',' )
		  {
				strTemp = strTemp+ targetstr.charAt(i);
			}
			else
			{
				strTemp = strTemp+ "";
			}
		}

		return strTemp;
}

/*¹®ÀÚ¿­ÀÇ ¸ðµç °ø¹éÀ» Á¦°Å ÇÔ¼ö */
function AllTrim(a)
{
	for (; a.indexOf(" ") != -1 ;)
  {
  	a = a.replace(" ","")
  }
  return a;
}

/*¹®ÀÚ¿­ÀÇ ¿ÞÂÊ °ø¹éÀ» Á¦°Å ÇÔ¼ö   */
function LTrim(a)
{
	var search = 0

  while ( a.charAt(search) == " ")
  {
  	search = search + 1
  }

  a = a.substring(search, (a.length))

  return a;
}

/*¹®ÀÚ¿­ÀÇ ¿À¸¥ÂÊ °ø¹éÀ» Á¦°Å ÇÔ¼ö */
function RTrim(char_text)
{
	var search = char_text.length - 1

  while (char_text.charAt(search) ==" ")
  {
  	search = search - 1
  }
  return char_text.substring(0, search + 1)
}

/*¹®ÀÚ¿­ÀÇ ¾çÂÊ(¿ÞÂÊ, ¿À¸¥ÂÊ) °ø¹éÀ» Á¦°Å ÇÔ¼ö */
function Trim(a)
{
	var search = 0
  while ( a.charAt(search) == " ")
  {
  	search = search + 1
  }

  a = a.substring(search, (a.length))

  search = a.length - 1

  while (a.charAt(search) ==" ")
  {
  	search = search - 1
  }

  return a.substring(0, search + 1)
}

/*ÀÔ·Â¹®ÀÚ¿­ÀÇ Length¸¦ ±¸ÇÑ´Ù.*/
function strlen(a)
{
	a = (AllTrim(a)).length;
	return a;
}

/*ÀÌ¸ÞÀÏ Ã¼Å©*/
function mailCheck(obj,str)
{
	var strEmail = obj.value;
	var arrMatch = strEmail.match(/^(\".*\"|[A-Za-z0-9_-]([A-Za-z0-9_-]|[\+\.])*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z0-9][A-Za-z0-9_-]*(\.[A-Za-z0-9][A-Za-z0-9_-]*)+)$/);
	if (arrMatch == null || strlen(strEmail) == 0 ) {
		alert(str + "À» ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		obj.focus();
		return true;
	}

	var arrIP = arrMatch[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/);
	if (arrIP != null) {
		for (var i = 1; i <= 4; i++) {
			if (arrIP[i] > 255) {
				alert(str + " ÀÔ·ÂÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù!");
				obj.focus();
				return true;
      		}
   		}
	}
	return false;
}
/*ÀÌ¸ÞÀÏ Ã¼Å©; ´Ü Æ÷Ä¿½º¸¦ ÁÖÁö ¾Ê´Â´Ù*/
function mailCheck_noFocus(obj,str)
{
	var strEmail = obj.value;
	var arrMatch = strEmail.match(/^(\".*\"|[A-Za-z0-9_-]([A-Za-z0-9_-]|[\+\.])*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z0-9][A-Za-z0-9_-]*(\.[A-Za-z0-9][A-Za-z0-9_-]*)+)$/);
	if (arrMatch == null || strlen(strEmail) == 0 ) {
		alert(str + "À» ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		return true;
	}

	var arrIP = arrMatch[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/);
	if (arrIP != null) {
		for (var i = 1; i <= 4; i++) {
			if (arrIP[i] > 255) {
				alert(str + " ÀÔ·ÂÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù!");
				return true;
      		}
   		}
	}
	return false;
}

function show_print()
{
	if (navigator.appName == "Netscape")
	{
		window.print() ;
	}
	else
	{
		var VERSION = navigator.appVersion;
		if (VERSION.indexOf("MSIE 5") == -1)
		{
			var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
			document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
			WebBrowser1.ExecWB(6, 2);
		}
		else
		{
			window.print();
		}
	}
}
function isNull(input) {
    if (input.value == null || input.value == "") {
        return true;
    }
    return false;
}

/**
 * ÀÔ·Â°ª¿¡ ½ºÆäÀÌ½º ÀÌ¿ÜÀÇ ÀÇ¹ÌÀÖ´Â °ªÀÌ ÀÖ´ÂÁö Ã¼Å©
 * ex) if (isEmpty(form.keyword)) {
 *         alert("°Ë»öÁ¶°ÇÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
 *     }
 */
function isEmpty(input) {
    if (input.value == null || input.value.replace(/ /gi,"") == "") {
        return true;
    }
    return false;
}

/**
 * ÀÔ·Â°ª¿¡ Æ¯Á¤ ¹®ÀÚ(chars)°¡ ÀÖ´ÂÁö Ã¼Å©
 * Æ¯Á¤ ¹®ÀÚ¸¦ Çã¿ëÇÏÁö ¾ÊÀ¸·Á ÇÒ ¶§ »ç¿ë
 * ex) if (containsChars(form.name,"!,*&^%$#@~;")) {
 *         alert("ÀÌ¸§ ÇÊµå¿¡´Â Æ¯¼ö ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
 *     }
 */
function containsChars(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) != -1)
           return true;
    }
    return false;
}

/**
 * ÀÔ·Â°ªÀÌ Æ¯Á¤ ¹®ÀÚ(chars)¸¸À¸·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 * Æ¯Á¤ ¹®ÀÚ¸¸ Çã¿ëÇÏ·Á ÇÒ ¶§ »ç¿ë
 * ex) if (!containsCharsOnly(form.blood,"ABO")) {
 *         alert("Ç÷¾×Çü ÇÊµå¿¡´Â A,B,O ¹®ÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
 *     }
 */
function containsCharsOnly(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) == -1)
           return false;
    }
    return true;
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºªÀÎÁö Ã¼Å©
 * ¾Æ·¡ isAlphabet() ºÎÅÍ isNumComma()±îÁöÀÇ ¸Þ¼Òµå°¡
 * ÀÚÁÖ ¾²ÀÌ´Â °æ¿ì¿¡´Â var chars º¯¼ö¸¦
 * global º¯¼ö·Î ¼±¾ðÇÏ°í »ç¿ëÇÏµµ·Ï ÇÑ´Ù.
 * ex) var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 *     var lowercase = "abcdefghijklmnopqrstuvwxyz";
 *     var number    = "0123456789";
 *     function isAlphaNum(input) {
 *         var chars = uppercase + lowercase + number;
 *         return containsCharsOnly(input,chars);
 *     }
 */
function isAlphabet(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ´ë¹®ÀÚÀÎÁö Ã¼Å©
 */
function isUpperCase(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ¼Ò¹®ÀÚÀÎÁö Ã¼Å©
 */
function isLowerCase(input) {
    var chars = "abcdefghijklmnopqrstuvwxyz";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ª¿¡ ¼ýÀÚ¸¸ ÀÖ´ÂÁö Ã¼Å©
 */
function isNumber(input) {
    var chars = "0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª,¼ýÀÚ·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isAlphaNum(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¼ýÀÚ,´ë½Ã(-)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isNumDash(input) {
    var chars = "-0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¼ýÀÚ,ÄÞ¸¶(,)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isNumComma(input) {
    var chars = ",0123456789";
    return containsCharsOnly(input,chars);
}
/**
 * ÀÔ·Â°ªÀÌ ¼ýÀÚ,µµÆ®(.)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isNumDot(input) {
    var chars = ".0123456789";
    return containsCharsOnly(input,chars);
}
/**
 * ÀÔ·Â°ªÀÌ »ç¿ëÀÚ°¡ Á¤ÀÇÇÑ Æ÷¸Ë Çü½ÄÀÎÁö Ã¼Å©
 * ÀÚ¼¼ÇÑ format Çü½ÄÀº ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ 'regular expression'À» ÂüÁ¶
 */
function isValidFormat(inputObj,format) {
    if (inputObj.value.search(format) != -1) {
        return true; //¿Ã¹Ù¸¥ Æ÷¸Ë Çü½Ä
    }
    return false;
}

/**
 * ÀÔ·Â°ªÀÌ ÀÌ¸ÞÀÏ Çü½ÄÀÎÁö Ã¼Å©
 * ex) if (!isValidEmail(form.email)) {
 *         alert("¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù.");
 *     }
 */
function isValidEmail(input) {
//    var format = /^(\S+)@(\S+)\.([A-Za-z]+)$/;
    var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
    return isValidFormat(input,format);
}

/**
 * ÀÔ·Â°ªÀÌ ÀüÈ­¹øÈ£ Çü½Ä(¼ýÀÚ-¼ýÀÚ-¼ýÀÚ)ÀÎÁö Ã¼Å©
 */
function isValidPhone(input) {
    var format = /^(\d+)-(\d+)-(\d+)$/;
    return isValidFormat(input,format);
}

/**
 * ÀÔ·Â°ªÀÇ ¹ÙÀÌÆ® ±æÀÌ¸¦ ¸®ÅÏ
 * ex) if (getByteLength(form.title) > 100) {
 *         alert("Á¦¸ñÀº ÇÑ±Û 50ÀÚ(¿µ¹® 100ÀÚ) ÀÌ»ó ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
 *     }
 * Author : Wonyoung Lee
 */
function getByteLength(iinput,msg,maxlen) {

    var byteLength = 0;
    for (var inx = 0; inx < iinput.value.length; inx++) {
        var oneChar = escape(iinput.value.charAt(inx));
        if ( oneChar.length == 1 ) {
            byteLength ++;
        } else if (oneChar.indexOf("%u") != -1) {
            byteLength += 2;
        } else if (oneChar.indexOf("%") != -1) {
            byteLength += oneChar.length/3;
        }
    }

    //return byteLength;
    if(byteLength>maxlen){
    	alert(msg);
    	iinput.focus();
    	return false;
    }
    else return true;
}

/**
 * ÀÔ·Â°ª¿¡¼­ ÄÞ¸¶¸¦ ¾ø¾Ø´Ù.
 */
function removeComma(input) {
    return input.value.replace(/,/gi,"");
}

/**
 * ¼±ÅÃµÈ ¶óµð¿À¹öÆ°ÀÌ ÀÖ´ÂÁö Ã¼Å©
 * <input type="checkbox" ID="ARR_CHK" name="qt_no[]">
 *if(!hasCheckedBox(frm.ARR_CHK))alert("¼±ÅÃÇÏ¼¼¿ä!")
 */
function hasCheckedRadio(input1) {
    if (input1.length > 1) {
        for (var inx = 0; inx < input1.length; inx++) {
            if (input1[inx].checked) return true;
        }
    } else {
        if (input1.checked) return true;
    }
    return false;
}

/**
 * ¼±ÅÃµÈ Ã¼Å©¹Ú½º°¡ ÀÖ´ÂÁö Ã¼Å©
 */
function hasCheckedBox(input1)
{
    return hasCheckedRadio(input1);
}
/**
 * ¼±ÅÃµÈ Ã¼Å©¹Ú½º°¡ ¸î°³ÀÎÁö Ã¼Å©
 */
function hasCheckedBoxCount(input1)
{
    var cnt=0;
    if (input1.length > 1) {
        for (var inx = 0; inx < input1.length; inx++) {
            if (input1[inx].checked) cnt++;
        }
    } else {
        if (input1.checked) cnt++;
    }
    return cnt;
}
/**
 * ¼±ÅÃµÈ Ã¼Å©¹Ú½º°ªÀ» ¸®ÅÏ
 * ´Ü ÅäÅ«À¸·Î ¸®ÅÏÇÑ´Ù
 *alert(hasCheckedBoxValue(frm.ARR_CHK,"|"));
 */
function hasCheckedBoxValue(input1,tok)
{
    var r="";
    if (input1.length > 1) {
        for (var inx = 0; inx < input1.length; inx++) {
            if (input1[inx].checked) r+=input1[inx].value+tok;
        }
    } else {
        if (input1.checked)r+=input1[inx].value+tok;
    }
    return r;
}

/**
 * ¿åÇÊÅÍ¸µ, ¸¸¾à gubun ÀÌ¸é 0 then html±îÁö Ã¼Å©, gubun = 1 ÀÌ¸é ±ÛÀÚ¸¸
 */
function badword_check(gubun,strings)
{
  var swear_alert_arr=new Array;
  var swear_alert_count = 0;

  //HTML Ã¼Å©¹Ú½º Ã¼Å© À¯¹«
	if (gubun == 0)
	{
		var swear_words_arr=new Array("<style","<script","javascript:","<body","<div","<meta","<title","<html","<head","<div","<body","<layer","cunt","shit","fuck","asshole","suck","pussy","cock","penis","sux","dick","bitch","damn","sucker","fucker","°³»õ³¢","°³ÀÚ½Ä","°³½¦ÀÌ","ÀÌ»õ³¢","Àú»õ³¢","±×»õ³¢","¾¾¹ú","½ÃÆÈ","½Ã¹ß","½Ã¹ú","¾¾ºÎ¶ö","¾¾ºÎ·²","¾Ã","½Ê»õ³¢","½Ê»õ","½Ê½¦ÀÌ","18³ð","18³Ñ","18³â","Á¿","¹ÌÄ£³ð","¹ÌÄ£³Ñ","¹ÌÄ£³â","¹ÌÄ£»õ³¢","¿ÀÀÔ","¿°º´","¿¥º´","Áö¶ö","Á¥¹ä","°³œq","°³½¦","°³»Ô","°³»õ","°³¼¼","°³»õ³¢","°³ÇãÁ¢","µù½Ã","µù½Å","µ¹¾ÆÀÌ","¶Ê¾ÆÀÌ","¶Ë","¹ÌÃì","¹ÌÄ£","¹ÌÆ¾","ºé½Å","º´½®","ºù½Ã","ºù½Å","º´½Å","¹ð½Å","ºü°¡","»õ.³¢","½Ê»õ","½Ê¼¼","¾Ã»õ","¾Ã¼¼","¾¾ÆÅ","¼½½º","½Ã´ó","¾¾´ó","¾¾ÆÄ","½Ã´ó","¾¾ÆÈ","¾¾¹ß","¾ºÆÄ","¾¾ºÀ","¾¾¹æ","¾¾¹æ»õ","¾¾¹æ¼¼","¾¾¹æ","»õ³¢","¼¼³¢","½¬ÆÞ","½¬¹ú","¾¯ÆÞ","¾¯¹ú","¾¯»¹","½¬»¹","¾ÖÀÚ","ÁÖÁ¢¶³","Áö¶ö","Áö·Ñ","Áö·²","Á½±î","Á½","ÁÖµÕ¾Æ¸®","ÁÖµÕÀÌ","ôÈ","Á¥ ¹ä","°³ œq","°³ ½¦","°³ »Ô","°³ »õ","°³ ¼¼","µù ½Ã","µù ½Å","¹Ì Ä£","¹Ì Ãì","¹Ì Æ¾","ºé ½Å","º´ ½®","ºù ½Ã","ºù ½Å","º´ ½Å","¹ð ½Å","ºü °¡","»õ.³¢","»õ ³¢","½Ê »õ","½Ê ¼¼","¾Ã »õ","¾Ã ¼¼","¾¾ ÆÅ","¼½ ½º","½Ã ´ó","¾¾ ´ó","¾¾ ÆÄ","½Ã ´ó","¾¾ ÆÈ","¾¾ ¹ß","¾º ÆÄ","¾¾ ºÀ","¾¾ ¹æ","¾¾ ¹æ","»õ ³¢","¼¼ ³¢","½¬ ÆÞ","½¬ ¹ú","¾¯ ÆÞ","¾¯ ¹ú","¾¯ »¹","½¬ »¹","¾Ö ÀÚ","Áö ¶ö","Áö ·Ñ","Áö ·²","Á½ ±î","½Ö´¤","¾¾¹Ù¶ö","¸ÞÄ£³ð","°³¼Ò¸®","Á¶±î","¾¾ºÒ","°³½ÃÅ°","°³¼¨³¢","¾²¹ß","»õ²¥","XX³â","XX³ð","oo³â","oo³ð","OO³â","OO³ð","00³â","00³ð","±â»ýÃæ","»çÃ¤","½Å¿ëºÒ·®ÀÚ","ÀÌÀºÇÏ","Àå´ëÁø","·ë½Î·Õ","Á¤½Åº´¿ø","¿¬¿¹Áú","ÆÄ¿­","¾Úºê¶õ½º");
	}
	else
	{
		var swear_words_arr=new Array("cunt","shit","fuck","asshole","cunt","suck","pussy","cock","penis","sux","dick","bitch","damn","sucker","fucker","°³»õ³¢","°³ÀÚ½Ä","°³½¦ÀÌ","ÀÌ»õ³¢","Àú»õ³¢","±×»õ³¢","¾¾¹ú","½ÃÆÈ","½Ã¹ß","½Ã¹ú","¾¾ºÎ¶ö","¾¾ºÎ·²","¾Ã","½Ê»õ³¢","½Ê»õ","½Ê½¦ÀÌ","18³ð","18³Ñ","18³â","Á¿","¹ÌÄ£³ð","¹ÌÄ£³Ñ","¹ÌÄ£³â","¹ÌÄ£»õ³¢","¿ÀÀÔ","¿°º´","¿¥º´","Áö¶ö","Á¥¹ä","°³œq","°³½¦","°³»Ô","°³»õ","°³¼¼","°³»õ³¢","°³ÇãÁ¢","µù½Ã","µù½Å","µ¹¾ÆÀÌ","¶Ê¾ÆÀÌ","¶Ë","¹ÌÃì","¹ÌÄ£","¹ÌÆ¾","ºé½Å","º´½®","ºù½Ã","ºù½Å","º´½Å","¹ð½Å","ºü°¡","»õ.³¢","½Ê»õ","½Ê¼¼","¾Ã»õ","¾Ã¼¼","¾¾ÆÅ","¼½½º","½Ã´ó","¾¾´ó","¾¾ÆÄ","½Ã´ó","¾¾ÆÈ","¾¾¹ß","¾ºÆÄ","¾¾ºÀ","¾¾¹æ","¾¾¹æ»õ","¾¾¹æ¼¼","¾¾¹æ","»õ³¢","¼¼³¢","½¬ÆÞ","½¬¹ú","¾¯ÆÞ","¾¯¹ú","¾¯»¹","½¬»¹","¾ÖÀÚ","ÁÖÁ¢¶³","Áö¶ö","Áö·Ñ","Áö·²","Á½±î","Á½","ÁÖµÕ¾Æ¸®","ÁÖµÕÀÌ","ôÈ","Á¥ ¹ä","°³ œq","°³ ½¦","°³ »Ô","°³ »õ","°³ ¼¼","µù ½Ã","µù ½Å","¹Ì Ä£","¹Ì Ãì","¹Ì Æ¾","ºé ½Å","º´ ½®","ºù ½Ã","ºù ½Å","º´ ½Å","¹ð ½Å","ºü °¡","»õ.³¢","»õ ³¢","½Ê »õ","½Ê ¼¼","¾Ã »õ","¾Ã ¼¼","¾¾ ÆÅ","¼½ ½º","½Ã ´ó","¾¾ ´ó","¾¾ ÆÄ","½Ã ´ó","¾¾ ÆÈ","¾¾ ¹ß","¾º ÆÄ","¾¾ ºÀ","¾¾ ¹æ","¾¾ ¹æ","»õ ³¢","¼¼ ³¢","½¬ ÆÞ","½¬ ¹ú","¾¯ ÆÞ","¾¯ ¹ú","¾¯ »¹","½¬ »¹","¾Ö ÀÚ","Áö ¶ö","Áö ·Ñ","Áö ·²","Á½ ±î","½Ö´¤","¾¾¹Ù¶ö","¸ÞÄ£³ð","°³¼Ò¸®","Á¶±î","¾¾ºÒ","°³½ÃÅ°","°³¼¨³¢","¾²¹ß","»õ²¥","XX³â","XX³ð","oo³â","oo³ð","OO³â","OO³ð","00³â","00³ð","±â»ýÃæ","»çÃ¤","½Å¿ëºÒ·®ÀÚ","ÀÌÀºÇÏ","Àå´ëÁø","·ë½Î·Õ","Á¤½Åº´¿ø","¿¬¿¹Áú","ÆÄ¿­","¾Úºê¶õ½º");
	}


	var compare_text=strings;

	for(var i=0; i<swear_words_arr.length; i++)
	{
		for(var j=0; j<(compare_text.length); j++)
		{
			if(swear_words_arr[i]==compare_text.substring(j,(j+swear_words_arr[i].length)).toLowerCase())
			{
				swear_alert_arr[swear_alert_count]=compare_text.substring(j,(j+swear_words_arr[i].length));
				swear_alert_count++;
			}
		}
	}

	var alert_text="";

	for(var k=1; k<=swear_alert_count; k++)
	{
		alert_text+="\n" + "(" + k + ") " + swear_alert_arr[k-1];
	}

	if(swear_alert_count>0)
	{
		alert(" »ç¿ëÇÏ½Ç ¼ö ¾ø´Â ´Ü¾î°¡ ÀÖ½À´Ï´Ù.\n________________________________________\n" + alert_text + " ´Â(Àº) ÀûÀýÄ¡ ¸øÇÑ ´Ü¾îÀÔ´Ï´Ù.\n________________________________________");
		return false;
	}
	else
	{
		return true;
	}
}

function enabled(frmName)
{
	for(i=0; i < frmName.elements.length;i++)
	{
  	if( (frmName.elements[i].type == 'text') || (frmName.elements[i].type == 'textarea') )
  	{
  		frmName.elements[i].disabled = false;
	  }
	}
}
/**
 * °ø¹éÃ¼Å©
 * isFocus : true[Æ÷Ä¿½º ÁÜ], false[Æ÷Ä¿½º ÁÖÁö¾ÊÀ½]
 */
function Check_empty(obj, str, isFocus)
{
  if(obj.tagName!="SELECT" && obj.length!=null)
  {
		for(var i=0;i<obj.length;i++) {
			if (strlen(obj[i].value) == 0) {
				if(str!="")alert(str + " ÀÔ·ÂÇÏ½Ê½Ã¿À.");
				if(!obj[i].disabled&&isFocus)obj[i].focus();
				return true;
			}
		}
		return false;
	}else
	{
		if(obj.tagName == "SELECT") {
			if (obj.selectedIndex ==0 ) {
				if(str!="")alert(str + " ¼±ÅÃÇÏ½Ê½Ã¿À.");
				if(!obj.disabled&&isFocus)obj.focus();
				return true;
			} else {
				return false;
			}
		} else {
			if (strlen(obj.value) == 0) {
				if(str!="")alert(str + " ÀÔ·ÂÇÏ½Ê½Ã¿À.");
				if(!obj.disabled&&isFocus)obj.focus();
				return true;
			} else {
				return false;
			}
		}
	}
}

/**
 * ÆË¾÷Ã¢ ¶ç¿ì±â view_image('/upfile/test.jpg')
 * ÀÌ¹ÌÁö ¸®»çÀÌÁî
 */

function view_image(img_name){

		remote = window.open("", "bigphotoremote","toolbar=no,menubar=no,width=300,HEIGHT=200");
		remote.document.write("<HTML><HEAD><TITLE>»çÁøº¸±â</TITLE></HEAD><CENTER>");
		remote.document.write("<BODY BGCOLOR=#ffffff TOPMARGIN=0 LEFTMARGIN=0 marginwidth=0 marginheight=0");
		remote.document.write("<TABLE BORDER=0 cellpadding=0 cellspacing=0>");
		remote.document.write("<TR><TD VALIGN=MIDDLE ALIGN=CENTER>");
		remote.document.write("<IMG SRC=" + img_name  + " onClick=window.close() style=cursor:hand name=img>");
		remote.document.write(" <script language='javascript'> 	");
		remote.document.write(" var imgW = img.width;						");
		remote.document.write(" var imgH = img.height;					");
   	remote.document.write(" window.resizeTo(imgW,imgH);			");
    remote.document.write(" </script> ");
		remote.document.write("</TD></TR></TABLE>");
		remote.document.write("</BODY></HTML>");
		remote.focus();
}

/**
 *  ÀÌ ºÎºÐ ÀÌÇÏ´Â select box control
 */
function init_items(ary, selectobj) {
	idx = 0;
	val = 0;

	while (ary[val][0][0] != "") {
		AddItem(selectobj, val, ary[val][0][0], val);
		val=val+1;
	}
	selectobj.selectedIndex =0;
}
//¿øº» init_items ÃÊ±â option°ªÀ» ³Ö¾î Áà¾ßÇÑ´Ù
//Áï   <select name='xxx'><option value=''>--¼±ÅÃ--</option></select>
function init_o_items(ary, selectobj) {
	idx = 0;
	val = 0;
	s = selectobj.options[0].text
	selectobj.length =0;
	AddItem(selectobj,-1,s,0);

	while (ary[val][0][0] != "") {
		AddItem(selectobj, val, ary[val][0][0], val+1);
		val=val+1;
	}
	selectobj.selectedIndex =0;
}

function init_items_2by2(ary, selectobj) {
	idx = 0;
	val = 0;
	s = selectobj.options[0].text
	selectobj.length = 0;
	AddItem(selectobj,-1,s,0);

	while (ary[val][0] != "") {
		AddItem(selectobj, val, ary[val][0], val+1);
		val=val+1;
	}
	selectobj.selectedIndex =0;
}

//<select name='xxx'></select> option°ªÀ» ³ÖÁö¾ÊÀ½
function init_a_item (ary, ary_code, selectobj) {
	val = 0
	if  (ary_code == ary) {
		while (ary[val] != "") {
			AddItem(selectobj, ary_code[val], ary[val],val);
			val=val+1;
		}
	} else {
		while (ary[val] != "") {
			AddItem(selectobj, val, ary[val],val);
			val=val+1;
		}
	}
	selectobj.selectedIndex =0;
}

//init_a_item¿øº»<option value=''>--¼±ÅÃ--</option>
//ÀÌ¸§À» init_o_itemÀÌ¶ó°í ¹Ù²Þ
//<select name='xxx'><option value=''>--¼±ÅÃ--</option></select>
function init_o_item (ary, ary_code, selectobj) {
	val = 0
	s = selectobj.options[0].text
	selectobj.length =0;
	AddItem(selectobj,-1,s,0);
	if  (ary_code == ary) {
		while (ary[val] != "") {
			AddItem(selectobj, ary_code[val], ary[val],val+1);
			val=val+1;
		}
	} else {
		while (ary[val] != "") {
			AddItem(selectobj, val, ary[val],val+1);
			val=val+1;
		}
	}
	selectobj.selectedIndex =0;
}

function init_number (selectobj, st,ed,step) {
	val = st
	index = 1
	s = selectobj.options[0].text
	selectobj.length =0;

	AddItem(selectobj,-1,s,0);
	if (step < 0) index = ed-st+1
	for (val = st; val <= ed; val ++){
		AddItem(selectobj, val, val,index);
		index+=step;
	}
	selectobj.selectedIndex =0;
}

function init_number_desc (selectobj, ed,st,step) {
	val = st
	index = 1
	s = selectobj.options[0].text
	selectobj.length =0;
	AddItem(selectobj,-1,s,0);
	if  (step < 0) index = ed-st+1
	for  (val = st; val <= ed; val ++) {
		AddItem(selectobj, val, val,index);
		index+=step;
	}
	selectobj.selectedIndex =0;
}
function AddItem(selectobj,val,txt,optindex) {
	NewItem = new Option(txt, val, false, true);
   selectobj.options[optindex]=NewItem;
}

function set_sub_combo_2step (ary, val, subobj) {
	s = subobj.options[0].text
	subobj.length =0;
	AddItem(subobj,-1,s,0);
   if (val >= 0) {
		var idx=1;
		while (ary[val][idx] != "") {
			AddItem(subobj,idx, ary[val][idx],idx);
			idx=idx+1;
		}
	}
	subobj.selectedIndex =0;
}

//<select name="xxx"></select>
function set_sub_combo (ary, val, subobj) {
	s = subobj.options[0].text
	subobj.length =0;
	AddItem(subobj,-1,s,0);
   if (val >= 0) {
		var idx=0;
		while (ary[val][idx+1][0] != "") {
			AddItem(subobj,idx, ary[val][idx+1][0],idx);
			idx=idx+1;
		}
	}
	subobj.selectedIndex =0;
}

//set_sub_combo¿øº»
//<select name="xxx"><option value=''></option></select>
function set_sub_combo_o (ary, val, subobj) {
	s = subobj.options[0].text
	subobj.length =0;
	AddItem(subobj,-1,s,0);
   if (val >= 0) {
		var idx=1;
		while (ary[val][idx][0] != "") {
			AddItem(subobj,idx, ary[val][idx][0],idx);
			idx=idx+1;
		}
	}
	subobj.selectedIndex =0;
}

function set_sub_combo2(ary, val, subobj,code_ary) {
	s = subobj.options[0].text;
	subobj.length =0;
	AddItem(subobj,-1,s,0);
   if  (val >= 0) {
		var idx=1;
		while (ary[val][idx] != "") {
			AddItem(subobj,code_ary[val][idx], ary[val][idx],idx);
			idx=idx+1;
		}
	}
	subobj.selectedIndex =0;
}

function set_sub_combo1(ary, val, sub, clsobj) {
	s = clsobj.options[0].text
	clsobj.length =0;
	AddItem(clsobj,-1,s,0);
  	if  (val >= 0 && sub >= 0) {
		var idx=1;
		while (ary[val][sub][idx] != "") {
			AddItem(clsobj,idx, ary[val][sub][idx],idx);
			idx=idx+1;
		}
	}
	clsobj.selectedIndex =0;
}

function set_sub_combo_car (ary, val, subobj, clsobj) {
	s = subobj.options[0].text
	subobj.length =0;
	AddItem(subobj,-1,s,0);

	if (clsobj != null) {
		clsobj.length =0;
		AddItem(clsobj,-1,"---¼±ÅÃ---",0);
	}
   if (val >= 0) {
		var idx=1;
		while (ary[val][idx][0] != "") {
			AddItem(subobj, idx, ary[val][idx][0],idx);
			idx=idx+1;
		}
	}
	subobj.selectedIndex =0;
}
//<option value=''>--¼±ÅÃ--</option>»©°í <select name='xxx'></select>
function search_index_2_0 (ary, item) {
   i = 0;
   while (ary[i][0] != "") {
  		if (ary[i][0] == item) {
			return i;
		}
		i++;
   }
   return 0;
}
//search_index_2_0ÀÇ ¿øº»
//<select name='xxx'><option value=''>--¼±ÅÃ--</option></select>
function search_index_2_0_o (ary, item) {
   i = 0;
   while (ary[i][0] != "") {
  		if (ary[i][0] == item) {
			return i+1;
		}
		i++;
   }
   return 0;
}

function search_index_2_1(ary,item) {
	i= 0;
	while(ary[i][0] != "") {
		j=0;
		while(ary[i][j] != "") {
			if(ary[i][j] == item) return j+1;
			j++;
		}
		i++;
	}
	return 0;
}

function search_index_2_1parent(ary,item) {
	i= 0;
	while(ary[i][0] != "") {
		j=0;
		while(ary[i][j] != "") {
			if(ary[i][j] == item) return i+1;
			j++;
		}
		i++;
	}
	return 0;
}

function search_index_3_0 (ary, item) {
   i = 0;
   while (ary[i][0][0] != "") {
		if  (ary[i][0][0] == item)  return i+1;
		i++;
   }
   return 0;
}

function search_index_3_011 (ary,ary1, item) {
   i = 0;
   while (ary[i][0][0] != "") {
		if  (ary[i][0][0] == item)  return ary1[i][0][0];
		i++;
   }
   return -1;
}

function search_index_3_01 (ary, item) {
   i = 0;
   while (ary[i][0][0] != "") {
		if  (ary[i][0][0] == item)  return i;
		i++;
   }
   return -1;
}

function search_value_fc( ary, index) {
	i=0;
	while(ary[i][0][0] != "") {
		if(i == index) return ary[i][0][0];
		i++;
	}
	return "";
}

function search_value_md( ary,f_cd, index) {
	i=1;
	while(ary[f_cd][i][0] != "") {
		if(i == index) return ary[f_cd][i][0];
		i++;
	}
	return "";
}

function search_index_3_1 (ary, item, idx) {
   i = 1;
   while (ary[idx][i][0] != "") {
  		if(ary[idx][i][0] == item){  return i; }
		else i++;
   }
   return 0;
}

function search_index_3_11 (ary, ary1,item, idx) {
   i = 1;
   while (ary[idx][i][0] != "") {
  		if(ary[idx][i][0] == item){  return ary1[idx][i][0]; }
		else i++;
   }
   return 0;
}

function search_index_3_2 (ary, item, idx1, idx2) {
   i = 1;
   while (ary[idx1][idx2][i] != "") {
  		if(ary[idx1][idx2][i] == item){  return i; }
		else i++;
   }
   return 0;
}
function search_index_3_22 (ary, ary1,item, idx1, idx2) {
   i = 1;
   while (ary[idx1][idx2][i] != "") {
  		if(ary[idx1][idx2][i] == item){  return ary1[idx1][idx2][i]; }
		else i++;
   }
   return 0;
}
function search_index_1ary (ary, item) {
   i = 0;
   while (ary[i] != "") {
		if (ary[i] == item)  return i;
		i++;
   }
   return 0;
}

function search_index_1ary2111 (ary, item) {
   i = 0;
   while (ary[i] != "") {
		if (ary[i] == item)  return i+1;
		i++;
   }
   return 0;
}

function search_index_option (obj, item) {
	for (i = 0; i < obj.length; i++) {
		if (obj.options[i].text == item) return i;
	}
	return 0;
}

function search_index_option_by_value(obj, item) {
	for (i = 0; i < obj.length; i++) {
		if (obj.options[i].value== item) return i;
	}
	return 0;
}

function init_a_item_new (ary, ary_code, selectobj) {
	val = 0
	s = selectobj.options[0].text
	selectobj.length =0;
	AddItem(selectobj,-1,s,0);
	if (ary_code != ary) {
		while (ary[val] != "") {
			AddItem(selectobj, ary_code[val], ary[val],val+1);
			val=val+1;
		}
	} else {
		while (ary[val] != "") {
			AddItem(selectobj, ary_code[val], ary[val],val+1);
			val=val+1;
		}
	}
	selectobj.selectedIndex =0;
}
/**
 * Select¹Ú½ºÀÇ ÃÊ±â°ª Setting
 *
 * @prarm obj ÆûÀÇ Select°´Ã¼
 * @prarm str ¼±ÅÃµÇ¾îÁú ObjÀÇ value°ª
**/
function set_select(obj, str) {
	if(typeof obj == "undefined")return;
	for(var i = 0; i < obj.length; i++) {
		if(obj.options[i].value == str) {
			obj.options[i].selected = true;
			break;
		}
	}
}
function set_select_text(obj, str) {
	for(var i = 0; i < obj.length; i++) {
		if(obj.options[i].text == str) {
			obj.options[i].selected = true;
			break;
		}
	}
}
function get_select_text(obj)
{
	return obj.options[obj.selectedIndex].text;
}
function get_select_value(obj)
{
	return obj.options[obj.selectedIndex].value;
}

function get_array_select_code(ary, select_obj) {
	var r = ary[select_obj.selectedIndex-1];
	if( typeof r == 'undefined' )r="";
	return r;
}


function set_array_select_text(arry,item, select_obj)
{
  var i   = 0;
  if(strlen(item)!=0)
  {
	  while( arry[i] != "" )
	  {
			if ( arry[i] == item )
			{
				i = i+1;
				break;
			}
			i++;
	  }
		select_obj.options[i].selected = true;
	}
	else
		select_obj.options[0].selected = true;
}
/*ÀÌÁß¹è¿­ÀÏ¶§*/
function get_twoArray_oneDepth_code(ary,selObj)
{
	return ary[selObj.selectedIndex-1][0];
}
function get_twoArray_twoDepth_code(ary,first_selObj,second_selObj)
{
	return ary[first_selObj.selectedIndex-1][second_selObj.selectedIndex];
}

function NvChange() {

	this.version = "0.1";
	this.name = "NvChange";
	this.item = new Array();
	this.itemcount = 0;
	this.itemoffset = 0;
	this.item_i = new Array();
	this.item_icount = 0;
	this.item_ioffset = 0;
	this.currentspeed = 0;
	this.scrollspeed = 50;
	this.pausedelay = 1000;
	this.pausemouseover = false;
	this.stop = 0;
	this.height = 100;
	this.heightGap = 0;
	this.width = 100;
	this.height_i = 100;
	this.width_i = 100;
	this.stopHeight=0;
	this.count=0;
	this.flag=true;
	this.position="absolute";
	this.item_position="absolute";

	this.add = function () {
		var text = arguments[0];
		this.item[this.itemcount] = text;
		this.itemcount = this.itemcount + 1;
	};

	this.addImage = function () {
		var text = arguments[0];
		this.item_i[this.item_icount] = text;
		this.item_icount = this.item_icount + 1;
	};

	this.start = function () {
		this.display();
		this.currentspeed = this.scrollspeed;
		obj = document.getElementById(this.name+'item0').style;
		obj.display='block';
		this.count++;
		setTimeout(this.name+'.scroll()',this.currentspeed);
	};

	this.ready = function () {
		now = new Date(); ran = now % this.item_icount;
		temp = this.item_i[ran]; this.item_i[ran] = this.item_i[0]; this.item_i[0] = temp;
		this.displayImage();
		obj_i = document.getElementById(this.name+'item_i0').style;
		obj_i.display='block';
	};

	this.display = function () {
		document.write('<div id="'+this.name+'" style="height:'+this.height+';width:'+this.width+';position:'+this.position+';overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
		for(var i = 0; i < this.itemcount; i++) {
				document.write('<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+';position:'+this.item_position+'; display:none; ">');
				document.write(this.item[i]);
				document.write('</div>');
		}
		document.write('</div>');
	};

	this.displayImage = function () {
		document.write('<div id="'+this.name+'_i" style="left:0; height:'+this.height_i+';width:'+this.width_i+';position:relative;overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
		for(var i = 0; i < this.item_icount; i++) {
			document.write('<div id="'+this.name+'item_i'+i+'"style="left:0px; width:'+this.width_i+'; display:none; ">');
			document.write(this.item_i[i]);
			document.write('</div>');
		}
		document.write('</div>');
	};

	this.scroll = function () {
		this.currentspeed = this.scrollspeed;
		if ( !this.stop ) {
			this.imageChange();
		}
		window.setTimeout(this.name+".scroll()",this.currentspeed);
	};


	this.imageChange = function ()
	{
		for (k = 0; k < this.item_icount; k++) {
			obj_i = document.getElementById(this.name+'item_i'+k).style;
			if (this.count % this.item_icount == k) {
				obj_i.display = 'block';
			} else {
				obj_i.display = 'none';
			}
		}
		for (k = 0; k < this.itemcount; k++) {
			obj = document.getElementById(this.name+'item'+k).style;
			if (this.count % this.itemcount == k) {
				obj.display = 'block';
			} else {
				obj.display = 'none';
			}
		}
		this.count++;
	}

	this.onmouseover = function ()
	{
		if ( this.pausemouseover ) {
			this.stop = 1;
		}
	};
		for (k = 0; k < this.item_icount; k++) {
			obj_i = document.getElementById(this.name+'item_i'+k).style;
			if (this.count % this.item_icount == k) {
				obj_i.display = 'block';
			} else {
				obj_i.display = 'none';
			}
		}

	this.onmouseout = function ()
	{
		if ( this.pausemouseover ) {
			this.stop = 0;
		}
	};

	this.up = function ()
	{
		var i;
		this.stop++;

		if ( this.itemcount <= this.itemoffset )
			this.itemoffset = this.itemoffset % this.itemcount;

		for (i = 0; i < this.item_icount; i++) {
			obj_i = document.getElementById(this.name+'item_i'+i).style;
			if ( obj_i.display == "block" ) {this.item_ioffset = i+1;obj_i.display="none";}
		}

		if (this.item_icount > 0) {
			if (this.item_ioffset < this.item_icount) {
				obj_i = document.getElementById(this.name+'item_i'+this.item_ioffset).style;
				obj_i.display = "block";
			} else {
				obj_i = document.getElementById(this.name+'item_i0').style;
				obj_i.display = "block";
			}
		}
		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( obj.display == "block" ) {this.itemoffset = i+1;obj.display="none";}
		}
		if (this.itemoffset < this.itemcount) {
			obj = document.getElementById(this.name+'item'+this.itemoffset).style;
			obj.display = "block";
		} else {
			obj = document.getElementById(this.name+'item0').style;
			obj.display = "block";
		}
		window.setTimeout(this.name + ".stop--;",this.pausedelay);
		//this.stop--;
	}

}
// ¸ÞÀÎ¿¡¼­ ´ëÀÚº¸ ÆË¾÷³»¿ë ¹Ì¸®º¸±â
function Poster_Preview03(filename) { //v2.0
  var features="width=437,height=340,scrollbars=yes";
  var winName="win1";
  var theURL='/tempPoster/'+filename;
  window.open(theURL,winName,features);
}

/*»ç¿ë¹æ¹ý
1)ÃÊ±âÈ­  : <script language="javascript">progressBar("init","")</script>
2)º¸ÀÌ±â  : <script language='javascript'>progressBar('visible','')</script>
3)ÀÚ·áÁøÇà: <script language='javascript'>progressBar('data','i/20000')</script> ==>gif animation¾È ¿òÁ÷ÀÓ
4)Á¾·á    : <script language='javascript'>progressBar('','')</script>
*/
function progressBar(actionStatus,datas)
{
	if(actionStatus=="init")
	{
		document.write("<table ID='ProgressBar' style='position:absolute;visibility:hidden' width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'>");
		document.write("  <tr>");
		document.write("    <td align='center'>");
		document.write("      <table width='300' height='150' border='0' cellpadding='0' cellspacing='0'>");
		document.write("        <tr>");
		document.write("          <td height='143' align='center' valign='top' background='/icon/loading_bg.gif'>");
		document.write("          	<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
		document.write("              <tr>"); 
		document.write("                <td height='33' align='left'style='padding:0 0 0 0'>&nbsp;&nbsp;<b><font color='#ffffff'>Àá½Ã¸¸ ±â´Ù·ÁÁÖ¼¼¿ä!!!!</font></b></td>");
		document.write("              </tr>");
		document.write("              <tr>"); 
		document.write("                <td height='45' align='center' valign='bottom' style=font-family:±¼¸²;font-size:9pt;this.style.color='#433F37';this.style.fontWeight='normal'><span id='span_progress_count'></span>Ã³¸®ÁßÀÔ´Ï´Ù.! Àá½Ã ±â´Ù·Á ÁÖ¼¼¿ä.</td>");
		document.write("              </tr>");
		document.write("              <tr>"); 
		document.write("                <td height='35' align='center'><img src='/icon/loading.gif' width='269' height='14'></td>");
		document.write("              </tr>");
		document.write("            </table>");
		document.write("          </td>");
		document.write("        </tr>");
		document.write("      </table>");
		document.write("    </td>");
		document.write("  </tr>");
		document.write("</table>");
		document.write("<script language='Javascript'>");
		document.write("  ProgressBar.style.top=document.body.offsetHeight/2 -ProgressBar.offsetHeight/2;");
		document.write("  ProgressBar.style.left=document.body.offsetWidth/2 -ProgressBar.offsetWidth/2;");
		document.write("  ProgressBar.style.visibility='hidden';");
		document.write("</script>");
	}
	else if(actionStatus=="visible")
	{
		document.write("<script language='javascript'>");
		document.write("parent.ProgressBar.style.visibility='visible';");
		document.write("</script>");
	}
	else if(actionStatus=="data")
	{
		//span_progress
		document.write("<script language='javascript'>");
		document.write("parent.document.all.span_progress_count.innerHTML='"+datas+"';");
		document.write("</script>");
	}
	else
	{
		document.write("<script language='javascript'>");
		document.write("parent.ProgressBar.style.visibility='hidden';");
		document.write("</script>");
	}
}	
