(function(c){c.fn.menuModel=function(a){function m(b){c.each(b,function(d){this._type=1;this._id=d+1;this._parent=-1;c(">ul>li>a",this.parentNode).size()>0&&p(c(">ul>li>a",this.parentNode).get(),2,this._id)})}function p(b,d,g){c.each(b,function(l){this._type=d;this._id=l+1;this._parent=g;c(">ul>li>a",this.parentNode).size()>0&&q(c(">ul>li>a",this.parentNode).get(),3,this._id)})}function q(b,d,g){c.each(b,function(l){this._type=d;this._id=l+1;this._parent=g})}function r(b,d,g){d=RegExp(eval("/"+d+ "/g"));if(d.exec(b)!=null)b=b.replace(d,g);return b}function h(b,d,g){c(">img",b).length>0&&c(">img",b).attr("src",r(c(">img",b).attr("src"),d,g))}function i(b){a.visibled&&a.visibled._id!=b._parent&&e(a.visibled);a.subVisibled&&a.subVisibled._parent!=b._id&&e(a.subVisibled);c(b).addClass(a.activeClass);a.model==1&&a.parentYN&&h(b,a.imgOff,a.imgOn);c("+ul",b).css(a.showOps);a.visibled=b}function j(b){a.subVisibled&&e(a.subVisibled);c(b).addClass(a.activeClass);a.model==1&&a.childYN&&h(b,a.imgOff, a.imgOn);c("+ul",b).css(a.showOps);a.subVisibled=b}function k(b){a.ssubVisibled&&e(a.ssubVisibled);c(b).addClass(a.activeClass);a.model==1&&a.childYN&&h(b,a.imgOff,a.imgOn);a.ssubVisibled=b}function e(b){c(b).removeClass(a.activeClass);c("+ul",b).css(a.hideOps);a.model==1&&h(b,a.imgOn,a.imgOff)}function s(){f[0].getElementsByTagName("a");c.each(f[0].getElementsByTagName("a"),function(){switch(this._type){case 1:this.onmouseover=function(){i(this)};this.onfocus=function(){i(this)};break;case 2:this.onmouseover= function(){j(this)};this.onfocus=function(){j(this)};break;case 3:this.onmouseover=function(){k(this)};this.onfocus=function(){k(this)};break;default:break}if(this._type==1&&this._id==a.hightLight.level_1)a.hightLight.level_1_obj=this;else if(this._type==2&&this._parent==a.hightLight.level_1&&this._id==a.hightLight.level_2)a.hightLight.level_2_obj=this;else if(this._type==3&&this._parent==a.hightLight.level_2&&this._id==a.hightLight.level_3)a.hightLight.level_3_obj=this})}function t(){f[0].getElementsByTagName("a"); c.each(f[0].getElementsByTagName("a"),function(){if(this._type==1&&this._id==a.hightLight.level_1)a.hightLight.level_1_obj=this;else if(this._type==2&&this._parent==a.hightLight.level_1&&this._id==a.hightLight.level_2)a.hightLight.level_2_obj=this;else if(this._type==3&&this._parent==a.hightLight.level_2&&this._id==a.hightLight.level_3)a.hightLight.level_3_obj=this})}function n(){if(a.hightLight.level_1){c.each(f[0].getElementsByTagName("a"),function(){e(this)});if(a.hightLight.level_1_obj){i(a.hightLight.level_1_obj); if(a.hightLight.level_2_obj){j(a.hightLight.level_2_obj);a.hightLight.level_3_obj&&k(a.hightLight.level_3_obj)}}}else c.each(f[0].getElementsByTagName("a"),function(){e(this)})}function o(){c(a.target_obj).hover(function(){},function(){if(a.visibled){e(a.visibled);if(a.hightLight.level_1_obj){i(a.hightLight.level_1_obj);if(a.subVisibled){e(a.subVisibled);if(a.hightLight.level_2_obj){j(a.hightLight.level_2_obj);if(a.ssubVisibled){e(a.ssubVisibled);k(a.hightLight.level_3_obj)}}}}}})}var f=c(this);a= c.extend({model:1,parentYN:true,childYN:true,defaultLightMoveYN:true,target_obj:this,visibled:"",subVisibled:"",ssubVisibled:"",activeClass:"hover",showspeed:1E3,hidespeed:0,imgOn:"_on.gif",imgOff:".gif",showOps:{visibility:"visible"},hideOps:{visibility:"hidden"},hightLight:{level_1:0,level_1_obj:"",level_2:0,level_2_obj:"",level_3:0,level_3_obj:""}},a||{});switch(a.model){case 1:m(c(">li>a",f).get());s();n();o();break;case 2:m(c(">li>a",f).get());t();n();o();break}}})(jQuery);

