function contentPrint() { // ÇÁ¸°Æ®½ºÅ©¸³Æ®
  var windowLeft = (screen.width-780)/2;
  var windowTop = (screen.height-480)/2;
  var printURL = "/home/inc/printpage.html";
   window.open(printURL,"content",'width=685, height=480, menubar=yes, scrollbars=yes,status=no,resizable=yes,top=' + windowTop + ',left=' + windowLeft + '');
}

// ¿ìÃø Äüº£³Ê ÆË¾÷ÆîÄ¥¶§ ·¹ÀÌ¾î ÁÂÇ¥º¯°æ
function setQuickLayer(opc) {
	var frm=document.all;
	var strLeft="0";
	var strWidth="0";

	if(opc==0) {
		strLeft="924";
		strWidth="62";
	}
	else { 
		strLeft="500";
		strWidth="496";
	}

	frm.left_slider.style.left=strLeft;
	frm.left_slider.style.width=strWidth;
}

function optSearch() {
	var frm=document.frmSearch;
	var url=frm.target_page.value;

	if(frm.keyword.value=="") {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
		frm.keyword.focus();
	}
	else {
		frm.action=url;
		frm.submit();
	}
}

//	È­¸é Áß¾Ó¿¡ Ã¢ ¶ç¿ì±â : 
function LaunchCenter(url, name, width, height, scrollbars) {
	var win_height = height;
	var win_width = width;
	var win_top = window.screen.height/2 - win_height/2;
	var win_left = window.screen.width/2 - win_width/2;
	var wintype="width=" +win_width+ ",height="+win_height+", top="+win_top+",left="+win_left+", menubar=no, scrollbars="+scrollbars+", resizable=no, status=yes, toolbar=no";

	return window.open(url, name, wintype);
}

function showFlash (src, width, height) {
	var flash_tag = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"" + width + "\" height=\"" + height + "\">\n"
				  + "<param name=movie value=\"" + src + "\">\n"
				  + "<param name=quality value=high>\n"
				  + "<param name=wmode value=transparent>\n"
				  + "<embed src=\"" + src + "\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height +"\"></embed>\n"
				  + "</object>";

	document.write (flash_tag);
}

// ¾ÆÀÌµð °Ë»ö
function chkID() {
	var frm=document.form1;
	var M_ID=frm.M_ID.value;

	if(M_ID=='') {
		alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
		frm.M_ID.focus();
	}
	else if(frm.M_ID.value.length<6) {
		alert("¾ÆÀÌµð´Â ¿©¼¸±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		frm.M_ID.focus();
	}
	else if(chkValue(frm.M_ID,'abcdefghijklmnopqrstuvwxyz0123456789')==false) {
		alert("¾ÆÀÌµð´Â ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		frm.M_ID.focus();
	}
	else {
		LaunchCenter('/home/lib/chk_id.php?M_ID='+M_ID, 'chk_id', 400, 250, 'no');
	}
}

// ÁÖ¹Îµî·Ï¹øÈ£ Áßº¹Ã¼Å©
function chkJumin() {
	var frm=document.form1;

	if(frm.M_JUMIN1.value=='') {
		alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ ¾ÕÀÚ¸®¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
		frm.M_JUMIN1.focus();
	}
	else if(chkValue(frm.M_JUMIN1,'0123456789')==false) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£´Â ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		frm.M_JUMIN1.focus();
	}
	else if(frm.M_JUMIN2.value=='') {
		alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ µÞÀÚ¸®¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
		frm.M_JUMIN2.focus();
	}
	else if(chkValue(frm.M_JUMIN2,'0123456789')==false) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£´Â ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		frm.M_JUMIN2.focus();
	}
	else if (!chk_jumin(frm.M_JUMIN1.value,frm.M_JUMIN2.value)) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		frm.M_JUMIN1.focus();
	} 
	else {
		frm.target='ifrm2';
		frm.action='/home/lib/chk_jumin.php';
		frm.submit();
	}
}

// ¿ìÆí¹øÈ£ °Ë»ö
function setZipcode(thisForm,thisField) {
	LaunchCenter('/home/lib/zipcode.php?thisForm='+thisForm+'&thisField='+thisField, 'zipcode', 400, 330, 'no');
}

