document.write("<script language='javascript' type='text/javascript' src='/common/js/common_different.js'></script>");

/**
 * @type : intro
 * @desc : common.js´Â ¸ðµç ¸Þ´º¿¡ Àü¹ÝÀûÀ¸·Î »ç¿ëÇÏ´Â °øÅë js
 * <pre>
 *     - cf  : common function
 *     - co  : common object
 *     - cov : common object for validation
 * </pre>
 * <font color=red>¡ØÁÖÀÇ»çÇ×</font>
 * <pre>
 *     - ÁÖÀÇ»çÇ× ³»¿ë
 * </pre>
 * @version : 1.0
 */
/**
 * <pre>
 * desc   : Global º¯¼ö¼±¾ð, ½ºÆ®¸µÀÌ Á¤±Ô½Ä¿¡ ÀûÇÕÇÑÁö ÆÇ´ÜÇÒ ¶§ »ç¿ëµÇ´Â Á¤±Ô½Ä º¯¼ö
 */
var gSignedNumType		= /^[+|-]?\d+$/
var gEngLowerType		= /^[a-z]+$/
var gEngUpperType		= /^[A-Z]+$/
var gEngType			= /[^A-Za-z]/		// ÀÌÀü /^[a-zA-Z]+$/
var gEngNumType			= /^[a-zA-Z0-9]+$/
var gEmailType			= /(.+)@.+\..+/		// /^.+\@.+\..+$/
var gUpperEngNumType	= /^[A-Z0-9]+$/
var gLowerEngNumType	= /^[a-z0-9]+$/
var gIdType				= /[^A-Za-z0-9_-]/
var gTelType			= /[^0-9_-]/
var gMoneyType			= /[^0-9_,]/
var gNumberType			= /[^0-9]/			// /^\d+$/
var gDateType			= /\d{4}\.\d{2}\.\d{2}/
var gSpecialType        = /[\\~!@\#|$%^&*\()\-=+_,'"]/gi
var favorS;
var favorS1;

/**
 * <pre>
 * desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ Trim ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     var str = " Çö´ëÄ«µå";
 *     alert(str.Trim());
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "Çö´ëÄ«µå"°¡ µÈ´Ù.
 * @type    prototype_function
 * @access  public
 * @return  stringÀÇ °ø¹éÁ¦°Å µ¥ÀÌÅ¸
 * @author  ±èÇüÁø
 */
String.prototype.Trim = function(str) {
	str = this != window ? this : str;
	return str.replace(/^\s+/g,'').replace(/\s+$/g,'');
}
String.prototype.trim = function(str) {
	str = this != window ? this : str;
	return str.replace(/^\s+/g,'').replace(/\s+$/g,'');
}
/**
 * <pre>
 * desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ bytes ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     var str = "Çö´ëÄ«µå";
 *     alert(str.bytes());
 * </pre>
 * @type    prototype_function
 * @access  public
 * @return  stringÀÇ byte ¼ö
 * @author  ±èÈ£ÈÆ
 */
String.prototype.bytes = function(str) {
	str = this != window ? this : str;
	var len = 0;
	for(j=0; j<str.length; j++) {
		var chr = str.charAt(j);
		len += (chr.charCodeAt() > 128) ? 2 : 1
	}
	return len;
}
/**
 * <pre>
 * desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ StrLen ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù.
 *           StrLen ¸Þ¼Òµå´Â ½ºÆ®¸µÀÇ ±æÀÌ¸¦ °è»êÇÏ¿© ±× ¼ö¸¦ ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     var str = "Çö´ëÄ«µå";
 *     alert(str.StrLen());
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "Çö´ëÄ«µå"°¡ µÈ´Ù.
 * @type    prototype_function
 * @access  public
 * @return  stringÀÇ ±æÀÌ
 * @author  ±èÈ£ÈÆ
 */
String.prototype.StrLen = function() {
	var temp;
	var set = 0;
	var mycount = 0;
	for( k = 0 ; k < this.length ; k++ ){
		temp = this.charAt(k);
		if( escape(temp).length > 4 ) {
			mycount += 2
		}
		else mycount++;
	}
	return mycount;
}
/**
 * <pre>
 * desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ StrToDate ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù.
 *           StrToDate ¸Þ¼Òµå´Â »ç¿ëÇÏ´Â ³¯ÀÚ ½ºÆ®¸µÀ» Date TypeÀ¸·Î ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     var str = "20070101";
 *     alert(str.StrToDate());
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "20070101"°¡ µÈ´Ù.
 * @type    prototype_function
 * @access  public
 * @return  stringÀÇ Date
 * @author  ±èÈ£ÈÆ
 */
String.prototype.StrToDate = function(){
	if (this.StrLen() == 8 || this.StrLen() == 10){
		switch(this.StrLen()){
			case 8:
				return new Date(this.substring(0, 4), this.substring(4, 6), this.substring(6, 8));
				break;
			case 10:
				var tmp = new Date(this.substring(0, 4), this.substring(5, 7), this.substring(8, 10));
				return tmp;
				break;
		}
	}
}
/**
 * <pre>
 * desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ StrToNum ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù.
 *           StrToNum ¸Þ¼Òµå´Â »ç¿ëÇÏ´Â Number ½ºÆ®¸µÀ» Number TypeÀ¸·Î ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     var str = "10076";
 *     alert(str.StrToNum());
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "10076"°¡ µÈ´Ù.
 * @type    prototype_function
 * @access  public
 * @return  stringÀÇ ¼ýÀÚ
 * @author  ±èÈ£ÈÆ
 */
String.prototype.StrToNum = function(){
	if (typeof(this) == "string"){
		return new Number(this);
	}else if (typeof(this) == "object"){
		return new Number(this.toString());
	}
}
/**
 * <pre>
 * desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ IsValue ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù.
 *           IsValue ¸Þ¼Òµå´Â »ç¿ëÇÏ´Â ½ºÆ®¸µ¿¡ µ¥ÀÌÅ¸°¡ ÀÖ´ÂÁöÀÇ ¿©ºÎ¸¦ ÆÇ´ÜÇÏ¿© true, false¸¦ ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     var str = "abcd";
 *     alert(str.IsValue());
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "abcd"°¡ µÈ´Ù.
 * @type    prototype_function
 * @access  public
 * @return  stringÀÇ µ¥ÀÌÅ¸ Á¸Àç À¯¹«
 * @author  ±èÈ£ÈÆ
 */
String.prototype.IsValue = function(){
	if( (this == "") || (this == null) || (this == "null") || (typeof(this) == 'undefined') ){
		return false
	}
	return true;
}
/**
 * <pre>
 * desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ NumToStr ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù.
 *           NumToStr ¸Þ¼Òµå´Â »ç¿ëÇÏ´Â ¼ýÀÚ¸¦ String TypeÀ¸·Î ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     var istr = 10076;
 *     alert(istr.StrToNum());
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ istr 10076°¡ µÈ´Ù.
 * @type    prototype_function
 * @access  public
 * @return  String Type ¼ýÀÚ
 * @author  ±èÈ£ÈÆ
 */
Number.prototype.NumToStr = function(){
	var str = new String(this);
	return str.valueOf();
}
/**
 * <pre>
 * desc   : Number Check,
 *           ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ IsNumber ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù.
 *           IsNumber ¸Þ¼Òµå´Â ½ºÆ®¸µ ÀÌ gNumberType(¼ýÀÚ¿¡ ´ëÇØ ÀûÇÕÇÑ type)¿¡ ÇØ´çÇÏ´Â ½ºÆ®¸µÀÎÁö
 *           °Ë»öÇÏ¿© ÇØ´çÇÏ´Â °æ¿ì true, ¾Æ´Ï¸é false¸¦ ¸®ÅÏÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     var str = "1234";
 *     if( str.IsNumber())
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "1234"°¡ µÈ´Ù.
 * @type    prototype_function
 * @access  public
 * @return  stringÀÇ ¼ýÀÚÇü½Ä ÀûÇÕ¿©ºÎ
 * @author  ±èÈ£ÈÆ
 */
String.prototype.IsNumber = function() {
	if (this.search(gNumberType) == -1)
		return true;
	else
		return false;
}
/**
 * <pre>
 * desc   : 3ÀÚ¸®¼ö ¸¶´Ù ',' »ðÀÔÇÑ´Ù.
 *        : ÆÄ¶ó¹ÌÅÍÀÇ typeÀÌ string ÀÏ °æ¿ì´Â ','¸¦ »ðÀÔÇÏ´Â string ¸®ÅÏ
 *        : ÆÄ¶ó¹ÌÅÍÀÇ typeÀÌ object ÀÏ °æ¿ì´Â object value·Î ¼¼ÆÃ
 *
 * »ç¿ë¿¹ :
 *     var str = "1345245";
 *     alert(getInsComma(str, ','));
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â ','°¡ ¾ø´Â ¼ýÀÚ°¡ ÀÔ·ÂµÇ¾î¾ß ÇÑ´Ù.
 * @type    function
 * @access  public
 * @return  ÁöÁ¤ÇÑ mark °¡ µé¾î°£ ¼ýÀÚ ¹ÝÈ¯
 * @author  ±èÈ£ÈÆ
 */
function getInsComma(str){
	if(typeof(str) == 'string'){
		if(str.Trim() == '') return str;
		var resultNum = '';
		var str_tmp = (str.StrToNum()).NumToStr();
		for (i=str_tmp.length-1 ,  k=0 ; i >= 0; i-- , k++) {
		    if ((k % 3) == 0 && (k != 0) )
		        resultNum =  ',' + resultNum;
		    resultNum = str_tmp.charAt(i) + resultNum;
		}
		
		return resultNum;
	}else if(typeof(str) == 'object'){
		str.value = getInsComma(str.value);
	}	
}
/**
 * <pre>
 * desc   : ÀÎÀÚ·Î Á¦°øµÇ´Â Å¬·¡½º¸í°ú À©µµ¿ìID·Î ÇØ´ç  id¸¦ °¡Áø ÆäÀÌÁö¿¡¼­ ÀÎÀÚ·Î Á¦°øµÈ Å¬·¡½º¸íÀ» °¡Áø ¸ðµç ¿ä¼Ò¸¦ ¹è¿­·Î ¹ÝÈ¯ÇÑ´Ù.
 * </pre>
 * @type	function
 * @access	public
 * @param	_class Å¬·¡½º¸í
 * @param	el_id À©µµ¿ì ID
 * @return		Array
 * @author	±èÇüÁø
 */
function getElementsByClass(_class, el_id) {
	var browser=navigator.appName;
	var getkey=navigator.appVersion;
	
	var parent, els, returnArr = new Array(), i = 0;
	parent = (el_id) ? document.getElementById(el_id) : document;
	
	els = parent.getElementsByTagName('*');
	
	if ((browser.substring(0, 9)=="Microsoft") && (getkey.substring(22, 23)=="5"))
		 els = parent.all;
	
	for (i; i < els.length; i++) {
		if ((els[i].className == _class) || (els[i].className.indexOf(" "+_class) != -1 )) {
			returnArr[returnArr.length] = els[i];
		}
	}
	return returnArr;
}
/**
 * <pre>
 * desc   : ÀÎÀÚ·Î Á¦°øµÇ´Â url·Î opener À©µµ¿ìÀÇ ÁÖ¼Ò¸¦ ÀÌµ¿½ÃÅ²´Ù.
 * </pre>
 * @type	function
 * @access	public
 * @param	url ÀÌµ¿½ÃÅ³ ÆäÀÌÁö ÁÖ¼Ò
 * @author	±èÇüÁø
 */
function opener_url(url){
  opener.location=url;
}
/**
 * <pre>
 * desc   : Á¦°øµÈ ÀÎÀÚµéÀ» ¼Ó¼ºÀ¸·Î ÆË¾÷À» ¶ç¿î´Ù.
 * </pre>
 * @type	function
 * @access	public
 * @param	url ÆË¾÷ ÆäÀÌÁö ÁÖ¼Ò
 * @param	wName À©µµ¿ì¸í
 * @param	width °¡·Î»çÀÌÁî
 * @param	height ¼¼·Î»çÀÌÁî
 * @param	top »ó´Ü¿©¹é
 * @param	left ÁÂÃø ¿©¹é
 * @param	center È­¸é Áß¾Ó Á¤·Ä ¿©ºÎ(true/false)
 * @author	±èÇüÁø
 */
function opwin(url,wName,width,height,top,left,center, scroll){
	if( (scroll == "") || (scroll == null) || (scroll == "null") || (typeof(scroll) == 'undefined') ){
		scroll ="no";
	}
	
	var arg = "width=" + width + ", height=" + height +", scrollbars="+scroll+", status=no, resizable=no,direction=no,location=no,menubar=no,toolbar=no,titlebar=no,fullscreen=no";
	if(!center){
		arg += ",left="+left+",top="+top;
	}
	else{
		var winl = (screen.width - width) / 2;
		var wint = (screen.height - height) / 2;
		arg += ",left="+winl;
		arg += ",top="+wint;
	}
	var win = window.open(url, wName, arg);
	if (win !=null) win.focus();
}
/**
 * <pre>
 * desc   : ÀÎÀÚ·Î Á¦°øµÈ °´Ã¼ÀÇ display ¼Ó¼º º¯°æ.
 * </pre>
 * @type	function
 * @access	public
 * @param	e °´Ã¼
 * @author	±èÇüÁø
 */
function toggle(e) { // TYPE A
	if (e.style.display == "none") {
		e.style.display = "";
	} else {
		e.style.display = "none";
	}
}
/**
 * <pre>
 * desc   : ÀÎÀÚ·Î Á¦°øµÈ ÀÌ¹ÌÁö °´Ã¼ÀÇ °¡·Î ¼¼·Î ÃÖ´ë Å©±â º¯°æ.
 * </pre>
 * @type	function
 * @access	public
 * @param	target_img ÀÌ¹ÌÁö °´Ã¼
 * @param	maxWidth ÃÖ´ë °¡·Î Å©±â
 * @param	maxHeight ÃÖ´ë ¼¼·Î Å©±â
 * @author	±èÇüÁø
 */
function adjustImageWidth(target_img, maxWidth, maxHeight)
{
	var newHeight, newWidth;
	var newImg;
	newImg = new Image();
	newImg.src = target_img.src;
	imgw = newImg.width;
	imgh = newImg.height;
	if (imgw > maxWidth)	{
		newWidth = maxWidth;
		newHeight = imgh;
		newWidth = Math.min(newWidth, Math.round((imgw*newHeight)/imgh));
		newHeight = Math.min(Math.round((imgh*newWidth)/imgw), newHeight);
	}	else  {
		newWidth = imgw;
		newHeight = imgh;
	}
	target_img.onload = null;
	target_img.src = newImg.src;
	target_img.width = newWidth;
	target_img.height = newHeight;
	if(!isNaN(maxHeight)){
		adjustImageHeight(target_img, maxHeight)
	}
}
/**
 * <pre>
 * desc   : ÀÎÀÚ·Î Á¦°øµÈ ÀÌ¹ÌÁö °´Ã¼ÀÇ ¼¼·Î ÃÖ´ë Å©±â º¯°æ.
 * </pre>
 * @type	function
 * @access	public
 * @param	target_img ÀÌ¹ÌÁö °´Ã¼
 * @param	maxWidth ÃÖ´ë °¡·Î Å©±â
 * @author	±èÇüÁø
 */
function adjustImageHeight(target_img, maxHeight)
{
	var newHeight, newWidth;
	var newImg;
	newImg = new Image();
	newImg.src = target_img.src;
	imgh = newImg.height;
	if (imgh > maxHeight)
	{
		newHeight = maxHeight;
	}
	target_img.height = newHeight;
}
/**
 * <pre>
 * desc   : ÀÎÀÚ·Î Á¦°øµÈ ÆÄÀÏ ÀüÃ¼ °æ·Î¿¡¼­ ÆÄÀÏ¸í ÃßÃâ
 * </pre>
 * @type	function
 * @access	public
 * @param	fileName ÆÄÀÏ ÀüÃ¼ °æ·Î
 * @return	String ÆÄÀÏ¸í
 * @author	±èÇüÁø
 */
function GetFileName(fileName)
{
	strFileName = fileName.substr(fileName.lastIndexOf("\\")+1);
	return strFileName;
}
/**
 * <pre>
 * desc   : ÀÎÀÚ·Î Á¦°øµÈ ÆÄÀÏ¸íÀÇ È®ÀåÀÚ °ËÁõ. ÆÄÀÏ È®ÀåÀÚ°¡ °ËÁõ È®ÀåÀÚ¿¡ ÀÖÀ¸¸é true, ¾øÀ¸¸é false.
 * </pre>
 * @type	function
 * @access	public
 * @param	fileName ÆÄÀÏ ÀüÃ¼ °æ·Î
 * @param	acExt °ËÁõÇÒ È®ÀåÀÚ
 * @return	boolean
 * @author	±èÇüÁø
 */
function ExtCheck(fileName,acExt)
{
	strFileName = GetFileName(fileName);
	strExtName  = strFileName.substr(strFileName.lastIndexOf(".")+1).toLowerCase();
	if(acExt.indexOf(strExtName)<0)
	{
		return false;
	}
	return true;
}
/**
 * <pre>
 * desc   : ÀÎÀÚ·Î Á¦°øµÈ urlÀÇ ³»¿ëÀ» ÀÐ¾î¿À´Â ÇÔ¼ö
 * </pre>
 * @type	function
 * @access	public
 * @param	url ³»¿ëÀ» ÀÐ¾î¿Ã ÁÖ¼Ò
 * @return	String ³»¿ë
 * @author	±èÇüÁø
 */
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;
}
/**
 * <pre>
 * desc   : ¼¿·ºÆ®¹Ú½º¿ë ³âµµ ¹× ¿ù¿¡ µû¸¥ ³¯Â¥ ÀÚµ¿ »ý¼º(±âº»°ªÀÌ ÀÖ´Â °æ¿ì)
 * </pre>
 * @type	function
 * @access	public
 * @param	objMonth ¿ùÇ¥½Ã ¼¿·ºÆ® ¹Ú½º °´Ã¼
 * @param	objDay ³¯Ç¥½Ã ¼¿·ºÆ® ¹Ú½º °´Ã¼
 * @param	objYear ³âÇ¥½Ã ¼¿·ºÆ® ¹Ú½º °´Ã¼
 * @param	selValue ¼±ÅÃÀÏ °ª
 * @param	bool ±âº»°ªÀÌ ¼³Á¤¿©ºÎ (true/false)
 * @return	String ³»¿ë
 * @author	±èÇüÁø
 */
