/*
 * IEÀÇ »õ·Î¿î ActiveXÁ¤Ã¥¿¡ ÀÇÇØ Object´Â document.write½ºÅ©¸³Æ®¸¦ È°¿ëÇÏ¿©¾ß ÇÑ´Ù.
 * ÀÛ¼ºÀÚ : 2006.04.18 ÇöÁØ¾Æºü
 * 
 * String src : ÇÃ·¡½¬ ÁÖ¼Ò [ÇÊ¼ö]
 * int w : ÇÃ·¡½¬ Æø [ÇÊ¼ö]
 * int h : ÇÃ·¡½¬ ³ôÀÌ [ÇÊ¼ö]
 * wmode : [¼±ÅÃ]
 * menu : [¼±ÅÃ]
 */
function writeFlash(src,width,height,wmode,menu) {
	var html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	html = html + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ width + '" height="' + height + '">';
	html = html + '<param name="movie" value="' + src + '">';
	if(wmode != null) {	html = html + '<param name="wmode" value="' + wmode + '">';	}
	if(menu != null) {	html = html + '<param name="menu" value="' + menu+ '">';	}
	html = html + '<param name="quality" value="high">';
	html = html + '<embed src="' + src + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>';
	html = html + '</object>';

	document.write(html);		
}

/*
 * IEÀÇ »õ·Î¿î ActiveXÁ¤Ã¥¿¡ ÀÇÇØ Object´Â document.write½ºÅ©¸³Æ®¸¦ È°¿ëÇÏ¿©¾ß ÇÑ´Ù.
 * ÀÛ¼ºÀÚ : 2006.10.12 ÇöÁØ¾Æºü
 * 
 * String src : µ¿¿µ»ó ÁÖ¼Ò [ÇÊ¼ö]
 * int w : µ¿¿µ»ó Æø [ÇÊ¼ö]
 * int h : µ¿¿µ»ó ³ôÀÌ [ÇÊ¼ö]
 */
function writeVod(src,width,height) {
	var html = "<OBJECT ID='MediaPlayer'codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' Version='6,4,5,715'standby='Loading Microsoft Windows Media Player components...'type='application/x-oleobject'width='" + width + "' height='" + height + "'>";
	html = html + "<PARAM NAME='FileName' VALUE='" + src + "'>";
	html = html + "<PARAM NAME='AnimationatStart' VALUE='false'>";
	html = html + "<PARAM NAME='TransparentatStart' VALUE='true'>";
	html = html + "<PARAM NAME='AutoStart' VALUE='true'>";
	html = html + "<PARAM NAME='AutoSize' VALUE='false'>";
	html = html + "<PARAM NAME='ShowControls' VALUE='true'>";
	html = html + "<PARAM NAME='ShowStatusBar' VALUE='false'>";
	html = html + "<PARAM NAME='Volume' value='-600'>";
	html = html + "<PARAM NAME='EnableFullScreenControls' value='true'>";
	html = html + "<PARAM NAME='AllowChangeDisplaySize' value='false'>";
	html = html + "</OBJECT>";		
	
	document.write(html);		
}

/*
 * IEÀÇ »õ·Î¿î ActiveXÁ¤Ã¥¿¡ ÀÇÇØ Object´Â document.write½ºÅ©¸³Æ®¸¦ È°¿ëÇÏ¿©¾ß ÇÑ´Ù.
 * ÀÛ¼ºÀÚ : 2006.04.18 ÇöÁØ¾Æºü
 * 
 * String classid : ÅÂ±×ÇÁ¸® ID [ÇÊ¼ö]
 */
function writeTagfree(classid,width,height) {
	html = '<object classid="' + classid + '" id="twe" style="width:' + width + ';height:' + height + '"> ';
	html = html + '<param name="InitFile" value="/contents/assist/tagfree/env.xml">';
	html = html + '<param name="ApplyInitData" value="1"><param name="Mode" value="0">';
	html = html + '</object>';
	document.write(html);		
}