// ¹®ÀÚ¿­ Ã¼Å©
function chkValue(obj,str) {
	var valid = str
	var ok = "yes";
	var temp;

	for (var i=0; i<obj.value.length; i++) {
		temp = "" + obj.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	if (ok == "no") {
		return false;
	}
	else {
		return true;
	}
}

// ÁÖ¹Îµî·Ï¹øÈ£ À¯È¿¼º Ã¼Å©
function chk_jumin(obj1,obj2) {
	str1 = obj1;
	str2 = obj2;
	var li_lastid,li_mod,li_minus,li_last;
	var value0,value1,value2,value3,value4,value5,value6;
	var value7,value8,value9,value10,value11,value12;

	li_lastid    = parseFloat(str2.substring(6,7));
	value0  = parseFloat(str1.substring(0,1))  * 2;
	value1  = parseFloat(str1.substring(1,2))  * 3;
	value2  = parseFloat(str1.substring(2,3))  * 4;
	value3  = parseFloat(str1.substring(3,4))  * 5;
	value4  = parseFloat(str1.substring(4,5))  * 6;
	value5  = parseFloat(str1.substring(5,6))  * 7;
	value6  = parseFloat(str2.substring(0,1))  * 8;
	value7  = parseFloat(str2.substring(1,2))  * 9;
	value8  = parseFloat(str2.substring(2,3))  * 2;
	value9  = parseFloat(str2.substring(3,4))  * 3;
	value10 = parseFloat(str2.substring(4,5))  * 4;
	value11 = parseFloat(str2.substring(5,6))  * 5;
	value12 = 0;

	value12 = value0+value1+value2+value3+value4+value5+value6+value7+value8+value9+value10+value11+value12;

	li_mod = value12 %11;
	li_minus = 11 - li_mod;
	li_last = li_minus % 10;

	if (li_last != li_lastid) {
		return false;
	}
	else
	return true;
}	

// ÀÌ¸ÞÀÏ À¯È¿¼º Ã¼Å©
function chkEmail(){
	var str=document.form1.M_EMAIL.value;

	if (str.search(/(\S+)@(\S+)\.(\S+)/) == -1) {
		return false;
	}
}

function popMsg(msg) {
	alert(msg);
	return;
}

function popImages(no) {
	LaunchCenter('/home/culture/festival_popup.php?no='+no, 'images', 815, 640, 'yes');
	return;
}

function popVOD(V_FILE) {
	LaunchCenter('/home/culture/festival_vod.php?V_FILE='+V_FILE, 'images', 400, 455, 'no');
	return;
}

function popPopup(P_SEQ) {
	LaunchCenter('/home/etc/popup.php?P_SEQ='+P_SEQ, 'images', 373, 422, 'no');
	return;
}

function optURL(url, width, height) {
	if(url!="") {
		var win_height = height;
		var win_width = width;
		var win_top = window.screen.height/2 - win_height/2;
		var win_left = window.screen.width/2 - win_width/2;
		var wintype="width=" +win_width+ ",height="+win_height+", top="+win_top+",left="+win_left+", menubar=yes, scrollbars=yes, resizable=yes, status=yes, toolbar=yes";

		return window.open(url, "viewpage", wintype);
	}
}


/* È®´ë, Ãà¼Ò ½ÃÀÛ *******************************************************************************/
document.onkeypress = getKey;

initZoomDisplay() ;
	
function getKey(keyStroke) {
	isNetscape=(document.layers);
	eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
	which = String.fromCharCode(eventChooser).toLowerCase();
	which2 = eventChooser;

	var el=event.srcElement;

	if ((el.tagName != "INPUT") && (el.tagName != "TEXTAREA"))		//input,textarea ¾È¿¡¼­ÀÇ +.-°ªÀº ½ÇÇà¾ÈµÇµµ·Ï
	{			
		if(which == "+" || which == "=")
			zoomInOut('zoom', 'in');
		else if(which == "-" || which == "_")
			zoomInOut('zoom', 'out');
	}
}

var zoomRate = 20;			//È®´ë/Ãà¼Ò½Ã Áõ°¨·ü
//var maxRate = 300;			//ÃÖ´ëÈ®´ë·ü
var maxRate = 160;			//ÃÖ´ëÈ®´ë·ü
var minRate = 100;			//ÃÖ¼ÒÃà¼Ò·ü

function zoomInOut(contentid, how) {

	if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
		//document.all[contentid].style.zoom = GetCookie("zoomVal");
		document.body.style.zoom = GetCookie("zoomVal");
		currZoom=GetCookie("zoomVal");
	}
	else{
		//document.all[contentid].style.zoom = '100%'; 
		document.body.style.zoom = '100%'; 
		currZoom = '100%';
	}
	
	if (((how == "in") && (parseInt(currZoom) >= maxRate)) || ((how == "out") && (parseInt(currZoom) <= minRate)) ) {
		return; 
	}
	if (how == "in") {
		//document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)+zoomRate+'%'
		document.body.style.zoom = parseInt(document.body.style.zoom)+zoomRate+'%'
	}
	else {
		//document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)-zoomRate+'%'
		document.body.style.zoom = parseInt(document.body.style.zoom)-zoomRate+'%'
	}
	SetCookie("zoomVal",document.body.style.zoom, 1);
}

function SetCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" ;
}

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 GoZoom(contentid){
	if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
		//document.all[contentid].style.zoom = GetCookie("zoomVal");
		document.body.style.zoom = GetCookie("zoomVal");
		currZoom=GetCookie("zoomVal");
	}
	else{
		//document.all[contentid].style.zoom = '100%'; 
		document.body.style.zoom = '100%'; 
		currZoom = '100%';
	}
}

function initZoomDisplay(){
	var currZoom = "100%" ;
	if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
		currZoom=GetCookie("zoomVal");
	}
	//document.body.style.zoom = currZoom ;
}
/* È®´ë, Ãà¼Ò ³¡ *********************************************************************************/

function menulink(link_go) {  
		switch ( link_go ) {

			case '1-1' : <!--ÇâÅä¹®È­ÀÚ¿ø-->
			location.href="/home/culture/culture_search.php";
			break;
			
			case '1-2' : <!--Áö¿ªÃàÁ¦-->
			location.href="/home/culture/festival_search.php";
			break;
			
			case '1-3' : <!--ÇâÅä»ç-->
			location.href="/home/culture/folk_search.php";
			break;
			
			case '1-4' : <!--ÇâÅä»ç°¡-->
			location.href="/home/culture/historian_search.php";
			break;
			
			case '1-5' : <!--ÇâÅä»ç´ÜÃ¼-->
			location.href="/home/culture/coop_search.php";
			break;
			
			case '1-6' : <!--ÇâÅä¼Ò¸®/¿µ»ó-->
			location.href="/home/culture/folkmovie_search.php";
			break;
			

			case '2-1' : <!--ÇâÅä¹®È­¹ß±¼-->
			location.href="/home/participate/excavation_index.php";
			break;

			case '2-2' : <!--¹¯°í´äÇÏ±â-->
			location.href="/home/participate/qna_index.php";
			break;
			
			case '2-3' : <!--ÀÚÀ¯°Ô½ÃÆÇ-->
			location.href="/home/participate/bbs_index.php";
			break;
			
			case '2-4' : <!--¿Â¶óÀÎ Æú-->
			location.href= "/home/participate/poll_index.php";
			break;
			
			
			
			case '3-1' : <!--¿ì¸®¹®È­-->
			location.href="/home/data/woori_index.php";
			break;
			
			case '3-2' : <!--°£Çà¹°-->
			location.href="/home/data/publications_index.php";
			break;
			
			case '3-3' : <!--½ÃÃ»°¢ÀÚ·á-->
			location.href="/home/data/media_index.php";
			break;
			
			case '3-4' : <!--»çÁøÀÚ·á-->
			location.href="/home/data/photo_index.php";
			break;
			
			case '3-5' : <!--ÀÚ·á½Ç-->
			location.href="/home/data/morgue_index.php";
			break;
			
			case '3-6' : <!--µµ¼­½Ç-->
			location.href="/home/data/book_index.php";
			break;
			
			
			case '4-1' : <!--°øÁö»çÇ×-->
			location.href="/home/announce/notice_index.php";
			break;
			
			case '4-2' : <!--»ç¾÷°ø°í-->
			location.href="/home/announce/biddings_index.php";
			break;
			
			case '4-3' : <!--º¸µµÀÚ·á-->
			location.href="/home/announce/aritcles_index.php";
			break;
			
			case '4-4' : <!--¿¬ÇÕÈ¸Çà»çÀÏÁ¤-->
			location.href="/home/announce/schedule_index.php";
			break;
			
			case '4-5' : <!--´º½º·¹ÅÍ-->
			location.href="/home/announce/newsletter_index.php";
			break;
			
			
			
			case '5-1' : <!--Áö¹æ¹®È­¿ø¼Ò½Ä-->
			location.href="/home/region/local_news_index.php";
			break;
			
			case '5-2' : <!--Áö¹æ¹®È­¿øÇà»çÀÏÁ¤-->
			location.href="/home/region/local_schedule.php";
			break;
			
			case '5-3' : <!--Áö¹æ¹®È­¿øÃ£±â-->
			location.href="/home/region/local_search.php";
			break;
			case '5-4' : <!--Áö¹æ¹®È­¿øÃ£±â-->
			location.href="/home/region/local_notice.php";
			break;
						
			
			
			case '6-1' : <!--ÀÎ»ç¸»-->
			location.href="/home/introduce/introduction.php";
			break;
			
			case '6-2' : <!--±â°ü¼Ò°³-->
			location.href="/home/introduce/work.php";
			break;
			
			case '6-3' : <!--¿¬Çõ-->
			location.href="/home/introduce/history_2000.php";
			break;
			
			case '6-4' : <!--Á¶Á÷ÇöÈ²-->
			location.href="/home/introduce/organization_01.php";
			break;
			
			case '6-5' : <!--»ç¾÷½ÇÀû-->
			location.href="/home/introduce/results_index.php";
			break;
			
			case '6-6' : <!--Ã£¾Æ¿À½Ã´Â ±æ-->
			location.href="/home/introduce/map.php";
			break;
			
			case '6-7' : <!--È«º¸µ¿¿µ»ó-->
			location.href="/home/introduce/videos.php";
			break;
			
		}
		
}

