//<![CDATA[

// popup
function openWindow(theURL,theName,theTop,theLeft,theWidth,theHeight,theScroll) { 
	window.open(theURL, theName,'top='+theTop+',left='+theLeft+',width='+theWidth+',height='+theHeight+',marginwidth=0,marginheight=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+theScroll+',resizable=no');
}

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

// GETCOOKIE
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 AutoResize(img) { 
	foto1= new Image(); 
	foto1.src=(img); 
	Controlla(img); 
} 

function Controlla(img) { 
	if((foto1.width!=0)&&(foto1.height!=0)){ 
		viewFoto(img); 
	} else{ 
		funzione="Controlla('"+img+"')"; 
		intervallo=setTimeout(funzione,20); 
	} 
} 

function viewFoto(img) { 
	largh=foto1.width; 
	altez=foto1.height; 
	stringa="width="+largh+",height="+altez; 
	WinOpen(img, stringa);
	// finestra=window.open(img,"",stringa); 
} 

function WinOpen(img, stringa) {
	var WinOpen1;
	WinOpen1 = window.open("","",stringa);
	WinOpen1.document.open();
	WinOpen1.document.write("<HTML><HEAD><TITLE>:: ÀÌ¹ÌÁöºä ::</TITLE></HEAD>");
	WinOpen1.document.write("<BODY topmargin=0 leftmargin=0>");
	WinOpen1.document.write("<a href='javascript:window.close()'><IMG SRC='"+escape(img)+"' border=0 alt='Ã¢´Ý±â' onfocus='this.blur()' GALLERYIMG='no' /></a>");
	WinOpen1.document.write("</BODY></HTML>");
	WinOpen1.document.close();
}  


/*********************************************************************
*	¸Þ´º·Ñ¿À¹ö ±â´É(µå¸²À§¹öÁ¦°ø)
*********************************************************************/ 
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];}
}

/*********************************************************************
*	onfocus="this.blur();" È¿°ú ÁÖ±â
*********************************************************************/  
function autoBlur(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
		document.body.focus(); 
	} 
document.onfocusin=autoBlur; 


// +++++++++++++  MakeFlashString(source,id,width,height,wmode) ++++++++
// 
// source: source url --> ÇÃ·¡½¬ ÆÄÀÏÀÇ °æ·Î
// id: flash id 
// width: source width
// height: source height
// wmode: wmode --> "none, transparent, opaque"
// otherparam : Ãß°¡ ÆÄ¶ó¹ÌÅÍ "<param name='myParam' value='myValue' />
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++  MakeObjectString(classid, codebase, name, id, width,height, param) ++++++++
// 
// classid: classid --> ÇÃ·¡½¬ ÆÄÀÏÀÇ °æ·Î
// codebase: cabÆÄÀÏ À§Ä¡ ¹× ¹öÀüÁ¤º¸ 
// name :
// id :
// width: source width
// height: source height
// param : Ãß°¡ ÆÄ¶ó¹ÌÅÍ "<param name='myParam' value='myValue' />
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// Example 
// DocumentWrite(MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
// SetInnerHTML(document.all.mm, MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
// @@ÁÖÀÇ »çÇ× 
//  - »óÈ£ÀÛ¿ë ¾ø´Â ÄÁÅÙÃ÷´Â DocumentWrite, SetInnerHTML µÑ´Ù »ç¿ë °¡´É
//  - »óÈ£ÀÛ¿ë ÀÖ´Â ÄÁÅÙÃ÷´Â SetInnerHTML¸¸ »ç¿ë °¡´É
// #######################################################################

function MakeFlashString(source, id, width, height, wmode, otherParam) {	
	return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+width+" height="+height+"></embed></object>";
}

function MakeObjectString(classid, codebase, name, id, width, height, param) {
	return "<object classid="+classid+" codebase="+codebase+" name="+name+" width="+width+" height="+height+" id="+id+">"+param+"</object>";
}

// innerHTML Type
function SetInnerHTML(target, code) { 
	target.innerHTML = code; 
}

// Direct Write Type
function DocumentWrite(src) {
	document.write(src);
}

