function open_win(url,name,width,height,top,left,scroll) {
	var wContentsLink = window.open(url, name, "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width="+width+",height="+height+",top="+top+",left="+left+",scrollbars="+scroll );
//	wContentsLink.moveTo(left,top);
	wContentsLink.focus();
}

function initMain() {
	var ckValue = GetCookie('ctsState');
	cView = document.getElementById("contentView");
	cClose = document.getElementById("contentClose");
	viewAnchor = cView.getElementsByTagName("a").item(0);
	closeAnchor = cClose.getElementsByTagName("a").item(0);
	
	if( ckValue == "true" ) {
		cClose.parentNode.parentNode.style.display = "block";
		cView.parentNode.style.display = "none";
		document.getElementById("ctsState").checked = true;
	} else {
		cClose.parentNode.parentNode.style.display = "none";
		cView.parentNode.style.display = "block";
		document.getElementById("ctsState").checked = false;
	}
}

function fnOpenSite(url){
	window.open(url);
}

function fnFooterOpen(obj){
	var url = obj.value;
	if(url==""){
		alert("선택되지 않았습니다.");
		return;
	}else{
		window.open(url);
	}	
}

function fnOpenChild(url){
	window.open(url);
}

function initcafe(tabContainerID){
var tabContainer = document.getElementById(tabContainerID);
var tabAnchor = tabContainer.getElementsByTagName("a");
var i = 0;

for(i=0; i<tabAnchor.length; i++) {
	if (tabAnchor.item(i).className == "tab")
		thismenu = tabAnchor.item(i);
	else
		continue;

	thismenu.container = tabContainer;
	thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
	thismenu.targetli = document.getElementsByTagName("li")[i];
	thismenu.targetEl.style.display = "none";
	thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
	thismenu.onclick = thismenu.onfocus = function tabMenuClick() {
		currentmenu = this.container.current;
		if(currentmenu == this)
			return false;

		if(currentmenu){
			currentmenu.targetEl.style.display = "none";
			if (currentmenu.imgEl){
				currentmenu.imgEl.src = currentmenu.imgEl.src.replace("on.gif", ".gif");
				currentmenu.imgEl.style.zIndex = "1";
				currentmenu.targetli.style.zIndex = "990";
				//currentmenu.imgEl.className = currentmenu.imgEl.className.replace(" viewCafe", "");
				//currentmenu.targetli.className = currentmenu.targetli.className.replace(" viewmap", "");
			}
		}
		this.targetEl.style.display = "";
		if(this.imgEl){
			this.imgEl.src = this.imgEl.src.replace("^[on].gif", "on.gif");
			this.imgEl.style.zIndex = "99";
			this.targetli.style.zIndex = "999";
			//this.imgEl.className += " viewCafe";
			//this.targetli.className += " viewmap";
		} 
		this.container.current = this;

		return false;
	};
	if (!thismenu.container.first)
		thismenu.container.first = thismenu;
}
if (tabContainer.first)
	tabContainer.first.onclick();
}	
/*   */
function setCtsState() {
	// pageZoomIn.js 에있는 쿠키 관련 스크립트 사용
	var obj = document.getElementById("ctsState");
	if( obj.checked ) {
		SetCookie('ctsState', 'true');
	} else {
		SetCookie('ctsState', 'false');
	}
}

function portal_popup_windowOpen_scroll(url, popupwidth, popupheight)
{
 Top = (window.screen.height - popupheight) / 3;
 Left = (window.screen.width - popupwidth) / 2;
 if (Top < 0) Top = 0;
 if (Left < 0) Left = 0;
 Future = "fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=yes,resizable=yes,left=" + Left + ",top=" + Top + ",width=" + popupwidth + ",height=" + popupheight;
 PopUpWindow = window.open(url, "PopUpWindow", Future);
 PopUpWindow.focus();
}

function portal_popup_windowOpen_scroll_sub()
{
 Top = (window.screen.height - 800) / 3;
 Left = (window.screen.width - 800) / 2;
 if (Top < 0) Top = 0;
 if (Left < 0) Left = 0;
 Future = "fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=yes,resizable=yes,left=" + Left + ",top=" + Top + ",width=800,height=800";
 PopUpWindow = window.open('http://www.agrix.go.kr/Portal_GoRILoginPage.do', "PopUpWindow", Future)
 PopUpWindow.focus();
}