function popup_link(link_go) {  

		switch ( link_go ) {

			case '1' : <!--ÇâÅä¹®È­ÀÚ¿ø-->
			location.href=   "/home/culture/culture_search.php";
			break;
			
			case '2' : <!--Áö¹æ¹®È­¼Ò½Ä-->
			location.href=   "/home/region/local_news_index.php";
			break;
			
			case '3' : <!--RSS¼­ºñ½º-->
			location.href=   "/home/etc/rss.php";
			break;

			case '4' : <!--ÇÁ¸°Æ®-->
			location.href=   "javascript:contentPrint();"
			break;

			case '5' : <!--½ºÅ©·¦-->
				var frm=document.frmScrap;
				if(frm.page_name.value=='') {
					alert('ÆäÀÌÁö Á¦¸ñÀÌ ¾ø½À´Ï´Ù.');
					return;
				}
				else {
					LaunchCenter('', 'scrap', 400, 255, 'no');
					frm.target='scrap';
					frm.action='/home/lib/scrap.php';
					frm.submit();
				}
			break;
			
			case '6' : <!--¸ÞÀÏ¹ß¼Û-->
				var frm=document.frmScrap;

				LaunchCenter('/home/lib/sendmail.php', 'sendmail', 400, 525, 'no');
				frm.target='sendmail';
				frm.action='/home/lib/sendmail.php';
				frm.submit();
			break;
			
			case '7' : <!--TOP-->
			location.href=   "#";
			break;

			case '8' : <!--TOP-->
			location.href=   "/home/etc/popzone.php";
			break;

		}
		
}



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_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];}}
}

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_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 LoadImg(img,size){ 
	newImage = new Image(); 
	newImage.src = img.src; 
	wx = newImage.width; 
	if (wx > size) { 
		img.width = size; 
	} 
}