(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(c){c.fn.menuUpdate=function(a){function l(b){c.each(b,function(d){this._type=1;this._id=d+1;this._parent=-1;c(" ul>li>a",this.parentNode).size()>0&&o(c(" ul>li>a",this.parentNode).get(),2,this._id)})}function o(b,d,g){c.each(b,function(p){this._type=d;this._id=p+1;this._parent=g})}function q(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",q(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 r(){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 s(){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 m(){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 n(){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:l(c(">li>a",f).get());r();m();n();break;case 2:l(c(">li>a",f).get());s();m();n();break}}})(jQuery);
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 });
	});
}

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					= "";
	}
}

jQuery(document).ready(function(){
	var rm = new scrollquick('quickmenu','200');

	$(".Address").click(function(){
		
		if($('#mapWarp')) $('#mapWarp').remove();

		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;

		$.ajax({
			type: "POST",
			url: "/gs_k/inc/get_NaverMapXY.jsp",
			data: "query="+addressStr,
			success: function(msg){

				if (msg == "") {alert("주소검색 오류 입니다."); return false;}
				$("#mapWarp").css({left:l,top:t}).slideDown('nomal');

				var arrMsg = msg.split('|');
				x = arrMsg[0];
				y = arrMsg[1];

				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();
			}
		});
	});
});


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();
	}
}

(function(c){c.fn.menuModel=function(a){function k(b,d,f){c.each(b,function(l){this._type=d;this._id=l+1;this._parent=f})}function m(b,d,f){d=new RegExp(eval("/"+d+"/g"));if(d.exec(b)!=null)b=b.replace(d,f);return b}function j(b,d,f){c(">img",b).length>0&&c(">img",b).attr("src",m(c(">img",b).attr("src"),d,f))}function h(b){a.visibled&&a.visibled._id!=b._parent&&e(a.visibled);c(b).addClass(a.activeClass);a.model==1&&a.parentYN&&j(b,a.imgOff,a.imgOn);c("+ul",b).css(a.showOps);a.visibled=b}function i(b){a.subVisibled&& e(a.subVisibled);c(b).addClass(a.activeClass);a.model==1&&a.childYN&&j(b,a.imgOff,a.imgOn);a.subVisibled=b}function e(b){c(b).removeClass(a.activeClass);c("+ul",b).css(a.hideOps);a.model==1&&j(b,a.imgOn,a.imgOff)}var g=c(this);a=c.extend({model:1,parentYN:true,childYN:true,defaultLightMoveYN:true,visibled:"",subVisibled:"",activeClass:"hover",showspeed:1E3,hidespeed:0,imgOn:"_on.gif",imgOff:".gif",showOps:{visibility:"visible"},hideOps:{visibility:"hidden"},hightLight:{level_1:3,level_1_obj:"",level_2:1, level_1_obj:""}},a||{});(function(b){c.each(b,function(d){this._type=1;this._id=d+1;this._parent=-1;c("ul>li>a",this.parentNode).size()>0&&k(c("ul>li>a",this.parentNode).get(),2,this._id)})})(c(">li>a",g).get());(function(){c.each(g[0].getElementsByTagName("a"),function(){if(this._type==1){this.onmouseover=function(){h(this)};this.onfocus=function(){h(this)}}else{this.onmouseover=function(){i(this)};this.onfocus=function(){i(this)}}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})})();(function(){if(a.hightLight.level_1){c.each(g[0].getElementsByTagName("a"),function(){e(this)});if(a.hightLight.level_1_obj){h(a.hightLight.level_1_obj);a.hightLight.level_2_obj&&i(a.hightLight.level_2_obj)}}else c.each(g[0].getElementsByTagName("a"),function(){e(this)})})();(function(){g.hover(function(){},function(){if(a.visibled){e(a.visibled);a.hightLight.level_1_obj&& h(a.hightLight.level_1_obj)}if(a.subVisibled){e(a.subVisibled);a.hightLight.level_2_obj&&i(a.hightLight.level_2_obj)}})})()}})(jQuery);