function changeDay(objMonth, objDay, objYear, selValue, bool, viewValue)
{
	if( (viewValue == "") || (viewValue == null) || (viewValue == "null") || (typeof(viewValue) == 'undefined') ){
		viewValue ="";
	}
	month = eval(objMonth.options[objMonth.selectedIndex].value);
	year = eval(objYear.options[objYear.selectedIndex].value);
	if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)
	{
		endDay = 31;
	}
	else if(month == 4 || month == 6 || month == 9 || month == 11)
	{
		endDay = 30;
	}
	else
	{
		if((year%4)==0)
		{
			endDay = 29;
		}
		else
		{
			endDay = 28;
		}
	}
	try
	{
		day = eval(objDay.options[objDay.selectedIndex].value) - 1;
	}
	catch (e)
	{
		day = 0;
	}
	objDay.options.length = 0;
	if(bool)
	{
		objDay.options[0] = new Option('¼±ÅÃ', '');
	}
	for(i=1; i<=endDay; i++)
	{
		if(i<10)
		{
			j = "0" + i;
		}
		else
		{
			j = "" + i;
		}
		objDay.options[objDay.options.length] = new Option(j+viewValue, j);
	}
	if(day >= endDay)
	{
		day = endDay-1;
	}
	objDay.selectedIndex = day;
	if(selValue.length > 9)
	{
		selectValues = selValue.split("-");
		for(i=0; i<objYear.options.length; i++)
		{
			if(objYear.options[i].value == selectValues[0])
			{
				objYear.options[i].selected = true;
				break;
			}
		}
		for(i=0; i<objMonth.options.length; i++)
		{
			if(objMonth.options[i].value == selectValues[1])
			{
				objMonth.options[i].selected = true;
				break;
			}
		}
		for(i=0; i<objDay.options.length; i++)
		{
			if(objDay.options[i].value == selectValues[2])
			{
				objDay.options[i].selected = true;
				break;
			}
		}
	}
	else
	{
		for(i=0; i<objDay.options.length; i++)
		{
			if(objDay.options[i].value == selValue)
			{
				objDay.options[i].selected = true;
				break;
			}
		}
	}
}
/**
 * <pre>
 * desc   : ³âµµ ¼¿·ºÆ®¹Ú½º ¸¸µé±â(±âº»°ª ÀÖ´Â °æ¿ì)
 * </pre>
 * @type	function
 * @access	public
 * @param	obj ¼¿·ºÆ® ¹Ú½º °´Ã¼
 * @param	startYear ½ÃÀÛ ³âµµ
 * @param	endYear ¸¶Áö¸· ³âµµ
 * @param	bool Ã¹ ÄÃ·³ ¼±ÅÃ ¿©ºÎ 
 * @param	defaultValue ¼±ÅÃµÇ¾î ³ª¿Ã ³â
 * @author	±èÇüÁø
 */