function leftmenu(rootid,menucodel1,menucodel2,menucodel3){
	var root=document.getElementById(rootid).getElementsByTagName('ul')[0];
	var $root=$(root);
	var l2obj;
	var l3obj;
	var l4obj;
	function rplks(str,keywords,newkey) {
		var patt=new RegExp(eval("/"+keywords+"/g"));
		//var patt=new RegExp(keywords,'g');
		if(patt.exec(str)!= null){
			var str=str.replace(patt,newkey);
		}
		return str;
	}
	function curh(obj){
		
		$(obj).addClass('hover');
		$(obj.parentNode).addClass('bg0');
			
	}
	function cur(obj){
		if(obj.parentNode.parentNode.getElementsByTagName('ul').length>0){
			$(" ul",$(obj.parentNode.parentNode)).each(function (){
				$(this).css({display:'none'});
			})
		}
		if(obj.parentNode.getElementsByTagName('ul').length>0){
			$(">ul:first",obj.parentNode).css({display:'block'});
		}
	}
	function inthover(){
		if(typeof(menucodel1)=='undefined'||menucodel1==''||menucodel1=='0'){
			$(" ul",$root).each(function (){
				$(this).css({display:'none'});
			})
		}else{
			$(">li>a:first-child",$root).each(function (i){
				if(i==menucodel1-1){
					curh(this);
					cur(this);
					l2obj=this;
					$(">ul>li>a:first-child",$(this.parentNode)).each(function (i){
						if(i==menucodel2-1){
								curh(this);
								cur(this);
								l3obj=this;
						$(">ul>li>a:first-child",$(this.parentNode)).each(function (i){
						if(i==menucodel3-1){
								curh(this);
								cur(this);
								l4obj=this;	
								}
					})
						}
					})
				}
			})
		}
	}
	function recover(){
		curh(l2obj);
	}
	if(root){
		$root.hover(function (){},function (){
			recover();
		})
		inthover();
	}
}

//quickmenu.js Start
function scrollquick(name,bottomlimit){
	var topdis=50;
	if(!document.getElementById(name)){
		return;
	}
	var obj = $("#"+name);
	var btmlimit=parseInt(document.documentElement.scrollHeight-obj.height()-bottomlimit);
	var menuYloc = parseInt(obj.css("top").substring(0, obj.css("top").indexOf("px")));
	$(window).scroll(function() {
		if(menuYloc<$(document).scrollTop()){
			
		}else{
			topdis = menuYloc;
		}
		offset = topdis+parseInt($(document).scrollTop()) + "px";
		if(parseInt(offset)>btmlimit||menuYloc>btmlimit){
			return;
		}
		obj.animate({ top: offset }, { duration: 500, queue: false });
	});
}
//quickmenu.js End