// ¸Þ´º
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function goto_byselect(sel, targetstr) {
  var index = sel.selectedIndex;
  if (sel.options[index].value != '') {
     if (targetstr == 'blank') {
       window.open(sel.options[index].value, 'win1');
     } else {
       var frameobj;
       if (targetstr == '') targetstr = 'self';
       if ((frameobj = eval(targetstr)) != null)
         frameobj.location = sel.options[index].value;
     }
  }
}

function slide(Id, interval, to) {
	var level = Id.length;
    var obj = document.getElementById(Id);
    var H, step = 5;

    if (obj == null) return;
    if (to == undefined) { // user clicking
        if (obj._slideStart == true) return;
        if (obj._expand == true) {
            to = 0;
            obj.style.overflow = "hidden";
        } else {
            slide.addId(Id);
			for(var i=0; i < slide.objects.length; i++) {
				if (slide.objects[i].id != Id && slide.objects[i]._expand == true) {
					slide(slide.objects[i].id);
				}
			}
            obj.style.height = "";
            obj.style.overflow = "";
            obj.style.display = "block";
            to = obj.offsetHeight; 
            obj.style.overflow = "hidden";
            obj.style.height = "1px";
        }
        obj._slideStart = true;
    }
    
    step             = ((to > 0) ? 1:-1) * step;
    interval         = ((interval==undefined)?1:interval);

    obj.style.height = (H=((H=(isNaN(H=parseInt(obj.style.height))?0:H))+step<0)?0:H+step)+"px";
    
    
    if (H <= 0) {
		obj.style.display = "none";
		obj.style.overflow = "hidden";
		obj._expand = false;
		obj._slideStart = false;
    } else if (to > 0 && H >= to) {
		obj.style.display = "block";
		obj.style.overflow = "visible";
		obj.style.height = H + "px";
		obj._expand = true;
		obj._slideStart = false;
    } else {
        setTimeout("slide('"+Id+"' , "+interval+", "+to+");", interval);
    }
}
slide.objects = new Array();
slide.addId = function(Id)
{
    for (var i=0; i < slide.objects.length; i++) {
       if (slide.objects[i].id == Id) return true;
    }
    slide.objects[slide.objects.length] = document.getElementById(Id);
}

