
var c=false;
function ch () {
if(c) return;
document.form1.search_word.style.backgroundImage="";
c=true;
}
function MM_openBrWindow(theURL,winName,features){
  window.open(theURL,winName,features);
}

function scrab_blog(mdno){
	MM_openBrWindow('/common/scrab.jsp?mdno='+mdno,'국가지식포털','width=610,height=581,resizable=yes');
}


function taballOne(n){

	document.t1.src='/imgs/guide/tab01.gif';
	document.t2.src='/imgs/guide/tab02.gif';
	document.t3.src='/imgs/guide/tab03.gif';
	document.t4.src='/imgs/guide/tab04.gif';
	document.t5.src='/imgs/guide/tab05.gif';

	now = eval("document.t"+n);

	now.src='/imgs/guide/tab0'+n+'_on.gif';
	document.screen.src='/imgs/guide/img_tab0'+n+'.gif';
}



function pageGo(name,cate,search){//??? ??? ??

	neoform1.search_word.value=search;
	neoform1.menuCat.value=name;

	if(name=="all"){
		if(search !="" || !search){
				neoform1.action="/html/main/result.jsp";
				neoform1.submit();
				//location.href="/html/main/result.jsp?menuCat="+name+"&search_word="+search;
		}else if(search){
				neoform1.search_word.value="";
				neoform1.action="/html/upload/main/main.jsp";
				neoform1.submit();
				//location.href="/html/upload/main/main.jsp?menuCat="+name;

		}
	}else{

	if(cate=="main" && !search){
		if(name == 'knowledge') {
				neoform1.search_word.value="";
				neoform1.action="/html/knowledge/index.jsp";
				neoform1.submit();
		//location.href="/html/knowledge/index.jsp?menuCat="+name;
		}else {
				neoform1.search_word.value="";
				neoform1.action="/html/"+name+"/submain.jsp";
				neoform1.submit();
			//location.href="/html/"+name+"/submain.jsp?menuCat="+name;
		}
	}else if(cate=="sub" && !search){
		if(name == 'knowledge') {
				neoform1.search_word.value="";
				neoform1.action="/html/knowledge/index.jsp";
				neoform1.submit();
		//location.href="/html/knowledge/index.jsp?menuCat="+name;
		}else {
				neoform1.search_word.value="";
				neoform1.action="/html/"+name+"/submain.jsp";
				neoform1.submit();
			//location.href="/html/"+name+"/submain.jsp?menuCat="+name;//??
		}
	}else{
		if(name == 'knowledge') {
				neoform1.search_word.value="";
				neoform1.action="/html/knowledge/index.jsp";
				neoform1.submit();
		//location.href="/html/knowledge/index.jsp?menuCat="+name;
		}else if(name =="all"){
				neoform1.menuCat.value="";
				neoform1.action="/html/main/result.jsp";
				neoform1.submit();
		//location.href="/html/main/result.jsp?search_word="+search;
		}else {

			if(name=="culture"){
				setInfoCenter_js='NK01';
			}else if(name=="history"){
				setInfoCenter_js='NK03';
			}else if(name=="edu"){
				setInfoCenter_js="NK02";
			}else if(name=="infonc"){
				setInfoCenter_js="NK04";
			}else if(name=="scntech"){
				setInfoCenter_js="NK05";
			}else if(name=="abandon"){
				setInfoCenter_js="NK08";
			}else if(name=="build"){
				setInfoCenter_js="NK06";
			}else if(name=="ocean"){
				setInfoCenter_js="NK09";
			}else if(name=="life"){
				setInfoCenter_js="NK10";
			}else if(name=="industry"){
				setInfoCenter_js="NK07";
			}else{
				setInfoCenter_js="ALL";
			}


			directoryform.setInfoCenter.value=setInfoCenter_js;
			directoryform.menuCat.value=name;
			directoryform.search_word.value=search;
			directoryform.submit();


			//location.href="/html/main/result.jsp?cat="+name+"&search_word="+search;
		}
	}

	}





}