//scrollnews.js Start
(function($){
$.fn.extend({
	Scroll:function(opt,callback){
		if(!opt) var opt={};
		var toint=function (str){
			if(str=='auto'||str.length<=0){
				str=0;
			}else{
				str=parseInt(str);
			}
			return str;
		}
		var _btnUp = $(opt.up);
		var _btnDown = $(opt.down);
		var _btnPlay = $(opt.autoplay);
		var _btnStop = $(opt.autostop);
		var timerID;
		var isautoplay=true;
		var _this=this.eq(0).find("ul:first");

		var lineH=_this.find("li:first").width(), 
			line=opt.line?parseInt(opt.line,10):parseInt(this.width()/lineH,10), 
			speed=opt.speed?parseInt(opt.speed,10):500; 
			timer=opt.timer //?parseInt(opt.timer,10):3000;
		var totalwidth=0;
		$('>li',_this).each(function (){
			totalwidth+=$(this).width()+toint($(this).css('margin-left'))+toint($(this).css('margin-right'))+13;
		});
		if(line==0) line=1;
		var upHeight=0-line*lineH;
		
		_this.css({width:totalwidth});
		_this.parent().css({overflow:'hidden'});
		var getWidth=function (){
			var _curli=_this.find("li:first");
			upHeight=0-_curli.width()-toint(_curli.css('margin-left'))-toint(_curli.css('margin-right'));
			return upHeight;
		}
		var scrollUp=function(){
			_btnUp.unbind("click",scrollUp);
			_this.animate({
					marginLeft:getWidth()
			},speed,function(){
					for(i=1;i<=line;i++){
							_this.find("li:first").appendTo(_this);
					}
					_this.css({marginLeft:0});
					_btnUp.bind("click",scrollUp);
			});
			return false;
		}
		var scrollDown=function(){
			_btnDown.unbind("click",scrollDown);
			for(i=1;i<=line;i++){
					_this.find("li:last").show().prependTo(_this);
			}
			_this.css({marginLeft:getWidth()});
			_this.animate({
					marginLeft:0
			},speed,function(){
					_btnDown.bind("click",scrollDown);
			});
			return false;
		}
		var autoPlay = function(){
				if(timer)window.clearInterval(timerID);
				if(timer)timerID = window.setInterval(scrollUp,timer);
		};
		var autoStop = function(){
				if(timer)window.clearInterval(timerID);
		};
		_this.parent().parent().hover(function(){
				autoStop();
		},function (){
			if(isautoplay){
				autoPlay();
			}
		});
		_btnUp.css("cursor","pointer").click(function (e){
			scrollUp();
			return false;
		});
		_btnDown.css("cursor","pointer").click(function (e){
			scrollDown();
			return false;
		});
		_btnPlay.click(function (e){
			autoPlay();
			isautoplay=true;
			return false;
		});
		_btnStop.click(function (e){
			autoStop();
			isautoplay=false;
			return false;
		});
		autoPlay();
	}
})
})(jQuery);

//scrollnews.js End

//tools.js Start
$(function(){
	$('#n6').click(function(){$('.column_input')[0].focus()});
	$('.column_input').focus(function(){ $('#n6').attr({checked:'checked'})});

	var rm = new scrollquick('quickmenu','200'); //따라다니는 Top 버튼 시작

	var CaliFrame = "<iframe id='CalendarControlIFrame' src='javascript:;' frameBorder='0' scrolling='no'></iframe><div id='CalendarControl'></div>";
	$(CaliFrame).appendTo("body"); //달력스크립트 iframe 삽입

	$(".Address").click(function(){

		var MapDiv = "<div id=\"mapWarp\"><div id=\"mapContainer\"></div><a href=\"#self\" Onclick=\"$('#mapWarp').remove();\" class=\"clse\"><img src=\"http://static.naver.com/kin/09renewal/btn_close_layer3.gif\" width=\"19\" height=\"19\" alt=\"닫기\"></a></div>";

		$(MapDiv).appendTo("body");

		var addressStr = $(this).text();

		var offset = $(this).offset();
		l = offset.left-250;
		t = offset.top+30;

		addressStr = addressStr.replace("경산시 ","");
		addressStr = addressStr.replace("경산","");

		$.ajax({
			type: "POST",
			url: "/gs_k/inc/get_NaverMapXY.jsp",
			data: "query="+addressStr,
			success: function(msg){
				//var addressStr = msg;
				//alert(msg);


				if (msg == "") {alert("주소검색 오류 입니다."); return false;}
				$("#mapWarp").css({left:l,top:t}).slideDown('nomal');

				//msg = $("#addressStr").text()

				var arrMsg = msg.split('|');
				x = arrMsg[0];
				y = arrMsg[1];
//alert(y);
				var opts = {width:500, height:300, mapMode:0};

				var mapObj = new NMap(document.getElementById('mapContainer'),opts);
				var infowin = new NInfoWindow();


				/* 지도 좌표, 축적 수 준 초기화 */
				var pos = new NPoint(x, y);
				mapObj.setCenterAndZoom(pos,2);

				/* 지도 컨트롤 생성 */
				var zoom = new NZoomControl();

				zoom.setAlign("right");
				zoom.setValign("top");
				mapObj.addControl(zoom);

				/* 지도 모드 변경 버튼 생성 */
				var mapBtns = new NMapBtns();
				mapBtns.setAlign("right");
				mapBtns.setValign("top");
				mapObj.addControl(mapBtns);

				mapObj.addOverlay(infowin);
				var iconUrl = "http://static.naver.com/local/uploader/pin01.gif";

				var marker = new NMark(pos, new NIcon(iconUrl, new NSize(26, 26)));
				infowin.set(pos, '<div style="width:auto; height:auto; background-color:#ffffff; border:solid 1px #666666;padding:2px;margin-left:10px;">' + addressStr + '</div>');
				infowin.showWindow();
				mapObj.addOverlay(marker);
				$("#mapWarp").draggable();
			}
		});
	});
})
//tools.js End