function InitYear(obj, startYear, endYear, bool, defaultValue)
{
	obj.options.length = 0;
	if(bool)
	{
		obj.options[0] = new Option('¼±ÅÃ', '');
	}
	for(i=startYear; i<=endYear; i++)
	{
		obj.options[obj.options.length] = new Option(i+"³â", i);
	}
	if (defaultValue>0) {
		for (i = 0; i < obj.options.length; i++) {
			if (obj.options[i].value == defaultValue) {
				obj.options[i].selected = true;
			}
		}
	}
}
/**
 * <pre>
 * desc   : ¿ù ¼¿·ºÆ®¹Ú½º ¸¸µé±â(±âº»°ª ÀÖ´Â °æ¿ì)
 * </pre>
 * @type	function
 * @access	public
 * @param	obj ¼¿·ºÆ® ¹Ú½º °´Ã¼
 * @param	bool Ã¹ ÄÃ·³ ¼±ÅÃ ¿©ºÎ 
 * @param	defaultValue ¼±ÅÃµÇ¾î ³ª¿Ã 
 * @author	¿ìÁøÈ£
 */
function InitMonth(obj, bool, defaultValue)
{
	obj.options.length = 0;
	if(bool)
	{
		obj.options[0] = new Option('¼±ÅÃ', '');
	}
	
	if(defaultValue.length==1){
		defaultValue = "0" + defaultValue;
	}
	
	for(i=1; i<=12; i++)
	{
		if(i<10){
			obj.options[obj.options.length] = new Option("0"+i+"¿ù", "0"+i);
		} else {
			obj.options[obj.options.length] = new Option(i+"¿ù", i);
		}
	}
	
	if (defaultValue>0) {
		for (i = 0; i < obj.options.length; i++) {
			if (obj.options[i].value == defaultValue) {
				obj.options[i].selected = true;
			}
		}
	}
}
/**
 * <pre>
 * desc   : ±Ý¾×À» ÇÑ±Û·Î ¹Ù²Û´Ù. (235352542->ÀÌ¾ï»ïÃµ¿À¹é»ï½Ê¿À¸¸ÀÌÃµ¿À¹é»ç½ÊÀÌ¿ø)
 *		  : ±Ý¾×ÀÇ ÄÞ¸¶´Â (',') Á¦°ÅµÈ¸ç, ¿øÀÌÇÏ ±Ý¾×(¼Ò¼öÁ¡)Àº °í·ÁµÇÁö ¾Ê¾ÒÀ½
 *        : À¯È¿¼º °Ë»ç´Â Æ÷ÇÔµÇÁö ¾Ê´Â´Ù.
 *
 * »ç¿ë¿¹ :
 *     var str = "1,345,245";
 *     alert(priceToKorean(str));
 * </pre>
 * @type    function
 * @access  public
 * @param   ±Ý¾×
 * @return  string
 * @author  ±èÈ¿¿ø
 */