function searchMain(){
if(!document.form1.search_word.value)
	{
		alert("검색어를 입력하세요");
		return;
	} else{
		form1.submit();
	}
}

function searchDetail(){
		form1.submit();
}



function SearchOption(name,value){//??????
	Sname = eval("SOption."+name);
	Sname.value = value;
	SOption.submit();
}

function SumView(num,menu){//?????

	SV =eval("HidFrame"+num);
	Simg = eval("img"+num);
	if(SV.style.display=="none"){
		SV.style.display="block";
		Simg.src="/imgs/main/sumdown.gif";
	}else{
		SV.style.display="none";
		Simg.src="/imgs/main/sumup.gif";
	}

	SVUrl = eval("summary"+num);
	SVUrl.location.href="/html/main/summaryR.jsp?menuCat="+menu+"&Metaid="+num;



}


function SumView2(num,menu){//?????

	SV =eval("HidFrame"+num);
	if(SV.style.display=="none"){
		SV.style.display="block";
	}else{
		SV.style.display="none";
	}

	SVUrl = eval("best"+num);
	SVUrl.location.href="/html/main/summaryB.jsp?menuCat="+menu+"&Metaid="+num;



}


function frameBclose(id){
pframe=eval("parent.HidFrame"+id);
pframe.style.display='none';
}



function move(seq) {//??? ??
 pagging.NowNum.value = seq;
 pagging.submit();
}

function searchD(value){//????
	direct.taxonomyId.value=value;
	direct.submit();

}


ok=0; old_what="none";
function show(what){

		if((old_what != "none") && (what != old_what)){
				ok=1;
				old_what.style.display="none";
				//whattd.className="dirs2";
				what.style.display="";
		}else
		{
				if(ok){
						ok=0;
						what.style.display="none";
				}else
				{
						ok=1;
						what.style.display="";
						//this.className="dirs2b";
				}
		}
		old_what=what;
}



function submain(cate,Sdir){

		location.href="/html/main/sub_result.jsp?menuCat="+cate+"&Sdir="+Sdir;
}


function clubmove(arg1, arg2, arg3){
    location.href = "/html/community/CommunityMain.jsp?comId="+arg1+"&catId="+arg2+"&clsId="+arg3;
}

function openime(searchspec) {

str = document.searchDetail.search_word2.value;
wnd = window.open('/ime/inputassist.htm?'+escape(str), 'inputassist', 'toolbar=no, width=560, height=480');
wnd.focus();
}
//----????
function setsearchkey(data) {
document.searchDetail.search_word2.value = data;
//document.searchDetail.search_word.value = data;
}


//??? ??
function MailOpen() {
			var smpWin;
			smpWin = window.open("/intro/MailNewsSample.html", "sample", "scrollbars=yes, toolbar=no, width=635, height=768");
    		smpWin.focus();
		}


function tab01(num){
		t1.className='';
		t2.className='';
		t3.className='';
		t4.className='';
		t5.className='';
		if(num=="1"){
				where1.style.display="block";
				where2.style.display="none";
				where3.style.display="none";
				where4.style.display="none";
				where5.style.display="none";
				t1.className='b';
		}else if(num=="2"){
				where1.style.display="none";
				where2.style.display="block";
				where3.style.display="none";
				where4.style.display="none";
				where5.style.display="none";
				t2.className='b';
		}else if(num=="3"){
				where1.style.display="none";
				where2.style.display="none";
				where3.style.display="block";
				where4.style.display="none";
				where5.style.display="none";
				t3.className='b';
		}else if(num=="4"){
				where1.style.display="none";
				where2.style.display="none";
				where3.style.display="none";
				where4.style.display="block";
				where5.style.display="none";
				t4.className='b';
		}else{
				where1.style.display="none";
				where2.style.display="none";
				where3.style.display="none";
				where4.style.display="none";
				where5.style.display="block";
				t5.className='b';
		}


}

