
// Trim ÇÔ¼ö ##################################################
// Ex) str = "    Å× ½ºÆ®   ".trim(); => str = "Å× ½ºÆ®";
String.prototype.trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

// ¹®ÀÚ¿­ °ø¹éÁ¦°Å ÇÔ¼ö ##################################################
// Ex) str = "    Å× ½º   Æ®   ".stripspace(); => str = "Å×½ºÆ®";
String.prototype.stripspace = function() {
	return this.replace(/ /g, "");
}
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];
		}
	}
}

// ÀüÃ¼ ¹®ÀÚ¿­ ¹Ù²Ù±â ÇÔ¼ö ##################################################
// Ex) str = "aÅ×½ºÆ®bcdÅ×½ºÆ®efg".replaceAll("Å×½ºÆ®", ""); => str = "abcdefg";
String.prototype.replaceAll = function(a, b) {
	var s = this;
	var n1, n2, s1, s2;

	while (true) {
		if ( s=="" || a=="" ) break;
		n1 = s.indexOf(a);
		if ( n1 < 0 ) break;
		n2 = n1 + a.length;
		if ( n1==0 ) {
			s1 = b;
		}
		else {
			s1 = s.substring(0, n1) + b;
		}
		if ( n2 >= s.length ) {
			s2 = "";
		}
		else {
			s2 = s.substring(n2, s.length);
		}
		s = s1 + s2;
	}
	return s;
}

// Event Ãß°¡ ##################################################
function addEvent(obj, evt, exec) {
	if (window.attachEvent) obj.attachEvent('on'+evt, exec);
	else if (window.addEventListener) obj.addEventListener(evt, exec, false);
	else obj['on'+evt] = exec;
}


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 na_open_window(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 objPopup = window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
	
	if (objPopup == null)
	{
		alert("Â÷´ÜµÈ ÆË¾÷À» Çã¿ëÇØ ÁÖ½Ê½Ã¿ä");
		return;
	}  
}

function getCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
			endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
				
		x = document.cookie.indexOf( " ", x ) + 1;
				
		if ( x == 0 ) break;
	}
			return "";
}