function priceToKorean(price){
	price= price.replace(",","");
	arrayAmt = new Array("ÀÏ", "ÀÌ", "»ï", "»ç", "¿À", "À°", "Ä¥", "ÆÈ", "±¸", "½Ê");
	arrayPosi = new Array("", "½Ê", "¹é", "Ãµ");
	arrayUnit = new Array("", "¸¸", "¾ï", "Á¶");
	posi = price.length%4;				 //ÀÚ¸®¼ö
	len = (price.length/4).toString();
	if(len.indexOf(".")>0){
		unit = len.substring(0, len.indexOf(".")); //´ÜÀ§(0:ÀÏ´ÜÀ§, 1:¸¸´ÜÀ§...)
	}else{
		unit = price.length/4-1;
	}
	var korAmt = "";
	var op=0;
	for(i=0; i<price.length; i++){
		if(posi==0){
			posi=4;
		}
		num = parseInt(price.substring(i, i+1), 10);
		if(num!=0){
			korAmt += arrayAmt[num-1];
			korAmt += arrayPosi[posi-1];
			op=1;
		}
		if(posi==1){
			if(op==1){
				korAmt = korAmt + arrayUnit[unit];
				if(unit!=0)
					korAmt = korAmt + " ";		// ¸¸¿ø´ÜÀ§¸¶´Ù ½ºÆäÀÌ½º »ðÀÔ
			}
			unit--;
			op=0;
		}
		posi--;
	}
	if(korAmt.substring(korAmt.length-1, korAmt.length)==" ")	// ±Ý¾×ÀÌ ¸¸ ´ÜÀ§¿¡¼­ ³¡³­ °æ¿ì ¸¶Áö¸· ½ºÆäÀÌ½º Á¦°Å
		korAmt = korAmt.substring(0, korAmt.length-1);
	return korAmt + "¿ø";
}
/**
 * <pre>
 * desc   : ±Ý¾×ÀÇ ÄÞ¸¶(',')¸¦ Á¦°ÅÇÑ´Ù
 *        : ÆÄ¶ó¹ÌÅÍÀÇ typeÀÌ string ÀÏ °æ¿ì´Â ','¸¦ Á¦°ÅÇÑ string ¸®ÅÏ
 *        : ÆÄ¶ó¹ÌÅÍÀÇ typeÀÌ object ÀÏ °æ¿ì´Â object value·Î ¼¼ÆÃ
 *
 * »ç¿ë¿¹ :
 *     var str = "1,345,245";
 *     alert(setDelComma(str));
 * </pre>
 * @type    function
 * @access  public
 * @return  
 * @author  ÀÌ±Õ
 */
function setDelComma(str){
	if(typeof(str) == 'string'){
		if(str.Trim() == '') return str;
		return str.replace(/,/g, '');
	}else if(typeof(str) == 'object'){
		str.value = setDelComma(str.value);
	}	
}
/**
 * <pre>
 * desc   : Radio Button Value Return
 *          GetRadioValue ¸Þ¼Òµå´Â TypeÀÌ Radio ÀÎ°Í¿¡ ´ëÇØ ¼±ÅÃµÈ Value°ªÀ» ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     	alert(GetRadioValue(document.form.radio));
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ document.form.radio.value°ªÀ» ¸Þ¼¼Áö·Î Ãâ·ÂÇÑ´Ù.
 * @type    function
 * @access  public
 * @param   Form Field Object
 * @return  Check Box Checked Value
 * @author  ±èÈ£ÈÆ
 */
function GetRadioValue(opt) {
	var leng = ((isNaN(opt.length*1))?1:opt.length*1);
	// ÇØ´ç ¶óµð¿À ¹öÆ°ÀÇ °³¼ö¸¦ Ã¼Å©ÇÏ¿© ¼±ÅÃµÈ value°ªÀ» ¹ÝÈ¯
	if (leng == 1)
	{
			if (opt.checked)
			{
				return opt.value;
			}
	}
	else {
		var n = opt.length;
		for (i=0; i<n; i++) {
			if (opt[i].checked) {
				return opt[i].value;
			}
		}
	}
	return "";
}
/**
 * <pre>
 * desc   : getNowDate ¸Þ¼­µå´Â ÇöÀç ³¯Â¥¸¦ 8ÀÚ¸®('yyyymmdd')·Î ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     	alert(getNowDate());
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ °á°ú´Â '20070709'Çü½ÄÀÇ ÇöÀç ³¯Â¥°¡ ¹ÝÈ¯µÈ´Ù.
 * @type    function
 * @access  public
 * @return  Date
 * @author  ±èÈ£ÈÆ
 */
