

function flashActiveX1(name, w, h){
    document.write('<object id="elementid" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">');
    document.write('<Param name=movie value="'+name+'">');
    document.write('<Param name=quality value=high>');
    document.write('<param name=menu value=false>');
    document.write('<Param name=wmode value=transparent>');
    document.write('<embed src="'+name+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="'+w+'" height="'+h+'"></embed>');
    document.write('</object>');
}

function flashActiveX2(name1, name2, w, h){
    document.write('<object id="elementid" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">');
    document.write('<Param name=movie value="'+name1+'">');
    document.write('<Param name=quality value=high>');
    document.write('<param name=menu value=false>');
    document.write('<Param name=wmode value=transparent>');
    document.write('<embed src="'+name2+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"  wmode="transparent" width="'+w+'" height="'+h+'"></embed>');
    document.write('</object>');
}

function editorActiveX(name){
    document.write('<object id="'+name+'" classid="clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A" style="width:100%;height:100%" border="0" onFocus="hide_upload()"></object>');
}

function generalActiveX(text){
    document.write(text);
}




/**
 * onLoad ÀÌº¥Æ®¸¦ Ãß°¡ÇÑ´Ù.
 * ex) addOnLoad(test);
 *     function test(){
 *     }
 * 
 * @param funcName ÇÔ¼ö¸í
 */
function addOnLoad(funcName){
	if (window.addEventListener)	{/* Dom Standard */
		window.addEventListener( 'load' , funcName, false );
	}else{
		window.attachEvent('onload', funcName); 
	}
}

/**
 *	»ç¾÷Àå µî·Ï ¹øÈ£ Ã¼Å©
 */
function chkWorkNumb(strNumb) { 
	strNumb = Replace(strNumb,"-"); 
	if (strNumb.length != 10) { 
		alert("»ç¾÷ÀÚµî·Ï¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù."); 
		return false; 
	} 

	sumMod = 0; 
	sumMod += parseInt(strNumb.substring(0,1)); 
	sumMod += parseInt(strNumb.substring(1,2)) * 3 % 10; 
	sumMod += parseInt(strNumb.substring(2,3)) * 7 % 10; 
	sumMod += parseInt(strNumb.substring(3,4)) * 1 % 10; 
	sumMod += parseInt(strNumb.substring(4,5)) * 3 % 10; 
	sumMod += parseInt(strNumb.substring(5,6)) * 7 % 10; 
	sumMod += parseInt(strNumb.substring(6,7)) * 1 % 10; 
	sumMod += parseInt(strNumb.substring(7,8)) * 3 % 10; 
	sumMod += Math.floor(parseInt(strNumb.substring(8,9)) * 5 / 10); 
	sumMod += parseInt(strNumb.substring(8,9)) * 5 % 10; 
	sumMod += parseInt(strNumb.substring(9,10)); 

	if (sumMod % 10 != 0) { 
		alert("»ç¾÷ÀÚµî·Ï¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù."); 
		return false; 
	}
	return true; 
}

function chckNumKey(evt) {
	var charCode = (evt.which) ? evt.which : event.keyCode;
	if (charCode > 31 && (charCode < 48 || (charCode > 57 && charCode < 96) || (charCode > 105) )) {
		return false;
	}
	return true;
}

/**
 *	ÆÄÀÏ ´Ù¿î·Îµå
 */
function DownFile(flName)
{
	document.location.href = "/common/DownFile.jsp?file=" + flName;
}


// °øÅë ÆäÀÌÁöÇÁ¸°Æ® ÇÔ¼ö
// ¹æ¹ý : ÀÎ¼âÇÏ°íÀÚ ÇÏ´Â ¿µ¿ªÀ» <print> </print>·Î °¨½ÎÁÜ
// È£Ãâ¹æ¹ý : <a href="javascript:printPage('<html:env name='pageURL'/>', 800, 600)">
function printPage(url, w, h){
	popup("/print.do?url="+escape(url), w, h, 1);
}
// ÀÚ¹Ù½ºÅ©¸³Æ®¸¸À¸·Î ÀÎ¼âÇÏ´Â ±â´É
function ps_page_print(){
	popup('/common/print.jsp', 710, 520, 1);
}

function showMediaPlayer(url, w, h){
	var s = '<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="Player" '+
	' width="'+w+'" height="'+h+'"> '+
	'<param name="Filename" value="'+url+'"> '+
	'<param name="AutoStart" value="1"> '+
	'<param name="Enabled" value="1"> '+
	'<param name="EnableContextMenu" value="0"> '+
	'<param name="EnableTracker" value="0"> '+
	'<param name="ShowCaptioning" value="0"> '+
	'<param name="ShowControls" value="1"> '+
	'<param name="ShowAudioControls" value="1"> '+
	'<param name="ShowDisplay" value="0"> '+
	'<param name="ShowGotoBar" value="0"> '+
	'<param name="ShowPositionControls" value="1"> '+
	'<param name="ShowStatusBar" value="0"> '+
	'<param name="ShowTracker" value="1"> '+
	'<param name="Volume" value="80"> '+
	'</object> ';
	document.write(s);
	
}
function showMediaPlayer2(url, w, h){
	var s = '<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="Player" '+
	' width="'+w+'" height="'+h+'"> '+
	'<param name="Filename" value="'+url+'"> '+
	'<param name="AutoStart" value="1"> '+
	'<param name="Enabled" value="1"> '+
	'<param name="EnableContextMenu" value="0"> '+
	'<param name="EnableTracker" value="0"> '+
	'<param name="ShowCaptioning" value="0"> '+
	'<param name="ShowControls" value="1"> '+
	'<param name="ShowAudioControls" value="0"> '+
	'<param name="ShowDisplay" value="0"> '+
	'<param name="ShowGotoBar" value="0"> '+
	'<param name="ShowPositionControls" value="1"> '+
	'<param name="ShowStatusBar" value="0"> '+
	'<param name="ShowTracker" value="0"> '+
	'<param name="Volume" value="80"> '+
	'</object> ';
	document.write(s);
	
}


/////////////////////////////////////////////////////////
// onLoad ÀÌº¥Æ®¸¦ Ãß°¡ÇÑ´Ù.
// ex) addOnLoad(test);
//     function test(){
//     }
//
// @funcName ÇÔ¼ö¸í
function addOnLoad(funcName){
	if(window.attachEvent){ 
		window.attachEvent('onload', funcName); 
	}
}


///////////////////////////////////////////////////////////
// ÆË¾÷ ±â´É°ü·Ã
// @url URL
// @w Æø
// @h ³Êºñ
// @s ½ºÅ©·Ñ¹Ù ¿©ºÎ 1, 'Y'ÀÌ¸é º¸¿©ÁÜ, 0, '', 'N'ÀÌ¸é ¼û±è
function popup1(url,w,h,s){
	var l, t, objPopup
	l = (screen.width-w)/2;
	t = (screen.height-h)/2;
	if(s==1 || s=="Y") 
		objPopup  = window.open(url,'','width='+w+',height='+h+',left='+l+',top='+t+',resizable=0,scrollbars=1');
	else if (s=="" || s==0 || s=="N" || !s || s=="0" ) 
		objPopup = window.open(url,'','width='+w+',height='+h+',left='+l+',top='+t+',resizable=0,scrollbars=0,status=0');
	else
		objPopup = window.open(url,'','width='+w+',height='+h+',left='+l+',top='+t+',resizable=1,menubar=1,toolbar=1,scrollbars=1,status=1');
	if (objPopup == null) { 
		alert("Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ½Ê½Ã¿À."); 
	} 
	return objPopup;
}
function popup(url,w,h,s,target){
	var l, t, objPopup
	if(target == 'undefined' || target=='' || target==null) {
		var target='win1';
	}
	l = (screen.width-w)/2;
	t = (screen.height-h)/2;
	if(s==1 || s=="Y") 
		objPopup  = window.open(url,target,'width='+w+',height='+h+',left='+l+',top='+t+',resizable=0,scrollbars=1');
	else if (s=="" || s==0 || s=="N" || !s || s=="0" ) 
		objPopup = window.open(url,target,'width='+w+',height='+h+',left='+l+',top='+t+',resizable=0,scrollbars=0,status=0');
	else
		objPopup = window.open(url,target,'width='+w+',height='+h+',left='+l+',top='+t+',resizable=1,menubar=1,toolbar=1,scrollbars=1,status=1');
	if (objPopup == null) { 
		alert("Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ½Ê½Ã¿À."); 
	} 
	return objPopup;
}

function popupEx(url,w,h,s){
	var objPopup;
	
	if(s==1 || s=="Y") 
		objPopup  = window.open(url,'','width='+w+',height='+h+',resizable=0,scrollbars=1');
	else if (s=="" || s==0 || s=="N" || !s) 
		objPopup = window.open(url,'','width='+w+',height='+h+',resizable=0,scrollbars=0,status=0');
	else
		objPopup = window.open(url,'','width='+w+',height='+h+',resizable=1,menubar=1,toolbar=1,scrollbars=1,status=1');
	if (objPopup == null) { 
		alert("Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ½Ê½Ã¿À."); 
	} 
	return objPopup;
	
}

function popupEx1(url,w,h,s,l,t){
	var objPopup;
	
	if(s==1 || s=="Y") 
		objPopup  = window.open(url,'','width='+w+',height='+h+',left='+l+',top='+t+',resizable=0,scrollbars=1');
	else if (s=="" || s==0 || s=="N" || !s) 
		objPopup = window.open(url,'','width='+w+',height='+h+',left='+l+',top='+t+',resizable=0,scrollbars=0,status=0');
	else
		objPopup = window.open(url,'','width='+w+',height='+h+',left='+l+',top='+t+',resizable=1,menubar=1,toolbar=1,scrollbars=1,status=1');
	if (objPopup == null) { 
		alert("Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ½Ê½Ã¿À."); 
	} 
	return objPopup;
	
}

function openWin(url,w,h){
	window.open(url,"",'width='+w+',height='+h+',resizable=0,scrollbars=0,status=0');
}
function openSite(url,target){
	window.open(url,target,"width=960,height=768,resizable=1,scrollbars=1,status=0,menubar=0,toolbar=1");
}

function openSiteBc(url,target){
	window.open(url,target,"width=960,height=768,resizable=1,scrollbars=1,status=0,menubar=0,toolbar=1,alwaysRaised");
}

///////////////////////////////////////////////////////////
// Æ¯Á¤ url·Î ÀÌµ¿
function goSite(url){
	if(url != ''){
		if(url.indexOf("http")<0)
			url = "http://"+url;
		popup(url,1024,768,9);
	}else
		alert('urlÀÌ ¾ø½À´Ï´Ù.');
}


///////////////////////////////////////////////////////////
// 0À¸·Î Ã¼¿ì±â

function getZeroFill(n,str) {
 		var ret="";
 		i=0;
 		len=0;
 		if(str == ""){
 			ret = "0";
 			len = 1;
 		}else{
 			ret = str;
 			len = str.length;
 		}

 		if(len < n){
 			for(i=0;i<n-len;i++){
 				ret = "0" + ret;
 			}
 		}
	return ret;
}


///////////////////////////////////////////////////////////
// ÆäÀÌÁö À§Ä¡ º¯°æ Ã³¸®
function goUrl(url,target){
	if(!target) target = window;
	target.location.href=url;
}


///////////////////////////////////////////////////////////
// ÄíÅ°¼ÂÆÃ
function setCookie( name, value, expiredays ) {
 	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}  
function getCookie( name )
{ 
	var 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 "";
}



///////////////////////////////////////////////////////////
// String ¹®ÀÚ¿­ Ã³¸®
function LTrim(strValue){
    while (strValue.length>0){
       if(strValue.charAt(0)==' '){
           strValue=strValue.substring(1,strValue.length);              
   }
       else
          return strValue;     
    }
return strValue;
}


function RTrim(strValue){
    while (strValue.length>0){
       if(strValue.charAt(strValue.length-1)==' '){
           strValue=strValue.substring(0,strValue.length-1);              
   }
       else
           return strValue;     
   }
   return strValue;
}

function Trim(str) {
	var search = 0
	while ( str.charAt(search) == " ") search = search + 1
	str = str.substring(search, (str.length))
	search = str.length - 1
	while (str.charAt(search) ==" ") search = search - 1
	return str.substring(0, search + 1)
}

function Trim2(str){
	var reg = /\s+/g;
	return str.replace(reg,'');
}

//¹®ÀÚ¿­ º¯È¯
function Replace(strString, strChar) { 
	var strTmp = ""; 
	for (i = 0; i< strString.length; i++) { 
		if (strString.charAt(i) != strChar) { 
			strTmp = strTmp + strString.charAt(i); 
		} 
	} 
	return strTmp; 
} 

//¹®ÀÚ¿­ º¯È¯
function strReplace(szFind, szReplace, szAll) {
	var i;
	var length;

	length = szReplace.length - szFind.length;

	for (i=0; i < szAll.length; i++) {
		if (szAll.substr(i,szFind.length) == szFind) {
			if ( i > 0 ) {
				if (szFind == "\n") {
					szAll = szAll.substr(0, i-1) + szReplace + szAll.substr(i+szFind.length,szAll.length - (i+szFind.length));
				} else {
					szAll = szAll.substr(0, i) + szReplace + szAll.substr(i+szFind.length,szAll.length - (i+szFind.length));
				}
			} else { 
				szAll = szReplace + szAll.substr(i+szFind.length,szAll.length - (i+szFind.length));
			}
			i = i + length;
		}
	}
	return szAll;
}
// ´ë¹®ÀÚ·Î º¯°æ
function toUpperCase(val){
	return val.toUpperCase();
}
//*************************** 
// *** 123,456 Çü ¼ýÀÚ·Î ¸®ÅÏ
// ************************** 
function numberFormat(num)
{
	var str=''+num;
	var len=str.length;	
	var no =len/3;
	var remain=len%3;
	var rv='';
	var str1='';
	var blank=0;
	var Bstr='                                   ';
	
	for (var i=1;i<=no;i++)
	{
		rv=str.substring(len-i*3,len-(i*3)+3)+rv;
		if (i!=no ) rv=','+rv;
	}
	if (remain) rv=str.substring(0,remain)+rv;
	
	if (navigator.appName=="Microsoft Internet Explorer")
	{
		rv=Bstr.substring(0,14-rv.length)+rv;
	}
	else
	{
		rv=Bstr.substring(0,14-rv.length)+rv;
	}
	return rv;
}

//*******************************
// *** ¼¿·ºÆ®¹Ú½º ¼±ÅÃ µÇ¾ú´ÂÁö 
// ******************************
function isSelect(sel) {
	if(sel.selectedIndex==0){
		return false;
	}else{
		return true;
	}
}

//*******************************
// *** ¶óµð¿À¹öÆ° Ã¼Å© µÇ¾ú´ÂÁö 
// ******************************
function isRadio(sel) {
	var n=0;
	if(sel.length==undefined){
		if(sel.value) n++;
	}else{
		for(i=0; i<sel.length; i++){
			if(sel[i].checked){
				n++;
			}
		}
	}
	if(n==0){
		return false;
	}else{
		return true;
	}
}

//*******************************
// *** È÷µçÆû¿¡ °ªÀÌ ÀÖ´ÂÁö 
// ******************************
function isHidden(sel) {
	if(!sel.value){
		return false;
	}else{
		return true;
	}
}

//*************************** 
// *** ÀÔ·ÂÀÌ µÇ¾ú´ÂÁö Ã¼Å© 
// ************************** 
function isInput(obj)
{ 

	if(obj.type=="select-one"){
		if(!isSelect(obj))
		return false;
	}else if(obj.type=="radio" || obj.type==undefined){

		if(!isRadio(obj))
		return false;
	}else if(obj.type=="hidden"){
		if(!isHidden(obj))
		return false;
	}else{
		var val = Trim(obj.value);
		if(val.length==0 || val=="")
		return false;
	}
	return true; 
} 

//******************************************* 
//*** °ªÀÌ °°ÀºÁö Ã¼Å© (pwd1/pwd2)
//******************************************* 
function isEqual(obj1,obj2) 
{ 
	if(obj1.value != obj2.value) return false;
	return true; 
} 

//************************************ 
//*** ÀÔ·ÂµÈ ¹®ÀÚÀÇ ±æÀÌ°¡ °°ÀºÁö Ã¼Å© 
//************************************ 
function isChkLen(obj,len)
{ 
	if(obj.value.length != len)  return false;
	return true 
} 

//*********************************** 
// *** ÀÔ·ÂµÈ ¹®ÀÚÀÇ ±æÀÌ ¹üÀ§¸¦ Ã¼Å©
//*********************************** 
function isBtnLen(obj,len1,len2)
{ 
	if(obj.value.length <len1 && obj.value.length > len2) return false;
	return true ;
} 

//*********************************** 
// *** ÀÔ·ÂµÈ ¹®ÀÚÀÇ ±æÀÌ ¹üÀ§¸¦ errÃ¼Å©  
//*********************************** 
function isBtnLens(obj,len1,len2)
{ 
	if(obj.value.length <len1 || obj.value.length > len2) return false;
	return true ;  
	
} 


//*****************************// 
//*** ¼ýÀÚ¸¸ ÀÔ·Â °¡´É 
//*****************************// 
function isNum(obj) 
{
	if(obj.value.search(/\D/) != -1 ) return false;
	return true ; 
} 

//*****************************// 
//***Æ¯¼ö¹®ÀÚ Á¦¾î ±â´É (¿µ¹®°ú ¼ýÀÚ¸¸)
//*****************************// 
function isOnlyEng(obj) {
	var inText = obj.value; 
	var ret; 
	for (var i = 0; i < inText.length; i++) { 
		ret = inText.charCodeAt(i); 
		if ((ret > 122) || (ret < 48) || (ret > 57 && ret < 65) || (ret > 90 && ret < 97)) { 
			return false; 
		} 
	} 
	return true; 
} 



//**************************************** 
//*** ÀÔ·ÂµÈ ¹®ÀÚ¿­ÀÌ ÁÖ¹Îµî·Ï¹øÈ£ÀÎÁö Ã¼Å© 
//**************************************** 
function isJuminNum(aNum1, aNum2) 
{ 
	var tot=0, result=0, re=0, se_arg=0; 
	var chk_num=""; 
	var aNum = aNum1 + aNum2; 

	if (aNum.length != 13) 
	{ 
		return false; 
	} 
	else 
	{ 
		for (var i=0; i <12; i++) 
		{ 
			if (isNaN(aNum.substr(i, 1))) 
			return false; 
			se_arg = i; 

			//¿Ü±¹ÀÎ ÀÎ °æ¿ì 
			if(i==6) { 
				if (aNum.substr(i, 1) == 7 || aNum.substr(i, 1) == 8 ) 
				return true 
			} 

			if (i >= 8) 
			se_arg = i - 8; 
			tot = tot + Number(aNum.substr(i, 1)) * (se_arg + 2) 
		} 

		if (chk_num != "err") 
		{ 
			re = tot % 11; 
			result = 11 - re; 
			if (result >= 10) result = result - 10; 
			if (result != Number(aNum.substr(12, 1))) return false; 
			if ((Number(aNum.substr(6, 1)) < 1) || (Number(aNum.substr(6, 1)) > 4)) return false; 
		} 
	} 
	return true; 
} 


//*****************************// 
//***ÀÌ¸ÞÀÏÀÌ ¿Ã¹Ù¸¥Áö Ã¼Å© ***// 
//*****************************// 
function emailCheck (emailStr) { 
	// Email check ÇÔ¼ö 
	var emailPat=/^(.+)@(.+)$/ 
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]" 
	var validChars="\[^\\s" + specialChars + "\]" 
	var firstChars=validChars 
	var quotedUser="(\"[^\"]*\")" 
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/ 
	var atom="(" + firstChars + validChars + "*" + ")" 
	var word="(" + atom + "|" + quotedUser + ")" 
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$") 
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$") 


	var matchArray=emailStr.match(emailPat) 
	if (matchArray==null) { 
		alert("e-mail ÁÖ¼Ò°¡ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù.\n @ ¿Í . À» È®ÀÎÇÏ½Ê½Ã¿À") 
		return false 
	} 
	var user=matchArray[1] 
	var domain=matchArray[2] 

	if (user.match(userPat)==null) { 
		alert("¸ÞÀÏ ¾ÆÀÌµð°¡ Á¤È®ÇÑ °Í °°Áö ¾Ê½À´Ï´Ù.") 
		return false 
	} 

	var IPArray=domain.match(ipDomainPat) 
	if (IPArray!=null) { 
		for (var i=1;i<=4;i++) { 
		if (IPArray[i]>255) { 
		alert("IP°¡ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù.") 
		return false 
	} 
	} 
	return true 
	} 

	var domainArray=domain.match(domainPat) 

	if (domainArray==null) { 
		alert("µµ¸ÞÀÎ ÀÌ¸§ÀÌ Á¤È®ÇÑ °Í °°Áö ¾Ê½À´Ï´Ù.") 
		return false 
	} 
	var atomPat=new RegExp(atom,"g") 
	var domArr=domain.match(atomPat) 
	var len=domArr.length 

	if (domArr[domArr.length-1].length<2 || 
		domArr[domArr.length-1].length>3) { 
		alert("µµ¸ÞÀÎ¸íÀÇ ±¹°¡ÄÚµå´Â 2ÀÚº¸´Ù Å©°í 3ÀÚº¸´Ù ÀÛ¾Æ¾ß ÇÕ´Ï´Ù.") 
		return false 
	} 

	if (domArr[domArr.length-1].length==2 && len<3) { 
		var errStr="This address ends in two characters, which is a country" 
		errStr+=" code. Country codes must be preceded by " 
		errStr+="a hostname and category (like com, co, pub, pu, etc.)" 
		alert(errStr) 
		return false 
	} 

	if (domArr[domArr.length-1].length==3 && len<2) { 
		var errStr="ÀÌ ÁÖ¼Ò´Â È£½ºÆ®¸íÀÌ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù." 
		alert(errStr) 
		return false 
	} 
	return true; 
} 




/*
2005.08.12 Ãß°¡
*/

///////////////////////////////////////////////////////////
// ÇÑ±ÛÀÎÁö Ã¼Å©
function isHangul (obj)
{
	if (obj.type == object) {
		var str = obj.value;
        var retCode=0;
        for(i=0; i<str.length; i++)
        {
                var code = str.charCodeAt(i)
                var ch = str.substr(i,1).toUpperCase()
                code = parseInt(code)

                if((ch<"0" || ch>"9") && (ch<"A" || ch>"Z") && ((code>255) || (code<0)))
                {
                        return true;
                }
        }
        return false;

	} else {
		return isHangul2(obj);
	}
}

// ÇÑ±ÛÀÎÁö ¾Æ´ÑÁö ±¸º°
function isHangul2(s) 
{
     var len;
     
     len = s.length;

     for (var i = 0; i < len; i++)  {
         if (s.charCodeAt(i) != 32 && (s.charCodeAt(i) < 44032 || s.charCodeAt(i) > 55203))
             return false;
     }
     return true;
}

///////////////////////////////////////////////////////////
// °ø¹éÃ¼Å©      
function isEmpty( str ) {
   for ( var i = 0 ; i < str.length ; i++ )    {
      if ( str.substring( i, i+1 ) == " " )

         return true;
   }
   return false;
}

///////////////////////////////////////////////////////////
// Æû Ç×¸ñµé ÀÔ·Â°ª Ã¼Å© 
function chkInput(obj, msg){
	if(!isInput(obj)){
		alert(msg);
		if(obj.type !="radio" && obj.type != undefined && obj.type != "hidden"){
			obj.value="";
			obj.focus();
		}
		return false;
	}
	return true;
}

///////////////////////////////////////////////////////////
// Æû Ç×¸ñÀÇ ¼ýÀÚ Ã¼Å©
function chkNum(obj,msg) 
{
	if(!chkInput(obj,msg)) return false;
	if(!isNum(obj)){
		alert(msg);
		obj.value="";
		obj.focus();
		return false;		
	}
	return true;
} 

///////////////////////////////////////////////////////////
// Æû Ç×¸ñ ¿µ¹®/¼öÀÚ Ã¼Å©
function chkOnlyEng(obj, msg){
	if(!isInput(obj) || !isOnlyEng(obj)){
		alert(msg);
		obj.value="";
		obj.focus();
		return false;
	}
	return true;
}

function chkBtnLen(obj,len1,len2,msg){
	if(!isBtnLen(obj,len1,len)){
		alert(msg);
		obj.value="";
		obj.focus();
	}
}

//////////////////////////////////////////////////////////////
// ¸ÖÆ¼ Ã¼Å©¹Ú½º
/**
 * Æ¯Á¤ÀÌ¸§ÀÇ ¸ÖÆ¼Ã¼Å©¹Ú½º¸¦ Ã¼Å© ¶Ç´Â Ã¼Å©ÇØÁ¦ÇÑ´Ù.
 * ex) <input type=checkbox name=IDS value='...'>
 *     <script language='javascript'>
 *		toggleMultiChk(true, 'IDS')
 *	   </script>
 *
 * @param bCheck    true|false(Ã¼Å©ÇÒ »óÅÂ)
 * @param itemName  Ã¼Å©´ë»ó Ã¼Å©¹Ú½ºÀÌ¸§
 */
function toggleMultiChk(bCheck, itemName){
	var obj = document.getElementsByName(itemName);
	if(typeof(obj) == 'undefined'){
		return;
	}
	
	for(var i=0; i<obj.length; i++){
		obj[i].checked = bCheck;
	}
}
/**
 * Ã¼Å©µÈ °³¼ö
 * @param itemName Ã¼Å©¹Ú½º¸í
 */
function getMultiCheckedNum(itemName){
	var obj = document.getElementsByName(itemName);
	if(typeof(obj) == 'undefined'){
		return 0;
	}
	var chkedCnt=0;
		
	for(var i=0; i<obj.length; i++){
		if(obj[i].checked)
			chkedCnt++;
	}
	return chkedCnt;
}
/**
 * Ã¼Å©µÈ Ç×¸ñµé °ªÀ» ÃëÇÕÇØ¼­ ¸®ÅÏ
 * @param itemName Ã¼Å©¹Ú½º¸í
 * @param delim    ±¸ºÐÀÚ
 */
function getMultiCheckedString(itemName, delim){
	var obj = document.getElementsByName(itemName);
	var div = delim;
	if(div=="")
		div="|";
	var chkCnt=0;
	if(typeof(obj) == 'undefined'){
		return "";
	}
	var s="";
	var n=0;
	for(var i=0; i<obj.length; i++){
		if(obj[i].checked){
			if(n>0)
				s += div;
			s += obj[i].value;
			n++;
		}
	}
	return s;
}

///////////////////////////////////////////////////////////
// Æ÷Ä¿½ºÀÌµ¿ 
function moveFocus(obj1,obj2,movLen){
	movLen = (!movLen) ? 6 : movLen; //  = 6 //Æ÷Ä¿½ºÀÌµ¿   ;
	if(obj1.value.length == movLen ) obj2.focus();
}
//´ë¹®ÀÚ·Î º¯°æ
function upperCase(str) {
	if (str.length = 0 ) return "";
	else return str.toUpperCase();
}
//¼Ò¹®ÀÚ·Î º¯°æ
function lowerCase(str) {
	if (str.length = 0 ) return "";
	else return str.toLowerCase();
}

// ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ°Ô ÇÑ´Ù.
// onkeydown="return onlyNumber();"
function onlyNumber() {
	 if ((window.event.keyCode == 8) || (window.event.keyCode == 9) || (window.event.keyCode == 46)) { //¹é½ºÆäÀÌ½ºÅ°¿Í  tab, delÅ°´Â ¸Ô°ÔÇÑ´Ù.
      window.event.returnValue=true;
	 } else if ((window.event.keyCode >= 96) && (window.event.keyCode <= 105)) { //¼ýÀÚÆÐµå´Â ¸Ô°Ô ÇÑ´Ù.
	 		window.event.returnValue=true;
   } else if( (window.event.keyCode<48) || (window.event.keyCode>57) ) {
      window.event.returnValue=false;
  }
}
// ¼ýÀÚ ¹× '.' ¸¸ ÀÔ·Â
function onlyNumberAndDot() {
	 if ((window.event.keyCode == 8) || (window.event.keyCode == 190) || (window.event.keyCode == 9) || (window.event.keyCode == 46)) { //¹é½ºÆäÀÌ½ºÅ°¿Í  '.', tab, delÅ°´Â ¸Ô°ÔÇÑ´Ù.
      window.event.returnValue=true;
	 } else if (((window.event.keyCode >= 96) && (window.event.keyCode <= 105)) || (window.event.keyCode == 110)) { //¼ýÀÚÆÐµå´Â ¸Ô°Ô ÇÑ´Ù.
	 		window.event.returnValue=true;
   } else if( (window.event.keyCode<48) || (window.event.keyCode>57) ) {
      window.event.returnValue=false;
  }
}
// ÀÌ¹ÌÁö ÆÄÀÏ ¿©ºÎ
function isImageFile(fn) {
	var ext = fn.value;
	ext = ext.substring(ext.length-3,ext.length);
	ext = ext.toLowerCase();
	if(ext == "jpg" || ext == "jpeg" || ext == "gif" || ext == "bmp") {
		return true; 
	} else {
		alert("ÀÌ¹ÌÁö ÆÄÀÏ(jpg, gif, bmp)¸¸ ¾÷·Îµå ÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		return false; 
	}
}
// ÆË¾÷Ã¢
// arg1 : url
// arg2 : window name
// arg3 : width
// arg4 : height
// arg5 : Ã¢ Áß¾Ó À§Ä¡ ¿©ºÎ
// arg6 : top
// arg7 : left
function showPopup()
{
	var url, name, w, h, loca, top, left, status, scroll, resize;
	var menubar, toolbar, locat, fullscreen;
	var winprops, win;
	url = arguments[0];
	name = arguments[1];
	if (arguments[2] == "" || arguments[2] == null)
	w = 300;
	else w = arguments[2];
	if (arguments[3] == "" || arguments[3] == null)
	h = 200;
	else h = arguments[3];
	if ( arguments[4] == "" || arguments[4] == null || arguments[4] == "1" || arguments[4] == "yes")
	{
	top = (screen.height - h) / 2;
	left = (screen.width - w) / 2;
	loca = 'top='+top+'; left='+left+';' ;
	}
	else if(arguments[4] == "0" || arguments[4] == "no")
	{
	if (arguments[5] == "" || arguments[5] == null)
	top = 0;
	else top = arguments[5];
	if (arguments[6] == "" || arguments[6] == null)
	left = 0;
	else left = arguments[6];
	loca = 'top='+top+'; left='+left+';' ;
	}
	else loca = '';
	if (arguments[7] == "" || arguments[7] == null)
	status = '1';
	else status = arguments[7];
	if (arguments[8] == "" || arguments[8] == null)
	scroll = '0';
	else scroll = arguments[8];
	if (arguments[9] == "" || arguments[9] == null)
	resize = '0';
	else resize = arguments[9];
	if (arguments[10] == "" || arguments[10] == null)
	menubar = '0';
	else menubar = arguments[10];
	if (arguments[11] == "" || arguments[11] == null)
	toolbar = '0';
	else toolbar = arguments[11];
	if (arguments[12] == "" || arguments[12] == null)
	locat = '0';
	else locat = arguments[12];
	if (arguments[13] == "" || arguments[13] == null)
	fullscreen = '0';
	else fullscreen = arguments[13];
	winprops = 'width='+w+'; height='+h+'; '+loca+' status='
	+status+'; scrollbars='+scroll+'; resizable='+resize+'; menubar='
	+menubar+'; toolbar='+toolbar+'; location='+locat+'; fullscreen='+fullscreen;
	win = window.open(url,name,winprops);
	return win ; 
}
function closeWindow()
{
	window.close();
	return false;
}

// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
function checkNationalId(nationalId1, nationalId2)
	{
	
	if(isNaN(nationalId1) || isNaN(nationalId2))
	{
		return 'N';
	}
	
	var nationalId = nationalId1 + nationalId2;

	var nationalIdStr = nationalId.toString();
	a = nationalIdStr.substring(0, 1);
	b = nationalIdStr.substring(1, 2);
	c = nationalIdStr.substring(2, 3);
	d = nationalIdStr.substring(3, 4);
	e = nationalIdStr.substring(4, 5);
	f = nationalIdStr.substring(5, 6);
	g = nationalIdStr.substring(6, 7);
	h = nationalIdStr.substring(7, 8);
	i = nationalIdStr.substring(8, 9);
	j = nationalIdStr.substring(9, 10);
	k = nationalIdStr.substring(10, 11);
	l = nationalIdStr.substring(11, 12);
	m = nationalIdStr.substring(12, 13);
	
	month = nationalIdStr.substring(2,4);
	day = nationalIdStr.substring(4,6);
	
	if(month <= 0 || month > 12) return 'N';
	if(day <= 0 || day > 31) return 'N';
	
	
	
	// ÁÖ¹Îµî·ÏµÞÀÚ¸® Ã¹¹øÂ° ¹øÈ£ À¯È¿¼º Ã¼Å© (1,2,3,4) are only valid
	//if(g > 4 || g == 0) return 'N';
	
	var temp=a*2+b*3+c*4+d*5+e*6+f*7+g*8+h*9+i*2+j*3+k*4+l*5;
	temp=temp%11;
	temp=11-temp;
	temp=temp%10;
	
	if(temp == m)
		return 'Y';
	else
		return 'N'; 
	
}


// °ø¹éÀÌ ÀÖ´ÂÁö Ã¼Å©
function checkSpace( str )
{
	return (str.search(/\s/) != -1);
}


// 14¼¼ ÀÌ»óÀÌ¸é true¾Æ´Ï¸é false;
function is14AgeOver( v_year, v_month, v_day)
{
     var today = new Date();
     
     var d_year = v_year*1 + 14;
     var d_month = v_month*1;
     var d_day = v_day*1;
     
     /* °ú°Å ³¯Â¥¿©¾ß ÇÔ. */ 
     if( d_year > today.getFullYear() ){
         return false;
     }else if( d_year == today.getFullYear() && d_month > (today.getMonth()*1+1)){
         return false;
     }else if( d_year == today.getFullYear() && d_month == (today.getMonth()*1+1) && d_day > today.getDate()){
         return false;
     }
     
     
     /* ´Þº° ÀÏ check */
     if( d_month == 1 || d_month == 3 || d_month == 5 || d_month == 7 || d_month == 8 || d_month == 10 || d_month == 12){
         if( d_day > 31 || d_day < 1) {
         	return false;
         }
     }
     else if(d_month == 4 || d_month == 6 || d_month == 9 || d_month == 11 ){
         if( d_day > 30 || d_day < 1 ) {
         	return false;	
         }
     }
     else if( d_month == 2 )
     {
     /*
     	 if( ((d_year%400) == 0 || ((d_year%100) != 0 && (d_year%4) == 0) ){
     	     if( d_day > 29 || d_day < 1 ) {
     	     	return false;
     	     }
     	 }
     	 else {
     	     if( d_day > 28 || d_day < 1 ) {
     	     	return false;
     	     }
     	 }
     */
     }
     
     return true;
}

	// Æ¯¼ö¹®ÀÚ Ã¼Å©
function Check_nonChar(id_text)
{
		//var nonchar = '~`!@#$%^&*()-_=+\|<>?,./;:"';
		var nonchar = '`@#$%&\|<>;"';

		var i ; 
		for ( i=0; i < id_text.length; i++ )  {
			if( nonchar.indexOf(id_text.substring(i,i+1)) > 0) {
				break ; 
			}
		}
		if ( i != id_text.length ) {
			return false ; 
		}
		else{
			return true ;
		} 

		return false;
}

//¹®ÀÚ¿­ °³¼ö
function LengthCheck(message) {
	var nbytes = 0;

	for (i=0; i<message.length; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			nbytes += 2;
		} else if (ch != '\r') {
			nbytes++;
		}
	}

	return nbytes;
}

function strCutByte(message, maximum){
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;
	
	for (i=0; i<msglen; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			inc = 2;
		} else if (ch != '\r') {
			inc = 1;
		}
		if ((nbytes + inc) > maximum) {
			break;
		}
		nbytes += inc;
		msg += ch;
	}

	return msg;
}