function tabcon(str){
	
	function hideall(){
		for(i=1;i<=5;i++){
			
				document.getElementById('tab'+i).className='';
				//alert(i);
				//alert( document.getElementById('tabcon'+i))
			    document.getElementById('tabcon'+i).style.visibility='hidden';
		}
	}
	for(i=1;i<=5;i++){		
		document.getElementById('tab'+i).onclick=function (e){
			 hideall();
			 document.getElementById('tabcon'+this.id.charAt(3)).style.visibility='visible';
			 this.className='onhover';
		}
		document.getElementById('tab'+i).onmouseover=function (e){
			 hideall();
			 document.getElementById('tabcon'+this.id.charAt(3)).style.visibility='visible';
			this.className='onhover';
		}
	}
	hideall();
    if(str){
		document.getElementById('tab'+str).className='onhover';
		document.getElementById('tabcon'+str).style.visibility='visible';
		
		}
}

function tabcons(){
	function hideall(){
		for(i=1;i<=15;i++){
			    document.getElementById('tabcont'+i).style.display='none';
				document.getElementById('tabcont'+i).parentNode.style.padding='0';
				document.getElementById('tabcont'+i).parentNode.style.border='0';
		}
	}
	for(i=1;i<=15;i++){		
		    document.getElementById('tabt'+i).onclick=function (e){
			 hideall();
			 document.getElementById('tabcont'+this.id.substring(4)).style.display='block';
			 document.getElementById('tabcont'+this.id.substring(4)).style.padding='0';
		}
	}
	hideall();
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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					= "";
	}
}


//플래시 스크립트
function embedFlash(src, width, height, id)
{
	//var content ="";
	content="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' "+
			"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0'"+
			"width='"+width+"' height='"+height+"' id='"+id+"'>"+
			"<param name='movie' value='"+src+"'>"+
			"<param name='wmode' value='transparent'>"+
			"<param name='quality' value='high'>"+
			"<embed src='"+src+"' wmode='transparent' quality='high' "+
			"pluginspage='http://www.macromedia.com/go/getflashplayer' "+
			"type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed>"+
			"</object>";
	document.write(content);
}