function getNowDate(){
	var dt = new Date();
	var tmp = dt.getMonth()+1;
	
	return dt.getYear() + "" + make2Digits((tmp == 0) ? 12 : tmp) + "" + make2Digits(dt.getDate());
}
/**
 * <pre>
 * desc   : GetRadioValue ¸Þ¼Òµå´Â 10º¸´Ù ÀÛÀº ¼ö ¾Õ¿¡ 0 ¹®ÀÚ ºÙ¿©¼­ ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     	alert(make2Digits(1));
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ °á°ú·Î 01¸¦ ¹ÝÈ¯ÇÑ´Ù.
 * @type    function
 * @access  public
 * @param   String str
 * @return  String
 * @author  ±èÈ£ÈÆ
 */
function make2Digits(str) {
	if(str < 10) {
		str = "0" + str;
	}
	return str;
}
/**
 * <pre>
 * desc   : getDateDiff ¸Þ¼­µå´Â ÀÔ·ÂµÈ  ³¯Â¥¿¡ ´ëÇØ  +/- ¿¬»êÀ» ¼öÇàÈÄ ½ÃÀÛÀÏ°ú Á¾·áÀÏÀ» ¹ÝÈ¯
 *
 * »ç¿ë¿¹ :
 *     	alert(getDateDiff("2007-07-09", -1m, "yyyy³â MM¿ù ddÀÏ"));
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ Date Type¿¡ ÇØ´çÇÏ´Â ³¯Â¥¸¦ ¹ÝÈ¯ÇÑ´Ù.
 * @type    function
 * @access  public
 * @param   Start Date
 * @param   +/- Period (-1y, -1m, -1d)
 * @param   Date Type (date:³¯Â¥Çü½Ä, daycount:ÀÏ¼ö)
 * @return  Date
 * @author  ±èÈ£ÈÆ
 */
function getDateDiff(strDate, period, returnType){
	var sdt = strDate.StrToDate();
	var edt;
	var cnt = 0;
	var year = sdt.getFullYear();
	var month = 0;
	var day = 0;
	if (period.lastIndexOf("y") > -1){
		
		cnt = period.replace("y", "");
		if (sdt.getMonth() == 0){
			year--;
		}
		
		year += cnt*1;
		edt = new Date(year, sdt.getMonth(), sdt.getDate());
	}else if (period.lastIndexOf("m") > -1){
		
		cnt = period.replace("m", "");
		
		month = (sdt.getMonth() == 0) ? 12 + (cnt*1) : sdt.getMonth() + (cnt*1);
		if (sdt.getMonth() == 0){
			year--;
		}
		edt = new Date(year, month, sdt.getDate());
		
	}else if (period.lastIndexOf("d") > -1){
		
		cnt = period.replace("d", "");
		var tmpDate = new Date(year, sdt.getMonth(), sdt.getDate() + cnt.StrToNum());
		tmpDate.setYear(tmpDate.getFullYear());
		edt = tmpDate;
	}
	// return type º°·Î ¹ÝÈ¯°ªÀ» ¼³Á¤
	if (returnType == "date"){
		year = ((edt.getMonth() == 0) ? edt.getYear() - 1 :edt.getYear());
		month = make2Digits((edt.getMonth() == 0) ? 12 : edt.getMonth());
		day = make2Digits(edt.getDate());
		return year + "" + month + "" + day;
	}else if (returnType == "daycount"){
		return (Math.floor((sdt - edt) / 1000 / 60 / 60 / 24));
	}
}
/**
 * <pre>
 * desc   : Check Box Checked Count Return
 *          GetCheckCount ¸Þ¼Òµå´Â TypeÀÌ Radio ÀÎ°Í¿¡ ´ëÇØ ¼±ÅÃµÈ Count¸¦ ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     	alert(GetCheckCount(document.form.checkBox));
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ document.form.checkBox ÀÇ °³¼ö¸¦  ¸Þ¼¼Áö·Î Ãâ·ÂÇÑ´Ù.
 * @type    function
 * @access  public
 * @param   Form Field Object
 * @return  Check Box Checked Count
 * @author  ±èÈ£ÈÆ
 */
function GetCheckCount(opt) {
	var leng = ((isNaN(opt.length*1))?1:opt.length*1);
	var chkcnt = 0;
	if (leng == 1)
	{
			if (opt.checked)
			{
				chkcnt = 1;
			}
	}
	else {
		var n = opt.length;
		for (i=0; i<n; i++) {
			if (opt[i].checked) {
				chkcnt = chkcnt + 1;
			}
		}
	}
	return chkcnt;
}
/**
 * <pre>
 * desc   : Check Box Checked Value Return
 *          GetCheckValue ¸Þ¼Òµå´Â TypeÀÌ Radio ÀÎ°Í¿¡ ´ëÇØ ¼±ÅÃµÈ Value°ªÀ» ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     	alert(GetCheckValue(document.form.checkBox));
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ document.form.checkBox ÀÇ °³¼ö¸¦  ¸Þ¼¼Áö·Î Ãâ·ÂÇÑ´Ù.
 * @type    function
 * @access  public
 * @param   Form Field Object
 * @return  Check Box Checked Value
 * @author  ±èÈ£ÈÆ
 */
function GetCheckValue(opt) {
	var leng = ((isNaN(opt.length*1))?1:opt.length*1);
	var chkValue = "";
	if (leng == 1)
	{
			if (opt.checked)
			{
				chkValue = opt.value;
			}
	}
	else {
		var n = opt.length;
		for (i=0; i<n; i++) {
			if (opt[i].checked) {
				chkValue = opt[i].value;
			}
		}
	}
	return chkValue;
}
/**
 * <pre>
 * desc   : GetSelectValue ¸Þ¼­µå´Â ComboBoxÀÇ selected value ¸¦ ¹ÝÈ¯ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     	alert(GetSelectValue(document.form.selectBox));
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ document.form.selectBox.selectedIndex¿¡ ÇØ´çÇÏ´Â °ªÀ» ¹ÝÈ¯ÇÑ´Ù.
 * @type    function
 * @access  public
 * @param   Combo Box Object
 * @return  String
 * @author  ±èÈ£ÈÆ
 */
function GetSelectValue(opt){
	if (opt.selectedIndex > -1){
		return opt.options[opt.selectedIndex].value;
	}else{
		return "";
	}
}
/**
 * <pre>
 * desc   : setDateView ¸Þ¼­µå´Â ÇØ´ç Form Field Id¿¡ ³¯Â¥ °ªÀ» innerHTML ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     	alert(setDateView("2007-07-09", document.form.obj));
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ document.form.obj¿¡ "2007-07-09" innerHTML ÇÑ´Ù.
 * @type    function
 * @access  public
 * @param   Date
 * @param   hidden Form Field Object
 * @author  ±èÈ£ÈÆ
 */