function next(str, size){     // ÁÖ¹Î¹øÈ£ valid check , ÀÚµ¿ ´ÙÀ½ Æû ÀÌµ¿
   num = str.socialId1.value;
   siz = num.length;
   if(siz == size){
      str.socialId2.focus();
   }
   return true;
}

function next2(str, size){     // ÁÖ¹Î¹øÈ£ valid check , ÀÚµ¿ ´ÙÀ½ Æû ÀÌµ¿
   num = str.jumin1.value;
   siz = num.length;
   if(siz == size){
      str.jumin2.focus();
   }
   return true;
}


function chkEmail(obj1,obj2){
	if(!chkInput(obj1,"e-mailÀ» ÀÔ·ÂÇÏ¼¼¿ä.")) return false;
	if(obj2){
		if(!chkInput(obj2,"e-mailÀ» ÀÔ·ÂÇÏ¼¼¿ä.")) return false; 
		if(!emailCheck(obj1.value+"@"+obj2.value)){ obj1.focus(); return false; }
	}else{
		if(!emailCheck(obj1.value)){ obj1.focus(); return false; }
	}
	return true; 
}




function doResize(){ 
	container.height = myframe.document.body.scrollHeight; 
	container.width = myframe.document.body.scrollWidth; 
} 


///////////////////////////////////////////////////////////////
// ÀÌ¹ÌÁö popup ÇÔ¼ö
function jsOpenImage(imageRef)
{
    var x,y,w,h,loadingMsg;
    //ÆË¾÷µÉ Ã¢ÀÇ ÃÊ±â Å©±â
    w=400;h=560;
    //È­¸é ÇÑ°¡¿îµ¥·Î ÆË¾÷Ã¢ ¶ç¿ì±â À§ÇÑ ÁÂÇ¥ °è»ê
   // x=Math.floor( (screen.availWidth-(w+12))/2 );y=Math.floor( (screen.availHeight-(h+30))/2 );
    //ÀÌÁö¹Ì°¡ ·ÎµùÁß¿¡ ³»º¸³¾ ¸Þ½ÃÁö
    //loadingMsg="<table width=100% height=100%><tr><td valign=center align=center><font size='2' color='#ff6600' face='termanal'>NOW LODDING...</font></td></tr></table>";

    with( window.open("","",'height='+h+',width='+w+',top='+y+',left='+x+',scrollbars=no,resizable=no,status=no') )
    {
        document.write(
        "<body topmargin=0 rightmargin=0 bottommargin=0 leftmargin=0>",
        "<img src=\""+imageRef+"\" hspace=0 vspace=0 border=0 onmousedown=\"window.close();\" onload=\"document.title='¿øº» ÀÌ¹ÌÁö';window.moveTo(Math.floor( (screen.availWidth-(this.width+12))/2),Math.floor( (screen.availHeight-(this.height+30))/2 ));\">",
        "</body>");
        focus();
    }

    return false;
}