/*

	var xmlHttp2='';
	var xmlHttp3='';
	var xmlHttp4='';
	var xmlHttp5='';
	var xmlHttp6='';
	var xmlHttp7='';
	var xmlHttp8='';
						
	var xmlHttp='';						
							
	var glb_gubun='';
	function browserCheck(){	
		var szBrowser = navigator.userAgent;
		var vrBrowser = navigator.appVersion;
		var str = '';
		
		if ( szBrowser.indexOf("Firefox") != -1 ) {
			//firefox
			 str = 'f';
		}
		else if ( szBrowser.indexOf("Opera") != -1 ) {
			//opera
		 str = 'o';
	
		}else str='ie';

		return str;
	}	
	
	
	function createXMLHttpRequest() {
		var ajxHttp;

		if (window.XMLHttpRequest) {
	        ajxHttp = new XMLHttpRequest();
	    }	

	    else if (window.ActiveXObject) {
	        ajxHttp = new ActiveXObject("Microsoft.XMLHTTP");
	    } 

	    return ajxHttp;
	}	
	
	
	function fnMainBrd2(gubun){
		var sSrc = '/GetMainBrd.ajax';
	    var param = 'gubun='+gubun;glb_gubun = gubun;
	    xmlHttp2 = createXMLHttpRequest();
	    xmlHttp2.onreadystatechange = fnBrdList2;
	    xmlHttp2.open("POST",sSrc,true); 
	    xmlHttp2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	    xmlHttp2.setRequestHeader("Content-length", param.length); 
	    xmlHttp2.setRequestHeader("Connection", "close"); 
	    xmlHttp2.send(param);	
	}
	function fnMainBrd3(gubun){
		var sSrc = '/GetMainBrd.ajax';
	    var param = 'gubun='+gubun;glb_gubun = gubun;
	    xmlHttp3 = createXMLHttpRequest();
	    xmlHttp3.onreadystatechange = fnBrdList3;
	    xmlHttp3.open("POST",sSrc,true); 
	    xmlHttp3.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	    xmlHttp3.setRequestHeader("Content-length", param.length); 
	    xmlHttp3.setRequestHeader("Connection", "close"); 
	    xmlHttp3.send(param);	
	}	
	function fnMainBrd4(gubun){
		var sSrc = '/GetMainBrd.ajax';
	    var param = 'gubun='+gubun;glb_gubun = gubun;
	    xmlHttp4 = createXMLHttpRequest();
	    xmlHttp4.onreadystatechange = fnBrdList4;
	    xmlHttp4.open("POST",sSrc,true); 
	    xmlHttp4.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	    xmlHttp4.setRequestHeader("Content-length", param.length); 
	    xmlHttp4.setRequestHeader("Connection", "close"); 
	    xmlHttp4.send(param);	
	}
	function fnMainBrd5(gubun){
		var sSrc = '/GetMainBrd.ajax';
	    var param = 'gubun='+gubun;glb_gubun = gubun;
	    xmlHttp5 = createXMLHttpRequest();
	    xmlHttp5.onreadystatechange = fnBrdList5;
	    xmlHttp5.open("POST",sSrc,true); 
	    xmlHttp5.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	    xmlHttp5.setRequestHeader("Content-length", param.length); 
	    xmlHttp5.setRequestHeader("Connection", "close"); 
	    xmlHttp5.send(param);	
	}
	function fnMainBrd6(gubun){
		var sSrc = '/GetMainBrd.ajax';
	    var param = 'gubun='+gubun;glb_gubun = gubun;
	    xmlHttp6 = createXMLHttpRequest();
	    xmlHttp6.onreadystatechange = fnBrdList6;
	    xmlHttp6.open("POST",sSrc,true); 
	    xmlHttp6.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	    xmlHttp6.setRequestHeader("Content-length", param.length); 
	    xmlHttp6.setRequestHeader("Connection", "close"); 
	    xmlHttp6.send(param);	
	}		
	function fnMainBrd7(gubun){
		var sSrc = '/GetMainBrd.ajax';
	    var param = 'gubun='+gubun;glb_gubun = gubun;
	    xmlHttp7 = createXMLHttpRequest();
	    xmlHttp7.onreadystatechange = fnBrdList7;
	    xmlHttp7.open("POST",sSrc,true); 
	    xmlHttp7.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	    xmlHttp7.setRequestHeader("Content-length", param.length); 
	    xmlHttp7.setRequestHeader("Connection", "close"); 
	    xmlHttp7.send(param);	
	}
	function fnMainBrd8(gubun){
		var sSrc = '/GetMainBrd.ajax';
	    var param = 'gubun='+gubun;glb_gubun = gubun;
	    xmlHttp8 = createXMLHttpRequest();
	    xmlHttp8.onreadystatechange = fnBrdList8;
	    xmlHttp8.open("POST",sSrc,true); 
	    xmlHttp8.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	    xmlHttp8.setRequestHeader("Content-length", param.length); 
	    xmlHttp8.setRequestHeader("Connection", "close"); 
	    xmlHttp8.send(param);	
	}	
	
	function fnBrdList2(){if(xmlHttp2.readyState == 4) {if(xmlHttp2.status == 200) {xmlHttp = xmlHttp2;	fnMakeBrd('gubun2');}}}
	function fnBrdList3(){if(xmlHttp3.readyState == 4) {if(xmlHttp3.status == 200) {xmlHttp = xmlHttp3; fnMakeBrd('gubun3');}}}
	function fnBrdList4(){if(xmlHttp4.readyState == 4) {if(xmlHttp4.status == 200) {xmlHttp = xmlHttp4;	fnMakeBrd('gubun4');}}}	
	function fnBrdList5(){if(xmlHttp5.readyState == 4) {if(xmlHttp5.status == 200) {xmlHttp = xmlHttp5;	fnMakeBrd('gubun5');}}}		
	function fnBrdList6(){if(xmlHttp6.readyState == 4) {if(xmlHttp6.status == 200) {xmlHttp = xmlHttp6;	fnMakeBrd('newsArticle');}}}			
	function fnBrdList7(){if(xmlHttp7.readyState == 4) {if(xmlHttp7.status == 200) {xmlHttp = xmlHttp7;	fnMakeBrd('ecList');}}}			
	function fnBrdList8(){if(xmlHttp8.readyState == 4) {if(xmlHttp8.status == 200) {xmlHttp = xmlHttp8;	fnMakeBrd('gaList');}}}					

	function fnStrLen(str,len){var s = '';if(str.length > parseInt(len)){s = str.substring(0,parseInt(len))+'...';}else{s = str;}return s;}

	function fnMakeBrd(divID){

		var len = 0;
		
		if(xmlHttp.responseXML.getElementsByTagName("atc_num").length > 0){
			len = xmlHttp.responseXML.getElementsByTagName("atc_num").length;
			
			var atc_num = xmlHttp.responseXML.getElementsByTagName("atc_num");
			var atc_title = xmlHttp.responseXML.getElementsByTagName("atc_title");
			var reg_dt = xmlHttp.responseXML.getElementsByTagName("reg_dt");

			
			if(divID=='gubun2'){
				var str2='';
				for(var i=0; i < len; i++){
					str2 +="<li><span class=\"nSject\">";
					str2 += "<a href=\"/administration/AdministrationView.do?atc_num="+atc_num[i].firstChild.nodeValue+"&menu_cd=03010300&tpl_num=41&menu_gubun=BRD\">";
					str2 += fnStrLen(atc_title[i].firstChild.nodeValue,'25');
					str2 += "</a></span>";
					str2 += "<span class=\"nDate\">"+reg_dt[i].firstChild.nodeValue+"</span></li>";
					
				}		
				document.getElementById(divID).innerHTML = str2;
				xmlHttp = '';
				
			}else if(divID=='gubun3'){
				var str3='';
				for(var i=0; i < len; i++){
					str3 +="<li><span class=\"nSject\">";
					str3 += "<a href=\"/administration/AdministrationView.do?atc_num="+atc_num[i].firstChild.nodeValue+"&menu_cd=03010400&tpl_num=223&menu_gubun=MNW\">";
					str3 += fnStrLen(atc_title[i].firstChild.nodeValue,'25');
					str3 += "</a></span>";
					str3 += "<span class=\"nDate\">"+reg_dt[i].firstChild.nodeValue+"</span></li>";
					
				}		

				document.getElementById(divID).innerHTML = str3;
				xmlHttp = '';
				
			}else if(divID=='gubun4'){
				var str4='';
				for(var i=0; i < len; i++){
					str4 +="<li><span class=\"nSject\">";
					str4 += "<a href=\"/administration/AdministrationView.do?atc_num="+atc_num[i].firstChild.nodeValue+"&menu_cd=03010700&tpl_num=223&menu_gubun=MNW\">";
					str4 += fnStrLen(atc_title[i].firstChild.nodeValue,'25');
					str4 += "</a></span>";
					str4 += "<span class=\"nDate\">"+reg_dt[i].firstChild.nodeValue+"</span></li>";
					
				}		

				document.getElementById(divID).innerHTML = str4;
				xmlHttp = '';
				
			}else if(divID=='gubun5'){
				var str5='';
				for(var i=0; i < len; i++){
					str5 +="<li><span class=\"nSject\">";
					str5 += "<a href=\"/administration/AdministrationView.do?atc_num="+atc_num[i].firstChild.nodeValue+"&menu_cd=04040400&tpl_num=223&menu_gubun=MNW\">";
					str5 += fnStrLen(atc_title[i].firstChild.nodeValue,'25');
					str5 += "</a></span>";
					str5 += "<span class=\"nDate\">"+reg_dt[i].firstChild.nodeValue+"</span></li>";
					
				}		

				document.getElementById(divID).innerHTML = str5;
				xmlHttp = '';
				
			}else if(divID=='newsArticle'){
				var str6='';
				for(var i=0; i < len; i++){
					str6 +="<li>";
					str6 += "<a href=\"/administration/AdministrationView.do?atc_num="+atc_num[i].firstChild.nodeValue+"&menu_cd=03010200&tpl_num=41&menu_gubun=BRD\">";
					str6 += fnStrLen(atc_title[i].firstChild.nodeValue,'20');
					str6 += "</a>";
					str6 += "</li>";
					
				}		

				document.getElementById(divID).innerHTML = str6;	
				xmlHttp = '';
								
			}else if(divID=='ecList'){
				var str7='';
				for(var i=0; i < len; i++){
					str7 +="<li>";
					str7 += "<a href=\"/administration/AdministrationView.do?atc_num="+atc_num[i].firstChild.nodeValue+"&menu_cd=03010800&tpl_num=41&menu_gubun=BRD\">";
					str7 += fnStrLen(atc_title[i].firstChild.nodeValue,'20');
					str7 += "</a>";
					str7 += "</li>";
					
				}		

				document.getElementById(divID).innerHTML = str7;	
				xmlHttp = '';
				
			}else if(divID=='gaList'){
				var str8='';
				for(var i=0; i < len; i++){
					str8 += "<li><span class=\"gaSject\">";
					str8 += "<a href=\"/administration/AdministrationView.do?atc_num="+atc_num[i].firstChild.nodeValue+"&menu_cd=03011000&tpl_num=223&menu_gubun=MNW\">";
					str8 += fnStrLen(atc_title[i].firstChild.nodeValue,'20');
					str8 += "</a>";
					str8 += "</span>";
					str8 += "<span class=\"gaDate\">"+reg_dt[i].firstChild.nodeValue+"</span></li>";					
				}		

				document.getElementById(divID).innerHTML = str8;	
				xmlHttp = '';
				
			}
			


			
			
		}
		
	
	
	}

*/

/********************
 * 검색
*************************/
function searchEngine() {
    if( searchForm.qt.value == '' ) {
      alert('검색어를 입력하십시오.');
      searchForm.qt.focus();
      return false;
    }
    return true;
  }

function gogoSearchClick(rsfwl_get){
    var frm = document.gogoSearchForm;
    frm.qt.value=rsfwl_get;
    frm.submit();				
}