function embedMovie(src, width, height)
{
	content="<OBJECT ID='MediaPlayer' align='middle' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'"+
			"codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' "+
			"standby='Loading Microsoft Windows Media Player components...' "+
			"type='application/x-oleobject' width='"+width+"' height='"+height+"'>\n"+ 
			"		<param name='Filename' value='"+src+"'>\n"+
			"		<param NAME='AudioStream' VALUE='-1'>\n"+
			"		<param NAME='AutoSize' VALUE='0'>\n"+
			"		<param NAME='AutoStart' VALUE='-1'>\n"+
			"		<param NAME='AnimationAtStart' VALUE='-1'>\n"+
			"		<param NAME='AllowScan' VALUE='-1'>\n"+
			"		<param NAME='AllowChangeDisplaySize' VALUE='-1'>\n"+
			"		<param NAME='AutoRewind' VALUE='-1'>\n"+
			"		<param NAME='Balance' VALUE='0'>\n"+
			"		<param NAME='BaseURL' VALUE>\n"+
			"		<param NAME='BufferingTime' VALUE='7'>\n"+
			"		<param NAME='CaptioningID' VALUE>\n"+
			"		<param NAME='ClickToPlay' VALUE='-1'>\n"+
			"		<param NAME='CursorType' VALUE='0'>\n"+
			"		<param NAME='CurrentPosition' VALUE='-1'>\n"+
			"		<param NAME='CurrentMarker' VALUE='-1'>\n"+  
			"		<param NAME='DefaultFrame' VALUE='1'>\n"+
			"		<param NAME='DisplayBackColor' VALUE='0'>\n"+
			"		<param NAME='DisplayForeColor' VALUE='16777215'>\n"+
			"		<param NAME='DisplayMode' VALUE='1'>\n"+
			"		<param NAME='DisplaySize' VALUE='2'>\n"+	//<!-- 창 크기 -->\n"+
			"		<param NAME='Enabled' VALUE='-1'>\n"+
			"		<param NAME='EnableContextMenu' VALUE='1'>\n"+
			"		<param NAME='EnablePositionControls' VALUE='-1'>\n"+
			"		<param NAME='EnableFullScreenControls' VALUE='0'>\n"+
			"		<param NAME='EnableTracker' VALUE='-1'>\n"+
			"		<param NAME='InvokeURLs' VALUE='-1'>\n"+
			"		<param NAME='Language' VALUE='-1'>\n"+
			"		<param NAME='Mute' VALUE='0'>\n"+
			"		<param NAME='PlayCount' VALUE='1'>\n"+
			"		<param NAME='PreviewMode' VALUE='0'>\n"+
			"		<param NAME='Rate' VALUE='1'>\n"+
			"		<param NAME='SAMILang' VALUE>\n"+
			"		<param NAME='SAMIStyle' VALUE>\n"+
			"		<param NAME='SAMIFileName' VALUE>\n"+
			"		<param NAME='SelectionStart' VALUE='-1'>\n"+
			"		<param NAME='SelectionEnd' VALUE='-1'>\n"+
			"		<param NAME='SendOpenStateChangeEvents' VALUE='-1'>\n"+
			"		<param NAME='SendWarningEvents' VALUE='-1'>\n"+
			"		<param NAME='SendErrorEvents' VALUE='-1'>\n"+
			"		<param NAME='SendKeyboardEvents' VALUE='0'>\n"+
			"		<param NAME='SendMouseClickEvents' VALUE='0'>\n"+
			"		<param NAME='SendMouseMoveEvents' VALUE='0'>\n"+
			"		<param NAME='SendPlayStateChangeEvents' VALUE='-1'>\n"+
			"		<param NAME='ShowCaptioning' VALUE='0'>\n"+
			"		<param NAME='ShowControls' VALUE='1'>\n"+
			"		<param NAME='ShowAudioControls' VALUE='1'>\n"+
			"		<param NAME='ShowDisplay' VALUE='0'>\n"+  //<!-- 쇼, 클립, 만든이, 저작권 표시  -->\n"+
			"		<param NAME='ShowGotoBar' VALUE='0'>\n"+  //<!-- 재생, 정지메뉴 밑의 '바' 없애기 -->\n"+
			"		<param NAME='ShowPositionControls' VALUE='1'>\n"+
			"		<param NAME='ShowStatusBar' VALUE='1'>\n"+
			"		<param NAME='ShowTracker' VALUE='1'>\n"+
			"		<param NAME='TransparentAtStart' VALUE='1'>\n"+
			"		<param NAME='VideoBorderWidth' VALUE='0'>\n"+
			"		<param NAME='VideoBorderColor' VALUE='0'>\n"+
			"		<param NAME='VideoBorder3D' VALUE='0'>\n"+
			"		<param NAME='Volume' VALUE='-200'>\n"+
			"		<param NAME='WindowlessVideo' VALUE='0'>\n"+ //<!-- 화면 재생 여부 -->\n"+			
			"		<EMBED type='application/x-MediaPlayer12' "+
					"pluginspage = 'http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'	"+
					"src=''	name='MediaPlayer' width='"+width+"' height='"+height+"' ShowControls='0'>\n"+
			"		</EMBED>\n"+
			"	</object>"; 
	document.write(content);
}

var swapID	= "";
function swapImage(a) {
	if(swapID != "" || swapID == null) {
		swapImgRestore(swapID);
	}
	document.getElementById(a).src = "/S0001/img/main/"+a+"_on.gif";
	swapID = a;
}
function swapImgRestore(id) {
	document.getElementById(id).src = "/S0001/img/main/"+id+"_off.gif";
}



/*  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;
}

/* IP 유효성 체크 */
function validateIP(src)
{
	var partten = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
	var arrayMatch = src.match(partten);

	if(arrayMatch == null) return false;

	for(i=0;i<arrayMatch.length;i++)
	{
		if(arrayMatch[i] > 254) return false;
	}

	return true;
}

/* 페이지이동 */
function movePage(pageNo)
{
	document.frm.action	="?pageNo="+pageNo;
	document.frm.submit();
}

/* 아이디 찾기 */
function searchID()
{
	window.open("/common/memSearchID.jsp", "_searchID", "toolbar=no,locationbar=no");
}