function imgPopupResize(src){
    var x,y,w,h,loadingMsg;
    var img  = new Image();
    img.src = src;
    //ÆË¾÷µÉ Ã¢ÀÇ ÃÊ±â Å©±â
    w=(img.width);
    h=(img.height);
    //È­¸é ÇÑ°¡¿îµ¥·Î ÆË¾÷Ã¢ ¶ç¿ì±â À§ÇÑ ÁÂÇ¥ °è»ê
    //x=Math.floor( (screen.availWidth-(w+12))/2 );y=Math.floor( (screen.availHeight-(h+30))/2 );
    //ÀÌÁö¹Ì°¡ ·ÎµùÁß¿¡ ³»º¸³¾ ¸Þ½ÃÁö
    //loadingMsg="<table width=100% height=100%><tr><td valign=center align=center><font size='2' color='#ff6600' face='termanal'>NOW LODDING...</font></td></tr></table>";

    with( window.open("","",'height='+h+',width='+w+',top='+y+',left='+x+',scrollbars=no,resizable=no,status=no') )
    {
        document.write(
        "<body topmargin=0 rightmargin=0 bottommargin=0 leftmargin=0>",
        "<img src=\""+img.src+"\" hspace=0 vspace=0 border=0 onmousedown=\"window.close();\" onload=\"document.title='¿øº» ÀÌ¹ÌÁö';window.moveTo(Math.floor( (screen.availWidth-(this.width+12))/2),Math.floor( (screen.availHeight-(this.height+30))/2 ));\">",
        "</body>");
        focus();
    }

    return false;
}