/*********************************************************************
*	Flash Navigation È£Ãâ (Å¾ ¸Þ´º)
*********************************************************************/
function lf_menuLink(as_link) {
	switch (as_link) {

	/*´ë¸Þ´º*/
		case "1" :	/* ±â¼ú¼¾ÅÍÇöÈ²/////////¼ÒÀåÀÎ»ç¸» */
			document.location.href="../sub/subFrame.php?book=1&part=1&chapter=0";	
			break;			
		case "2" :	/* ÇÔÆò±º³ó¾÷ÇöÈ²//////////Àç¹è¸éÀû*/
			document.location.href="../sub/subFrame.php?book=2&part=1&chapter=0";	
			break;		
		case "3" :	/* ³ó¾÷±â¼úÁ¤º¸//////////ÁÖ°£¿ù°£³ó»çÁ¤º¸ */
			document.location.href="../bb/boardList.php?boardNM=sub0301&book=3&part=1&chapter=1";	
			break;		
		case "4" :	/* Ä£È¯°æ³ó¾÷//////////Ä£È¯°æ³ó¾÷¼Ò°³ */
			document.location.href="../sub/subFrame.php?book=4&part=1&chapter=0";			
			break;
		case "5" :	/* ³ó¾÷ÀÎ´ÜÃ¼//////////³óÃÌÁöµµÀÚ */
			document.location.href="../sub/subFrame.php?book=5&part=1&chapter=0";			
			break;	
		case "6" :	/* ¹®È­°ü±¤//////////ÇÔÆò°ü±¤*/
			document.location.href="../sub/subFrame.php?book=6&part=1&chapter=1";			
			break;	
		case "7" :	/* Á¤º¸±¤Àå//////////°øÁö»çÇ× */
			document.location.href="../bb/boardList.php?boardNM=board&book=7&part=1&chapter=0";
			break;	
		case "8" :	/* ¿­¸°±¤Àå//////////¿µ³ó»ó´ã */
			document.location.href="../bb/boardList.php?boardNM=sangdam&book=8&part=1&chapter=0";
			break;
			
	/*¼Ò¸Þ´º-----±â¼ú¼¾ÅÍÇöÈ²*/
		case "12" :	/* Á¶Á÷¹× ±¸¼º */
			document.location.href="../sub/subFrame.php?book=1&part=2&chapter=0";
			break;	
		case "13" :	/* ±â¼ú¼¾ÅÍ */
			document.location.href="../sub/subFrame.php?book=1&part=3&chapter=1";
			break;
		case "14" :	/* ÁÖ¿ä¾÷¹« */
			document.location.href="../sub/subFrame.php?book=1&part=4&chapter=3";
			break;
		case "15" :	/* ÀÚÄ¡¹ý±Ô */
			document.location.href="../sub/subFrame.php?book=1&part=5&chapter=0";
			break;

	/*¼Ò¸Þ´º-----ÇÔÆò±º³ó¾÷ÇöÈ²*/
		case "22" :	/* ³ó¾÷ÀÎ±¸ÇöÈ² */
			document.location.href="../sub/subFrame.php?book=2&part=2&chapter=0";
			break;	
		case "23" :	/* ÅäÁöÇöÈ² */
			document.location.href="../sub/subFrame.php?book=2&part=3&chapter=0";
			break;
		case "24" :	/* ÇàÁ¤±¸¿ª¾àµµ */
			document.location.href="../sub/subFrame.php?book=2&part=4&chapter=0";
			break;
		case "25" :	/* ±â»ó°³¿ä */
			document.location.href="../sub/subFrame.php?book=2&part=5&chapter=0";
			break;
	
	/*¼Ò¸Þ´º-----³ó¾÷±â¼úÁ¤º¸*/
		case "32" :	/* ³óÀÛ¹°º´ÇØÃæÁ¤º¸ */
			document.location.href="../bb/boardList.php?boardNM=sub0303&book=3&part=2&chapter=1";
			break;	
		case "33" :	/* ÀÛ¹°¿µ¾çÀå¾ÖÁø´Ü */
			window.open ("http://www.niast.go.kr/pnd/crop/crop_view.asp");
			break;
		case "34" :	/* ½Ã¼³Ç¥ÁØ¼³°èµµ */
			document.location.href="../bb/boardList.php?boardNM=sub0304&book=3&part=4&chapter=1";
			break;
		case "35" :	/* ³ó¾à¾ÈÀü»ç¿ë */
			document.location.href="../sub/subFrame.php?book=3&part=5&chapter=0";
			break;
		case "36" :	/* ³ó¾÷¿ë¾î»çÀü */
			document.location.href="../pgm/wordSearch.php?book=3&part=6&chapter=0";
			break;
		case "37" :	/* ´ç¸é¿µ³óÁ¤º¸ */
			document.location.href="../bb/boardList.php?boardNM=info&book=3&part=7&chapter=0";
			break;
		case "38" :	/* ½Ç½Ã°£ ¿µ³óÁ¤º¸ */
			document.location.href="../bb/boardList.php?boardNM=proinfo&book=3&part=8&chapter=1";
			break;

	/*¼Ò¸Þ´º-----Ä£È¯°æ³ó¾÷*/
		case "42" :	/* ¿ì¸®°íÀåÄ£È¯°æ³ó°¡ */
			document.location.href="../sub/subFrame.php?book=4&part=2&chapter=0";
			break;	
		case "43" :	/* ½ÇÃµ¿ì¼ö»ç·Ê */
			document.location.href="../sub/subFrame.php?book=4&part=3&chapter=0";
			break;
		case "44" :	/* Åä¾ç°ËÁ¤ */
			document.location.href="../sub/subFrame.php?book=4&part=4&chapter=0";
			break;
		case "45" :	/* Ä£È¯°æÀÚ·á½Ç */
			document.location.href="../bb/boardList.php?boardNM=sub0405&book=4&part=5&chapter=0";
			break;
		case "46" :	/* Ä£È¯°æÀÎÁõ³ó»ê¹° */
			document.location.href="../sub/subFrame.php?book=4&part=6&chapter=0";
			break;
		case "47" :	/* Áö¸®ÀûÇ¥½Ã */
			document.location.href="../sub/subFrame.php?book=4&part=7&chapter=1";
			break;
	
	/*¼Ò¸Þ´º-----³ó¾÷ÀÎ´ÜÃ¼*/
		case "52" : /* »ýÈ°°³¼±È¸ */
			document.location.href="../sub/subFrame.php?book=5&part=2&chapter=0";
			break;	
		case "53" :	/* ³ó¾÷°æ¿µÀÎÈ¸ */
			document.location.href="../sub/subFrame.php?book=5&part=3&chapter=0";
			break;
		case "54" :	/* 4-H */
			document.location.href="../sub/subFrame.php?book=5&part=4&chapter=0";
			break;
		case "55" :	/* ÇÑ¿©³ó */
			document.location.href="../sub/subFrame.php?book=5&part=5&chapter=0";
			break;
		case "56" :	/* ¿ì¼ö¼±µµ³ó°¡ */
			document.location.href="../sub/subFrame.php?book=5&part=6&chapter=0";
			break;
		case "57" :	/* ³ó¾÷ÀÎÈ¨ÆäÀÌÁö */
			document.location.href="../sub/subFrame.php?book=5&part=7&chapter=1";
			break;
		case "58" :	/* ÀÛ¸ñ¹ÝÇöÈ² */
			document.location.href="../sub/subFrame.php?book=5&part=8&chapter=0";
			break;
		case "59" :	/* ³ó±â°è¼øÈ¸±³À° */
			document.location.href="../sub/subFrame.php?book=5&part=9&chapter=1";
			break;


	/*¼Ò¸Þ´º-----¹®È­°ü±¤*/
		case "62" :	/* ³ó¾÷ÀÎ±¸ÇöÈ² */
			document.location.href="../sub/subFrame.php?book=6&part=2&chapter=1";
			break;	
		case "63" :	/* ÅäÁöÇöÈ² */
			document.location.href="../sub/subFrame.php?book=6&part=3&chapter=1";
			break;
		case "64" :	/* ÇàÁ¤±¸¿ª¾àµµ */
			document.location.href="../sub/subFrame.php?book=6&part=4&chapter=1";
			break;

	/*¼Ò¸Þ´º-----Á¤º¸±¤Àå*/
		case "72" :	/* º¸µµÀÚ·á */
			document.location.href="../bb/boardList.php?boardNM=bodo&book=7&part=2&chapter=0";
			break;	
		case "73" :	/* ÃÖ±Ù¿µ³ó´º½º */
			document.location.href="../bb/boardList.php?boardNM=lifeinfo&book=7&part=3&chapter=0";
			break;
		case "74" :	/* ÀÚ·á½Ç */
			document.location.href="../bb/boardList.php?boardNM=wkfytlf&book=7&part=4&chapter=0";
			break;
		case "75" :	/* Çà»çÀÏÁ¤ */
			document.location.href="../pgm/scheduleList.php?book=7&part=5&chapter=0";
			break;
		case "76" :	/* ±Í³ó°¡ÀÌµå */
			document.location.href="../sub/subFrame.php?book=7&part=6&chapter=0";
			break;
		case "77" :	/* ¿ì¼ö³ó»ê¹°°ü¸®Á¦µµ(GAP) */
			document.location.href="../sub/subFrame.php?book=7&part=7&chapter=0";
			break;
		
	/*¼Ò¸Þ´º-----¿­¸°±¤Àå*/
		case "82" :	/* ÀÚÀ¯°Ô½ÃÆÇ */
			document.location.href="../bb/boardList.php?boardNM=hamboard&book=8&part=2&chapter=0";
			break;	
		case "83" :	/* ³ªºñ°¶·¯¸® */
			document.location.href="../bb/photoList.php?boardNM=photogallery&book=8&part=3&chapter=0";
			break;
		
		case "91" :	/* ·Î±×ÀÎ */
			document.location.href="../sub/subFrame.php?book=9&part=1&chapter=0";
			break;	
		case "92" :	/* »çÀÌÆ®¸Ê */
			document.location.href="../sub/subFrame.php?book=9&part=2&chapter=0";
			break;
		case "93" :	/* °Ô½ÃÆÇ °ü¸® */
			document.location.href="../pgm/boardList.php?book=9&part=3&chapter=0";
			break;
		case "94" :	/* ÀÏÁ¤°ü¸® */
			document.location.href="../pgm/scheduleList.php?book=9&part=4&chapter=0";
			break;
		case "95" :	/* ³ó»çÁ¤º¸ */
			document.location.href="../pgm/nongsaList.php?book=9&part=5&chapter=0";
			break;
		case "96" :	/* È¸¿ø°¡ÀÔ */
			document.location.href="../pgm/memberList.php?book=9&part=6&chapter=0";
			break;
		case "101" :	/* home */
			document.location.href="../main/main.php";
			break;

		default	:		
			break;			
			
	}
}	