function historyP(num){
		t1.className='';
		t2.className='';
		t3.className='';
		t4.className='';
		t5.className='';
		t6.className='';
		t7.className='';
		imgt1.src="/imgs/icon/icon_down4.gif";
		imgt2.src="/imgs/icon/icon_down4.gif";
		imgt3.src="/imgs/icon/icon_down4.gif";
		imgt4.src="/imgs/icon/icon_down4.gif";
		imgt5.src="/imgs/icon/icon_down4.gif";
		imgt6.src="/imgs/icon/icon_down4.gif";
		imgt7.src="/imgs/icon/icon_down4.gif";
		if(num=="1"){
				where1.style.display="block";
				where2.style.display="none";
				where3.style.display="none";
				where4.style.display="none";
				where5.style.display="none";
				where6.style.display="none";
				where7.style.display="none";
				t1.className='historyP';
				imgt1.src="/imgs/icon/icon_down3.gif";
		}else if(num=="2"){
				where1.style.display="none";
				where2.style.display="block";
				where3.style.display="none";
				where4.style.display="none";
				where5.style.display="none";
				where6.style.display="none";
				where7.style.display="none";
				t2.className='historyP';
				imgt2.src="/imgs/icon/icon_down3.gif";
		}else if(num=="3"){
				where1.style.display="none";
				where2.style.display="none";
				where3.style.display="block";
				where4.style.display="none";
				where5.style.display="none";
				where6.style.display="none";
				where7.style.display="none";
				t3.className='historyP';
				imgt3.src="/imgs/icon/icon_down3.gif";
		}else if(num=="4"){
				where1.style.display="none";
				where2.style.display="none";
				where3.style.display="none";
				where4.style.display="block";
				where5.style.display="none";
				where6.style.display="none";
				where7.style.display="none";
				t4.className='historyP';
				imgt4.src="/imgs/icon/icon_down3.gif";
		}else if(num=="5"){
				where1.style.display="none";
				where2.style.display="none";
				where3.style.display="none";
				where4.style.display="none";
				where5.style.display="block";
				where6.style.display="none";
				where7.style.display="none";
				t5.className='historyP';
				imgt5.src="/imgs/icon/icon_down3.gif";
		}else if(num=="6"){
				where1.style.display="none";
				where2.style.display="none";
				where3.style.display="none";
				where4.style.display="none";
				where5.style.display="none";
				where6.style.display="block";
				where7.style.display="none";
				t6.className='historyP';
				imgt6.src="/imgs/icon/icon_down3.gif";
		}else{
				where1.style.display="none";
				where2.style.display="none";
				where3.style.display="none";
				where4.style.display="none";
				where5.style.display="none";
				where6.style.display="none";
				where7.style.display="block";
				t7.className='historyP';
				imgt7.src="/imgs/icon/icon_down3.gif";
		}


}


function clustering () {
			cluWindow = window.open('/metasch/MetaCluster.jsp?q=s' , 'clustering', 'location=no, width=667, height=307, resizable=no, toolbar=no');
			cluWindow.focus();
			return false;
		}



function highlight(arg1, arg2) {//??? ????? ???, ?
			var tempTagName;
			var r = document.body.createTextRange();
			r.moveToElementText((document.getElementById) ? document.getElementById("searchResult") : document.all("searchResult"));
			while(r.findText(arg1)) {
				if ((tempTagName = r.parentElement().tagName) != "FONT") {
					r.execCommand('ForeColor','',arg2);
					if (tempTagName != "B") r.execCommand('Bold','','');
				}
				r.collapse(false);
			}
		}


function goHome(){
		 location.href = "/html/upload/main/main.jsp";
}


function popsumView(Metaid,search_word){
		summarypop.Metaid.value=Metaid;
		summarypop.search_word.value=search_word;
		window.open('','summarypopup','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=550,height=500,scrollbars=auto');
		summarypop.submit();
		
		//cluWindow = window.open('/html/main/summary.jsp?Metaid='+Metaid+'&search_word='+search_word,'summery','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=550,height=500,scrollbars=auto');
		//cluWindow.focus();
		//window.open('','summarypopup','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=550,height=500,scrollbars=auto');

}