///////////////////////////////////////////////////////////////
// ÀÌ¹ÌÁö resize
function imageResize(img, maxWidth, maxHeight)
{
	var width, height;

	width	= parseInt(img.width);
	if(width == 0) {
		return false;
	}

	height	= parseInt(img.height);
	if(height > maxHeight) {
		img.style.width		= Math.ceil(width * maxHeight / height);
		img.style.height	= maxHeight;
	}
	if(width > maxWidth) {
		img.style.height	= Math.ceil(height * maxWidth / width);
		img.style.width		= maxWidth;
	}

	return true;
}

///////////////////////////////////////////////////////////////
// ³â¿ù yyyyMMÇüÅÂ·Î ¸®ÅÏ
function mergeToYM(year, month){
	var yymm = year;
	if(month.length < 2){
		yymm += "0"+month;
	}else{
		yymm += month;
	}
	return yymm;
}

///////////////////////////////////////////////////////////////
/**
 * ÀÔ·Â¹Ú½ºÀÇ ÀÔ·ÂµÇ´Â ±ÛÀÚbyte¼ö¸¦ Ã¼Å©ÇÏ°í Á¦ÇÑÇÑ´Ù.
 * @param item   ÀÔ·Â¹Ú½º ÀÌ¸§
 * @param viewId ÇöÀç ÀÔ·ÂµÈ ±ÛÀÚ¼ö¸¦ º¸¿©ÁÙ spanÅÂ±× ¾ÆÀÌµð
 * ex)
 *         ÇöÀç <span id='cmntlen' style=''>0</span>byte
 *         <textarea onKeyUp='inputCheckLen(this, "cmntLen", 100)'></textarea>
 */