function setCookie( name, value, expiredays ) { 
        var todayDate = new Date(); 
        todayDate.setDate( todayDate.getDate() + expiredays ); 
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

function CookieOpenWin(cookies,theURL,winName,features) { 
	//ÄíÅ°³×ÀÓÀ» ¹Þ¾Æ ÇØ´çÄíÅ°°¡ doneÀÌ ¾Æ´Ï¸é ÆË¾÷¶ç¿ò
	if (getCookie(cookies) != "done") {
		window.open(theURL,winName,features);
	}
}	

function check_space(str) {
	//°ø¹éÀ» Á¦°ÅÇÏ°í ÀÔ·Â ¿©ºÎ Ã¼Å©
	if (str.search(/\S/)<0) {
		return false;
	}
	var temp=str.replace(' ','');
	if (temp.length == 0) {
		return false;
	}
	return true;
}

function AlpaNumber(string) {
	//¾ËÆÄºªÀÌ³ª ¼ýÀÚ°¡ ¾Æ´Ñ ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖÀ¸¸é false ¸®ÅÏ
	valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
	for (var i=0; i< string.length; i++) {
		if (valid.indexOf(string.charAt(i)) == -1) {
		return false;
		}
	}
	return true;
}

function NoNumber(string) {
	if (!f_chkNoNum(string)) {
		alert("¼ýÀÚ´Â Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		return false;
	}
	return true;
}

function f_chkNoNum(string) {
	//¼ýÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖÀ¸¸é false ¸®ÅÏ
	valid = "0123456789";
	for (var i=0; i< string.length; i++) {
		if (valid.indexOf(string.charAt(i)) != -1) {
			return false;
		}
	}
	return true;
}

function OnlyNumber(string) {
	if (!f_chkOnlyNum(string)) {
		return false;
	}
	return true;
}

function f_chkOnlyNum(string) {
	//¼ýÀÚ ¿ÜÀÇ ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖÀ¸¸é false ¸®ÅÏ
	valid = "0123456789";
	for (var i=0; i< string.length; i++) {
		if (valid.indexOf(string.charAt(i)) == -1) {
			return false;
		}
	}
	return true;
}

function f_chkSpecialChar(string) {
	// Æ¯¼ö¹®ÀÚ ' °¡ Æ÷ÇÔµÇ¾î ÀÖÀ¸¸é false ¸®ÅÏ
	valid = "'";
	for (var i=0; i< string.length; i++) {
		if (valid.indexOf(string.charAt(i)) != -1) {
			return false;
		}
	}
	return true;
}

function f_chkALlSpecialChar(string) {
	// ´Ù¼öÀÇ Æ¯¼ö¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖÀ¸¸é false ¸®ÅÏ
	valid = "~`!@#$%^&*'";
	for (var i=0; i< string.length; i++) {
		if (valid.indexOf(string.charAt(i)) != -1) {
			return false;
		}
	}
	return true;
}


function Calbyte(aquery) {
	//¹ÙÀÌÆ® ¼ö °è»ê
	//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);
		onechar_1 = escape(onechar); // ISO -> ASCII
		if ( onechar_1.charAt(0) == "%" ) {
			onechar_1 = onechar_1.substring(1,2);
			switch ( onechar_1 ) {
			case "0":
			case "1":
			case "2":
			case "3":
			case "4":
			case "5":
			case "6":
			case "7":
				tcount++;
				break;
			default:
				tcount += 2;
				break;
			}
		}
		else if (onechar!='\r') { //Enter¿Ü
			tcount++;
		}
	}
	return tcount;
}

function f_TogShowHide(LayerName) {
	//·¹ÀÌ¾î show, hide
	var DisplayVal = document.getElementById(LayerName).style.display;
	if(DisplayVal=='none') {
		document.getElementById(LayerName).style.display = 'block';
	} else {
		document.getElementById(LayerName).style.display = 'none';
	}
}

function f_TogShow(LayerName) {
	//·¹ÀÌ¾î show
	document.getElementById(LayerName).style.display = 'block';

if (LayerName == "div_adiform"){
	//f_TogShow('div_adiform');
	document.getElementById("adiform").style.backgroundColor='#FFFFFF';
	document.getElementById("babycell").style.backgroundColor='#EBEBE3';
	document.getElementById("derman").style.backgroundColor='#EBEBE3';
}else if (LayerName == "div_babycell"){
	//f_TogShow('div_babycell');
	document.getElementById("adiform").style.backgroundColor='#EBEBE3';
	document.getElementById("babycell").style.backgroundColor='#FFFFFF';
	document.getElementById("derman").style.backgroundColor='EBEBE3';
}else if (LayerName == "div_derman"){
	//f_TogShow('div_derman');
	document.getElementById("adiform").style.backgroundColor='#EBEBE3';
	document.getElementById("babycell").style.backgroundColor='#EBEBE3';
	document.getElementById("derman").style.backgroundColor='#FFFFFF';
}

if (LayerName == "div_theracol")
{
	document.getElementById("theracol").style.backgroundColor='#FFFFFF';
	document.getElementById("biocollagen").style.backgroundColor='#EBEBE3';
	document.getElementById("liposome").style.backgroundColor='#EBEBE3';
	document.getElementById("therafill").style.backgroundColor='#EBEBE3';
	document.getElementById("theraform").style.backgroundColor='#EBEBE3';
	document.getElementById("novostrata").style.backgroundColor='#EBEBE3';
}else if (LayerName == "div_biocollagen")
{
	document.getElementById("theracol").style.backgroundColor='#EBEBE3';
	document.getElementById("biocollagen").style.backgroundColor='#FFFFFF';
	document.getElementById("liposome").style.backgroundColor='#EBEBE3';
	document.getElementById("therafill").style.backgroundColor='#EBEBE3';
	document.getElementById("theraform").style.backgroundColor='#EBEBE3';
	document.getElementById("novostrata").style.backgroundColor='#EBEBE3';
}else if (LayerName == "div_liposome")
{
	document.getElementById("theracol").style.backgroundColor='#EBEBE3';
	document.getElementById("biocollagen").style.backgroundColor='#EBEBE3';
	document.getElementById("liposome").style.backgroundColor='#FFFFFF';
	document.getElementById("therafill").style.backgroundColor='#EBEBE3';
	document.getElementById("theraform").style.backgroundColor='#EBEBE3';
	document.getElementById("novostrata").style.backgroundColor='#EBEBE3';
}else if (LayerName == "div_therafill")
{
	document.getElementById("theracol").style.backgroundColor='#EBEBE3';
	document.getElementById("biocollagen").style.backgroundColor='#EBEBE3';
	document.getElementById("liposome").style.backgroundColor='#EBEBE3';
	document.getElementById("therafill").style.backgroundColor='#FFFFFF';
	document.getElementById("theraform").style.backgroundColor='#EBEBE3';
	document.getElementById("novostrata").style.backgroundColor='#EBEBE3';
}else if (LayerName == "div_theraform")
{
	document.getElementById("theracol").style.backgroundColor='#EBEBE3';
	document.getElementById("biocollagen").style.backgroundColor='#EBEBE3';
	document.getElementById("liposome").style.backgroundColor='#EBEBE3';
	document.getElementById("therafill").style.backgroundColor='#EBEBE3';
	document.getElementById("theraform").style.backgroundColor='#FFFFFF';
	document.getElementById("novostrata").style.backgroundColor='#EBEBE3';
}else if (LayerName == "div_novostrata")
{
	document.getElementById("theracol").style.backgroundColor='#EBEBE3';
	document.getElementById("biocollagen").style.backgroundColor='#EBEBE3';
	document.getElementById("liposome").style.backgroundColor='#EBEBE3';
	document.getElementById("therafill").style.backgroundColor='#EBEBE3';
	document.getElementById("theraform").style.backgroundColor='#EBEBE3';
	document.getElementById("novostrata").style.backgroundColor='#FFFFFF';
}
if (LayerName == "div_platform")
{
	document.getElementById("platform").style.backgroundColor='#FFFFFF';
	document.getElementById("operatingsoftware").style.backgroundColor='#EBEBE3';
	document.getElementById("apparatusinstrument").style.backgroundColor='#EBEBE3';
}else if (LayerName == "div_operatingsoftware")
{
	document.getElementById("platform").style.backgroundColor='#EBEBE3';
	document.getElementById("operatingsoftware").style.backgroundColor='#FFFFFF';
	document.getElementById("apparatusinstrument").style.backgroundColor='#EBEBE3';
}else if (LayerName == "div_apparatus&instrument")
{
	document.getElementById("platform").style.backgroundColor='#EBEBE3';
	document.getElementById("operatingsoftware").style.backgroundColor='#EBEBE3';
	document.getElementById("apparatusinstrument").style.backgroundColor='#FFFFFF';
}
}

function f_TogHide(LayerName) {
	//·¹ÀÌ¾î hide
	document.getElementById(LayerName).style.display = 'none';

}

function Move_Cur(arg,nextname,len) {
	//alert(arg);
	//alert(nextname);
	//alert(len);
	// ÀÚµ¿ Focus ÀÌµ¿
  if (arg.length == len) {
      nextname.focus() ;
      return;
   }
}

function JuminCheck(jumin1, jumin2){
	//ÁÖ¹Î¹øÈ£ Ã¼Å© 
		var str_jumin1 = jumin1;
  		var str_jumin2 = jumin2;
		var check = false;

		  var i2=0
		  for (var i=0;i< str_jumin1.length;i++)
		  {
		      var ch1 = str_jumin1.substring(i,i+1);
		      if (ch1<"0" || ch1>"9") { i2=i2+1 }
		  }
		  if ((str_jumin1 == "") || ( i2 != 0 ))
		  {
		   return check;
		  }
		
		  var i3=0
		  for (var i=0;i<str_jumin2.length;i++)
		  {
		      var ch1 = str_jumin2.substring(i,i+1);
		      if (ch1<"0" || ch1>"9") { i3=i3+1 }
		  }
		  if ((str_jumin2 == "") || ( i3 != 0 ))
		  {
		  	return check;
		  }
		
		  var f1=str_jumin1.substring(0,1)
		  var f2=str_jumin1.substring(1,2)
		  var f3=str_jumin1.substring(2,3)
		  var f4=str_jumin1.substring(3,4)
		  var f5=str_jumin1.substring(4,5)
		  var f6=str_jumin1.substring(5,6)
		  var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7
		  var l1=str_jumin2.substring(0,1)
		  var l2=str_jumin2.substring(1,2)
		  var l3=str_jumin2.substring(2,3)
		  var l4=str_jumin2.substring(3,4)
		  var l5=str_jumin2.substring(4,5)
		  var l6=str_jumin2.substring(5,6)
		  var l7=str_jumin2.substring(6,7)
		  hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5
		  hap=hap%11
		  hap=11-hap
		  hap=hap%10
		  if (hap != l7){
		    return check;
		  }
		return true;
}


function Menu_chg(vID, vToColor)
{
	document.getElementById(vID).style.backgroundColor = vToColor;
}

function Layer_show(vID, vMenuWidth)
{
	f_TogShow(vID);

	//ÇØ»óµµ ´Þ¶óÁü¿¡ µû¸¥ ·¹ÀÌ¾î À§Ä¡ ¼ÂÆÃ
	var LeftPosPixel = 0;
	var LeftPixel = 0;
	
	LeftPixel = (document.body.clientWidth - 780)/2;
	
	if(LeftPixel > 0){
		LeftPosPixel = LeftPixel + vMenuWidth;
	}
	else{
		LeftPosPixel = vMenuWidth;
	}	
	
	document.getElementById(vID).style.left = LeftPosPixel;
}


/*
===============================================================================
*  i.e patch
===============================================================================
*/


// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå) 
function flashWrite(url,w,h,id,bg,vars,win){ 

 // ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ 
 var flashStr= 
 "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+ 
 "<param name='allowScriptAccess' value='always' />"+ 
 "<param name='movie' value='"+url+"' />"+ 
 "<param name='FlashVars' value='"+vars+"' />"+ 
 "<param name=wmode value=transparent> "+ 
 "<param name='menu' value='false' />"+ 
 "<param name='quality' value='high' />"+ 
 "<param name='bgcolor' value='"+bg+"' />"+ 
 "<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' />"+ 
 "</object>"; 

 // ÇÃ·¡½Ã ÄÚµå Ãâ·Â 
 document.write(flashStr); 

} 
//µ¿¿µ»ó 
function aviPlay(src,w,h) { 
document.write('<embed src="'+src+'" width='+w+' height='+h+'>') 
} 


//ÀÌ¹ÌÁö ¿øº»»çÀÌÁî ÆË¾÷
function ImgPopup(img2){

 poto= new Image();
 poto.src=(img2);
 Controlla(img2);
}

function Controlla(img2){
 if((poto.width!=0)&&(poto.height!=0)){
  winopen(img2,poto.width,poto.height);
 }else{
  funzione="Controlla('"+img2+"')";
  intervallo=setTimeout(funzione,20);
 }
}

function winopen(img_view, Width, Height) {
 if( Width > 1024 || Height > 768 ){
		Width = Width + 20;
		vScrolling = "yes";
 }else{
 		vScrolling = "no";
 }
 var winHandle = window.open("" ,"windowName","toolbar=no,scrollbars="+vScrolling+",resizable=no, top=200, left=200 ,width=" + Width + ",height=" + Height)
  if(winHandle != null) {
  var htmlString = "<html><head><title>ÀÌ¹ÌÁö</title></head>" 
   htmlString += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
   htmlString += "<a href=javascript:window.close();><img src=" + img_view + " border=0 alt=ÀÌ¹ÌÁöÅ¬¸¯:È­¸é´Ý±â></a>"
   htmlString += "</body></html>"
   winHandle.document.open()
   winHandle.document.write(htmlString)
   winHandle.document.close()
  } 
  if(winHandle != null) winHandle.focus()
   return winHandle
}
//ÆË¾÷¶ç¿ì±â
function winOpen (doc, wname, top, left, width, height) {
  window.open(doc, wname, 'scrollbars=no,resizable=yes,top='+top+',left='+15+',width='+width+',height='+height);
}
function winOpen2 (doc, wname, top, left, width, height) {
  window.open(doc, wname, 'scrollbars=no,resizable=no,top='+top+',left='+15+',width='+width+',height='+height);
}

//¾Æ·¡·Î ÆîÃÄÁö´Â Å×±×
      var old_menu = '';
      function menuclick(num) {
        var submenu = eval('prdPar_' + num);

        if (old_menu != submenu) {
          if (old_menu != '') old_menu.style.display = 'none';
          submenu.style.display = 'block';
          old_menu = submenu;
        } else {
          submenu.style.display = 'none';
          old_menu = '';
        }
      }
	  
	  
function divlayerchange(Lname,LastCnt,Sname) {
	// 2009-08-19 - ±èÀç¿µ
	// name°ª ¾øÀ½À¸·Î ÀÎÇÑ ¿À·ù ¹ß»ýÀ¸·Î ÀÎÇØ ¿À·ù¹ß»ýÀ» Á¦°ÅÇÏ±â À§ÇØ try/catch¹® Ãß°¡

	try {
		for(i=0;i<LastCnt;i++){
			if(Lname+i==Sname){
				document.all[Lname+i].style.display= '';
			}else{
				document.all[Lname+i].style.display= 'none';
			}
		}
	}
	catch(ex) {
		//>
	}
}	  


function blockNotNumber(e) {
	var e = window.event || e;
	if (window.event) {
		if (e.keyCode < 48 || e.keyCode > 57) e.returnValue = false;
	}
	else {
		if (e.which != 8 && (e.which < 48 || e.which > 57)) e.preventDefault(); // 8 : Back Space
	}
}

function numberOnly(obj, isDec) {
	if (!isDec) isDec = false;
	if (obj.disabled) return false;

	var num = obj.value.stripspace();
	if (num == "") return false;

	if (!checkNum(num, isDec)) {
		//alert ("¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		num = stripCharFromNum(num, isDec);
		obj.blur(); obj.focus();
	}
	num = stripCharFromNum(stripComma(num), isDec);
	var arrNum = num.split(".");
	if (arrNum.length > 1) {
		obj.value = arrNum[0]+"."+arrNum[1];
	}
	else {
		obj.value = arrNum[0];
	}
}

function stripComma(str) {
    var re = /,/g;
    return str.replace(re, "");
}

function checkNum(value, isDec) {
	var RegExp;

	if (!isDec) isDec = false;
	RegExp = (isDec) ? /^-?[\d\.]*$/ : /^-?[\d]*$/;

	return RegExp.test(value)? true : false;
}

// ÀÌ¸ÞÀÏ È®ÀÎ ##################################################
function checkEmail(email) {
	if (email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
		return true;
	}
	else {
		return false;
	}
}


function checkEmpty(obj) {
	if (obj.value.stripspace() == "") {
		return true;
	}
	else {
		return false;
	}
}

function stripCharFromNum(value, isDec) {
	var i;
	var minus = "-";
	var nums = "1234567890"+((isDec) ? "." : "");
	var result = "";

	for(i=0; i<value.length; i++) {
		numChk = value.charAt(i);
		if (i == 0 && numChk == minus) {
			result += minus;
		}
		else {
			for(j=0; j<nums.length; j++) {
				if(numChk == nums.charAt(j)) {
					result += nums.charAt(j);
					break;
				}
			}
		}
	}
	return result;
}

// ¾ÆÀÌµð È®ÀÎ ##################################################
function checkID(value, min, max) {
	var RegExp = /^[a-zA-Z0-9_]*$/i;
	var returnVal = RegExp.test(value) ? true : false;
	if (typeof(min) != "undefined" && value.length < min) returnVal = false;
	if (typeof(max) != "undefined" && value.length > max) returnVal = false;
	return returnVal;
}

// ºñ¹Ð¹øÈ£ È®ÀÎ ##################################################
function checkPass(value, min, max) {
	var RegExp = /^[a-zA-Z0-9]*$/i;
	var returnVal = RegExp.test(value) ? true : false;
	if (typeof(min) != "undefined" && value.length < min) returnVal = false;
	if (typeof(max) != "undefined" && value.length > max) returnVal = false;
	return returnVal;
}

function openPopup(theURL, winName, width, height, remFeatures) {
	var features = "";
	if (typeof winName == "undefined") winName = "";
	if (typeof width != "undefined") features += ((features) ? "," : "")+"width="+width;
	if (typeof height != "undefined") features += ((features) ? "," : "")+"height="+height;
	if (typeof remFeatures != "undefined") features += ((features) ? "," : "")+remFeatures;
	if (features.indexOf("status") < 0) features += ",status=yes";

	var popup = window.open(theURL, winName, features);
	popup.focus();

	return popup;
}

function CheckLen(content, num){ //// name : ¾ÆÀÌµð, num : ±ÛÀÚ¼ö (±ÛÀÚ ¼ö Ã¼Å© : ¹ÝÈ¯°ª: 1 - ÃÊ°ú, 0 - Á¤»ó)
	var t,msglen = 0,l = eval(content),tmpstr = "",msgchk=0;

	    for(k=0;k<l.value.length;k++) {
		  t = l.value.charAt(k);
		   if(escape(t).length > 4){msglen += 2;}
		   else{msglen++;}
			if(msglen >num){alert("ÇÑ±Û "+num/2+"ÀÚ, ¿µ¹® "+num+"ÀÚ±îÁö¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù..");l.value = tmpstr;
			msglen=num-2;l.focus();msgchk="1";break;}
			tmpstr += t;
		}
	return msgchk;		//// 0: ÃÊ°ú ÇÏÁö ¾ÊÀ½, 1:ÃÊ°ú µÆÀ½ 
}


function CheckLenBoard(content, num){ //// name : ¾ÆÀÌµð, num : ±ÛÀÚ¼ö (±ÛÀÚ ¼ö Ã¼Å© : ¹ÝÈ¯°ª: 1 - ÃÊ°ú, 0 - Á¤»ó)
	var t,msglen = 0,l = eval(content),tmpstr = "",msgchk=0;

	if (l.value.length == 0 || l.value.indexOf(" ")==0){alert('°ªÀÌ ºñ¾îÀÖ°Å³ª Ã¹ÀÚ°¡ °ø¶õÀÔ´Ï´Ù.');msgchk="1";l.value ="";l.focus();}
	else{
	    for(k=0;k<l.value.length;k++) {
		  t = l.value.charAt(k);
		   if(escape(t).length > 4){msglen += 2;}
		   else{msglen++;}
			if(msglen >num){alert("ÇÑ±Û "+num/2+"ÀÚ, ¿µ¹® "+num+"ÀÚ±îÁö¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù..");l.value = tmpstr;
			msglen=num-2;l.focus();msgchk="1";break;}
			tmpstr += t;
		}
	}
	return msgchk;		//// 0: ÃÊ°ú ÇÏÁö ¾ÊÀ½, 1:ÃÊ°ú µÆÀ½ 
}


function PopWindow(the_url,win_name,features, my_width, my_height, is_center) { //v3.0
	try
	{
		if (the_url == 'http://')
		{
			alert('Àß¸øµÈ URL ÀÔ´Ï´Ù.');
			return;
		}
		if(window.screen)if(is_center)if(is_center=="true"){
			var myLeft = (screen.width-my_width)/2;
			var myTop = (screen.height-my_height)/2;
			features+=(features!='')?',':'';
			features+=',left='+myLeft+',top='+myTop;
		}
		
		popWindow = window.open(the_url,win_name,features+((features!='')?',':'')+'width='+my_width+',height='+my_height);
		popWindow.focus();	
	}
	catch (e)
	{
		alert('Àß¸øµÈ URL ÀÔ´Ï´Ù.');
		return;
	}
	return false;
}

function PopView(url)
{
	url = decodeURI(url);
	url = encodeURI(url);
    window.open("/util/img_viewer.asp?img_nm=" + url, "imgview", "scrollbars=yes,width=100,height=100,resizable=yes");
}

function Moive(_file){
	var Movie ='<OBJECT classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="300">'
		  +'<PARAM NAME="Filename" VALUE="/upload/movie/'+_file+'">'
		  +'<param name="ClickToPlay" value="true">'
		  +'<param name="AutoSize" value="true">'
		  +'<param name="AutoStart" value="true">'
		  +'<param name="ShowControls" value="true">'
		  +'<param name="ShowAudioControls" value="true">'
		  +'<param name="ShowDisplay" value="false">'
		  +'<param name="ShowTracker" value="true">'
		  +'<param name="ShowStatusBar" value="false">'
		  +'<param name="EnableContextMenu" value="false">'
		  +'<param name="ShowPositionControls" value="false">'
		  +'<param name="ShowCaptioning" value="false">'
		  +'<param name="AutoRewind" value="true">'
		  +'<param name="Enabled" value="true">'
		  +'<param name="EnablePositionControls" value="true">'
		  +'<param name="EnableTracker" value="true">'
		  +'<param name="PlayCount" value="1">'
		  +'<param name="SendWarningEvents" value="true">'
		  +'<param name="SendErrorEvents" value="true">'
		  +'<param name="SendKeyboardEvents" value="false">'
		  +'<param name="SendMouseClickEvents" value="false">'
		  +'<param name="SendMouseMoveEvents" value="false">'
		  +'<param name="ShowGotoBar" value="false">'
		  +'<param name="TransparentAtStart" value="false">'
		  +'<param name="Volume" value="0">'
		  +'</OBJECT>'

	document.write(Movie);
}