/* 우편번호 찾기 */
function searchZipcode()
{
	window.open("/common/searchZipcode.jsp", "_searchZip", "toolbar=no,locationbar=no");
}

function popupOpen(url,vscrollbars,vtoolbar,vmenubar,vlocation,vwidth,vheight){		

	window.open(url,'_PopUp','scrollbars='+vscrollbars+',toolbar='+vtoolbar+',menubar='+vmenubar+',location='+vlocation+',width='+vwidth+',height='+vheight+',location=no')

}

/* 팝업창 위치 잡기 */
function setPosition(valueW, valueH)
{
	if(navigator.appVersion.indexOf("MSIE 7.0") > 0) {
		valueW = valueW;
		valueH = valueH + 21;
	} else {
		valueW = valueW;
		valueH = valueH - 1;
	}

	var height	= screen.height;
	var width	= screen.width;
	var leftpos = width / 2 - valueW / 2;
	var toppos	= height / 2 - valueH / 2;

	self.resizeTo(valueW, valueH);
	self.moveTo(leftpos, toppos);
	self.resizeTo(valueW, valueH);		// 이유없다 resize잘안되어서 한번더 call
}

function getCookie( name ){ 
	var nameOfCookie = name + "="; 
	var x = 0; 
	while ( x <= document.cookie.length ) 
	{ 
			var y = (x+nameOfCookie.length); 
			if ( document.cookie.substring( x, y ) == nameOfCookie ) { 
					if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
							endOfCookie = document.cookie.length; 
					return unescape( document.cookie.substring( y, endOfCookie ) ); 
			} 
			x = document.cookie.indexOf( " ", x ) + 1; 
			if ( x == 0 ) 
					break; 
	} 
	return ""; 
}