//달력스크립트 시작
function CalendarControl() {

  var calendarId = 'CalendarControl';
  var currentYear = 0;
  var currentMonth = 0;
  var currentDay = 0;

  var selectedYear = 0;
  var selectedMonth = 0;
  var selectedDay = 0;


  var months = ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'];
  var dateField = null;

  function getProperty(p_property){
    var p_elm = calendarId;
    var elm = null;

    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    if (elm != null){
      if(elm.style){
        elm = elm.style;
        if(elm[p_property]){
          return elm[p_property];
        } else {
          return null;
        }
      } else {
        return null;
      }
    }
  }

  function setElementProperty(p_property, p_value, p_elmId){
    var p_elm = p_elmId;
    var elm = null;

    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    if((elm != null) && (elm.style != null)){
      elm = elm.style;
      elm[ p_property ] = p_value;
    }
  }

  function setProperty(p_property, p_value) {
    setElementProperty(p_property, p_value, calendarId);
  }

  function getDaysInMonth(year, month) {
    return [31,((!(year % 4 ) && ( (year % 100 ) || !( year % 400 ) ))?29:28),31,30,31,30,31,31,30,31,30,31][month-1];
  }

  function getDayOfWeek(year, month, day) {
    var date = new Date(year,month-1,day)
	//alert(date);
    return date.getDay();

  }

  this.clearDate = clearDate;
  function clearDate() {
    dateField.value = '';
    hide();
  }

  this.setDate = setDate;
  function setDate(year, month, day) {
    if (dateField) {
      if (month < 10) {month = "0" + month;}
      if (day < 10) {day = "0" + day;}

      //var dateString = month+"-"+day+"-"+year;
	  var dateString = year+"-"+month+"-"+day;
      dateField.value = dateString;
      hide();
    }
    return;
  }

  this.changeMonth = changeMonth;
  function changeMonth(change) {
    currentMonth += change;
    currentDay = 0;
    if(currentMonth > 12) {
      currentMonth = 1;
      currentYear++;
    } else if(currentMonth < 1) {
      currentMonth = 12;
      currentYear--;
    }

    calendar = document.getElementById(calendarId);
    calendar.innerHTML = calendarDrawTable();
  }

  this.changeYear = changeYear;
  function changeYear(change) {
    currentYear += change;
    currentDay = 0;
    calendar = document.getElementById(calendarId);
    calendar.innerHTML = calendarDrawTable();
  }

  function getCurrentYear() {
    var year = new Date().getYear();
    if(year < 1900) year += 1900;
    return year;
  }

  function getCurrentMonth() {
    return new Date().getMonth() + 1;
  } 

  function getCurrentDay() {
    return new Date().getDate();
  }

  function calendarDrawTable() {

    var dayOfMonth = 1;
    var validDay = 0;
    var startDayOfWeek = getDayOfWeek(currentYear, currentMonth, dayOfMonth);
    var daysInMonth = getDaysInMonth(currentYear, currentMonth);
    var css_class = null; //CSS class for each day

    var table = "<table cellspacing='0' cellpadding='0' border='0'>";
    table = table + "<tr class='date' height='40'>";
    table = table + "  <td colspan='2'><a href='javascript:changeCalendarControlMonth(-1);'><img src='/img/common/car_pre.gif' border='0'></a> <a href='javascript:changeCalendarControlYear(-1);'><img src='/img/common/car_pre10.gif' border='0'></a></td>";
    table = table + "  <td colspan='3' class='title'>" + months[currentMonth-1] + "<br>" + currentYear + "</td>";
    table = table + "  <td colspan='2'><a href='javascript:changeCalendarControlYear(1);'><img src='/img/common/car_nxt10.gif' border='0'></a> <a href='javascript:changeCalendarControlMonth(1);'><img src='/img/common/car_nxt.gif' border='0'></a></td>";
    table = table + "</tr>";
    table = table + "<tr height='25px'><th>일</th><th>월</th><th>화</th><th>수</th><th>목</th><th>금</th><th>토</th></tr>";

    for(var week=0; week < 6; week++) {
      table = table + "<tr>";
      for(var dayOfWeek=0; dayOfWeek < 7; dayOfWeek++) {
        if(week == 0 && startDayOfWeek == dayOfWeek) {
          validDay = 1;
        } else if (validDay == 1 && dayOfMonth > daysInMonth) {
          validDay = 0;
        }

        if(validDay) {
          if (dayOfMonth == selectedDay && currentYear == selectedYear && currentMonth == selectedMonth) {
            css_class = 'current';
          } else if (dayOfWeek == 0 || dayOfWeek == 6) {
            css_class = 'weekend';
          } else {
            css_class = 'weekday';
          }

          table = table + "<td><a class='"+css_class+"' href=\"javascript:setCalendarControlDate("+currentYear+","+currentMonth+","+dayOfMonth+")\">"+dayOfMonth+"</a></td>";
          dayOfMonth++;
        } else {
          table = table + "<td class='empty'> </td>";
        }
      }
      table = table + "</tr>";
    }

    table = table + "<tr class='header'><th colspan='7' style='padding: 3px;' height='25px'><a href='javascript:clearCalendarControl();'>지우기</a> &nbsp; <a href='javascript:hideCalendarControl();'>닫기</a></td></tr>";
    table = table + "</table>";

    return table;
  }

  this.show = show;
  function show(field) {
    can_hide = 0;
  
    // If the calendar is visible and associated with
    // this field do not do anything.
    if (dateField == field) {
      return;
    } else {
      dateField = field;
    }

    if(dateField) {
      try {
        var dateString = new String(dateField.value);
        var dateParts = dateString.split("-");
        
        selectedMonth = parseInt(dateParts[1],10);
        selectedDay = parseInt(dateParts[2],10);
        selectedYear = parseInt(dateParts[0],10);
      } catch(e) {}
    }

    if (!(selectedYear && selectedMonth && selectedDay)) {
      selectedMonth = getCurrentMonth();
      selectedDay = getCurrentDay();
      selectedYear = getCurrentYear();
    }

    currentMonth = selectedMonth;
    currentDay = selectedDay;
    currentYear = selectedYear;

    if(document.getElementById){

      calendar = document.getElementById(calendarId);
      calendar.innerHTML = calendarDrawTable(currentYear, currentMonth);

      setProperty('display', 'block');

      var fieldPos = new positionInfo(dateField);
      var calendarPos = new positionInfo(calendarId);

      var x = fieldPos.getElementLeft();
      var y = fieldPos.getElementBottom();

	  //레이어 코딩시 밀리는것때문에 일단 작업
	  if(document.getElementById("centercolumn")){
			y=y-230;
	  }
      setProperty('left', x + "px");
      setProperty('top', y + "px");
 
      if (document.all) {
        setElementProperty('display', 'block', 'CalendarControlIFrame');
        setElementProperty('left', x + "px", 'CalendarControlIFrame');
        setElementProperty('top', y + "px", 'CalendarControlIFrame');
        setElementProperty('width', calendarPos.getElementWidth() + "px", 'CalendarControlIFrame');
        setElementProperty('height', calendarPos.getElementHeight() + "px", 'CalendarControlIFrame');
      }
    }
  }

  this.hide = hide;
  function hide() {
    if(dateField) {
      setProperty('display', 'none');
      setElementProperty('display', 'none', 'CalendarControlIFrame');
      dateField = null;
    }
  }

  this.visible = visible;
  function visible() {
    return dateField
  }

  this.can_hide = can_hide;
  var can_hide = 0;
}