/*********************************************************************
*	Flash Navigation È£Ãâ (ÁÂÃø Äü¹è³Ê ÇÃ·¡½Ã)
*********************************************************************/
function lf_bannerLink(as_link) {
	switch (as_link) {
		case "1" :	/* banner01 */
			document.location.href="../sub/subFrame.php?book=10&part=1&chapter=1&line=1";
			break;			
		case "2" :	/* banner02 */
			document.location.href="../sub/subFrame.php?book=10&part=2&chapter=0";
			break;		
		case "3" :	/* banner03 */
			document.location.href="../sub/subFrame.php?book=10&part=3&chapter=1";
			break;		
		case "4" :	/* banner04 */
			document.location.href="../sub/subFrame.php?book=10&part=4&chapter=1";
			break;	
			
		default	:		
			break;			
			
	}
}	


/*********************************************************************
*	Flash Navigation È£Ãâ (¹®È­°ü±¤¿¡ ¿©ÇàÁ¤º¸/±³Åë¾È³»)
*********************************************************************/
function lf_mapLink(as_link) {
	switch (as_link) {
		case "1" :	/* 1.ÇÔÆò¿À´Â ±æ */
			document.location.href="sub060201.htm?book=6&part=2&chapter=1";
			break;		
		case "2" :	/* 2.½Ã³»¹ö½º */
			document.location.href="sub06020101.htm?book=6&part=2&chapter=1";
			break;		
		case "3" :	/* 3.½Ã¿Ü¹ö½º */
			document.location.href="sub06020102.htm?book=6&part=2&chapter=1";
			break;
		case "4" :	/* 4.¿­Â÷ */
			document.location.href="sub06020103.htm?book=6&part=2&chapter=1";
			break;
		case "5" :	/* 5.Ç×°ø */
			document.location.href="sub06020104.htm?book=6&part=2&chapter=1";
			break;

/*********************************************************************
*	Flash Navigation È£Ãâ (¹®È­°ü±¤¿¡ ¿©ÇàÁ¤º¸/¼÷¹Ú¾È³»)
*********************************************************************/

		case "11" :	/* 1.¸ðÅÚ */
			document.location.href="sub060202.htm?book=6&part=2&chapter=2";
			break;		
		case "12" :	/* 2.¹Î¹Ú */
			document.location.href="sub06020201.htm?book=6&part=2&chapter=2";
			break;		
		case "13" :	/* 3.±âÅ¸¼÷¹Ú */
			document.location.href="sub06020202.htm?book=6&part=2&chapter=2";
			break;
		
/*********************************************************************
*	Flash Navigation È£Ãâ (¹®È­°ü±¤¿¡ ¹®È­À¯»ê/Áö¸íÀ¯·¡)
*********************************************************************/

		case "21" :	/* ÇÔÆòÀ¾  */
			document.location.href="sub06040401.htm?book=6&part=4&chapter=4";
			break;		
		case "22" :	/* ¼ÕºÒ¸é */
			document.location.href="sub06040402.htm?book=6&part=4&chapter=4";
			break;		
		case "23" :	/* ½Å±¤¸é */
			document.location.href="sub06040403.htm?book=6&part=4&chapter=4";
			break;
		case "24" :	/* ÇÐ±³¸é */
			document.location.href="sub06040404.htm?book=6&part=4&chapter=4";
			break;
		case "25" :	/* ¾ö´Ù¸é */
			document.location.href="sub06040405.htm?book=6&part=4&chapter=4";
			break;
		case "26" :	/* ´ëµ¿¸é */
			document.location.href="sub06040406.htm?book=6&part=4&chapter=4";
			break;
		case "27" :	/* ³ª»ê¸é */
			document.location.href="sub06040407.htm?book=6&part=4&chapter=4";
			break;
		case "28" :	/* ÇØº¸¸é */
			document.location.href="sub06040408.htm?book=6&part=4&chapter=4";
			break;
		case "29" :	/* ¿ù¾ß¸é */
			document.location.href="sub06040409.htm?book=6&part=4&chapter=4";
			break;
			

		default	:		
			break;			
			
	}
}

//]]>