function setCookie(name, value, expiredays)
{
	var today = new Date();
	today.setDate( today.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
}

function viewPopup(pop_uid) 
{
	var objPop = document.all["popup_" + pop_uid];
	if(objPop.style.display == "none") {
		objPop.style.display = "block";
	} else if (objPop.style.display == "block") {
		objPop.style.display = "none";
	}
}

function closewin(pop_uid)
{
	setCookie(pop_uid, "popChk", 1);
	viewPopup(pop_uid);
}


/* editor 입력 체크 */
function validateContent(obj)
{
	if(FCKeditorAPI.GetInstance(obj).GetXHTML() == "") {
		return false;
	}
	return true;
}

/* 레이어 리사이즈 */
function divResize()
{
	document.getElementById("LIST").style.height = document.body.clientHeight - document.getElementById("TBL").clientHeight;
}

/* 첨부파일 체크 */
function checkFile(formName)
{
	var	formName	= eval(formName);
	if(checkImgExt(formName.value) == false && formName.value.replace(/ /g, "").length != 0) {
		alert("이미지파일만 허용됩니다.");
		formName.select();
		document.selection.clear();
		return false;
	}
	return true;
}


/* 확장자 검사 */
function checkImgExt(str) {
	// 확장자 비교 
	compStr = new Array("gif","jpg","jpeg","bmp","png"); 
	
	// 확장자 가져오기 
	idx = str.lastIndexOf('.'); 
	if( idx != -1 ) { 
		ext = str.substring( idx+1, str.len ); 
	} else { 
		ext = ""; 
	} 
	
	if(ext != "") {
		for (var i = 0; i < compStr.length; i++) {
			if (compStr[i] == ext.toLowerCase()) { 
				return true; 
				break; 
			}
		}
	}
	return 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 ''; 
}

//수동 탭메뉴 처리
var preTabpage = "";
function showTabPage(tabID) {
	var tabPage		= document.getElementById("tab_"+tabID);

	if(preTabpage != tabPage) {
		if(preTabpage != "") {
			preTabpage.style.display	= "none";
		}else{
			document.getElementById("tab_1").style.display	= "none";
		}
		tabPage.style.display	= "block";
		preTabpage					= tabPage;
	}
	/*
	else{
		preTabpage.style.display	= "none";
		preTabpage					= "";
	}
	*/
}

/* 네비게이션 서브메뉴 */
var preNaviID	= "";
var preOver		= "";
var preSub		= "";
function showSubNavi(naviID) {
	var over	= document.getElementById("over"+naviID);
	var sub		= document.getElementById("sub"+naviID);

	if(preNaviID != naviID || preNaviID == "") {
		if(preNaviID != "" || preNaviID == null) {
			document.getElementById("over"+preNaviID).style.display	= "none";
			document.getElementById("sub"+preNaviID).style.display	= "none";
		}
		over.style.display	= "block";
		sub.style.display	= "block";
		preNaviID			= naviID;
	}

}
function showSubSiteNavi(naviID) {
	var sub		= document.getElementById(naviID);

	if(preNaviID != naviID || preNaviID == "") {
		if(preNaviID != "" || preNaviID == null) {
			document.getElementById(preNaviID).style.visibility	= "hidden";
		}
		sub.style.visibility	= "visible";
		preNaviID				= naviID;
	}

}

/* 서브 사이트 레프트 메뉴 */
var oldObj	= "";
var oldImg	= "";
function subSiteviewMenu(menuID) 
{
	var objMenu		= document.getElementById(menuID);

	if(oldObj != objMenu) {
		if(oldObj != "") {
			oldObj.style.display	= "none";
		}
		objMenu.style.display	= "block";
		oldObj					= objMenu;
	}else{
		oldObj.style.display	= "none";
		oldObj					= "";
	}
}

/* 라디오박스 체크 */
function ValidateForm(theForm){
	is_checked = false;
	if(theForm.length > 1) {
		for (i=0;i<theForm.length;i++) {
			if (theForm[i].checked) {
				is_checked = true;
				break;
			}
		} 
	}else{
		if (theForm.checked) {
			is_checked = true;
		}
	}
	return is_checked;
}

/* 부서팝업 */
function showDeptInfo(dept_id) {
	popupOpen("/common/deptInfoView.jsp?dept_id="+dept_id,1,0,0,0,550,650);
}

/* 이미지 뷰어 팝업 */
function viewImage(imgPath, imgFile) {
	popupOpen("/common/imgView.jsp?imgPath="+imgPath+"&imgFile="+imgFile,0,0,0,0,1,1);
}

//문자 일정일기 채우기 */
function getStrLpad(n, inval)
{
	var tmp = "00000" + inval;
	var len = tmp.length;
	return (tmp.substring(len - n, len));
}

/* 클립보드 복사 */
function CopyClibboard(link)
{
    if(window.clipboardData.setData('Text', link)){
		alert("주소가 복사되었습니다");
	}
}

/* 글짜크기 크게 작게 */
function getFontCookie() { 
	var fontSize = getCookie("font_size"); 
	try { 
		if ( fontSize == null ) return 16; 
		if ( fontSize.length ) return parseInt(fontSize); else return 16; 
	} catch (e) { 
		return 16; 
	} 
} 
var fontSize = getFontCookie(); 

function scaleFont(val) { 
	var content, lineHeight; 
	var oldContent = document.getElementById("oldCnt"); 
	content = document.getElementById("ctn"); 
	
	if (oldContent != null) 
		content = oldContent; 
		if (val > 0) { 
			if (fontSize <= 18) { 
				fontSize = fontSize + val; 
				lineHeight = fontSize+Math.round(1.1*fontSize); 
				content.style.fontSize = fontSize + "px"; 
			} 
		} else { 
			if (fontSize > 12) { 
				fontSize = fontSize + val; 
				lineHeight = fontSize+Math.round(1.1*fontSize); 
				content.style.fontSize = fontSize + "px"; 
			} else { 
				lineHeight = fontSize+Math.round(1.1*fontSize); 
				content.style.fontSize = fontSize + "px"; 
			} 
		} 
	var mydate = new Date; mydate.setDate(mydate.getDate()+1000); 
	setCookie("font_size", fontSize, mydate); 
}

/* 페이지 프린트 */
function printPage()
{
    printFrame.printContent ( ctn.innerHTML );
    return;
}

function goSelectUrl(type) {
	var selectID = document.getElementById(type);
	if(selectID.value == ""){
		alert("목록을 선택하십시요.");
		selectID.focus();
		return false;
	}else{
		window.open(selectID.value, "_blank");
	}
}

function goSelectUrlSelf(type) {
	var selectID = document.getElementById(type);
	if(selectID.value == ""){
		alert("목록을 선택하십시요.");
		selectID.focus();
		return false;
	}else{
		location.href = selectID.value;
		//window.open(selectID.value, "_blank");
	}
}

function positionInfo(object) {

  var p_elm = object;

  this.getElementLeft = getElementLeft;
  function getElementLeft() {
    var x = 0;
    var elm;
    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    while (elm != null) {
      x+= elm.offsetLeft;
      elm = elm.offsetParent;
    }
    return parseInt(x);
  }

  this.getElementWidth = getElementWidth;
  function getElementWidth(){
    var elm;
    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    return parseInt(elm.offsetWidth);
  }

  this.getElementRight = getElementRight;
  function getElementRight(){
    return getElementLeft(p_elm) + getElementWidth(p_elm);
  }

  this.getElementTop = getElementTop;
  function getElementTop() {
    var y = 0;
    var elm;
    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    while (elm != null) {
      y+= elm.offsetTop;
      elm = elm.offsetParent;
    }
    return parseInt(y);
  }

  this.getElementHeight = getElementHeight;
  function getElementHeight(){
    var elm;
    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    return parseInt(elm.offsetHeight);
  }

  this.getElementBottom = getElementBottom;
  function getElementBottom(){
    return getElementTop(p_elm) + getElementHeight(p_elm);
  }
}

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>");
/*달력 스크립트 끝*/

//퀵링크 스크립트 시작
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 });
	});
}