function setDateView(strDate, hiddenObj) {
	var strSpanId = "span_" + hiddenObj.name;
	if(hiddenObj == undefined || document.getElementById(strSpanId) == null) return;
	if(strDate.length < 8) return;
	hiddenObj.value = strDate;
	document.getElementById(strSpanId).innerHTML = strDate.substring(0, 4) + "³â " + strDate.substring(4, 6) + "¿ù " + strDate.substring(6, 8) + "ÀÏ";
}
/**
 * <pre>
 * desc   : iframeÀÇ ¼¼·Î »çÀÌÁî¸¦ Á¶Á¤ÇÑ´Ù.
 *
 * »ç¿ë¿¹ :
 *     	<iframe .... onload="resizeFrame(this)"></iframe>
 * </pre>
 * @type    function
 * @access  public
 * @param   Object
 * @author  ¹Úº´¿õ
 */
function resizeFrame(iframeObj){
	var innerBody = iframeObj.contentWindow.document.body;
	oldEvent = innerBody.onclick;
	innerBody.onclick = function(){ resizeFrame(iframeObj, 1);oldEvent; };
	var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
	iframeObj.style.height = innerHeight;
	var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
	iframeObj.style.width = innerWidth;
}
/**
 * <pre>
 * desc   : formfield ¿¡ ¼ýÀÚ¸¸ ÀÔ·Â°¡´É
 *
 * »ç¿ë¿¹ :
 *     	if(cfCheckInt());
 *      <input type='password' name='jumin_no' size='7' maxlength='7' onKeypress="checkInt();>
 * </pre>
 *
 * @type    function
 * @access  public
 * @param   None
 * @return  boolean
 * @author  ±èÇüÁø
 */
function cfCheckInt(arg) {
	if(isNaN(arg)){
		arg = event.keyCode;
	}
	
	if(arg < 48 || arg > 57) {
		if(arg!=8 && arg!=46 && arg!=9) {
			event.returnValue = false;
		}
	}
}
/**
 * <pre>
 * desc   : input field¿¡¼­ ´ÙÀ½ object·Î focus¸¦ ³Ñ±ä´Ù.
 *
 * »ç¿ë¿¹ : <input type='password' name='jumin_no' size='7' maxlength='7' onKeypress="Next_tab(this,document.form1.input1,4);>
 * </pre>
 *
 * @type		function
 * @access	public
 * @param	thisObj		°Ë»ç ´ë»ó °´Ã¼
 * @param	nextObj		Ä¿¼­¸¦ ¹ÞÀ» °´Ã¼
 * @param	len			¸ÅÄª ¹®ÀÚ¿­ ±æÀÌ
 * @author  ±èÇüÁø
 */
// 
function Next_tab(thisObj,nextObj,len) {
    if(thisObj.value.length >= len) {
        nextObj.focus() ;
        return;
    }
}
/**
 * <pre>
 * desc   : StringBuffer class ±¸Çö
 * </pre>
 */
function StringBuffer(){
    this.__strings__ = new Array;
}
   
StringBuffer.prototype.append = function(str){
    this.__strings__.push(str);
}
   
StringBuffer.prototype.toString = function(){
    return this.__strings__.join("");
}
/*
 * ±â°£ ÀÔ·Â Check  
 * Á¶È¸ ³â¿ù±îÁö¸¸ ¹Þ¾Æ¼­ Check
 * @type    function
 * @access  public
 * @param   from_date : ½ÃÀÛÀÏ
 * @param   to_date : Á¾·áÀÏ
 * @param   cur_date : ÇöÀçÀÏ
 * @param   period : ±â°£ (°³¿ù)
 * @return  boolean
 */
function CheckPeriod(from_date, to_date, cur_date, period) {
	var temp_day = getPrevDate(cur_date, period);
	if(Number(from_date) <= Number(temp_day)) {
		alert("ÃÖ±Ù "+period+"°³¿ù°£¸¸ Á¶È¸ °¡´ÉÇÕ´Ï´Ù.");
		return false;
	}
	if(Number(from_date) > Number(cur_date)) {
		alert("Á¶È¸½ÃÀÛ¿ùÀÌ ÇöÀç¿ùº¸´Ù ¹Ì·¡ÀÔ´Ï´Ù.");
		return false;
	}
	if(Number(to_date) > Number(cur_date)) {
		alert("Á¶È¸Á¾·á¿ùÀÌ ÇöÀç¿ùº¸´Ù ¹Ì·¡ÀÔ´Ï´Ù.");
		return false;
	}
	if(Number(from_date) > Number(to_date)) {
		alert("Á¶È¸½ÃÀÛ¿ùÀÌ Á¶È¸Á¾·á¿ùº¸´Ù ¹Ì·¡ÀÔ´Ï´Ù.");
		return false;
	}
	return true;
}
/**
 *	ÇöÀç¿ùÀ» ±âÁØÀ¸·Î ÀÌÀü ¿ùÀ» ±¸ÇÑ´Ù.(author : Kim Bongsu)
 *	»ç¿ë¿¹: 1´ÞÀü getPrevDate(200306, 1)
 */
function getPrevDate(yyyymm, term) {
	var yyyy = yyyymm.substring(0, 4);
	var mm = yyyymm.substring(4, 6);
	var dd = "01";
	myDate = new Date();
	myDate.setFullYear(yyyy);
	myDate.setMonth(mm-1);
	myDate.setMonth(mm - eval(term) -1);
	myDate.setDate(myDate.getDate() + 1);
	yyyy = myDate.getFullYear();
	mm = myDate.getMonth()+1;
	mm = (mm<10)?'0'+mm:mm;
	return(yyyy+ '' +mm);
}
/**
 * <pre>
 * desc   : selecbox ¼±ÅÃ½Ã ´ÙÀ½ °´Ã¼·Î Æ÷Ä¿½º ÀÌµ¿ ±â´É(selectboxÀÇ ±âº»°ªÀÌ ¾ø´Â °æ¿ì¸¸ »ç¿ë)
 *
 * »ç¿ë¿¹ :
 *      <select name='select1' onChange="autoMoveTabForSelect(this,document.form1.input1);>
 * </pre>
 *
 * @type    function
 * @access  public
 * @param	thisObj		°Ë»ç ´ë»ó °´Ã¼
 * @param	nextObj		Ä¿¼­¸¦ ¹ÞÀ» °´Ã¼
 * @author  ±èÇüÁø
 */
function autoMoveTabForSelect( thisObj, nextObj ){
	if ( thisObj.selectedIndex != 0 ) nextObj.focus();
}
/**
  * ¼ýÀÚ¿Í ¿µ¹® Ã¼Å©ÇÏ´Â ÇÔ¼ö
  */
