<!--
function fncReady(){
		alert("[ CTS ±âµ¶±³ TV ]    \n\n¼­ºñ½º ÁØºñÁßÀÔ´Ï´Ù.   \n\nÁË¼ÛÇÕ´Ï´Ù.    ");
}
//****************************************************
// ?? ?¿ì±â
//****************************************************		
function fncOpenInfo(url,w,h)
{
	shape = 'width=' + w + ',height=' + h + ',';
	shape += "toolbar=no,location=no,directories=no,status=no,";
	shape += "menubar=no,scrollbars=no,resizable=no";
	open(url, "info", shape);
} 

//****************************************************
// µ¿¿µ»ó ?±â (·Î±×ÀÎ ÇØ¾ß º¼? ?? °Å)left=200
//****************************************************		
//function fncViewMov(prmSrc,prmTop,prmLeft){
//	window.open("/_sysprog/cmn_viewmov.asp?src="+prmSrc,'1',"personalbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=360,height=500,top=" + prmTop + ",left=" + prmLeft);
//}

function fncViewMovOpen(prmDPID, prmQlty){
  	fncViewMovOpen(prmDPID, prmQlty, 1)
}
function fncViewMovOpen2(prmDPID, prmQlty){
  	fncViewMovOpen2(prmDPID, prmQlty, 1)
}
function fncViewMovOpen(prmDPID, prmQlty, prmOrd){
	     
  		window.open("../../com_mod/vod/player.html?article_id="+prmDPID+"&homeid="+ prmQlty + "&Ord="+ prmOrd,'vod',"personalbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=734,height=588,top=0,left=0");	  	
}
function fncViewMovOpen2(prmDPID, prmQlty, prmOrd){
	     
  		window.open("../../com_mod/vod/aodplayer.html?article_id="+prmDPID+"&homeid="+ prmQlty + "&Ord="+ prmOrd,'vod',"personalbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=734,height=588,top=0,left=0");	  	
}
//****************************************************
// µ¿¿µ»ó ?±â  (·Î±×ÀÎ ?? º¼? ?? °Å)left=200
//****************************************************		
function fncViewMovOpen_1(prmDPID, prmQlty, prmCate){
  		window.open("/vodplayer/viewmov.asp?DPID="+prmDPID+"&Qlty="+ prmQlty+"&Cate="+ prmCate,'1',"personalbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=360,height=500,top=200,left=5");	  	
}
//****************************************************
// µ¿¿µ»ó ?±â  (·Î±×ÀÎ ?? º¼? ?? °Å)left=200
//****************************************************		
function fncViewMovSPOT(prmDPID, prmSPID, prmCate){
  		window.open("/vodplayer/viewmov_live.asp?DPID="+prmDPID+"&SPID="+ prmSPID+"&Cate="+ prmCate,'1',"personalbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=360,height=500,top=200,left=5");	  	
}
//****************************************************
// ¸ñ??¿¡? ÆíÁö?±â
//****************************************************		
function fncToPastro(s_mail,s_name){
	if (s_mail == ""){
		alert("¸ñ»ç´ÔÀÇ ¸ÞÀÏ ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù.");
		return;
	}
	var pWidth = 460;		//pop up window width
	var pHeight = 350;	     	//pop up window height
	var pointX = (screen.availWidth - pWidth) * 0.5;
	var pointY = (screen.availHeight - pHeight) * 0.5;	
	searchwin=window.open("/progsm/sendmail_topastro.asp?s_mail="+ s_mail + "&s_name=" + s_name, "mailwin", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width="+pWidth+", height="+pHeight+", left=20, top=20"); 
}
//****************************************************
// Ä£?¿¡? Ãß??±â
//****************************************************		
function fncRecommand(){
	var pWidth = 460;		//pop up window width
 var pHeight = 430;	     	//pop up window height
	var pointX = (screen.availWidth - pWidth) * 0.5;
	var pointY = (screen.availHeight - pHeight) * 0.5;	
	searchwin=window.open("/progsm/recomand_mail.asp", "commwin", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width="+pWidth+", height="+pHeight+", left=20, top=20"); 
}
//****************************************************
// ¼º°æ???±â
//****************************************************		
function fncSermonFullText(s_pid, s_dpid)
{
	var pWidth = 476;		//pop up window width
	var pHeight = 509;	     	//pop up window height
	var pointX = (screen.availWidth - pWidth) * 0.5;
	var pointY = (screen.availHeight - pHeight) * 0.5;	
	searchwin=window.open("/progsm/sermon_read.asp?s_pid="+s_pid + "&s_dpid=" + s_dpid, "writingswin", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width="+pWidth+", height="+pHeight+", left=20, top=20"); 
}
//****************************************************
// ¼³±³ °Ë?
//****************************************************		
function searchDetail()
{
	var pWidth = 460;		//pop up window width
	var pHeight = 350;	     	//pop up window height
	var pointX = (screen.availWidth - pWidth) * 0.5;
	var pointY = (screen.availHeight - pHeight) * 0.5;	
	searchwin=window.open("/progsm/search_detail.asp", "searchwin", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width="+pWidth+", height="+pHeight+", left=20, top=20"); 
}

function fncRequest()
{
	var pWidth = 460;		//pop up window width
	var pHeight = 430;	     	//pop up window height
	var pointX = (screen.availWidth - pWidth) * 0.5;
	var pointY = (screen.availHeight - pHeight) * 0.5;	
	searchwin=window.open("/progsm/request.asp", "resultwin", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width="+pWidth+", height="+pHeight+", left=20, top=20"); 
}



// **** ³Î? (space) Ã¼??±â ?? *******

function is_null(str) {

 var result_str = "" ;
 // ³Î?? ?¾Ø ?·Î¿î ?? ¸¸µé±â À§ÇØ? º¯?¼±¾ð ¹× ?±âÈ­
 var i ;

 for(i = 0 ; i < str.length ; i++) {
	 // ³Ñ?¿Â ÀÎÀÚ? ?³ª¾¿ °Ë?ÇØ? ³Î?(space)?? ?? ?¾Ö?
	 if(str.charAt(i) == " ") {
	  }
	  else {
				 result_str = result_str + str.charAt(i) ;
	  }

 }

 if(result_str == "") {
	 // ??ÀûÀÎ ?? ³Î???
	return true ;
	// true ? ¸®ÅÏ
 }

	return false ;
	// ??ÀûÀÎ ?? ³Î?? ¾Æ??
	// false ? ¸®ÅÏ
}


// ************** ¼ýÀÚ ?? ÆÇº° ?? **************************************************************************************************

function is_number(str) {

 str = str.toUpperCase() ;
 // ??µÈ ?? ¸ðµÎ ´ë?ÀÚ·Î ¹Ù²Û´Ù (¾Æ?ÀÇ for?¿¡? ?ÀÚ?À§Ã¼? À§ÇØ?)
 var i ;

 for(i = 0 ; i < str.length ; i++) {
	 // ??µÈ?? ²À ¿µ?ÀÚ¿Í ¼ýÀÚÀÎÁö? ÆÇ??±âÀ§ÇØ? °¢°¢ÀÇ ?ÀÚ? ?³ª¾¿ Ã¼?ÇÑ´Ù.

	  if( (str.charAt(i) < "0") || (str.charAt(i) > "9") ) {
	  return false ;
	  // ¿¡??¼¼Áö ??
	  }

 }

 return true ;
 // ¿¡??¼¼Áö ??¾È?

}

// ************** ¿µ? ?? ÆÇº° ?? **************************************************************************************************

function is_eng(str) {

 str = str.toUpperCase() ;
 // ??µÈ ?? ¸ðµÎ ´ë?ÀÚ·Î ¹Ù²Û´Ù (¾Æ?ÀÇ for?¿¡? ?ÀÚ?À§Ã¼? À§ÇØ?)
 var i ;

 for(i = 0 ; i < str.length ; i++) {
	 // ??µÈ?? ²À ¿µ?ÀÎÁö¸¦ ÆÇ??±âÀ§ÇØ? °¢°¢ÀÇ ?ÀÚ? ?³ª¾¿ Ã¼?ÇÑ´Ù.

	  if( (str.charAt(i) < "A") || (str.charAt(i) > "Z") ) {
	  return false ;
	  // ¿¡??¼¼Áö ??
	  }

 }

 return true ;
 // ¿¡??¼¼Áö ??¾È?

}

// ***** ¿µ? + ¼ýÀÚ ?? ÆÇº° ?? *******************

function is_number_eng(str) {

 str = str.toUpperCase() ;
 // ??µÈ ?? ¸ðµÎ ´ë?ÀÚ·Î ¹Ù²Û´Ù (¾Æ?ÀÇ for?¿¡? ?ÀÚ?À§Ã¼? À§ÇØ?)
 var i ;

 for(i = 0 ; i < str.length ; i++) {
	 // ??µÈ?? ²À ¿µ?ÀÎÁö¸¦ ÆÇ??±âÀ§ÇØ? °¢°¢ÀÇ ?ÀÚ? ?³ª¾¿ Ã¼?ÇÑ´Ù.

	  if( ((str.charAt(i) < "A") || (str.charAt(i) > "Z")) && ((str.charAt(i) < "0") || (str.charAt(i) > "9")) ) {
	  return false ;
	  // ¿¡??¼¼Áö ??
	  }

 }

 return true ;
 // ¿¡??¼¼Áö ??¾È?

}

// *** ³Î? ??? ¿¡? ?? **************

function is_null_error(str) {

 var i ;

 for(i = 0 ; i < str.length ; i++) {

	  if(str.charAt(i) == " ") {
	  return true ;
	  }

}

	  return false ;

}


// ************** ??ÀÏ ?? ÆÇº° ?? ************************************************************************************************

function email_check(email) {

	if (!is_null(email)) {

	  var filter=/^.+@.+\..{2,3}$/ ;
	  // °ø??? ?ÇØÇÒ·Á? ?Áö¸»°Í
	  if (filter.test(email)) {
	  return true ;
	  // ?¹Ù¸¥??ÀÏ
	  } else{
	  return false ;
	  // ?Áö¾Ê???ÀÏ
	  }

 } else {

		 if (is_null_error(email)) {
		 return false ;
		 }

		 return true ;
 }

}


//****************************************************
	// ?? ?? ??¿¡ ´ëÇÑ validation Ã¼?
	//****************************************************
	function check_string(str_label, obj, str_allow_char, from_len, to_len) {
	    if(! check_char(str_label, obj, str_allow_char)) return false;
	    if(! check_len(str_label, obj, from_len, to_len)) return false;
	    return true;
	}
	
	//****************************************************
	// ¼±ÅÃ ?? ??¿¡ ´ëÇÑ validation Ã¼?
	//****************************************************	
	function check_string_choose(str_label, obj, str_allow_char, from_len, to_len) {
	    if(! check_char(str_label, obj, str_allow_char)) return false;
	    if(! check_len_1(str_label, obj, from_len, to_len)) return false;
	    return true;
	}
	
	//****************************************************
	// °°? ?ÀÚ? ??Áö Ã¼?
	//****************************************************		
	function check_same_string(str_label1, obj1, str_label2, obj2) {
		if (obj1.value != obj2.value) {
			alert(str_label1+"¿Í "+str_label2+"°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.\n´Ù½Ã È®ÀÎÇØ ÁÖ¼¼¿ä.");
			obj2.select();obj2.focus();
			return false;
		}
	    return true;
	}
	
	//****************************************************
	// ?? ?ÀÚ ?À§¿¡ ÇØ´ç??Áö Ã¼?
	//****************************************************		
	function check_char(str_label, obj, str_allow_char) {
	    var i;
	    var msg_str;
	    var str_org = obj.value;
	    var len_org = str_org.length;
	
	    if (str_allow_char.length > 1) {
	        for (i=0; i<len_org; i++) {
	            if (str_allow_char.indexOf(str_org.charAt(i)) == -1) {
	                alert("'"+str_org.charAt(i)+"' ? ??µÇÁö ¾Ê? ?ÀÚ ??´Ù..");
	               // alert(str_label +" ¸¦ ???¼Å¾ß ??´Ù.");
	                obj.focus();
	                return false;
	            }
	        }
	    }
	    return true;
	}
	
	//****************************************************
	//?ÀÚ? ±æ? Ã¼?+ null Ã¼?
	//****************************************************			
	function check_len(str_label, obj, from_len, to_len) {
	    var str_org = obj.value;
	    //var len_org = str_org.length;
	    var len_org = get_bytes(obj.value)
	
	    // null Ã¼?
	    if (len_org < 1) {
	        alert (str_label+"À»[¸¦] ÀÔ·ÂÇÏ¼¼¿ä.");
	        obj.focus();
	        return false;
	    }
	    
	    if (len_org < from_len || len_org > to_len) {
	        if (from_len == to_len) {
	            msg_str = from_len;
	        } else {
	            msg_str = from_len + " ~ "+to_len;
	        }
	        alert (str_label+"´Â "+ msg_str +"ÀÚ¸® ÀÔ´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØÁÖ¼¼¿ä.")
	
	        obj.select();
	        obj.focus();
	        return false;
	    }
	    return true;
	}   
	
	//****************************************************
	//?ÀÚ? ±æ? Ã¼?
	//****************************************************	
	function check_len_1(str_label, obj, from_len, to_len) {
	    var str_org = obj.value;	    
	    var len_org = get_bytes(obj.value)
		
		// ??µÈ ?ÀÚ? null? ¾Æ? °æ¿ì
	    if (len_org > 1) {	       
		    if (len_org < from_len || len_org > to_len) {
		        if (from_len == to_len) {
		            msg_str = from_len;
		        } else {
		            msg_str = from_len + " ~ "+to_len;
		        }
		        alert (str_label+"´Â "+ msg_str +"ÀÚ¸® ÀÔ´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØÁÖ¼¼¿ä.")
		
		        obj.select();
		        obj.focus();
		        return false;
		    }
	  	}
	    return true;
	}   

	//****************************************************
	//³¯? Ã¼?
	//****************************************************		
	function check_date(str_label, obj, yyyy, mm, dd) {
		var chk_date, rtn_value;
		
		chk_date = new Date(yyyy,parseInt(mm)-1,dd);

		if (chk_date.getDate() == parseInt(dd, 10)) {
			rtn_value = true;
		} else {
			rtn_value = false;
			alert (str_label +"¹Ù¸£Áö ¾Ê½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			obj.focus();
		}
		
		return rtn_value;
	}
	
	//****************************************************
	//??ÀÏ Ã¼?
	//****************************************************	
	function check_email(obj){		
		var ema, cnt ;
		ema = obj.value; 
		cnt = 0; 
		
		if (ema != ""){
			for (i=0;i<ema.length;i++) { 
				if (ema.charAt(i)=="@") { 
					cnt++; 
				} 
			} 
			if (cnt!="1") {
				alert("¹Ù¸¥ ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ Àû¾îÁÖ¼¼¿ä."); 				
				obj.focus(); 
				return false; 
			} 
// ÇÑ?ÀÏÃ¼?	
//			var tempchr = obj.value.toUpperCase();
//			if (tempchr.indexOf("HANMAIL.")>0 || tempchr.indexOf("DAUM.")>0) { 
//				alert("ÇÑ?ÀÏ ÁÖ¼Ò? ??ÇÒ ? ?½À?´Ù."); 
//				obj.focus(); 
//				return false; 
//			}
		}
		return true; 
	}
	
	//****************************************************
	//ÁÖ¹Î?? ??¼º Ã¼?
	//****************************************************
	function check_jumin(obj1, obj2){
		if  (obj1.value != "") {
			if (obj2.value == "" ){
				alert("ÁÖ¹Î?? ?ÀÚ¸®¸¦ ???¼¼?.");
				obj2.focus();
				return false;
			} else {
				var a1=obj1.value.substring(0,1)
				var a2=obj1.value.substring(1,2)
				var a3=obj1.value.substring(2,3)
				var a4=obj1.value.substring(3,4)
				var a5=obj1.value.substring(4,5)
				var a6=obj1.value.substring(5,6)
		
				var check_digit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7
		
				var b1=obj2.value.substring(0,1)
				var b2=obj2.value.substring(1,2)
				var b3=obj2.value.substring(2,3)
				var b4=obj2.value.substring(3,4)
				var b5=obj2.value.substring(4,5)
				var b6=obj2.value.substring(5,6)
				var b7=obj2.value.substring(6,7)
		
				var check_digit=check_digit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5 
		
				check_digit = check_digit%11
				check_digit = 11 - check_digit
				check_digit = check_digit%10
		
				if (check_digit != b7){
					alert('Àß¸øµÈ ÁÖ¹Îµîµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
					obj1.focus();
					obj1.select();
					return false ; 
				}
			}
		}
		return true;
	}

	//****************************************************
	//byte  ±æ? Ã¼?
	//****************************************************		
	function get_bytes(str_org) {
		var msglen = 0;
		var temp = "";
		var i = 0;
		var total_bytes=0;
		
		msglen = str_org.length;
		for(i=0;i<msglen;i++) {
			temp = str_org.charAt(i);
	
			if (escape(temp).length > 4) {
				total_bytes += 2;
			} else {
				total_bytes ++;
			}
		}
		
		return total_bytes;
	}
	
// ************** ¸ñÈ¸?? ±Û?±â Ã¢ ?¿ì±â ************************************************************************************************

   function fncGoPLBWrite(prmGbCode,prmMod,prmNum){
	   window.open("/PLB/write.asp?GbCode=" + prmGbCode +"&hdnMod="+ prmMod + "&NUM="+ prmNum, "PLBW", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=502, height=465, left=20, top=20"); 
   }

// ************** ¸ñÈ¸?? Q&A ±Û?±â Ã¢ ?¿ì±â ************************************************************************************************

   function fncGoQnaPLBWrite(prmMod,prmNum){
	   window.open("/PLB/qnawrite.asp?hdnMod="+ prmMod + "&NUM="+ prmNum, "PLBqnaW", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=502, height=465, left=20, top=20"); 
   }

   
//****************************************************
// **** ??Ã¢ ?±â ÀÚµ¿?Àý
//****************************************************

function WindowReset( win  /*??¿ì°³Ã¼*/){ 
   
  var winBody = win.document.body; 
  
  // 
  // ?Ã¢ÀÇ ??Áî¿¡ ?ÇØ? marginWidth¿Í marginHeight 
  // 
  var marginHeight = parseInt(winBody.topMargin)+parseInt(winBody.bottomMargin); 
  var marginWidth = parseInt(winBody.leftMargin)+parseInt(winBody.rightMargin); 
  // 
  // ?Ã¢ÀÇ ??Áî ¼³? 
  // 
  var wid = winBody.scrollWidth + (winBody.offsetWidth - winBody.clientWidth) + marginWidth-5; 
  var hei = winBody.scrollHeight + (winBody.offsetHeight - winBody.clientHeight) + marginHeight+17; 
  // 
  // ??Áî Àç?? 
  // 
  win.resizeTo(wid, hei); 
} 

// »óÀ§ ??? ?±â ?Àý
function fncIframeReset(prmPIframe){ 


				var fo_PageWholeDiv = document.all? document.all["page_content"] : document.getElementById("page_content") ;

				fo_PageWholeDiv.style.top=0 ;
				fo_PageWholeDiv.style.left=0 ;

				pagelength=fo_PageWholeDiv.offsetHeight; 
				pagewidth=fo_PageWholeDiv.offsetWidth ;
				parent.document.getElementById(prmPIframe).style.height = pagelength;
				parent.document.getElementById(prmPIframe).style.width = pagewidth;			
} 

function fncCheckAll(prmAll, prmItem){
 		    var objAll = eval("document.all? document.all['" + prmAll + "'] : document.getElementById('" + prmAll + "')");
			var objItem = eval("document.all? document.all['" + prmItem + "'] : document.getElementById('" + prmItem + "')");
			if(objItem == undefined){
				// object? ¾Æ??
				return;
			}else{
				// object ÀÏ?
				if(isNaN(objItem.length)){
				// object ¹è?ÀÎ?? ???
								if(objAll.checked == true){
											   objItem.checked = true;
								}else{
											   objItem.checked = false;
								}
				}else{
				// object ¹è?ÀÎ?? ???
								if(objAll.checked == true){
											for(var i = 0; i < objItem.length ; i++){
											   objItem[i].checked = true;
											}
								}else{
 										for(var i = 0; i < objItem.length ; i++){
											   objItem[i].checked = false;
											}
								}
				}
			}
}
//-->

// PNG ÆÄÀÏ Ç¥½Ã ½ºÅ©¸³Æ®
function setPng24(obj) { 
  obj.width=obj.height=1; 
  obj.className=obj.className.replace(/\bpng24\b/i,''); 
  obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
  obj.src='';  
  return ''; 
}