function inputCheckLen(item, viewId, limit){
	var len = LengthCheck(item.value);
	if(len>limit){
		alert(limit+'byte¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.');
		item.value = strCutByte(item.value, limit);
	}
	len = LengthCheck(item.value);
	var obj = document.getElementById(viewId);
	obj.innerHTML = len;
}

/**
 * Ajax call
 */
function getHttprequest(URL) { 
	var xmlhttp = null; 
	if(window.XMLHttpRequest) { 
		xmlhttp = new XMLHttpRequest(); 
	} else { 
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
	} 
	xmlhttp.open('GET', URL,false); 
	xmlhttp.onreadystatechange = function() { 
		if(xmlhttp.readyState==4 && xmlhttp.status == 200 && xmlhttp.statusText=='OK') { 
			responseText = xmlhttp.responseText; 
		} 
	} 
	xmlhttp.send(''); 

	return responseText = xmlhttp.responseText; 
} 

/**
 * ¼±ÅÃ¹Ú½º °ªÀ» µðÆúÆ® ¼­ÅÃ
 */
function setSelBoxSelectedByValue(tbox, val){
	for(var i=0; i<tbox.options.length; i++){
		if(tbox.options[i].value == val){
			tbox.selectedIndex = i;
			return;
		}
	}
}
function setSelBoxSelectedByText(tbox, val){
	for(var i=0; i<tbox.options.length; i++){
		if(tbox.options[i].text == val){
			tbox.selectedIndex = i;
			return;
		}
	}
}

