if (typeof(COMMON_JS) == 'undefined') { // ÇÑ¹ø¸¸ ½ÇÇà
	var COMMON_JS = true;

	function pop_k2web(url)
	{
		//width=900,height=492
		var w=710;
		var h=700;
		var L = (screen.width-w)/2; 
		var T = (screen.height-h)/2; 
		var ff =window.open(url,'k2web_edit','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width='+w+',height='+h+',left='+L+',top='+T+',scrollbars=0');
		ff.focus();
	}

	function swf_show(src,wt,ht,vars,bg,pid,wm){
		var emsrc;

		emsrc = src;
		if(!bg) bg = '#FFFFFF';
		if(!pid) pid = 'untitle';
		if(!wm) wm = 'transparent';
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+wt+'" height="'+ht+'" id="'+pid+'">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="'+src+'" />');
		document.write('<param name="menu" value="false" />');
		document.write('<param name="wmode" value="'+wm+'" />');
		document.write('<param name="quality" value="high" />');
		document.write('<param name="bgcolor" value="'+bg+'" />');

		if(vars) {
			document.write('<param name="flashVars" value="'+vars+'" />');
			emsrc = src+'?'+vars;
		}
		document.write('<embed src="'+emsrc+'" quality="high" wmode="'+wm+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="'+wt+'" height="'+ht+'" menu="false"></embed>');
		document.write('</object>');
	}
	
	//¿ìÆí¹øÈ£ ÆË¾÷
	function checkpost(fn,skincode,pn1,pn2,addrn1,addrn2){
		var skincode = (skincode) ? skincode: 'default';
		var pn1 = (pn1) ? pn1: 'post1';
		var pn2 = (pn2) ? pn2: 'post2';
		var addrn1 = (addrn1) ? addrn1: 'addr1';
		var addrn2 = (addrn2) ? addrn2: 'addr2';
		ff = window.open('/_requisite/findpost/?fn='+fn+'&pn1='+pn1+'&pn2='+pn2+'&addrn1='+addrn1+'&addrn2='+addrn2+'&scode='+skincode,'findpost','width=200,height=150,scrollbars=yes');
		ff.focus();
	}

	//¿ìÆí¹øÈ£ ÆË¾÷2
	function checkpost1(fn,pn1,pn2,addrn1,addrn2,sitecode){
		ff = window.open('/_requisite/findpost/','findpost','width=200,height=150,scrollbars=yes');
		ff.focus();
	}
	
	//2007-06-14 window - popup
	function etc_pop_win(url,w,h,s,t)
	{
		var L = (screen.width-w)/2; 
		var T = (screen.height-h)/2; 
		var scroll = (s) ? 'scrollbars=1' : 'scrollbars=0' ;
		var targ = (t) ? t : '_blank' ;
		var ff =window.open(url,t,'location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width='+w+',height='+h+',left='+L+',top='+T+','+scroll);
		ff.focus();
	}

	//2007-06-14 window - popup
	function etc_pop_win2(url,w,h,left,top,s,t)
	{
		var L = (left) ? left : (screen.width-w)/2; 
		var T = (top) ? top : (screen.height-h)/2; 
		var scroll = (s) ? 'scrollbars=1' : 'scrollbars=0' ;
		var targ = (t) ? t : '_blank' ;
		var ff =window.open(url,t,'location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width='+w+',height='+h+',left='+L+',top='+T+','+scroll);
		ff.focus();
	}


	function flashpopupDisplay(index) {
		for (i=1; i<=2; i++) {
			if (index == i) {
				thisMenu = eval("flashpopup" + index + ".style");
				thisMenu.visibility = "visible";
			} else {
				otherMenu = eval("flashpopup" + i + ".style"); 
				otherMenu.visibility = "hidden"; 
			}
		}
	}


	// ÇÊµå °Ë»ç
	function login()
	{
		document.go_page.action = '/is_grant.html';
		document.go_page.submit();
	}

	function logout()
	{
		document.go_page.action = '/is_grant.html';
		document.go_page.page_act.value = 'logout';
		document.go_page.submit();
	}

	function member_join()
	{
		document.go_requisite.action='/welcome_to.html';
		document.go_requisite.submit();
	}

	function sitemap()
	{
		document.go_page.action='/sitemap.html';
		document.go_page.submit();
	}

	function member_info()
	{
		document.go_page.action = '/myinfo_to.html';
		document.go_page.page_act.value = 'modify';
		document.go_page.submit();
	}

	function intro_link(num)
	{
		if(num==2) 	opener.location.href='/?WELCOME=B';
		else  opener.location.href='/?WELCOME=A';
		opener.focus();
		self.close();		
	}

	function patriot()
	{
		var w=10;
		var h=10;
		var ff =window.open('/_publish/contents/kor/etc/patriot.html','_patriot','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width='+w+',height='+h+',scrollbars=auto');
		ff.focus();
	}

	function pop_movie()
	{
		var w=395;
		var h=445;
		var ff =window.open('/_module/vod_movie/movie_popup.html?url=/_data/vod_movie/2157846314450364998d53.wmv&title=(Àç)5¡¤18±â³äÀç´Ü%20È«º¸µ¿¿µ»ó&w=320&h=240','_movie','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width='+w+',height='+h+',scrollbars=auto');
		ff.focus();
	}

	function pop_live(no)
	{
		//width=900,height=492
		var w=900;
		var h=500;
		var L = (screen.width-w)/2; 
		var T = (screen.height-h)/2; 
		if(no=='0518'){
		var ff =window.open('/_publish/contents/kor/popup/SmartLive0519.html','live_onair','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width='+w+',height='+h+',left='+L+',top='+T+',scrollbars=0');
		}else if(no=='0519'){
		var ff =window.open('/_publish/contents/kor/popup/SmartLive0520.html','live_onair','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width='+w+',height='+h+',left='+L+',top='+T+',scrollbars=0');
		}else{
		var ff =window.open('/_publish/contents/kor/popup/SmartLive.html','live_onair','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width='+w+',height='+h+',left='+L+',top='+T+',scrollbars=0');
		}
		ff.focus();
	}


	function vr_java(code,w,h)
	{
		var w=10;
		var h=10;
		var ff =window.open('/_publish/pvr/popup.html?quics='+code,'vr_java_pop','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width='+w+',height='+h+',scrollbars=auto');
		ff.focus();
	}

	function vr_shockwave(code,w,h)
	{
		var w =  10;
		var h =  10;
		var ff =window.open('/_publish/pvr/shockwave.php?file='+code,'vr_java_pop','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width='+w+',height='+h+',scrollbars=auto');

		ff.focus();
	}


	function obj_show(objhtml)
	{ 
		document.write(objhtml); 
	} 



	function banner_click(num)
	{
		ff =window.open('/banner_click.html?num='+num,'banwin');
		ff.focus();
	}

	// Arguments : flashMovie(Ãâ·Â¿µ¿ªID,ÇÃ·¹½¬ÆÄÀÏ°æ·Î,WIDTH,HEIGHT[,FLASHVARS[,WMOD]]) 
	function flashMovie(fid,src,wid,hei,fvs,wmd) { 
	  this.fPrint = ''; 
	  this.Id = document.getElementById(fid); 
	  this.Src = src; 
	  this.Width = wid; 
	  this.Height = hei; 
	  this.FlashVars = (fvs != undefined)? fvs :''; 
	  this.Wmod = (wmd != undefined)? wmd :''; 
	  if(isObject(Id)) { 
		fPrint = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"'; 
		fPrint = fPrint + ' width="'+Width+'"'; 
		fPrint = fPrint + ' height="'+Height+'">'; 
		fPrint = fPrint + '<param name="movie" value="'+Src+'">'; 
		fPrint = fPrint + '<param name="quality" value="high">'; 
		fPrint = (FlashVars != null) ? fPrint + '<param name="FlashVars" value="'+FlashVars+'">' : ''; 
		fPrint = (Wmod != null) ? fPrint + '<param name="wmode" value="'+Wmod+'">' : ''; 
		fPrint = '<embed'; 
		fPrint = fPrint + ' src="'+Src+'"'; 
		fPrint = (FlashVars != null) ? fPrint + ' FlashVars="'+FlashVars+'"' : ''; 
		fPrint = (Wmod != null) ? fPrint + ' wmode="'+Wmod+'"' : ''; 
		fPrint = fPrint + ' quality="high"'; 
		fPrint = fPrint + ' pluginspage="http://www.macromedia.com/go/getflashplayer"'; 
		fPrint = fPrint + ' type="application/x-shockwave-flash"'; 
		fPrint = fPrint + ' width="'+Width+'"'; 
		fPrint = fPrint + ' height="'+Height+'"'; 
		fPrint = fPrint + '></embed>'; 
		fPrint = fPrint +'</object>'; 
		Id.innerHTML = fPrint; 
	  } 
	} 

	function isObject(a) { 
		return (a && typeof a == 'object'); 
	} 



	// Àü¿ª º¯¼ö
	var errmsg = "";
	var errfld;

	// ÇÊµå °Ë»ç
	function check_field(fld, msg) 
	{
		if ((fld.value = trim(fld.value)) == "") 			   
			error_field(fld, msg);
		else
			clear_field(fld);
		return;
	}

	// ÇÊµå ¿À·ù Ç¥½Ã
	function error_field(fld, msg) 
	{
		if (msg != "")
			errmsg += msg + "\n";
		if (!errfld) errfld = fld;
		fld.style.background = "#BDDEF7";
	}

	// ÇÊµå¸¦ ±ú²ýÇÏ°Ô
	function clear_field(fld) 
	{
		fld.style.background = "#FFFFFF";
	}

	function trim(s)
	{
		var t = "";
		var from_pos = to_pos = 0;

		for (i=0; i<s.length; i++)
		{
			if (s.charAt(i) == ' ')
				continue;
			else 
			{
				from_pos = i;
				break;
			}
		}

		for (i=s.length; i>=0; i--)
		{
			if (s.charAt(i-1) == ' ')
				continue;
			else 
			{
				to_pos = i;
				break;
			}
		}	

		t = s.substring(from_pos, to_pos);
		//				alert(from_pos + ',' + to_pos + ',' + t+'.');
		return t;
	}

	// ÀÚ¹Ù½ºÅ©¸³Æ®·Î PHPÀÇ number_format Èä³»¸¦ ³¿
	// ¼ýÀÚ¿¡ , ¸¦ Ãâ·Â
	function number_format(data) 
	{
		
		var tmp = '';
		var number = '';
		var cutlen = 3;
		var comma = ',';
		var i;
	   
		len = data.length;
		mod = (len % cutlen);
		k = cutlen - mod;
		for (i=0; i<data.length; i++) 
		{
			number = number + data.charAt(i);
			
			if (i < data.length - 1) 
			{
				k++;
				if ((k % cutlen) == 0) 
				{
					number = number + comma;
					k = 0;
				}
			}
		}

		return number;
	}

	// »õ Ã¢
	function popup_window(url, winname, opt)
	{
		window.open(url, winname, opt);
	}


	// Æû¸ÞÀÏ Ã¢
	function popup_formmail(url)
	{
		opt = 'scrollbars=yes,width=417,height=385,top=10,left=20';
		popup_window(url, "wformmail", opt);
	}

	// , ¸¦ ¾ø¾Ø´Ù.
	function no_comma(data)
	{
		var tmp = '';
		var comma = ',';
		var i;

		for (i=0; i<data.length; i++)
		{
			if (data.charAt(i) != comma)
				tmp += data.charAt(i);
		}
		return tmp;
	}

	// »èÁ¦ °Ë»ç È®ÀÎ
	function del(href) 
	{
		if(confirm("ÇÑ¹ø »èÁ¦ÇÑ ÀÚ·á´Â º¹±¸ÇÒ ¹æ¹ýÀÌ ¾ø½À´Ï´Ù.\n\nÁ¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) 
			document.location.href = href;
	}

	// ÄíÅ° ÀÔ·Â
	function set_cookie(name, value, expirehours) 
	{
		var today = new Date();
		today.setTime(today.getTime() + (60*60*1000*expirehours));
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
	}

	// ÄíÅ° ¾òÀ½
	function get_cookie(name) 
	{
		var find_sw = false;
		var start, end;
		var i = 0;

		for (i=0; i<= document.cookie.length; i++)
		{
			start = i;
			end = start + name.length;

			if(document.cookie.substring(start, end) == name) 
			{
				find_sw = true
				break
			}
		}

		if (find_sw == true) 
		{
			start = end + 1;
			end = document.cookie.indexOf(";", start);

			if(end < start)
				end = document.cookie.length;

			return document.cookie.substring(start, end);
		}
		return "";
	}

	// ÄíÅ° Áö¿ò
	function delete_cookie(name) 
	{
		var today = new Date();

		today.setTime(today.getTime() - 1);
		var value = getCookie(name);
		if(value != "")
			document.cookie = name + "=" + value + "; path=/; expires=" + today.toGMTString();
	}

	// ÀÌ¹ÌÁöÀÇ Å©±â¿¡ µû¶ó »õÃ¢ÀÇ Å©±â°¡ º¯°æµË´Ï´Ù.
	// zzzz´Ô²²¼­ ¾Ë·ÁÁÖ¼Ì½À´Ï´Ù. 2005/04/12
	function image_window(img)
	{
		var w = img.tmp_width; 
		var h = img.tmp_height; 
		var winl = (screen.width-w)/2; 
		var wint = (screen.height-h)/3; 

		if (w >= screen.width) { 
			winl = 0; 
			h = (parseInt)(w * (h / w)); 
		} 

		if (h >= screen.height) { 
			wint = 0; 
			w = (parseInt)(h * (w / h)); 
		} 

		var js_url = "<script language='JavaScript1.2'> \n"; 
			js_url += "<!-- \n"; 
			js_url += "var ie=document.all; \n"; 
			js_url += "var nn6=document.getElementById&&!document.all; \n"; 
			js_url += "var isdrag=false; \n"; 
			js_url += "var x,y; \n"; 
			js_url += "var dobj; \n"; 
			js_url += "function movemouse(e) \n"; 
			js_url += "{ \n"; 
			js_url += "  if (isdrag) \n"; 
			js_url += "  { \n"; 
			js_url += "    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n"; 
			js_url += "    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n"; 
			js_url += "    return false; \n"; 
			js_url += "  } \n"; 
			js_url += "} \n"; 
			js_url += "function selectmouse(e) \n"; 
			js_url += "{ \n"; 
			js_url += "  var fobj      = nn6 ? e.target : event.srcElement; \n"; 
			js_url += "  var topelement = nn6 ? 'HTML' : 'BODY'; \n"; 
			js_url += "  while (fobj.tagName != topelement && fobj.className != 'dragme') \n"; 
			js_url += "  { \n"; 
			js_url += "    fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n"; 
			js_url += "  } \n"; 
			js_url += "  if (fobj.className=='dragme') \n"; 
			js_url += "  { \n"; 
			js_url += "    isdrag = true; \n"; 
			js_url += "    dobj = fobj; \n"; 
			js_url += "    tx = parseInt(dobj.style.left+0); \n"; 
			js_url += "    ty = parseInt(dobj.style.top+0); \n"; 
			js_url += "    x = nn6 ? e.clientX : event.clientX; \n"; 
			js_url += "    y = nn6 ? e.clientY : event.clientY; \n"; 
			js_url += "    document.onmousemove=movemouse; \n"; 
			js_url += "    return false; \n"; 
			js_url += "  } \n"; 
			js_url += "} \n"; 
			js_url += "document.onmousedown=selectmouse; \n"; 
			js_url += "document.onmouseup=new Function('isdrag=false'); \n"; 
			js_url += "//--> \n"; 
			js_url += "</"+"script> \n"; 

		var settings;

		if (g4_is_gecko) {
			settings  ='width='+(w+10)+','; 
			settings +='height='+(h+10)+','; 
		} else {
			settings  ='width='+w+','; 
			settings +='height='+h+','; 
		}
		settings +='top='+wint+','; 
		settings +='left='+winl+','; 
		settings +='scrollbars=no,'; 
		settings +='resizable=yes,'; 
		settings +='status=no'; 


		win=window.open("","image_window",settings); 
		win.document.open(); 
		win.document.write ("<html><head> \n<meta http-equiv='imagetoolbar' CONTENT='no'> \n<meta http-equiv='content-type' content='text/html; charset=euc-kr'>\n"); 
		var size = "ÀÌ¹ÌÁö »çÀÌÁî : "+w+" x "+h;
		win.document.write ("<title>"+size+"</title> \n"); 
		if(w >= screen.width || h >= screen.height) { 
			win.document.write (js_url); 
			var click = "ondblclick='window.close();' style='cursor:move' title=' "+size+" \n\n ÀÌ¹ÌÁö »çÀÌÁî°¡ È­¸éº¸´Ù Å®´Ï´Ù. \n ¿ÞÂÊ ¹öÆ°À» Å¬¸¯ÇÑ ÈÄ ¸¶¿ì½º¸¦ ¿òÁ÷¿©¼­ º¸¼¼¿ä. \n\n ´õºí Å¬¸¯ÇÏ¸é ´ÝÇô¿ä. '"; 
		} 
		else 
			var click = "onclick='window.close();' style='cursor:pointer' title=' "+size+" \n\n Å¬¸¯ÇÏ¸é ´ÝÇô¿ä. '"; 
		win.document.write ("<style>.dragme{position:relative;}</style> \n"); 
		win.document.write ("</head> \n\n"); 
		win.document.write ("<body leftmargin=0 topmargin=0 bgcolor=#dddddd style='cursor:arrow;'> \n"); 
		win.document.write ("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img src='"+img.src+"' width='"+w+"' height='"+h+"' border=0 class='dragme' "+click+"></td></tr></table>");
		win.document.write ("</body></html>"); 
		win.document.close(); 

		if(parseInt(navigator.appVersion) >= 4){win.window.focus();} 
	}

	// ´Þ·Â Ã¢
	function popup_calendar(fld, dir, year, month, top, left)
	{
		if (!top) top = 100;
		if (!left) left = 200;
		if (!year) year = '';
		if (!month) month = '';
		url = dir+'/calendar.php?yyyy='+year+'&mm='+month+'&fld='+fld;
		opt = 'scrollbars=no,status=no,resizable=no,width=250,height=225,top='+top+',left='+left;
		window.open(url, "gbCalendar", opt);
	}

	// a ÅÂ±×¿¡¼­ onclick ÀÌº¥Æ®¸¦ »ç¿ëÇÏÁö ¾Ê±â À§ÇØ
	function win_open(url, name, option)
	{
		var popup = window.open(url, name, option);
		popup.focus();
	}

	// ¿ìÆí¹øÈ£ Ã¢
	function win_zip(frm_name, frm_zip1, frm_zip2, frm_addr1, frm_addr2)
	{
		url = g4_path + "/" + g4_bbs + "/zip.php?frm_name="+frm_name+"&frm_zip1="+frm_zip1+"&frm_zip2="+frm_zip2+"&frm_addr1="+frm_addr1+"&frm_addr2="+frm_addr2;
		win_open(url, "winZip", "left=50,top=50,width=616,height=460,scrollbars=1");
	}

	function win_zip2(frm_name, frm_zip, frm_addr1, frm_addr2)
	{
		url = g4_path + "/" + g4_bbs + "/zip2.php?frm_name="+frm_name+"&frm_zip="+frm_zip+"&frm_addr1="+frm_addr1+"&frm_addr2="+frm_addr2;
		win_open(url, "winZip", "left=50,top=50,width=616,height=460,scrollbars=1");
	}

	// ÂÊÁö Ã¢
	function win_memo(url)
	{
		if (!url)
			url = g4_path + "/" + g4_bbs + "/memo.php";
		win_open(url, "winMemo", "left=50,top=50,width=600,height=460,scrollbars=0");
	}

	// Æ÷ÀÎÆ® Ã¢
	function win_point(url)
	{
		win_open(g4_path + "/" + g4_bbs + "/point.php", "winPoint", "left=20, top=20, width=600, height=635, scrollbars=0");
	}

	// ½ºÅ©·¦ Ã¢
	function win_scrap(url)
	{
		if (!url)
			url = g4_path + "/" + g4_bbs + "/scrap.php";
		win_open(url, "scrap", "left=20, top=20, width=616, height=500, scrollbars=1");
	}

	// ÆÐ½º¿öµå ºÐ½Ç Ã¢
	function win_password_forget()
	{
		win_open(g4_path + "/" + g4_bbs + "/password_forget.php", 'winPasswordForget', 'left=50, top=50, width=616, height=500, scrollbars=1');
	}

	// ÄÚ¸àÆ® Ã¢
	function win_comment(url)
	{
		win_open(url, "winComment", "left=50, top=50, width=800, height=600, scrollbars=1");
	}

	// Æû¸ÞÀÏ Ã¢
	function win_formmail(mb_id, name, email)
	{
		win_open(g4_path+"/" + g4_bbs + "/formmail.php?mb_id="+mb_id+"&name="+name+"&email="+email, "winFormmail", "left=50, top=50, width=600, height=480, scrollbars=0");
	}

	// ¼³¹®Á¶»ç Ã¢
	function win_poll(url)
	{
		if (!url)
			url = "";
		win_open(url, "winPoll", "left=50, top=50, width=616, height=500, scrollbars=1");
	}

	// ÀÚ±â¼Ò°³ Ã¢
	function win_profile(mb_id)
	{
		win_open(g4_path+"/" + g4_bbs + "/profile.php?mb_id="+mb_id, 'winProfile', 'left=50,top=50,width=616,height=500,scrollbars=1');
	}

	var old='';
	function menu(name){

		submenu=eval(name+".style");

		if (old!=submenu)
		{
			if(old!='')
				old.display='none';

			submenu.display='block';
			old=submenu;
		}
		else
		{
			submenu.display='none';
			old='';
		}
	}

	function textarea_decrease(id, row)
	{
		if (document.getElementById(id).rows - row > 0)
			document.getElementById(id).rows -= row;
	}

	function textarea_original(id, row)
	{
		document.getElementById(id).rows = row;
	}

	function textarea_increase(id, row)
	{
		document.getElementById(id).rows += row;
	}

	// ±Û¼ýÀÚ °Ë»ç
	function check_byte(content, target)
	{
		var i = 0;
		var cnt = 0;
		var ch = '';
		var cont = document.getElementById(content).value;

		for (i=0; i<cont.length; i++) {
			ch = cont.charAt(i);
			if (escape(ch).length > 4) {
				cnt += 2;
			} else {
				cnt += 1;
			}
		}
		// ¼ýÀÚ¸¦ Ãâ·Â
		document.getElementById(target).innerHTML = cnt;
	}

	// ºê¶ó¿ìÀú¿¡¼­ ¿ÀºêÁ§Æ®ÀÇ ¿ÞÂÊ ÁÂÇ¥
	function get_left_pos(obj)
	{
		var parentObj = null;
		var clientObj = obj;
		var left = obj.offsetLeft + document.body.clientLeft;

		while((parentObj=clientObj.offsetParent) != null)
		{
			left = left + parentObj.offsetLeft;
			clientObj = parentObj;
		}

		return left;
	}

	// ºê¶ó¿ìÀú¿¡¼­ ¿ÀºêÁ§Æ®ÀÇ »ó´Ü ÁÂÇ¥
	function get_top_pos(obj)
	{
		var parentObj = null;
		var clientObj = obj;
		var top = obj.offsetTop + document.body.clientTop;

		while((parentObj=clientObj.offsetParent) != null)
		{
			top = top + parentObj.offsetTop;
			clientObj = parentObj;
		}

		return top;
	}

	function help(id, left, top)
	{
		menu(id);

		//submenu = eval(name+".style");
		submenu = document.getElementById(id).style;
		submenu.posLeft = tempX - 50 + left;
		submenu.posTop  = tempY + 15 + top;

	}


	function getCookie(NameCookie)
	{
		var i = document.cookie.indexOf(NameCookie + '=' );
		if (i != -1) {
			i += NameCookie.length + 1;
			NameEnd = document.cookie.indexOf(';', i);
			if (NameEnd == -1){
				NameEnd = document.cookie.length;
			}
			return  unescape(document.cookie.substring(i, NameEnd));
		} else {
			return "";
		}
	}

	function setCookie( name, value, expiredays ){
		var todayDate = new Date();
		todayDate.setDate( todayDate.getDate() + expiredays );
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
	}

//select boxÀÌµ¿
function goto_byselect(url,sel,flag,targetstr) {
  var index = sel.selectedIndex;
  if (sel.options[index].value != '') {
	 if (targetstr == 'blank') {
		 location.href = url+'&'+flag+'='+sel.options[index].value;
	 } else {
	   var frameobj;
	   if (targetstr == '') targetstr = 'top';
	   if ((frameobj = eval(targetstr)) != null)
		frameobj.location = url+'&'+flag+'='+sel.options[index].value;
	 } //end if
  } // end if
} // end function


//¸ÞÀÎ¿¡ ÀÏÁ¤ Ä¶¸°´õ »Ñ¸®±â
function open_schedule(year,month,div,lang){
	cal.location.href="/_module/cal/main.html?year="+year+"&month="+month+"&s_div="+div+"&lang="+lang;
}
}

//ÀÌ¹ÌÁö ¹Ù²Ù±â
function change_img(val,lang){
	var lang_flag;
	if(lang=="kor"){
		lang_flag = "kor";
	} else if(lang=="eng"){
		lang_flag = "eng";
	}
	if(val==1){
		
		document.getElementById("cal1").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu1_on.gif'; 
		document.getElementById("cal2").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu2.gif'; 
		document.getElementById("cal3").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu3.gif'; 
		
	} else if(val==2){
			
		document.getElementById("cal1").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu1.gif'; 
		document.getElementById("cal2").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu2_on.gif'; 
		document.getElementById("cal3").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu3.gif'; 
		
	} else if(val==3){
			
		document.getElementById("cal1").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu1.gif'; 
		document.getElementById("cal2").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu2.gif'; 
		document.getElementById("cal3").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu3_on.gif'; 
		
	} else{
			
		document.getElementById("cal1").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu1_on.gif'; 
		document.getElementById("cal2").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu2.gif'; 
		document.getElementById("cal3").src = '/_publish/contents/'+lang_flag+'/images/calendar_bu3.gif'; 
		
	}
}

// ±âº» ÇÔ¼ö
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";

function gotoTop() {
    window.scrollTo(0,0);
}

String.prototype.toInteger = function() {
	return this.replace(/[^0-9]/g, '') * 1;
}

var org_top=114;
//var min_bottom=405+88;
var min_bottom=599;
var Init = false;
var org_otop = 0;
var org_ltop = 0;
var org_mtop = 0;

function static_banner(div_id, origin_top, limit_top, margin_top)
{
	var d, t, s, g, target_height;

	b = document.body.clientHeight;

	d = document.getElementById(div_id);
	d.style.top=org_otop;

	if(b >= min_bottom) {
		setTimeout("follow_banner('" + div_id + "', " + org_otop + ", " + org_ltop + ", " + org_mtop + ");", 20);
	}else{
		setTimeout("static_banner('" + div_id + "', " + org_otop + ");", 20);
	}

}

function follow_banner(div_id, origin_top, limit_top, margin_top)
{
	var d, t, s, g,b, target_height;

	if(Init==false){
		org_otop = origin_top;
		org_ltop = limit_top;
		org_mtop = margin_top;
		Init = true;
	}

	origin_top *= 1;
	limit_top *= 1;
	margin_top *= 1;

	d = document.getElementById(div_id);
	s = document.body.scrollTop + "";
	b = document.body.clientHeight;

	target_height = s.toInteger() + margin_top;
	if(target_height < limit_top) {
		target_height = origin_top;
	}

	t = d.style.top.toInteger();

	if(t != target_height) {
		g = Math.ceil((t - target_height) / 5);
		if(g > 50) {
			g = 50;
		} else if (g < -50) {
			g = -50;
		}
		d.style.top = (t - g) + "px";
	}

	if(b >= min_bottom) {
		setTimeout("follow_banner('" + div_id + "', " + origin_top + ", " + limit_top + ", " + margin_top + ");", 20);
	}else{
		setTimeout("static_banner('" + div_id + "', " + org_otop + ");", 20);
//		follow_banner('" + div_id + "', " + org_otop + ", " + org_ltop + ", " + org_mtop + ");
//		setTimeout("follow_banner('" + div_id + "', " + org_otop + ", " + org_ltop + ", " + org_mtop + ");", 20);
	}
}


//¹¦Áö¾ÈÀåÇöÈ² ÀÚ¼¼È÷º¸±â(¹¦Áö¹øÈ£,½Å/±¸±¸ºÐ°ª)
function view_tomb(to_num,flag){
	fr_tomb.location.href="/_module/tomb/?to_num="+to_num+"&flag="+flag;
}

//¹¦Áö¾ÈÀåÇöÈ² º¸±â(½Å/±¸±¸ºÐ°ª,¹¦Áö±¸ºÐ)
function open_tomb(to_num,flag){
	if(flag == "old"){
		switch(to_num){
			case "1": link_url = "030201_gy.html"; height = "520"; break;
			case "2": link_url = "030201_gy02.html"; height = "700"; break;
			case "3": link_url = "030201_gy03.html"; height = "550"; break;
			default: link_url = "030201_gy.html"; height = "520"; break;
		}
	} else{
		height = "600";
		switch(to_num){
			case "1": link_url = "030202_gy01.html"; break;
			case "2": link_url = "030202_gy02.html"; break;
			case "3": link_url = "030202_gy03.html"; break;
			case "4": link_url = "030202_gy04.html"; break;
			case "5": link_url = "030202_gy05.html"; break;
			default : link_url = "030202_gy01.html"; break;
		}
	}

	window.open('/_publish/contents/kor/0302/'+link_url,'tomb','top=10,left=10,width=600,height='+height);
}