/**
 * <pre>
 * desc   : INPUT °´Ã¼·Î ¼ýÀÚ¿Í ¿µ¹® Ã¼Å©ÇÏ´Â ±â´É(styleÀÌ ime-mode:disabled ÀÏ °æ¿ì¸¸ Àû¿ë)
 *
 * »ç¿ë¿¹ :
 *      <input type="text" style="ime-mode:disabled" onkeypress="">
 * </pre>
 *
 * @type    function
 * @access  public
 * @param	arg		°Ë»ç ¹æ¹ý ¼±ÅÃ (1:¿µ¹®¸¸ Çã¿ë, 2:¼ýÀÚ¸¸ Çã¿ë, 3:¿µ¹®/¼ýÀÚ Çã¿ë)
 * @author  ±èÇüÁø
 */
function checkIntAndAbc(arg){
	if (arg==1){
		if (( event.keyCode < 65 || event.keyCode > 90 ) && ( event.keyCode < 97 || event.keyCode > 122 ) ) {
			if(event.keyCode!=8 && event.keyCode!=46 && event.keyCode!=9) {
				event.returnValue = false;
			}
		}
	} else if (arg==2) {
		if ( event.keyCode < 48 || event.keyCode > 57 ) {
			if(event.keyCode!=8 && event.keyCode!=46 && event.keyCode!=9) {
				event.returnValue = false;
			}
		}
	} else if (arg==3) {
		if ( ( event.keyCode < 48 || event.keyCode > 57 ) && ( event.keyCode < 65 || event.keyCode > 90 ) && ( event.keyCode < 97 || event.keyCode > 122 ) ) {
			if(event.keyCode!=8 && event.keyCode!=46 && event.keyCode!=9) {
				event.returnValue = false;
			}
		}
	}
}
/**
  * ¿À¸¥ÂÊÀ¸·Î padding ÇÏ´Â ÇÔ¼ö
  */
/**
 * <pre>
 * desc   : ÀüÃ¼±æÀÌ¸¸Å­ ¹®ÀÚ¿­ ¿À¸¥ÂÊÀ¸·Î pad_char¸¦ Ã¤¿öÁÖ´Â ÇÔ¼ö
 * </pre>
 *
 * @type    function
 * @access  public
 * @param	strings		¿øº» ¹®ÀÚ¿­
 * @param	target_len	ÀüÃ¼ ±æÀÌ
 * @param	pad_char	paddingÇÒ ¹®ÀÚ
 * @author  ±èÈ¿¿ø
 */
function right_pad(strings, target_len, pad_char) {
    var i;
    var rslt = "";
    if(strings == null || strings == "" || strings == undefined || strings == "undefined") return "";
    if(target_len <= 0) return strings;
    if(pad_char.length != 1) return strings;
    var len = strings.length;
    if(len >= target_len) return strings;
    rslt += strings;
    for(i=0;i<target_len-len;i++) {
        rslt += pad_char;
    }
    return rslt;
}
/**
 * <pre>
 * desc   : ±ÝÀ¶°è»ê½Ã ÆË¾÷Ã¢À» ¶ç¿ì´Â ÇÔ¼ö
 * </pre>
 *
 * @type    function
 * @access  public
 * @author  ±èÈ¿¿ø
 */



/* ÀÏ¹Ý ÆË¾÷ */
function windowo(targetURL,wName,w,h,tscrollbars,matrixL,matrixT,tstatus,resizable,direction,tlocation,tmenubar,ttoolbar,titlebar,fullscreen) {

	var wOption="width="+w+",height="+h;
	if(tscrollbars == null || tscrollbars == '' || tscrollbars == 'no' ) { wOption = wOption+",scrollbars=no"; } else { wOption = wOption+",scrollbars=yes"; }
	if(matrixL == null) { wOption = wOption+",left=0"; } else { wOption = wOption+",left="+matrixL }
	if(matrixT == null) { wOption = wOption+",top=0"; } else { wOption = wOption+",top="+matrixL }
	wOption = wOption + "status=no, resizable=no,direction=no,location=no,menubar=no,toolbar=no,titlebar=no,fullscreen=no";
	// alert(wOption);
	window.open(targetURL,wName,wOption);

}

function linkByPop(eventcd, url, prop) {
	window.open(url,"",prop);
}

/**
 * 2Â÷ ¼öÁ¤ ºÎºÐ
 */

/**
 * <pre>
 * desc   : ÇØ´ç id¸¦ Áö´Ñ ÅÂ±× ³»ÀÇ ³»¿ëÁß¿¡ urlÀÌ ÀÖÀ»°æ¿ì ÀÚµ¿ ¸µÅ©
 * </pre>
 *
 * @type    function
 * @access  public
 * @author  ±èÇüÁø
 */
function autolink(id) {
        var container = document.getElementById(id);
        var doc = container.innerHTML;
        var regURL = new RegExp("(http|https|ftp|telnet|news|irc)://([-/.a-zA-Z0-9_~#%$?&=:200-377()]+)","gi");
        var regEmail = new RegExp("([xA1-xFEa-z0-9_-]+@[xA1-xFEa-z0-9-]+\.[a-z0-9-]+)","gi");
        container.innerHTML = doc.replace(regURL,"<a href='$1://$2' target='_blank'>$1://$2</a>").replace(regEmail,"<a href='mailto:$1'>$1</a>");
}

/**
 * desc : ¾ÆÀÌÄÜ ÀÌ¹ÌÁö µµ¸ÞÀÎÀ» ¼ÂÆÃÇÕ´Ï´Ù.
 *
 */
 var iconImageUrl = "www.hyundaicard.com";



/*091109  ¼­ºñ½º½ºÅä¸® ºÎºÐ */

 function toggleDetails() {
		var desc = document.getElementById('view_privia_desc');
		var imgChg = document.getElementById('img_privia_open');

		if (desc.style.display == 'none')
		{
			desc.style.display='';
			imgChg.src = imgChg.src.replace('_open.gif','_close.gif');
		}
		else
		{
			desc.style.display='none';
			imgChg.src = imgChg.src.replace('_close.gif','_open.gif');
		}
	}

	function toggleDetails() {
		var desc = document.getElementById('view_privia_desc');
		var imgChg = document.getElementById('img_privia_open');

		if (desc.style.display == 'none')
		{
			desc.style.display='';
			imgChg.src = imgChg.src.replace('_open.gif','_close.gif');
		}
		else
		{
			desc.style.display='none';
			imgChg.src = imgChg.src.replace('_close.gif','_open.gif');
		}
	}