var calendarControl = new CalendarControl();

function showCalendarControl(textField) {
  // textField.onblur = hideCalendarControl;
  calendarControl.show(textField);
}

function clearCalendarControl() {
  calendarControl.clearDate();
}

function hideCalendarControl() {
  if (calendarControl.visible()) {
    calendarControl.hide();
  }
}

function setCalendarControlDate(year, month, day) {
  calendarControl.setDate(year, month, day);
}

function changeCalendarControlYear(change) {
  calendarControl.changeYear(change);
}

function changeCalendarControlMonth(change) {
  calendarControl.changeMonth(change);
}

//document.write("<iframe id='CalendarControlIFrame' src='javascript:;' frameBorder='0' scrolling='no'></iframe>");
//document.write("<div id='CalendarControl'></div>");
/*달력 스크립트 끝*/

var oldObj	= "";
var oldObj2 = "";
var oldImg	= "";
function viewMenu(menuID) 
{
	var objMenu		= document.getElementById("LEFT_"+menuID);
	var objMenu2	= document.getElementById("LEFT2_"+menuID);
	var objImg		= document.getElementById("IMG_"+menuID);

	if(oldObj != objMenu) {
		if(oldObj != "") {
			oldObj.style.display	= "none";
			oldObj2.style.display	= "none";
			oldImg.className		= "icon_plus";
		}
		objMenu.style.display	= "block";
		objMenu2.style.display	= "block";
		objImg.className		= "icon_minus";
		oldObj					= objMenu;
		oldObj2					= objMenu2;
		oldImg					= objImg;
	}else{
		oldObj.style.display	= "none";
		oldObj2.style.display	= "none";
		objImg.className		= "icon_plus";
		oldObj					= "";
		oldObj2					= "";
		oldImg					= "";
	}
}