function OpenWell(){
	window.open('/wellbeing/page.jsp?site_id=wellbeing&mnu_uid=4621','','width=820,statusbar=0,scrollbars=1');
}


/*  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;
}


/* 오류 게시판 */
function bugBoard(bugTit) {
//	window.open("/common/nameCheck.jsp?winOpt=1&rtnUrl="+encodeURL(bugTit), "_gPinLoginWin", "width=350,height=270,scrollbars=1");
	//popupOpen("/common/bugBoard/bugBoard.jsp?site_id=S0001&mnu_uid=1218&bubTit="+encodeURL(bugTit),1,0,0,0,700,650);
	window.open("/common/bugBoard/bugBoard.jsp?site_id=S0001&mnu_uid=1218&bubTit="+encodeURL(bugTit), "_gPinLoginWin", "width=350,height=270,scrollbars=1");
}

/* 오류 게시판 */
function bugBoardGo(bugTit) {
//	window.open('', '_bugBod','width=350, height=270, scrollbars=yes');
//	document.frmMnuGra.target = "_bugBod";
	//document.frmMnuGra.action = "/common/nameCheck.jsp?winOpt=1";
//	document.frmMnuGra.action = "/common/bugBoard/bugBoard.jsp?site_id=gs_k&mnu_uid=4705";
//	document.frmMnuGra.submit();
	window.open("/common/bugBoard/bugBoard.jsp?site_id=gs_k&mnu_uid=4705&bubTit="+encodeURL(bugTit), "_gPinLoginWin", "width=350,height=270,scrollbars=1");
}

/* G-PIN 인증 및 실명인증 창으로 이동 */
function nameCheckPopup(rtnUrl) {
	location.href="/common/certificate.jsp?rtnUrl="+encodeURL(rtnUrl);
}


function menuGratify(mnu_uid) 
{
	var objFrm = document.frmMnuGra.mnuGraPioint;
	if(!ValidateForm(objFrm)) {
		alert("점수를 선택해주세요");
		objFrm[0].focus();
		return false;
	}

	for (i=0;i<objFrm.length;i++) {
		if(objFrm[i].checked == true) {
			chkValue = objFrm[i].value;
		}
	}

	mnuGraFrame.location.href="/common/page/pageGratifyAction.jsp?mnu_uid="+mnu_uid+"&value="+chkValue;
}