/**
 * 0¿¡¼­ N±îÁöÀÇ ·£´ý°ª ¹ÝÈ¯ 
 */
function ps_random(i){
	return Math.floor(Math.random()*(i+1));
}

	/*****Zoom In & Zoom Out Script*****/

	var zoomRate = 20;			// È®´ë/Ãà¼Ò½Ã Áõ°¨·ü
	var maxRate = 300;			//ÃÖ´ëÈ®´ë·ü
	var minRate = 100;			//ÃÖ¼ÒÃà¼Ò·ü

	function GetCookie(name){
		if (document.cookie != "") {
			zoomc = document.cookie.split("; ");
			for (var i=0; i < zoomc.length; i++) {
                zoomv = zoomc[i].split("="); 
                if (zoomv[0] == name) {
				    return  unescape(zoomv[1]);
                }
			}
		}else{
			return "";
		}
	}

	function SetCookie(name,value){
		document.cookie = name + "=" + escape (value)+";";
	}

	function GoZoom(contentid){
		if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
			document.all[contentid].style.zoom = GetCookie("zoomVal");
			currZoom=GetCookie("zoomVal");
		}
		else{
			document.all[contentid].style.zoom = '100%'; 
			currZoom = '100%';
		}
	}

	//Zoom In & Zoom Out
	function zoomInOut(contentid, how) {

		if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
			document.all[contentid].style.zoom = GetCookie("zoomVal");
			currZoom=GetCookie("zoomVal");
		}
		else{
			document.all[contentid].style.zoom = '100%'; 
			currZoom = '100%';
		}
		if (((how == "in") && (parseInt(currZoom) >= maxRate)) || ((how == "out") && (parseInt(currZoom) <= minRate)) ) {
			return; 
		}
		if (how == "in") {
			document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)+zoomRate+'%'
		}
		else {
			document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)-zoomRate+'%'
		}
		SetCookie("zoomVal",document.all[contentid].style.zoom);
	}

	//	+, - key event
	//document.onkeypress = getKey;
	
	function getKey(keyStroke) {
		isNetscape=(document.layers);
		eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
		which = String.fromCharCode(eventChooser).toLowerCase();
		which2 = eventChooser;

		var el=event.srcElement;

		if ((el.tagName != "INPUT") && (el.tagName != "TEXTAREA"))		//input,textarea ¾È¿¡¼­ÀÇ +.-°ªÀº ½ÇÇà¾ÈµÇµµ·Ï
		{			
			if(which == "+" )
				zoomInOut('zoom', 'in');
			else if(which == "-" )
				zoomInOut('zoom', 'out');
		}
	}
	
	function jsiPrint()
	{
	    var width = 730;
	    var height = 350;
		var x, y;
		var screen_width  = screen.width;
		var screen_height = screen.height;
		x = (screen_width  / 2) - (width  / 2);
		y = (screen_height / 2) - (height / 2);
		var pop = window.open ( "./for_print.jsp","print","width=" + width + ", height=" + height + ", left=" + x + ", top=" + y + ", toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes");
		pop.focus();
		return;
	}
		
		