function popsummuryView(mdno){
	//	window.open('/SearchSF1/ahl/ahl.jsp?mdno='+mdno,'summury_view','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=635,height=550,scrollbars=yes');  // why auto do not effect
	window.open('/cmm/kix.do?method=summuryKix&mdno='+mdno,'summury_view','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=635,height=550,scrollbars=yes');  // why auto do not effect
		
		// MM_openBrWindow('summary.html','','scrollbars=yes,resizable=yes,width=630,height=500')

}

function originView(url,mdno,kc){

  //alert(document.body.clientHeight +" / "+ window.document.body.clientWidth);

  url = url.replace(/&/gi,"_notataion_dollar_");
  url = url.replace(/\+/gi,"_notataion_plus_");
  url = url.replace(/</gi,"  <");
  
   popWidth = document.body.clientWidth;
   popHeight = document.body.clientHeight;

  if(opener != null && opener != 'undefined'){	  
	  popWidth = opener.document.body.clientWidth;
	  popHeight = opener.document.body.clientHeight;
  }
 //alert(url);
// alert(encodeURIComponent(url));
// alert(decodeURIComponent(url));
// url = encodeURIComponent(url); 
window.open('/html/main/bridge.jsp?mdno='+mdno+'&kc='+kc+'&getUrl='+url,'origin_view','location=yes,directories=yes,resizable=yes,status=yes,toolbar=yes,menubar=yes,width='+popWidth+',height='+popHeight+',scrollbars=yes');	

//location.href = '/html/main/bridge.jsp?getUrl='+url;

}

function originView00(url,mdno,kc){	
	url = url.replace(/&/gi,"_notataion_dollar_");
	//url = encodeURIComponent(url);
	//alert(url,encodeURIComponent(url));
	window.open('/html/main/bridge_caller.jsp?callback=originPop&mdno='+mdno+'&kc='+kc+'&getUrl='+url,'','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=1,height=1,scrollbars=no');
}

function originPop(url,mdno,kc){
}

function pollsubmitVal()
{
window.open('blank.jsp','poll','height=490,width=450');
var f					= document.poll;

var sequce					= 0;
for(var x=1 ; x<15 ; x++)
{
if(eval("document.poll.poll_question"+x) != null )
{
var z = eval("document.poll.poll_question"+x).value;
if(z.length != 0)
{
sequce				= sequce+1;
if(eval("document.poll.answer_type"+x+".value") == '1')
{
if(eval("document.poll.rd"+x+"[0].checked") )
eval("document.poll.obj_choose"+x).value = "1";
else if(eval("document.poll.rd"+x+"[1].checked") )
eval("document.poll.obj_choose"+x).value = "2";
else if(eval("document.poll.rd"+x+"[2].checked") )
eval("document.poll.obj_choose"+x).value = "3";
else if(eval("document.poll.rd"+x+"[3].checked") )
eval("document.poll.obj_choose"+x).value = "4";
else if(eval("document.poll.rd"+x+"[4].checked") )
eval("document.poll.obj_choose"+x).value = "5";


if(eval("document.poll.obj_choose"+x+".value") == '')
{
alert(x+" ?? ??? ????? ????.");
return;
}
}else
{
if(eval("document.poll.sub_answer"+x+".value") =='')
{
alert('??? ??? ????? ????.');
eval("document.poll.sub_answer"+x+".focus()");
return;
}
}
}
}
}
f.maxseq.value				= sequce;
//alert(sequce);
document.poll.action 	= "/html/Kadmin/popup/poll_answer_proc.jsp";
document.poll.submit();
}

function pollshowResult()
{
window.open('blank.jsp','poll','height=490,width=450');
document.poll.action = "/html/Kadmin/popup/pollresult.jsp";
document.poll.submit();
}

function newPopup(url,name,attribute){
   window.open(url,name,attribute);
}