/*  UTF-8 인코딩 */
function encodeURL(str){
    var s0, i, s, u;
    s0 = "";                // encoded str
    for (i = 0; i < str.length; i++){   // scan the source
        s = str.charAt(i);
        u = str.charCodeAt(i);          // get unicode of the char
        if (s == " "){s0 += "+";}       // SP should be converted to "+"
        else {
            if ( u == 0x2a || u == 0x2d || u == 0x2e || u == 0x5f || ((u >= 0x30) && (u <= 0x39)) || ((u >= 0x41) && (u <= 0x5a)) || ((u >= 0x61) && (u <= 0x7a))){       // check for escape
                s0 = s0 + s;            // don't escape
            }
            else {                  // escape
                if ((u >= 0x0) && (u <= 0x7f)){     // single byte format
                    s = "0"+u.toString(16);
                    s0 += "%"+ s.substr(s.length-2);
                }
                else if (u > 0x1fffff){     // quaternary byte format (extended)
                    s0 += "%" + (oxf0 + ((u & 0x1c0000) >> 18)).toString(16);
                    s0 += "%" + (0x80 + ((u & 0x3f000) >> 12)).toString(16);
                    s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
                }
                else if (u > 0x7ff){        // triple byte format
                    s0 += "%" + (0xe0 + ((u & 0xf000) >> 12)).toString(16);
                    s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
                }
                else {                      // double byte format
                    s0 += "%" + (0xc0 + ((u & 0x7c0) >> 6)).toString(16);
                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
                }
            }
        }
    }
    return s0;
}

/*  UTF-8 디코딩 */
function decodeURL(str){
    var s0, i, j, s, ss, u, n, f;
    s0 = "";                // decoded str
    for (i = 0; i < str.length; i++){   // scan the source str
        s = str.charAt(i);
        if (s == "+"){s0 += " ";}       // "+" should be changed to SP
        else {
            if (s != "%"){s0 += s;}     // add an unescaped char
            else{               // escape sequence decoding
                u = 0;          // unicode of the character
                f = 1;          // escape flag, zero means end of this sequence
                while (true) {
                    ss = "";        // local str to parse as int
                        for (j = 0; j < 2; j++ ) {  // get two maximum hex characters for parse
                            sss = str.charAt(++i);
                            if (((sss >= "0") && (sss <= "9")) || ((sss >= "a") && (sss <= "f"))  || ((sss >= "A") && (sss <= "F"))) {
                                ss += sss;      // if hex, add the hex character
                            } else {--i; break;}    // not a hex char., exit the loop
                        }
                    n = parseInt(ss, 16);           // parse the hex str as byte
                    if (n <= 0x7f){u = n; f = 1;}   // single byte format
                    if ((n >= 0xc0) && (n <= 0xdf)){u = n & 0x1f; f = 2;}   // double byte format
                    if ((n >= 0xe0) && (n <= 0xef)){u = n & 0x0f; f = 3;}   // triple byte format
                    if ((n >= 0xf0) && (n <= 0xf7)){u = n & 0x07; f = 4;}   // quaternary byte format (extended)
                    if ((n >= 0x80) && (n <= 0xbf)){u = (u << 6) + (n & 0x3f); --f;}         // not a first, shift and add 6 lower bits
                    if (f <= 1){break;}         // end of the utf byte sequence
                    if (str.charAt(i + 1) == "%"){ i++ ;}                   // test for the next shift byte
                    else {break;}                   // abnormal, format error
                }
            s0 += String.fromCharCode(u);           // add the escaped character
            }
        }
    }
    return s0;
}

/* G-PIN 인증 및 실명인증 창으로 이동 */
function nameCheckPopup(rtnUrl) {
	location.href="/common/certificate.jsp?rtnUrl="+encodeURL(rtnUrl);
}