function add_re() {
	var index = ""
	index = document.form.deal_kind.selectedIndex
	opval = document.form.deal_kind.options[index].value
	switch(opval){
		case "sell":
			Clear_Set()
			var fileOption = new Option("선택 없음","no" , true)
			document.form.rent_kind.options[0] = fileOption
			Clear_Set()
			break;

		case "rent":
			Clear_Set()
			rent_kind = new Array("임대유형 선택","월세","보증금+월세")
			class_val = new Array("no","month","allmonth")
			k = rent_kind.length;

			for (i=0;i<k;i++){
				var fileOption = new Option(rent_kind[i], class_val[i], true)
				document.form.rent_kind.options[i] = fileOption
			}
			break;
	}
}

function Clear_Set() {
	document.form.rent_kind.length = 1;
	document.form.rent_kind.options[0].selected = true;
}

function checkInput(form) {
	if(!form.deal_kind.selectedIndex) {
		alert("거래유형을 선택해 주세요!");
		form.deal_kind.focus();
		return;
	}

	if(form.deal_kind.value == 'rent' && form.rent_kind.value == 'no') {
		alert("임대유형을 선택해 주세요!");
		form.rent_kind.focus();
		return;
	}
	form.submit();
}

function re_load () {
	form.reset();
}

function checkInput1 (form) {

	if (!form.cost1.value) {
		alert("거래금액을 입력하세요");
		form.cost1.focus();    
		return;
	}

	if (document.form1.cost1.value.charAt(0) == "0") {
		alert("0은 첫번째 숫자가 될수 없습니다.");
		document.form1.cost1.focus();
		return;
	}

	state=extract_dot(document.form1.cost1)

	if (!state) {
		alert("숫자만을 입력해 주세요.");
		document.form1.cost1.focus();
		return;
	}
	form.submit();
}


function checkInput2 (form) {
	if (!form.cost1.value) {
		alert("전세금액을 입력하세요");
		form.cost1.focus();    
		return;
	}

	if (document.form1.cost1.value.charAt(0) == "0") {
		alert("0은 첫번째 숫자가 될수 없습니다.");
		document.form1.cost1.focus();
		return;
	}

	state=extract_dot(document.form1.cost1);

	if (!state) {
		alert("숫자만을 입력해 주세요.");
		document.form1.cost1.focus();
		return;
	}
	form.submit();
}



function checkInput3 (form) {
	if (!form.cost2.value) {
		alert("월세금액을 입력하세요");
		form.cost2.focus();    
		return;
	}

	//if(!form.during.selectedIndex) {
	//	alert("계약기간을 선택해주세요!");
	//	return;
	//}  


	if (document.form1.cost2.value.charAt(0) == "0") {
		alert("0은 첫번째 숫자가 될수 없습니다.");
		document.form1.cost2.focus();
		return;
	}

	state=extract_dot(document.form1.cost2);

	if (!state) {
		alert("숫자만을 입력해 주세요.");
		document.form1.cost2.focus();
		return;
	}
	form.submit();
}


function checkInput4 (form) {
	if (!form.cost1.value) {
		alert("보증금을 입력하세요");
		form.cost1.focus();    
		return;
	}
	if (!form.cost2.value) {
		alert("월세금액을 입력하세요");
		form.cost2.focus();    
		return;
	}
	//	if(!form.during.selectedIndex) {
	//	alert("계약기간을 선택해주세요!");
	//	return;
	//	} 

	if (document.form1.cost1.value.charAt(0) == "0") {
		alert("0은 첫번째 숫자가 될수 없습니다.");
		document.form1.cost1.focus();
		return;
	}

	state=extract_dot(document.form1.cost1);
	if (!state) {
		alert("숫자만을 입력해 주세요.");
		document.form1.cost1.focus();
		return;
	}

	if (document.form1.cost2.value.charAt(0) == "0") {
		alert("0은 첫번째 숫자가 될수 없습니다.");
		document.form1.cost2.focus();
		return;
	}

	state=extract_dot(document.form1.cost2);
	if (!state) {
		alert("숫자만을 입력해 주세요.");
		document.form1.cost2.focus();
		return;
	}
	form.submit();
}