//HTMLÄÚ´õ ÀÌ°æ¹Î Ãß°¡»çÇ×
//¸ÞÀÎ ÀÌ¹ÌÁö ÇÃ·¡½Ã
function img_flash() { 
	document.write("<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=441 height=243>"); 
	document.write("<param name=movie value=/images/flash/main.swf>"); 
	document.write("<param name=quality value=high>"); 
//	document.write("<param name=wmode value=transparent>"); 
	document.write("<embed src=/images/flash/main.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=441 height=243></embed></object>");
}


function checkboxSelAll(selform)
{
  for (var i=0;i<selform.elements.length;i++)
  {
    var e = selform.elements[i];

    if(((e.name != 'checkall') && (e.type=='checkbox')))
    {
      e.checked = selform.checkall.checked;
    }
  }
}

function popup_resize(w,h) {
	window.moveTo(50, 50);
	var listBody =	document.body;
	
	var nWidth = w;
	var nHeight = h;
	var nHeightXP = 0;

	// »çÀÌÁî°¡ ÁöÁ¤µÇÁö ¾ÊÀº °æ¿ì(0)´Â body »çÀÌÁî·Î
	if ( nWidth == 0) {
		nWidth = listBody.scrollWidth;
	}

	if ( nHeight == 0) {
		nHeight = listBody.scrollHeight + 30;
	}

	// XPÀÎ °æ¿ì height 29 Ãß°¡
	if( window.navigator.userAgent.indexOf("SV1") != -1 ) {
		nHeightXP = 30;
	}
	
	if( window.navigator.userAgent.indexOf("7.") != -1 ) {
		nHeightXP += 45;
	}

	if(nHeight <= 800) {
		try{
		self.resizeTo(nWidth,nHeight + nHeightXP);
		} catch(e){}
	} else {
		try{
		self.resizeTo(nWidth,nHeight + nHeightXP);
		} catch(e) {}
	}
}

function goURL(url){
	if(opener){
		opener.location=url;
		self.close();
	}else{
		document.location.href=url;
	}
}