/*091109  ¼­ºñ½º½ºÅä¸® ºÎºÐ */
	function flashObj(URL,SizeX,SizeY,LnkId,Frm,Flag) // quick
{
    document.write('            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
    document.write('                    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
    document.write('                    width="'+SizeX+'" height="'+SizeY+'"  id="'+LnkId+'" align="middle">');
    document.write('            <param name="movie"     value="'+URL+'" />');
    document.write('            <param name="quality"   value="high" />');
    if ( Flag == null || Flag != 'N' )
    {
        document.write('        <param name="wmode"     value="transparent"/>');
    }
	document.write('			<param name="allowScriptAccess" value="always"/> ');
	document.write('			<param name="base" value="." />');
    document.write('            <embed base="." src="'+URL+'" quality="high" width="'+SizeX+'" height="'+SizeY+'"  align="middle" ');
	 if ( Flag == null || Flag != 'N' )
    {
        document.write('       		wmode="transparent" ');
    }
    document.write('           		type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" swLiveConnect=true name="'+LnkId+'"  />');
    document.write('            </embed></object>');
	if ( Frm == 'Y' ) { // form ÅÂ±× µé¾î°¡´Â ÆäÀÌÁö¿¡ Àû¿ë
		eval("window." + LnkId + " = document.forms[0]."+ LnkId +"; ");
	}
}

function flashObj(URL,SizeX,SizeY,LnkId,Frm,Flag) // quick
{
    document.write('            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
    document.write('                    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
    document.write('                    width="'+SizeX+'" height="'+SizeY+'"  id="'+LnkId+'" align="middle">');
    document.write('            <param name="movie"     value="'+URL+'" />');
    document.write('            <param name="quality"   value="high" />');
    if ( Flag == null || Flag != 'N' )
    {
        document.write('        <param name="wmode"     value="transparent"/>');
    }
	document.write('			<param name="allowScriptAccess" value="always"/> ');
	document.write('			<param name="base" value="." />');
    document.write('            <embed base="." src="'+URL+'" quality="high" width="'+SizeX+'" height="'+SizeY+'"  align="middle" ');
	 if ( Flag == null || Flag != 'N' )
    {
        document.write('       		wmode="transparent" ');
    }
    document.write('           		type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" swLiveConnect=true name="'+LnkId+'"  />');
    document.write('            </embed></object>');
	if ( Frm == 'Y' ) { // form ÅÂ±× µé¾î°¡´Â ÆäÀÌÁö¿¡ Àû¿ë
		eval("window." + LnkId + " = document.forms[0]."+ LnkId +"; ");
	}
}

/* 2010-03-09 Ãß°¡ */
function open_div(id)	
	{
		pop_cardobj = document.getElementById(id);
		pop_cardobj.style.display="block";
	}
function close_div(id)	
	{
	    pop_cardobj = document.getElementById(id);
		pop_cardobj.style.display="none";
	}

/* 2010-03-15  - ¿À´Ã ÇÏ·ç Ã¢À» ¿­Áö ¾ÊÀ½(·¹ÀÌ¾î) */
function setCookie( name, value, expiredays ) { 
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

function closeLayer() {
	if (document.notice_form.chkbox.checked) {
		setCookie("maindiv","done",1);
	}
document.all['theLayer'].style.display="none";
}
/* 2010-03-16  - ÀÏÁÖÀÏ°£ Ã¢À» ¿­Áö ¾Ê½À´Ï´Ù(·¹ÀÌ¾î) */
function closeLayer2() {
	if (document.notice_form.chkbox.checked) {
		setCookie('maindiv2','done',7);
	}
document.all['theLayer2'].style.display="none";
}
/* 2010-04-13 - ÀÏÁÖÀÏ°£ Ã¢À» ¿­Áö ¾Ê½À´Ï´Ù(·¹ÀÌ¾î) - ÀÌ¸ÞÀÏ¸í¼¼¼­*/
function closeLayer3() {
	if (document.notice_form.chkbox.checked) {
		setCookie("maindiv3","done",7);
	}
document.all['theLayer3'].style.display="none";
}

/* 2010-04-13 - ÀÏÁÖÀÏ°£ Ã¢À» ¿­Áö ¾Ê½À´Ï´Ù(·¹ÀÌ¾î) - supermatch */
function closeLayer4() {
	if (document.notice_form1.chkbox.checked) {
		setCookie("maindiv4","done",7);
	}
document.all['theLayer4'].style.display="none";
}
function closeLayer5() {
	if (document.notice_form2.chkbox.checked) {
		setCookie("maindiv5","done",7);
	}
document.all['theLayer5'].style.display="none";
}

/* 2010-04-19 - ÀÏÁÖÀÏ°£ Ã¢À» ¿­Áö ¾Ê½À´Ï´Ù(·¹ÀÌ¾î) - InBest*/
function closeLayer6() {
	if (document.notice_form.chkbox.checked) {
		setCookie("maindiv6","done",7);
	}
document.all['theLayer6'].style.display="none";
}

/* 2010-04-23 - ÀÏÁÖÀÏ°£ Ã¢À» ¿­Áö ¾Ê½À´Ï´Ù(·¹ÀÌ¾î) - spring2010*/
function closeLayer7() {
	if (document.notice_form7.chkbox.checked) {
		setCookie("maindiv7","done",1);
	}
document.all['theLayer7'].style.display="none";
}

function closeLayer8() {
	if (document.notice_form8.chkbox.checked) {
		setCookie("maindiv8","done",1);
	}
document.all['theLayer8'].style.display="none";
}

function closeLayer9() {
	if (document.notice_form9.chkbox.checked) {
		setCookie("maindiv9","done",1);
	}
document.all['theLayer9'].style.display="none";
}

function closeLayer10() {
	if (document.notice_form10.chkbox.checked) {
		setCookie("maindiv10","done",7);
	}
document.all['theLayer10'].style.display="none";
}

function closeLayer11() {
	if (document.notice_form11.chkbox.checked) {
		setCookie("maindiv11","done",1);
	}
document.all['theLayer11'].style.display="none";
}

/* 2010-06-04 */
	function popLayerOn() {
		document.getElementById('theLayer2').style.left = ((document.body.offsetWidth / 2) - 350) + 'px';

		var jwidth = document.body.offsetWidth;
		var jheight = document.body.offsetHeight;

		if(navigator.appName == "Microsoft Internet Explorer") {
			if (navigator.userAgent.toLowerCase().indexOf('msie 6.0') != -1) {
				document.getElementById('popupBg').style.position = 'absolute';
			}
			else {
				document.getElementById('popupBg').style.position = 'fixed';
			}
		}
		else if(navigator.appName == "Netscape") {
			if (navigator.userAgent.toLowerCase().indexOf('safari') != -1) {
				document.getElementById('popupBg').style.position = 'fixed';
			}
			else {
				document.getElementById('popupBg').style.position = 'fixed';
			}
		}
		else if(navigator.appName == "Opera") {
			document.getElementById('popupBg').style.position = 'fixed';
		}
		else {
			document.getElementById('popupBg').style.position = 'fixed';
		}

		document.getElementById('popupBg').style.width = jwidth + 'px';
		document.getElementById('popupBg').style.height = jheight + 'px';

		try{
			window.attachEvent('onload', popLayerOn);
		}catch(e){
			window.addEventListener('load', popLayerOn, false);
		}

		try{
			window.attachEvent('onresize', popLayerOn);
		}catch(e){
			window.addEventListener('resize', popLayerOn, false);
		}

	}

	function popLayerOff() {
		document.getElementById('popupBg').style.display = 'none';
	}

	function close_div2(id)	
	{
	    pop_cardobj = document.getElementById(id);
		pop_cardobj.style.display="none";
		popLayerOff();
	}
/* 2010-06-18  - ÇÑ´Þ°£ Ã¢À» ¿­Áö ¾Ê½À´Ï´Ù(·¹ÀÌ¾î) */
function closeLayer2_m() {
	if (document.notice_form.chkbox.checked) {
		setCookie('maindiv2','done',30);
	}
document.all['theLayer2'].style.display="none";
}