/*
 * IEÀÇ »õ·Î¿î ActiveXÁ¤Ã¥¿¡ ÀÇÇØ Object´Â document.write½ºÅ©¸³Æ®¸¦ È°¿ëÇÏ¿©¾ß ÇÑ´Ù.
 * ÀÛ¼ºÀÚ : 2006.04.18 ÇöÁØ¾Æºü
 * 
 * str : Ãß°¡³»¿ë
 */
function writeObject(str) {
	document.write(str);		
}

/*
  »õ·Î¿î ÆË¾÷Ã¢À» ¶ç¿ó´Ï´Ù.
  String url : ÆË¾÷¹®¼­ÀÇ °æ·Î
  String name : ÆË¾÷Ã¢ÀÇ ÀÌ¸§
  int w : ÆË¾÷Ã¢À» Æø
  int h : ÆË¾÷Ã¢ÀÇ ³ôÀÌ
  int x : ÆË¾÷Ã¢ÀÇ ÁÂÃø »ó´ÜÀÇ xÁÂÇ¥
  int y : ÆË¾÷Ã¢ÀÇ ÁÂÃø »ó´ÜÀÇ yÁÂÇ¥
  String s : ÆË¾÷Ã¢¿¡ ½ºÅ¬·Î¹Ù Ç¥½Ã¿©ºÎ('no' : Ç¥½Ã¾ÈÇÔ, 'yes' : Ç¥½ÃÇÔ)
*/
function popup(url, name, w, h, x, y, s) {
	var opt = ',menubar=0,status=0,resizable=0,directories=0,toolbar=0,location=0,';
	if(x == null) x = "10";
	if(y == null) y = "10";
	if(s == null) s = "0";
	p_win = window.open(url, name,
		'width=' + w + ',height=' + h + ',left=' + x + ',top=' + y + ',scrollbars=' + s + opt);

	if(p_win == null)
	{
		window.alert("ÆË¾÷À» Çã¿ëÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
		return;
	}

	p_win.focus();
	this.name = 'cnportal';
	return p_win;
}

/*
 * È­¸éÀÇ Áß¾Ó¿¡ ÆË¾÷Ã¢À» ¶ç¿ó´Ï´Ù.
 *
 * String url : ÆË¾÷¹®¼­ÀÇ °æ·Î [ÇÊ¼ö]
 * String name : ÆË¾÷Ã¢ÀÇ ÀÌ¸§ [default:"nWin"]
 * int w : ÆË¾÷Ã¢ÀÇ Æø [default:300]
 * int h : ÆË¾÷Ã¢ÀÇ ³ôÀÌ [default:300]
 * String s : ÆË¾÷Ã¢¿¡ ½ºÅ¬·Î¹Ù Ç¥½Ã¿©ºÎ('no' : Ç¥½Ã¾ÈÇÔ, 'yes' : Ç¥½ÃÇÔ, [default:"no"])
 */
function popupCenter(url, name, w, h, s) {
	if(url == null) return;
	_name = arguments[1] != null ? arguments[1] : "nWin";
	_w = arguments[2] != null ? arguments[2] : "300";
	_h = arguments[3] != null ? arguments[3] : "300";
	_x = (screen.width / 2) - (_w / 2);
	_y = (screen.height / 2) - (_h / 2);
	_s = arguments[4] == "yes" ? "yes" : "no";
	var opt = ',menubar=no,status=no,resizable=no,directories=0,toolbar=0,location=0,';
	p_win = window.open(url, _name,
			'width=' + _w + ',height=' + _h + ',left=' + _x + ',top=' + _y + ',scrollbars=' + _s + opt);
	p_win.focus();
	this.name = 'cnedu';
	return p_win;
}

/*
  »õ·Î¿î Ã¢À» ¶ç¿ó´Ï´Ù.
  String url : »õÃ¢¹®¼­ÀÇ °æ·Î
  Stirng name : »õÃ¢ÀÇ ÀÌ¸§
  int w : »õÃ¢ÀÇ Æø
  int h ; »õÃ¢ÀÇ ³ôÀÌ
  int x ; »õÃ¢ÀÇ ÁÂÃø »ó´ÜÀÇ xÁÂÇ¥
  int y : ÆË¾÷Ã¢ÀÇ ÁÂÃø »ó´ÜÀÇ yÁÂÇ¥
*/
function newwindow(url, name, w, h, x, y) {
	var opt = 'menubar=1,status=1,resizable=1,directories=1,toolbar=1,location=1,scrollbars=1';
	if(x == null) x = "10";
	if(y == null) y = "10";
	//p_win = window.open(url, name,
	//	'width=' + w + ',height=' + h + ',left=' + x + ',top=' + y + ',opt);
	p_win = window.open(url, name, 'width=' + w + ',height=' + h + ',left=' + x + ',top=' + y + opt);
	p_win.focus();
	this.name = 'cnportal';
	return p_win;
}


/*
  ÄíÅ°ÀÇ Á¸Àç¿©ºÎ¿¡ µû¶ó popupÃ¢À» ¶ç¿ó´Ï´Ù.
  String c_name : ÄíÅ°¸í
  String url : ÆË¾÷¹®¼­ÀÇ °æ·Î
  String name : ÆË¾÷Ã¢ÀÇ ÀÌ¸§
  int w : ÆË¾÷Ã¢À» Æø
  int h : ÆË¾÷Ã¢ÀÇ ³ôÀÌ
  int x : ÆË¾÷Ã¢ÀÇ ÁÂÃø »ó´ÜÀÇ xÁÂÇ¥
  int y : ÆË¾÷Ã¢ÀÇ ÁÂÃø »ó´ÜÀÇ yÇ¥Ç¥
  String s : ÆË¾÷Ã¢¿¡ ½ºÅ¬·Î¹Ù Ç¥½Ã¿©ºÎ('no' : Ç¥½Ã¾ÈÇÔ, 'yes' : Ç¥½ÃÇÔ)

  #2003.11.18 silver_star
  String s_date : ½ÃÀÛÀÏ½Ã
  String e_date : Á¾·áÀÏ½Ã

  ½ÃÀÛÀÏ½Ã <= °Ô½ÃÀÏ < Á¾·áÀÏ½Ã
*/
function popupByCookie(c_name, url, name, w, h, x, y, s,s_date,e_date) {
	var cookie = getCookie(c_name);

	if(s_date != null && e_date != null) {
		var day = new Date();
		year = day.getYear();
		month = day.getMonth() + 1;
		date = day.getDate();
		hour = day.getHours();
		if(month < 10) month = "0" + month;
		if(date < 10) date = "0" + date;
		if(hour < 10) hour = "0" + hour;

		var c_date = year + "" + month + "" + date + "" + hour;

		c_date = parseInt(c_date);
		s_date = parseInt(s_date);
		e_date = parseInt(e_date);

		if((c_date >= s_date) && (c_date < e_date)) {
			if(!cookie) popup(url, name, w, h, x, y, s);
		}
	} else {
		if(!cookie) popup(url, name, w, h, x, y, s);
	}
}

/*
  ÄíÅ° »ý¼º ÇÔ¼ö
  String name : ÄíÅ°¸í
  String value : ÄíÅ° °ª
  int day : ÄíÅ°¸¸·á ±â°£(ÀÏ ´ÜÀ§)
*/
function setCookie(name, value, day) {
	if(day != null) {
	    var expDays = day;                // ¸¸·á ³¯Â¥ ¼ÂÆÃ
    	var exp = new Date();
    	exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
    	var expire_date = new Date(exp);
	    document.cookie = name + "=" + value + "; domain=.chungnam.net ; expires=" + expire_date.toGMTString()+ "; path=/";
	} else {
		document.cookie = name + "=" + value + "; domain=.chungnam.net ; path=/";
	}
}

/*
  ÄíÅ° ¼Ò¸ê ÇÔ¼ö
  String name : ¼Ò¸ê½ÃÅ³ ÄíÅ°¸í
*/
function clearCookie(name) {
    var today = new Date()
    //¾îÁ¦ ³¯Â¥¸¦ ÄíÅ° ¼Ò¸ê ³¯Â¥·Î ¼³Á¤ÇÑ´Ù.
    var expire_date = new Date(today.getTime() - 60*60*24*1000)
    //document.cookie = name + "= " + "; expires=" + expire_date.toGMTString() + "; path=/";
    document.cookie = name + "= " + "; domain=.chungnam.net ; path=/";
}

/*
  ÄíÅ°¸¦ °¡Á®¿À´Â ÇÔ¼ö
  String name : ÄíÅ°¸í
*/
function getCookie(name) {
   var from_idx = document.cookie.indexOf(name+'=');
   if (from_idx != -1) {
      from_idx += name.length + 1
      to_idx = document.cookie.indexOf(';', from_idx)

      if (to_idx == -1) {
            to_idx = document.cookie.length
      }
      return unescape(document.cookie.substring(from_idx, to_idx))
   }
}

/*
  Ã¼Å© »óÅÂ¿¡ µû¶ó ÄíÅ° »ý¼º°ú ¼Ò¸êÀ» Á¦¾îÇÏ´Â ÇÔ¼ö
  checkboxÀÇ Event HandlerÀÎ onClickÀÌº¥Æ®¿¡ µî·ÏÇØ¼­ »ç¿ëÇÕ´Ï´Ù.
  ex) <input type="checkbox" onClick="controlCookie(this, 'cName')">
  Form.checkbox frmObj : input typeÀÌ 'checkbox'ÀÎ Form Object
  ex) checkbox¸¦ »ç¿ëÇÏÁö ¾Ê´Â°æ¿ì use¿¡ °ªÀ» ºÎ¿©ÇÑ´Ù.
*/
function controlCookie(frmObj, name, day,use) {
	  if ((frmObj.checked) || (use != null)) {
        //Ã¼Å© ¹Ú½º¸¦ ¼±ÅÃÇßÀ» °æ¿ì ÄíÅ° »ý¼º ÇÔ¼ö È£Ãâ
        setCookie(name,"true", day);
        self.close();
    }
    else {
        //Ã¼Å© ¹Ú½º¸¦ ÇØÁ¦ÇßÀ» °æ¿ì ÄíÅ° ¼Ò¸ê ÇÔ¼ö È£Ãâ
        clearCookie(name);
    } 
    return
}


/*
 Áñ°ÜÃ£±â Ãß°¡
*/
 function Bookmark(){
  if (document.all){
	  url="http://www.chungnam.net/";
	  title = "ÃæÃ»³²µµ È¨ÆäÀÌÁö(Ãæ³²³Ý)";
	  //title = document.title;
	  //url = "http://" + self.location.hostname
		window.external.AddFavorite(url ,title);
	}
}

// ########################################################################## //
//                                                                            //
//                              ³¯ÀÚ°ü·Ã À¯Æ¿¼º ÇÔ¼öµé                        //
//                                                                            //
// ########################################################################## //
// ¿ùº° ¸¶Áö¸· ÀÏÀÚ
var lastdays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

/**
* °¢ ´ÞÀÇ ¸¶Áö¸· ÀÏÀÚ¸¦ ¹ÝÈ¯ÇÕ´Ï´Ù.
* theDate°¡ Æ÷ÇÔµÇ´Â ³¯ÀÚÀÇ ¸¶Áö¸· ÀÏÀÚ¸¦ ±¸ÇÕ´Ï´Ù.
* theDateÀÇ Çü½ÄÀÌ ¿Ã¹Ù¸£Áö ¾Ê´Ù¸é ÀÌ¹ø´ÞÀÇ ¸¶Áö¸· ³¯ÀÚ¸¦ Ç¥½ÃÇÏ´Â Date°´Ã¼¸¦ ¹ÝÈ¯ÇÕ´Ï´Ù.
*/
function getLastDay(theDate) {
	if((theDate.getMonth() < 0) || (theDate.getMonth() > 11)) {
		return getLastDay(new Date());
	} else if(theDate.getMonth() == 1) {
		if((((theDate.getYear() % 4) == 0) && ((theDate.getYear() % 100) != 0)) ||
			((theDate.getYear() % 400) == 0)) {
			return 29;
		} else {
			return 28;
		}
	} else {
		return lastdays[theDate.getMonth()];
	}
}

/**
* ÁÖ¾îÁø Date°´Ã¼ÀÇ num_day¸¸Å­ÀÇ ÀÌÀü ³¯ÀÚÀÇ Date°´Ã¼¸¦ ¹ÝÈ¯ÇÕ´Ï´Ù.
* theDate : Date°´Ã¼
* num_day : ¾çÀÇ Á¤¼ö
*/
function theDayBefore(theDate, num_day) {
	r_date = new Date();
	r_date.setTime(theDate.getTime() - (num_day * 1000 * 60 * 60 * 24));
	return r_date;
}

/**
* ÁÖ¾îÁø Date°´Ã¼ÀÇ num_day¸¸Å­ÀÇ ÀÌÈÄ ³¯ÀÚÀÇ Date°´Ã¼¸¦ ¹ÝÈ¯ÇÕ´Ï´Ù.
* theDate : Date°´Ã¼
* num_day : ¾çÀÇ Á¤¼ö
*/
function theDayAfter(theDate, num_day) {
	r_date = new Date();
	r_date.setTime(theDate.getTime() + (num_day * 1000 * 60 * 60 * 24));
	return r_date;
}

/**
* ÁÖ¾îÁø Date°´Ã¼°¡ Æ÷ÇÔµÈ ÁÖÀÇ ÇØ´ç ¿äÀÏÀÇ Date°´Ã¼¸¦ ±¸ÇÕ´Ï´Ù.
* ¿äÀÏÀº ÀÏ,¿ù,È­,¼ö,¸ñ,±Ý,ÅäÀÇ ¼øÀ¸·Î °¢°¢ 0~6±îÁöÀÇ ¼ýÀÚ·Î Ç¥ÇöÇÕ´Ï´Ù.
*/
function theDayWeek(theDate, week) {
	r_date = new Date();
	r_date.setTime(theDate.getTime());
	if(r_date.getDay() > week) {
		return theDayBefore(r_date, r_date.getDay() - week);
	} else if(r_date.getDay() < week) {
		return theDayAfter(r_date, week - r_date.getDay());
	} else {
		return r_date;
	}
}



/**
* pdaÈ¨ÆäÀÌÁö Open
*/
function pdaView()
{
	var href = "http://www.chungnam.net/content/pda/";
	var width = 721, height = 673;
	var sleft = (screen.width - width) / 2;
	var stop = (screen.height - height) / 2;

	var style = "left="+sleft+",top="+stop+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height+"";
	window.open(href,'openWin',style);	
}


/**
* ¸ÞÀÏº¸³»±â 
*/
function commonSendMail(name,mail) {
	var url = "/content/mail/assist/mail/mail_001.html?txtToName=" + name + "&txtToMail=" + mail;
	popup(url, name, 600, 485, 10, 10, 'yes');
}


/*
 * ÇöÀç ÆäÀÌÁö¸¦ ¸ÞÀÏº¸³»±â Çü½ÄÀ¸·Î º½
 * ¼öÁ¤ : 20040522 | silver_star@hanmail.net | /content/popups¿¡¼­ ¸ÞÀÏÀ» ¹ß¼ÛÇÏ´Â °æ¿ì Ã³¸®
 */
function sendMail() {
	var uri = window.location.pathname;
	if(uri.indexOf("/content/popups") == -1) {
		uri = "/content/mail" + uri.substring(uri.indexOf("/", 1), uri.length);
	} else {
		uri = "/content/mail" + uri.substring(uri.indexOf("/", "/content/popups".length), uri.length);
	}	
	popup(uri + window.location.search, "mail", 635, 600, 170, 50, "yes");
}

/*
 * ÇöÀç ÆäÀÌÁö¸¦ ÇÁ¸°Æ® Çü½ÄÀ¸·Î º½
 * ¼öÁ¤ : 20040522 | silver_star@hanmail.net | /content/popups¿¡¼­ ÇÁ¸°Æ®ÇÏ´Â °æ¿ì Ã³¸® 
 */
function sendPrint() {
	var uri = window.location.pathname;
	if(uri.indexOf("/content/popups") == -1) {
	  uri = "/content/print" + uri.substring(uri.indexOf("/", 1), uri.length);
	} else {
		uri = "/content/print" + uri.substring(uri.indexOf("/", "/content/popups".length), uri.length);
	}	
	popup(uri + window.location.search, "print", 635, 600, 170, 50, "yes");
}

function sendMail1() {
	var uri = window.location.pathname;
	if(uri.indexOf("/content/popups") == -1) {
		uri = "/content/mail" + uri.substring(uri.indexOf("/", 1), uri.length);
	} else {
		uri = "/content/mail" + uri.substring(uri.indexOf("/", "/content/popups".length), uri.length);
	}	
	popup(uri + window.location.search, "mail", 735, 700, 170, 50, "yes");
}

/*
 * ÇöÀç ÆäÀÌÁö¸¦ ÇÁ¸°Æ® Çü½ÄÀ¸·Î º½
 * ¼öÁ¤ : 20040522 | silver_star@hanmail.net | /content/popups¿¡¼­ ÇÁ¸°Æ®ÇÏ´Â °æ¿ì Ã³¸® 
 */
function sendPrint1() {
	var uri = window.location.pathname;
	if(uri.indexOf("/content/popups") == -1) {
	  uri = "/content/print" + uri.substring(uri.indexOf("/", 1), uri.length);
	} else {
		uri = "/content/print" + uri.substring(uri.indexOf("/", "/content/popups".length), uri.length);
	}	
	popup(uri + window.location.search, "print", 735, 700, 170, 50, "yes");
}

/*
 * ÇöÀç ÆäÀÌÁö¸¦ ºÏ¸¶Å©¿¡ ÀúÀå
 * ¼öÁ¤ : 20071126 | silver_star@hanmail.net | 
 */
function addBookmark(seq) {
	if(confirm("Áñ°ÜÃ£±â¿¡ Ãß°¡ÇÏ½Ã°Ú½À´Ï±î?")) {
		var uri = "/content/popups/cnnet/asit/bookmark/bookmark.insert.jsp?menuSeq=" + seq;
		popup(uri, "bookmark", 635, 600, 170, 50, "yes");
	}
}
	
/*
 * °Ë»ö
 * ¼öÁ¤ : 20071128 | silver_star@hanmail.net | 
 */
function chkSearchForm(frm) {
	if(frm.qt.value == "") {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	} else {
		frm.action = "http://210.95.181.42/RSA/front/Search.jsp";
		frm.target = "_blank";
		return true;
	}
}
	
/*
 °ü¸® ´ë»ó ÄÁÅÙÃ÷ ¸ñ·Ï º¸±â
*/
function openContentMngList() {
	popupCenter("/content/popups/cnnet2/mypg/03/mypg_03_12_jsp", "winContentMngList", 600, 500, "yes");
}

/*
 °ü¸® ´ë»ó ÄÁÅÙÃ÷ °ü¸® ¸ñ·Ï º¸±â
*/
function openContentLogList(menuSeq) {
	popupCenter("/content/popups/cnnet2/mypg/03/mypg_03_12_02.jsp?menuSeq=" + menuSeq, "winContentLogList", 600, 500, "yes");
}

/*
 ¿î¿µÀÚ ¿äÃ»°Ô½ÃÆÇ ¸ñ·Ï º¸±â
*/
function openMngRequest() {
	popupCenter("/content/popups/cnnet2/mypg/02/mypg.02.004.jsp", "winMngRequest", 690, 570, "yes");
}

// ¸í½ÃµÈ °´Ã¼(object)ÀÇ Æ¯Á¤(event_type) ÀÌº¥Æ®¸®½º³Ê¿¡ handler¸¦ µî·ÏÇÑ´Ù.
function AddEventListener(object, event_type, handler) {
  if(document.attachEvent) {
    object.attachEvent(event_type, handler);
  } else {
    object.addEventListener(event_type.replace(/^on/i,""), handler, false);
  }
}

// ¸í½ÃµÈ °´Ã¼(object)ÀÇ Æ¯Á¤(event_type) ÀÌº¥Æ®¸®½º³Ê¿¡ µî·ÏµÈ handler¸¦ Á¦°ÅÇÑ´Ù.
function RemoveEventListener(object, event_type, handler) {
  if(document.detachEvent) {
    object.detachEvent(event_type, handler);
  } else {
    object.removeEventListener(event_type.replace(/^on/i,""), handler, false);
  }
}

/*
 * °Ô½ÃÆÇ ¸ñ·ÏÈ­¸é form check(°Ë»ö±â´É ¼öÇà)
 */
function chkListForm(frmObj) {
	frm = frmObj;
	if(frm != null) {
		if(isEmptyForm(frm.s_txt, "°Ë»ö¾î¸¦")) { return false; }
		// ÇÊ¿ä¾ø´ÂÆÄ¶ó¸ÞÅÍ¸¦ Á¤¸®ÇÑ´Ù.
		paramClear(frm, "list");
	}

	return true;
}

/**
 * ÆäÀÌÁö°£ÀÇ ÀÌµ¿½Ã request query¸¦ ±ò²ûÇÏ°Ô ¸¸µé±â À§ÇØ »ç¿ëÇÏÁö ¾Ê´Â ÆÄ¶ó¸ÞÅÍ¸¦ Á¤¸®ÇÑ´Ù.
 */
function paramClear(frm, _bmode) {
	// bmode set
	if(frm.bmode) {
		frm.bmode.value = _bmode;
		if(_bmode == "list" && frm.bmode.value != "list") {frm.bmode.disabled = true; }
	}

	// aSeq set
	if(frm.aSeq) {
		if(_bmode == "list") { frm.aSeq.disabled = true; }
	}

	// pSeq set
	if(frm.pSeq) {
		if(_bmode == "list") { frm.pSeq.disabled = true; } 
	}
	
	// uamSeq set
	if(frm.uamSeq) {
		frm.amSeq.value = frm.uamSeq.value;
		frm.uamSeq.disabled = true;
	}

	// amSeq set
	if(frm.amSeq) {
		if(frm.amSeq.value == "A") { frm.amSeq.disabled = true; }
	}

	// pageNo set
	if(frm.pageNo && (frm.pageNo.value <= 1)) { frm.pageNo.disabled = true; }
	// rowNum set
	if(frm.rowNum && (frm.rowNum.value == 10)) { frm.rowNum.disabled = true; }
	// search entities set
	if(frm.sTxt && (frm.sTxt.value == "")) {
		frm.sTxt.disabled = true;
		frm.sTarget.disabled = true;
	}

	if(frm.isHtml) { if(frm.isHtml.value == "N") { frm.isHtml.disabled = true; } }
	if(frm.isLock) { if(frm.isLock.value == "N") { frm.isLock.disabled = true; } }
	if(frm.rcvSms) { if(frm.rcvSms.value == "N") { frm.rcvSms.disabled = true; } }
	if(frm.rcvMail) { if(frm.rcvMail.value == "N") { frm.rcvMail.disabled = true; } }
	if(frm.isHot) { if(frm.isHot.value == "N") { frm.isHot.disabled = true; } }
	if(frm.isFix) { if(frm.isFix.value == "N") { frm.isFix.disabled = true; } }
}