function showFlash(swfURL,width,height) { 
	document.write("<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="+ width +" height="+ height +">"); 
	document.write("<param name=movie value="+ swfURL +">"); 
	document.write("<param name=quality value=high>"); 
//	document.write("<param name=wmode value=transparent>"); 
	document.write("<embed src="+ swfURL +" quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width="+ width +" height="+ height +"></embed></object>");
}
/**
* ÁÖ¹Îµî·Ï¹øÈ£ ÃëÇÕ
*/
function mergeToJumin(juminObj,jumin1Obj,jumin2Obj){
	juminObj.value = jumin1Obj.value + jumin2Obj.value ;
	var nationalIdStr = juminObj.value;
	var g = nationalIdStr.substring(6, 7);
	var year = ((g > 2) ? "20" : "19") + nationalIdStr.substring(0,2);
	var month = nationalIdStr.substring(2,4);
	var day = nationalIdStr.substring(4,6);
	
	if (!is14AgeOver(year, month, day)) {
		editForm.action = "underCheck.do";
	}
}



	/*
    * ºÐ¸®ÀÚ¸¦ ÀÌ¿ëÇÏ¿© ³¯Â¥ÀÇ À¯È¿¼º Ã¼Å©
    * ¿¹) 2000.03.24 -> '.'À» ÀÌ¿ëÇÏ¿© Ã¼Å©ÇÑ´Ù.
    *@param inputDate Ã¼Å©ÇÒ ³¯Â¥
    *@param point ³â,¿ù,ÀÏ ºÐ¸®ÀÚ
    */
   function isDateCheck(inputDate, point){
       var dateElement = new Array(3);
       
       if(point != ""){
           dateElement = inputDate.split(point);
           if(inputDate.length != 10 || dateElement.length != 3){
               return false;
           }
       }else{
           dateElement[0] = inputDate.substring(0,4);
           dateElement[1] = inputDate.substring(4,6);
           dateElement[2] = inputDate.substring(6,9);
       }
       //³âµµ °Ë»ç
       if( !( 1800 <= dateElement[0] && dateElement[0] <= 4000 ) ) {
           return false;
       }

       //´Þ °Ë»ç
       if( !( 0 < dateElement[1] &&  dateElement[1] < 13  ) ) {
           return false;
       }

       // ÇØ´ç ³âµµ ¿ùÀÇ ¸¶Áö¸· ³¯
       var tempDate = new Date(dateElement[0], dateElement[1], 0);
       var endDay = tempDate.getDate();

       //ÀÏ °Ë»ç
       if( !( 0 < dateElement[2] && dateElement[2] <= endDay ) ) {
            return false;
       }

       return true;
   }

/**
ÅëÇÔ°Ë»ö 
*/
function doSearch(sf){
	if(sf.query.value=="" || sf.query.value=='°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä'){
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä"); sf.query.value=''; sf.query.focus();				
		return false;
	}
	return true;
}

function loginChk(sf){
	if(!chkInput(sf.userId,"¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä")){
	 	return false; 
	}
	
	if(!chkInput(sf.userPassword,"ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä")){
		return false;
	} 
  	
	return true;
}

function check(sf){
	if(sf == null) sf= searchForm;
	if(sf.searchValue.value == ""){
		alert("°Ë»ö°ªÀ» ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	}
}
///////////////////////////////////////////////////////////////
// µå¸²À§¹ö°øÅëÇÔ¼ö
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
  	x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/* ÀÌ¹ÌÁö·Ñ¿À¹ö */

function rollOver(){
	this.init = function(obj, dis, overName){
		//alert(obj+'\n'+ dis+'\n'+ overName);
		if (!obj) return false;
		var outName = "Off.gif";
		var overName = (overName ? overName : "On.gif");
		var objEl = obj.getElementsByTagName("a");
		for (i=0; i<objEl.length; i++) {
			img = objEl[i].getElementsByTagName("img")[0];
			Event.observe(objEl[i], 'mouseover', function(){
				if(this.childNodes[0].className!="on") this.childNodes[0].src = this.childNodes[0].src.replace(outName, overName);
			});
			Event.observe(objEl[i], 'mouseout', function(){
				if(this.childNodes[0].className!="on") this.childNodes[0].src = this.childNodes[0].src.replace(overName,outName);
			});
		}
	}
	this.set = function(){
		
	}
}


/* ÅÇ¸Þ´º  */
function useTab(wrapId, btnTag, contTag){
	this.wrapId = wrapId;
	this.btnTag = (!btnTag ? 'h2' : btnTag);
	this.contTag = (!contTag ? 'ul' : contTag);
	$(this.wrapId).addClassName('script');
	/* */
	this.menus = $$("#"+this.wrapId+" "+this.btnTag);
	for (var i=0; i < this.menus.length; i++){
		var my = this;	
		this.menus[i].down('a').observe('mouseover', function(event){my.focusEvent(event)});
		this.menus[i].down('a').observe('focus', function(event){my.focusEvent(event)});
		if(i==0) this.menus[i].next(this.contTag).addClassName('block');
		else {
			this.menus[i].next(this.contTag).addClassName('none');
			if(this.menus[i].down('img')) this.menus[i].down('img').src = this.menus[i].down('img').src.replace("On.gif", "Off.gif");
		}
	}
}

useTab.prototype = {
	focusEvent:function(e){
		this.menus = $(this.wrapId).getElementsByTagName(this.btnTag);	
		var menu = (window.event ? event.srcElement : e.target);
		if(menu.tagName!="A") menu = menu.parentNode;//IE 
		if(menu.tagName==this.btnTag) menu = menu.down('a');//IE 
		for (var i=0; i < this.menus.length; i++){
			//alert(menus[i].tagName + menu.tagName);
			if(this.menus[i].down('a')==menu || this.menus[i]==menu){				
				if(menu.down('img')) menu.down('img').src = menu.down('img').src.replace("Off.gif", "On.gif");
				menu.parentNode.style.zIndex = 2; //index 
				menu.addClassName('on');
				menu.parentNode.next(this.contTag).removeClassName('none');
				menu.parentNode.next(this.contTag).addClassName('block');
				if(menu.parentNode.next('p')) menu.parentNode.next('p').style.display = 'block';
			}
			else {
				var my = this;
				my.reset(this.menus[i].down('a'));
				if(this.menus[i].next('p')) this.menus[i].next('p').style.display = 'none';
			}
		}
	},
	reset:function(menu){
		if(menu.down('img')) menu.down('img').src = menu.down('img').src.replace("On.gif", "Off.gif");
		menu.parentNode.style.zIndex = 0;
		menu.removeClassName('on');
		menu.parentNode.next(this.contTag).addClassName('block');
		menu.parentNode.next(this.contTag).addClassName('none');
	}
}

function openWebtvView( multimId, url ){
	if(url!="" && url.indexOf("http://")>-1){
		var popWebtvView = window.open('/webtvnew/common/view.do?multimId='+multimId, 'popWebtvView','width=800, height=527, left=0, top=0, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, copyhistory=no, resizable=no');
		popWebtvView.focus();
	}else{
		document.location.href = "/webtvnew/custom/view.do?multimId="+multimId;
	}
}
//cme ÇÐ¼úÇà»ç´Ù½Ãº¸±â ¹× ¿µ»óÀÚ·á º¸±â
function openMovView( movType, multimId, parameter, vodYn ){
	if(typeof(movType)=="undefined")	return;
	if(movType=="H"){
		var popWebtvView = window.open('/webtvnew/common/viewCme.do?multimId='+multimId, 'popWebtvView','width=800, height=527, left=0, top=0, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, copyhistory=no, resizable=no');
		popWebtvView.focus();
	}else{
		if(vodYn == "Y"){
			document.location.href = "/cme/vod/view.do?multim_id="+multimId+parameter;
		}else{
			document.location.href = "/cme/replay/view.do?multim_id="+multimId+parameter;
		}
	}
	
}
