var timerTree;

var timerAreaInfo;



//플래시 재생

function getFlashPlayerID(swf, w, h, id) {

	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='"+ w +"' height='"+ h +"' id='"+ id +"' align='middle'>");

	document.write("<param name='allowScriptAccess' value='sameDomain'>");

	document.write("<param name='movie' value='"+ swf +"'>");

	document.write("<param name='quality' value='high'>");

	document.write("<param name='wmode' value='transparent'>");

	document.write("<embed src='"+ swf +" quality='high' bgcolor='#ffffff' width='"+ w +"' height='"+ h +"' name='"+ id +"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>");

	document.write("</object>");

}



//svg

function getSVGPlayer( MapWidth, MapHeight, sSch_Clss, Pm_x, Pm_y, Pm_width, Pm_height ) {

	document.write ("<object classid='clsid:377B5106-3B4E-4A2D-8520-8767590CAC86' name='svg' codebase='SVGView.exe' width='"+ MapWidth +"' height='"+ MapHeight +"'>");

	document.write ("<param name='src' value='svg.jsp?sSch_Clss="+ sSch_Clss +"&Pm_x="+ Pm_x +"&Pm_y="+ Pm_y +"&Pm_width="+ Pm_width +"&Pm_height="+ Pm_height +"'>");

	document.write ("<param name='wmode' value='transparent'>");

	document.write ("</object>");

}

//zoom

function getZoomPlayer( zoomServer, zoomFile ) {

	document.write ("<applet height='520' width='360' code='zoom2dapplet' archive='zoom2dapplet.jar' codebase='"+ zoomServer +"/obj=delivery,1.0&cmd=retrieve&fif=servercomponents/code'>");

	document.write ("<param name='url' value='"+ zoomServer +"/fif="+ zoomFile +"'>");

	document.write ("</applet>");

}

//pvr_lng

function getPvrLngPlayer( pvrUrl ) {

	document.write ("<object ID=panoComponent WIDTH=600 HEIGHT=210 CLASSID='clsid:3F0EECCE-E138-11D1-8712-0060083D83F5' CODEBASE='http://www.iseemedia.com/downloads/activex/LPControl.cab#Version=4,0,0,0'>");

	document.write ("	<param NAME='URL' VALUE='"+ pvrUrl +"'>");

	document.write ("	<param NAME='type' VALUE='i-world/i-vrml'>");

	document.write ("	<param NAME='autospin' VALUE=1'>");

	document.write ("	<param NAME='pluginspage' VALUE='http://www.iseemedia.com/support/downloads/plugin.html'>");

	document.write ("</object>");

}

//pvr

function getPvrPlayer( pvrUrl ) {

	document.write ("<object ID=panoComponent WIDTH=600 HEIGHT=210 CLASSID='clsid:3F0EECCE-E138-11D1-8712-0060083D83F5' CODEBASE='http://www.iseemedia.com/downloads/activex/LPControl.cab#Version=4,0,0,0'>");

	document.write ("	<param NAME='URL' VALUE='"+ pvrUrl +"'>");

	document.write ("	<param NAME='type' VALUE='i-world/i-vrml'>");

	document.write ("	<param NAME='autospin' VALUE=1'>");

	document.write ("	<param NAME='pluginspage' VALUE='http://www.iseemedia.com/support/downloads/plugin.html'>");

	document.write ("</object>");

}

//pvr_map

function getPvrMapPlayer( mapUrl, w, h ) {

	document.write ("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='"+ w +"' HEIGHT='"+ h +"' id='flash' ALIGN=''>");

	document.write ("	<PARAM NAME=movie VALUE='"+ mapUrl +"'>");

	document.write ("	<PARAM NAME=quality VALUE=high>");

	document.write ("	<PARAM NAME=bgcolor VALUE=#FFFFFF>");

	document.write ("	<EMBED src='"+ mapUrl +"' quality=high bgcolor=#FFFFFF  WIDTH='"+ w +"' HEIGHT='"+ h +"' NAME='' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>");

	document.write ("</OBJECT>");

}



//MapOcx

function getMapOcx (Width, Height)

{

	//document.write("<object id='ocxMap' classid='clsid:622d0fe6-a628-4279-b30d-00a0a2cceb10' width='" + Width + "' height='" + Height + "' border='0' CODEBASE=\"/cf/cab/mapocx.cab#Version=1,2,0,1\"></object>");

	document.write("<object id='ocxMap' classid='clsid:8BC51312-6FC7-44d3-8BF3-214E2D47F2B5' width='" + Width + "' height='" + Height + "' border='0' CODEBASE=\"/cf/cab/mapocx.cab#Version=1,6,0,1\"></object>");

	//codebase='/cf/cab/mapocx.cab#version=1,0,0,0'

}



//3D 재생

function get3DPlayer (Media, Width, Height)

{

	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='" + Width + "' height='" + Height + "' id='3dPlayer' align='middle'>");

	document.write ("<param name='allowScriptAccess' value='sameDomain' />");

	document.write ("<param name='movie' value='rind_objp.swf?filename=" + Media + "' />");

	document.write ("<param name='menu' value='false' />");

	document.write ("<param name='quality' value='best' />");

	document.write ("<param name='bgcolor' value='#ffffff' />");

	document.write ("<embed src='rind_objp.swf?filename=" + Media + "' menu='false' quality='best' bgcolor='#ffffff' width='" + Width + "' height='" + Height + "' name='3dPlayer' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");

	document.write ("</object>");

}



//wmv 재생

function getMediaPlayer(Media,Width,Height)

{		

	document.write("<object id='mediaPlayer' CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' type='application/x-oleobject' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' width='" + Width + "' height='" + Height + "' style='FILTER:gray();z-index:-1;'>");

	//6BF52A52-394A-11d3-B153-00C04F79FAA6

	//63485F60-6816-4D5E-8B1B-3ACD8BB228BE

	document.write ("<param name='URL' value='" + Media + "'>");

	document.write ("<param name='AutoStart' value='true'>");

	document.write ("<param name='Balence' value='0'>");

	document.write ("<param name='Volume' VALUE='100'>");

	document.write ("<param name='PlayCount' value='1'>");

	document.write ("<param name='uiMode' value='full'>");

	document.write ("<param name='BaseURL'>");

	document.write ("<param name='EnableContextMenu' value='false'>");

	document.write ("<param name='InvokeURLs' value='false'>");

	document.write ("<param name='stretchToFit' value='true'>");

	document.write ("<embed");

	document.write ("		src='" + Media + "'");

	document.write ("		autostart='-1'");

	document.write ("		invokeURLs='false'");

	document.write ("		type='application/x-mplayer2'");

	document.write ("		pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'");

	document.write ("		id='mediaPlayer'");

	document.write ("		Name='mediaPlayer'");

	document.write ("		DisplaySize='4'");

	document.write ("		width='" + Width + "'");

	document.write ("		height='" + Height + "'");

	document.write ("		ShowControls='1'");

	document.write ("		ShowDisplay='0'");

	document.write ("		ShowStatusBar='1'>");

	document.write ("</embed invokeURLs=false>");

	document.write ("</object>");

	/*document.write ("<OBJECT ID=NSPlay Name=NSPlay classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...'  type='application/x-oleobject' style='FILTER:gray();z-index:-1;'>");

	document.write ("<PARAM NAME='AutoStart' VALUE='-1'><PARAM NAME='AnimationAtStart' VALUE='-1'><PARAM NAME='DisplayMode' VALUE='4'><PARAM NAME='Enabled' VALUE='true'><PARAM NAME='Filename' VALUE='" + Media + "'><PARAM NAME='ShowControls' VALUE='1'><PARAM NAME='ShowAudioControls' VALUE='1'><PARAM NAME='ShowDisplay' VALUE='0'><PARAM NAME='ShowGotoBar' VALUE='0'><PARAM NAME='ShowPositionControls' VALUE='0'><PARAM NAME='ShowStatusBar' VALUE='1'><PARAM NAME='Volume' VALUE='0'><PARAM NAME='ShowCaptioning' VALUE='0'>");

	document.write ("<EMBED src='" + Media + "' autostart='-1' invokeURLs='false' type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/' id='NSPlay' Name='NSPlay' DisplaySize='4' AutoSize='1'  ShowControls='1' ShowDisplay='0' ShowStatusBar='1'></EMBED invokeURLs='fals'e>");

	document.write ("</OBJECT>");*/

}



//플래시 재생

function getFlashPlayer(Media,Width,Height)

{

	document.write("<object id='flashPlayer' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + Width + "' height='" + Height + "' style='z-index:-1;'>");

	document.write("<param name='movie' value='" + Media + "'>");

	document.write("<param name='quality' value='high'>");

	document.write("<param name='wmode' value='transparent'>");

	document.write("<embed src='"+Media+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + Width + "' height='" + Height + "'></embed>");

	document.write("</object>");

}



//플래시 재생(투명하지 않게)

function getFlashPlayerbackground(Media,Width,Height)

{

	document.write("<object id='flashPlayer' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + Width + "' height='" + Height + "' style='z-index:-1;'>");

	document.write("<param name='movie' value='" + Media + "'>");

	document.write("<param name='quality' value='high'>");

	document.write("<param name='wmode' value='window'>");

	document.write("<embed src='"+Media+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>");

	document.write("</object>");

}



//플래시 재생_menu용

function getFlashPlayer_Menu(Media,Width,Height,menuOn)

{

	document.write("<object id='menu' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + Width + "' height='" + Height + "' style='z-index:-1;'>");

	document.write("<param name='movie' value='" + Media + "'>");

	document.write("<param name='quality' value='high'>");

	document.write("<param name='wmode' value='transparent'>");

	document.write("<param name='FlashVars' value='menuOn=" + menuOn + "'>");

	document.write("<embed name='menu' src='"+Media+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>");

	document.write("</object>");

}



function getVRMLPlayer( Width , Height , year_o , re_str ,  all , admin , search_value )

{

	document.write( '<object  id="Scene" width="' +  Width + '" height="' + Height + '" type="application/x-oleobject" classid="CLSID:86A88967-7A20-11D2-8EDA-00600818EDB1">' );

	document.write( '<param name="ShowLogo" value="ture">' );

	document.write( '<param name="ShowProgress" VALUE="true">' );

	document.write( '<param name="NavigationMode" value="2">' );	//<!--0 : none, 1 : walk, 2 : fly, 3 : examine-->

	document.write( '<param name="NavigationBar" value="1">' );		//<!--0 : false, 1 : true-->

	document.write( '<param name="Appearance" value="0">' );		//<!--border 0 : false, 1 : true-->

	document.write( '<param name="Scene" value="timd_vrml.jsp?year=' + year_o + '&back=TRUE&' + re_str + '&all=' + all + '&admin=' + admin + '&search_value=' + search_value + '">'  );

	document.write( '<param name="BackColor" value="ffffff">' );

	document.write( '<PARAM NAME="Collider" VALUE="1">' );

	document.write( '<PARAM NAME="ColliderMode" VALUE="1">' );

	document.write( '<param name="ContextMenu" value="true">' );

	document.write( '<param name="AnimateViewpoints" value="1">' );

	document.write( '<PARAM NAME="TravelSpeed" VALUE="3">' );

	document.write( '<param name="RendererHints" value="32768">' );

	document.write( '<PARAM NAME="RendererName" VALUE="DirectX Renderer">' );

	document.write( '<param name="vrml_splashscreen" value="true">' );

	document.write( '<param name="vrml_dashboard" value="false">' );

	document.write( '<param name="vrml_background_color" value="#000000">' );

	document.write( '</object></td>' );

}



//3D 플레이어 재생

/*

function get3DPlayer(Media,Width,Height)

{

	document.write("<OBJECT CLASSID='CLSID:4B6E3013-6E45-11D0-9309-0020AFE05CC8' ID='Contact3D' WIDTH='"+Width+"' HEIGHT='"+Height+"'>");

	document.write("<PARAM NAME='SRC' VALUE='"+Media+"'>");

	document.write("<EMBED SRC='"+Media+"' TYPE='application/x-cc3d' WIDTH='"+Width+"' HEIGHT='"+Height+"'>");

	document.write("</EMBED>");

	document.write("</OBJECT>");

}*/

//주석팝업띄우기

function PopJuSukView(strJuSukId)

{

	var strJuSukId_Length ;

	var nNowWinX = document.body.offsetWidth;	//현재document의 가로사이즈

	var nNowWinY = document.body.offsetHeight;	//현재document의 세로사이즈

	nMouseX = event.clientX + document.body.scrollLeft;

	nMouseY = event.clientY + document.body.scrollTop;

	

	strJuSukId_Length = ((strJuSukId.text.length / 30) * 25 ) + 30;

	//alert(strJuSukId_Length);

	if ( (nMouseX + 300) > nNowWinX  )			// 현재마우스위치 + 팝업창가로사이즈 > 현재윈도우값을 벗어나는가

	{

		nMouseX = nNowWinX - 350				//벗어날경우 현재윈도우 - 팝업창가로사이즈

	}



	//주석이 화면창에서 벗어날경우 처리

	if ( (nMouseY+strJuSukId_Length - document.body.scrollTop) > nNowWinY )

	{

		nMouseY = nMouseY - strJuSukId_Length - 20				

	}

	divJusuk_Out.style.left = nMouseX ;

	divJusuk_Out.style.top = nMouseY + 10;

	TdJusuk.innerHTML = strJuSukId.text;



	TdJusukNum.innerHTML = strJuSukId.hreflang;

	divJusuk_Out.style.display='';



}





//주석팝업Close

function PopJusukHidden()

{

	divJusuk_Out.style.display = 'none';

	TdJusuk.innerText = "";

}

function goUsangiUrl(menu)

{

	if (menu=="index")

	{

		location.href="/index.asp";

	}

	else if (menu=="bd")

	{

		location.href="/mountain/spotview.asp?mou=1";

	}

	else if (menu=="kg")

	{

		location.href="/mountain/spotview.asp?mou=2";

	}

	else if (menu=="jr")

	{

		location.href="/mountain/spotview.asp?mou=3";

	}

	else if (menu=="bh")

	{

		location.href="/mountain/spotview.asp?mou=4";

	}

	else if (menu=="gy")

	{

		location.href="/mountain/spotview.asp?mou=5";

	}

	else if (menu=="cr")

	{

		location.href="/mountain/spotview.asp?mou=6";

	}

	else if (menu=="story")

	{

		location.href="/storybank/bank.asp";

	}



}

//javascript:goUsangiUrl('story')



function syncLoad( cat )

{

	var strHeaderBizName = syncHeaderParameter("cat");



	if (undefined != top.frames.fraBottom || undefined != top.frames.noFraBottom) //FRAME

	{

		//var tmpCat;

		//tmpCat = cat;

		//if (cat.substring (0, 6) == "et_pol")

			//cat = "et_pol";

		//else if (cat.substring (0, 6) == "tu_cts")

		//	cat = "tu_cts";

		

		if( cat != strHeaderBizName)

		{

			//cat = tmpCat;

			if ( top.location.pathname != "/index.jsp" )		//url만치고 들어왔을경우

			{

				var url = top.location.pathname + top.location.search;

				url = encodeURI(url);

				HeaderMoveUrlAll(cat, url);

				return true;

			}

			else

			{

				var url = location.pathname + location.search;

				HeaderMoveUrlAll(cat, url);

				return true;

			}

		}

	}

	else

	{

		if ((top.frames.fraBottom == undefined && parent == self) || (top.frames.noFraBottom == undefined && parent == self))

		{

			var url = location.pathname + top.location.search;

			url = encodeURI(url);

			HeaderMoveUrlAll(cat, url);

			return true;

		}

	}

}



function TreeView()

{

	if (top.frames.fraBottom != undefined)

	{

		if (top.fraBottom.fraContentBar.document.all("showtoc_td").style.width == "60px")

		{

			top.fraBottom.fraContentBar.showtoc.style.display = '';

		}

	}

}



function syncHeaderParameter(p)

{

  if (p) r=top.location.search.match(new RegExp("[&?]"+p+"=(.*?)(&|$)"));

  return r&&r[1]?r[1]:null;

}



//뒤로가기버튼이 제자리일경우 사용 전체Url로 걸어준다

function HeaderMoveUrlAll(strMoveCat, strUrl)	//HeaderMoveUrlAll(이동문집아이디, 이동 경로)

{

	strUrl = ncCom_Replace(strUrl, "&", "%26");

	strUrl = ncCom_Replace(strUrl, "?", "%3F");

	var strMoveUrl = "http://" + location.host + "/index.jsp?cat="+strMoveCat+"&url="+strUrl;

	top.location.href = strMoveUrl;

}



function ncCom_Replace(originalString, findText, replaceText)

{

	var pos = 0

	var preStr = ""

	var postStr = ""



	pos = originalString.indexOf(findText)

	while (pos != -1)

	{

		preString = originalString.substr(0,pos)

		postString = originalString.substring(pos+findText.length)

		originalString = preString + replaceText + postString

		pos = originalString.indexOf(findText)

	}

	return originalString

}







//현재위치의 정보를 네비게이션에 뿌린다

function AreaInfoUrl(strText,strTextEnd)

{

	clearTimeout (timerAreaInfo);

	//alert (top.frames.fraBottom + "::" + top.document.all.area_info);

	if ((parent.fraContentBar == undefined || parent.fraContentBar.area_info == undefined) && (top.noFraBottom == undefined || top.noFraBottom.area_info == undefined))

	{

		clearTimeout (timerAreaInfo);

		timerAreaInfo = setTimeout ("AreaInfoUrl (\"" + strText + "\", \"" + strTextEnd + "\")", 500) ;

		return;

	}



	if (top.frames.fraBottom != undefined)

		parent.fraContentBar.area_info.innerHTML = strText +  "<span class='nav'>"+strTextEnd+"</span>";

	else

		top.noFraBottom.area_info.innerHTML = strText +  "<span class='nav'>"+strTextEnd+"</span>";

}



function removeChildAll (obj)

{

	if (obj == undefined || !obj.hasChildNodes ())

		return;

	

	for (i = obj.children.length; i > 0 ; i--)

	{

		obj.removeChild (obj.children[i - 1]);

	}

}



//페이지 바로가기 처리

function directPageGo (addr, index, maxPage)

{

	var indexNum = new Number (index);

	var maxPageNum = new Number (maxPage);

	var oPage = document.getElementsByName ("directPage");

	var pageValue = oPage.item(indexNum).value;	

	

	//if (!addr) {

		addr = location.href;

	//}

	if (addr.indexOf ("?") == -1) {

		addr += "?";

	}

	if (addr.indexOf ("pageno") != -1)

		addr = addr.substring (0, addr.indexOf ("pageno"));



	if (pageValue == "")

	{

		alert ("페이지 번호를 입력해 주세요.");

		return;

	}

	else if (!checkNumber (pageValue))

	{

		alert ("페이지 번호는 숫자만 입력해 주세요.");

		return;

	}

	else if (pageValue < 1 || pageValue > maxPageNum)

	{

		alert ("1페이지 부터 " + maxPage + " 페이지 이하로 입력해 주세요.");

		return;

	}	

	location.href = addr + "&pageno=" + pageValue;

}



function checkNumber(pageValue){

	var anum=/(^\d+$)|(^\d+\.\d+$)/

	if (anum.test(pageValue))

	{

		result=true;

	}

	else

	{

		result=false;

	}

	return (result)

}



function syncTree ()

{

	if (typeof (top.deeptree) != "undefined" && typeof (top.deeptree.Sync) == "unknown")	//트리동기화

	{

		clearTimeout (timerTree);

		top.deeptree.Sync ();

		TreeView();

	}

	else

	{

		clearTimeout (timerTree);

		timerTree = setTimeout ("syncTree ()", 500);

		return;

	}

}



function ncCom_SetBtn (cat, argObj, argFlag)

{

	if(argObj.tagName!="IMG") return;

	var str = argObj.src;

	var imgPath = "/" + cat + "/img/";

	

	var imgName = "";	

	if (argObj.id == "imgNext")

		imgName = "btn_rightbar_search";

	else if (argObj.id == "imgScr")

		imgName = "btn_rightbar_scrop";

	else if (argObj.id == "imgPrt")

		imgName = "btn_rightbar_print";

	else if (argObj.id == "imgSrchFirst")

		imgName = "btn_sch_start";

	else if (argObj.id == "imgSrchPrev")

		imgName = "btn_sch_prev";

	else if (argObj.id == "imgSrchNext")

		imgName = "btn_sch_next";

	else if (argObj.id == "imgSrchEnd")

		imgName = "btn_sch_end";

	

	if (argFlag) {

		argObj.src = imgPath + imgName + "_A.gif"

		argObj.disabled = false;

		argObj.style.cursor="hand"

	}

	else {

		argObj.src = imgPath + imgName + "_B.gif"

		argObj.disabled = true;

		argObj.style.cursor=""

	}

}



function setThreeBtn (cat, srch, scr, prt)

{

	ncCom_SetBtn (cat, "imgNext", srch);

	ncCom_SetBtn (cat, "imgScr", scr);

	ncCom_SetBtn (cat, "imgPrt", prt);

}

var iCount_Move = 0;

function moveResultInFrame()

{

	var gofast = top.fraBottom.fraContent.document.all.gofast;



	if ( typeof(gofast) != "undefined" )

	{

		if(gofast.length > 0)

		{

			if( typeof(gofast[iCount_Move]) == "undefined")

			{

				iCount_Move = 0;

				gofast[iCount_Move].focus();

				var objLI = gofast[iCount_Move];

				var iY = objLI.offsetTop - window.document.body.clientHeight/2;

				var iX = 0;

				top.fraBottom.fraContent.scrollTo( iX , iY+40 );

				iCount_Move++;

			}

			else

			{

				var objLI = gofast[iCount_Move];



				//alert(gofast[iCount_Move].offsetHeight);

				if(objLI.offsetTop - window.document.body.scrollTop > 0 && objLI.offsetTop - window.document.body.scrollTop +10 < window.document.body.clientHeight)

				{

					objLI.focus();

					var iY = objLI.offsetTop - window.document.body.clientHeight/2;

					var iX = 0;

					top.fraBottom.fraContent.scrollTo( iX , iY+40 );

					iCount_Move++;

				}

				else

				{

					objLI.focus();

					var iY = objLI.offsetTop - window.document.body.clientHeight/2;

					var iX = 0;

					top.fraBottom.fraContent.scrollTo( iX , iY+10 );

					iCount_Move++;

				}

			}

		}

		else

		{

				var objLI = gofast;

				var iY = objLI.offsetTop - window.document.body.clientHeight/2;

				var iX = 0;

				top.fraBottom.fraContent.scrollTo( iX , iY+40 );

				gofast.focus();

		}

	}

	else

	{

		//alert("이미지에서 검색된결과 가 있습니다.");

	}

}



function moveResultInNoFrame()

{

	var gofast = top.noFraBottom.page.document.all.gofast;



	if ( typeof(gofast) != "undefined" )

	{

		if(gofast.length > 0)

		{

			if( typeof(gofast[iCount_Move]) == "undefined")

			{

				iCount_Move = 0;

				gofast[iCount_Move].focus();

				var objLI = gofast[iCount_Move];

				var iY = objLI.offsetTop - window.document.body.clientHeight/2;

				var iX = 0;

				top.noFraBottom.window.scrollTo( iX , iY+40 );

				iCount_Move++;

			}

			else

			{

				var objLI = gofast[iCount_Move];



				//alert(gofast[iCount_Move].offsetHeight);

				if(objLI.offsetTop - window.document.body.scrollTop > 0 && objLI.offsetTop - window.document.body.scrollTop +10 < window.document.body.clientHeight)

				{

					objLI.focus();

					var iY = objLI.offsetTop - window.document.body.clientHeight/2;

					var iX = 0;

					top.noFraBottom.window.scrollTo( iX , iY+40 );

					iCount_Move++;

				}

				else

				{

					objLI.focus();

					var iY = objLI.offsetTop - window.document.body.clientHeight/2;

					var iX = 0;

					top.window.scrollTo( iX , iY+10 );

					iCount_Move++;

				}

			}

		}

		else

		{

				var objLI = gofast;

				var iY = objLI.offsetTop - window.document.body.clientHeight/2;

				var iX = 0;

				top.noFraBottom.window.scrollTo( iX , iY+40 );

				gofast.focus();

		}

	}

	else

	{

		//alert("이미지에서 검색된결과 가 있습니다.");

	}

}



function pdaGuide ()

{

	window.open('/et/gis/PDA/pda_down.jsp', 'pda', 'width=722, height=640, scrollbars=yes');

}



function goUGYOUrl (cat, parm)

{

	if (cat == "mn") //메인

		top.location.href = "/index.jsp";

	else if (cat == "cf_map") //전체맵보기

		window.open ("/cf/map/", "cf_map", "height=633, width=939");

	else if (cat == "yk") //유교기록자료관

		top.location.href = "/index.jsp?cat=yk_gds_ysb";

	else if (cat == "yk_gms_dsv") //고문서(도산서원고문서)

		top.location.href = "/index.jsp?cat=yk_gms_dsv";

	else if (cat == "yk_gms_mmf") //고문서(명문가고문서)

		top.location.href = "/index.jsp?cat=yk_gms_mmf";

	else if (cat == "yk_gds_ysb") //고도서(영남사림문집)

		top.location.href = "/index.jsp?cat=yk_gds_ysb";

	else if (cat == "yk_gds_ysd") //고도서(영남사림일기)

		top.location.href = "/index.jsp?cat=yk_gds_ysd";

	else if (cat == "yk_hej") //해제

		top.location.href = "/index.jsp?cat=yk_hej";

	else if (cat == "yk_cat") //기록문화찾아가기

		window.open ("/yk/cat/index.jsp", "yk_cat", "width=770, height=550");

	else if (cat == "si_bok") //유교문화간행물

		top.location.href = "/index.jsp?cat=si_bok";

	else if (cat == "si_bok_his") //안동의역사

		top.location.href = "/index.jsp?cat=si_bok&clsscode=1";

	else if (cat == "si_bok_ind") //독립운동

		top.location.href = "/index.jsp?cat=si_bok&clsscode=2";

	else if (cat == "si_bok_mun") //문화유산

		top.location.href = "/index.jsp?cat=si_bok&clsscode=3";

	else if (cat == "si_bok_see") //관광정보

		top.location.href = "/index.jsp?cat=si_bok&clsscode=4";

	else if (cat == "si_bok_yuk") //유교문화

		top.location.href = "/index.jsp?cat=si_bok&clsscode=5";

	else if (cat == "si_bok_min") //민속문화

		top.location.href = "/index.jsp?cat=si_bok&clsscode=6";

	else if (cat == "si_bok_jun") //정기간행물

		top.location.href = "/index.jsp?cat=si_bok&clsscode=7";

	else if (cat == "et_cmt") //문중관

		top.location.href = "/index.jsp?cat=et_cmt&linkmode=1";

	else if (cat == "et_cmt_int") //기탁문중소개

		top.location.href = "/index.jsp?cat=et_cmt&linkmode=1";

	else if (cat == "et_cmt_rel") //문중홍보

		top.location.href = "/index.jsp?cat=et_cmt&linkmode=2";

	else if (cat == "tu") //유교역사관

		top.location.href = "/index.jsp?cat=tu";

	else if (cat == "tu_rin") //유적

		top.location.href = "/index.jsp?cat=tu_rin";

	else if (cat == "tu_rin_an")

		top.location.href="/index.jsp?cat=tu_rin&lcatcode=an";

	else if (cat == "tu_rin_ye")

		top.location.href="/index.jsp?cat=tu_rin&lcatcode=ye";

	else if (cat == "tu_rin_bo")

		top.location.href="/index.jsp?cat=tu_rin&lcatcode=bo";

	else if (cat == "tu_psn") //인물

		top.location.href = "/index.jsp?cat=tu_psn";

	else if (cat == "tu_psn_an")

		top.location.href="/index.jsp?cat=tu_psn&lcatcode=an";

	else if (cat == "tu_psn_ye")

		top.location.href="/index.jsp?cat=tu_psn&lcatcode=ye";

	else if (cat == "tu_psn_bo")

		top.location.href="/index.jsp?cat=tu_psn&lcatcode=bo";

	else if (cat == "tu_tim") //연표

		top.location.href = "/index.jsp?cat=tu_tim";

	else if (cat == "tu_cts_dig") //디지털복원관

		top.location.href = "/index.jsp?cat=tu_cts_dig";

	else if (cat == "tu_cts_dig_adu") //안동읍성(메인)

		top.location.href = "/index.jsp?cat=tu_cts_dig&code=1";

	else if (cat == "tu_cts_dig_tbs") //디지털복원관

		top.location.href = "/index.jsp?cat=tu_cts_dig&code=2";

	else if (cat == "tu_cts_cyb") //사이버유교건축관

		top.location.href = "/index.jsp?cat=tu_cts_cyb";

	else if (cat == "tu_cts_cyb_dsm") //사이버유교건축관 도산서원 (메인)

		top.location.href = "/index.jsp?cat=tu_cts_cyb&code=1";

	else if (cat == "tu_cts_cyb_bsm") //사이버유교건축관 병산서원 (메인)

		top.location.href = "/index.jsp?cat=tu_cts_cyb&code=2";

	else if (cat == "tu_cts_cyb_hhv") //사이버유교건축관 하회마을 (메인)

		top.location.href = "/index.jsp?cat=tu_cts_cyb&code=3";

	else if (cat == "tu_cts_cyb_ock") //사이버유교건축관 오천군자리 (메인)

		top.location.href = "/index.jsp?cat=tu_cts_cyb&code=4";

	else if (cat == "tu_cts_cyb_dsv") //사이버유교건축관 봉화닭실마을 (메인)

		top.location.href = "/index.jsp?cat=tu_cts_cyb&code=5";

	else if (cat == "tu_cts_cyb_bht") //사이버유교건축관 봉화향교 (메인)

		top.location.href = "/index.jsp?cat=tu_cts_cyb&code=6";

	else if (cat == "tu_cts_cyb_ssm") //사이버유교건축관 영주소수서원(메인)

		top.location.href = "/index.jsp?cat=tu_cts_cyb&code=7";

	else if (cat == "tu_cts_cyb_msv") //사이버유교건축관 영주무섬마을 (메인)

		top.location.href = "/index.jsp?cat=tu_cts_cyb&code=8";

	else if (cat == "tu_mti") //플래쉬이야기

		top.location.href = "/index.jsp?cat=tu_mti";

	else if (cat == "tu_ani") //체험동영상

		top.location.href = "/index.jsp?cat=tu_ani";

	else if (cat == "si_tre") //유교학맥도

		top.location.href = "/index.jsp?cat=si_tre&linkmode=1";

	else if (cat == "si_tre_tae") //퇴계학맥도

		top.location.href = "/index.jsp?cat=si_tre&linkmode=1";

	else if (cat == "si_tre_yul") //율곡학맥도

		top.location.href = "/index.jsp?cat=si_tre&linkmode=2";

	else if (cat == "et_pol") //참여광장

		top.location.href = "/index.jsp?cat=et_pol";

	else if (cat == "et_pol_not") //공지사항

		top.location.href = "/index.jsp?cat=et_pol_not";

	else if (cat == "et_pol_dat") //자료실

		top.location.href = "/index.jsp?cat=et_pol_dat";

	else if (cat == "et_pol_bor") //게시판

		top.location.href = "/index.jsp?cat=et_pol_bor";

	else if (cat == "et_pol_rct") //추천맛집

		top.location.href = "/index.jsp?cat=et_pol_rct";

	else if (cat == "et_pol_qnd") //Q&A

		top.location.href = "/index.jsp?cat=et_pol_qnd";

	else if (cat == "et_pol_fvq") //FAQ

		top.location.href = "/index.jsp?cat=et_pol_fva";

	else if (cat == "et_pol_hwr") //숙제도우미

		top.location.href = "/index.jsp?cat=et_pol_hwr";

	else if (cat == "et_pol_map") //사이트맵

		//top.location.href = "/index.jsp?cat=et_pol_map";

		top.location.href = "/et/pol/site_link.jsp?cat=et_pol_map";

	//else if (cat == "et_per") //마이페이지

		//top.location.href = "/index.jsp?cat=et_per";

	else if (cat == "et_per_inf") //회원정보수정

		top.location.href = "/index.jsp?cat=et_per_inf";

	else if (cat == "et_per_scr") //스크랩

		top.location.href = "/index.jsp?cat=et_per_scr";

	else if (cat == "et_per_lea") //회원탈퇴

		top.location.href = "/index.jsp?cat=et_per_lea";

	else if (cat == "et_hel") //도움말

		window.open ("/et/hel/index.jsp?cat=et_hel", "et_hel", "width=953 height=640");

	else if (cat == "et_lng_eng") //도움말 - 영어

		window.open ("/et/lng/index.jsp?lng=eng", "et_lng_eng", "width=953 height=640");

	else if (cat == "et_lng_chi") //도움말 - 중국어

		window.open ("/et/lng/index.jsp?lng=chi", "et_lng_chi", "width=953 height=640");

	else if (cat == "et_lng_jpn") //도움말 - 일본어

		window.open ("/et/lng/index.jsp?lng=jpn", "et_lng_jpn", "width=953 height=640");

	else if (cat == "mt") //멀티미디어유물관

		top.location.href = "/index.jsp?cat=mt_rlc";

	else if (cat == "mt_rlc") //멀티미디어유물관

		top.location.href = "/index.jsp?cat=mt_rlc";

	else if (cat == "mt_mdt") //유교문화권목판

		top.location.href = "/index.jsp?cat=mt_mdt";

	else if (cat == "mt_idt") //유교문화갤러리

		top.location.href = "/index.jsp?cat=mt_idt";

	else if (cat == "si_see") //체험정보

		top.location.href = "/index.jsp?cat=si_see";

	else if (cat == "si_see_the") //테마관광

		top.location.href = "/index.jsp?cat=si_see&lcatcode=01&classcode=1";

	else if (cat == "si_see_day") //일정별관광

		top.location.href = "/index.jsp?cat=si_see&lcatcode=02&classcode=2";

	else if (cat == "si_see_hou") //전통숙박체험

		top.location.href = "/index.jsp?cat=si_see&lcatcode=03&classcode=3";

	else if (cat == "si_see_foo") //향토음식

		top.location.href = "/index.jsp?cat=si_see&lcatcode=04&classcode=4";	

	else if (cat == "si_see_spe") //특산물

		top.location.href = "/index.jsp?cat=si_see&lcatcode=05&classcode=5";

	else if (cat == "si_see_car") //교통편

		top.location.href = "/index.jsp?cat=si_see&lcatcode=99&classcode=6";	

	else if (cat == "et_gis") //GIS

		window.open ("/et/gis/mainFrame.jsp", "et_gis", "width=953 height=640");

	else if (cat == "cf_sch_det") //상세검색

		top.location.href = "/index.jsp?cat=cf_sch_det";

	else if (cat == "cf_sch_hst")

		window.open ("/cf/sch/srch_popu.jsp?hst=" + encodeURIComponent (parm), "cf_sch_hst", "width=600 height=400, scrollbars=yes");

	else if (cat == "et_log") //로그인

		top.location.href = "/index.jsp?cat=et_log";

	else if (cat == "et_log_joi") //회원가입

		top.location.href = "/index.jsp?cat=et_log_joi";

	else if (cat == "et_log_idp") //아이디,비밀번호찾기

		top.location.href = "/index.jsp?cat=et_log_idp";

	else if (cat == "ot_mlt") //유교문화관

		window.open ("http://multi.koreastudy.or.kr");

	else if (cat == "ot_yus") //유산기

		window.open ("http://yusan.culturecontent.com");	

	else if (cat == "ot_jan") //사이버장판각

		window.open ("http://multi.koreastudy.or.kr/vrTour.jsp");

	else if (cat == "ot_guk") //한국국학진흥원

		window.open ("http://www.koreastudy.or.kr");

	else if (cat == "ot_hkp") //국가지식포털

		window.open ("http://www.knowledge.go.kr");

	else if (cat == "ot_kho") //역사정보검색

		window.open ("http://www.koreanhistory.or.kr");

	else if (cat == "ot_bak") //유교문화박물관

		window.open ("http://www.confuseum.org");

	else if (cat == "et_fnt") //유니코드폰트

		window.open( "/et/hel/font_popu.jsp" , "유니코드폰트" , "width=366,height=273" );

}



function trim( str )

{

	var startInd = 0;

	var endInd = 0 ;

	var i;

	for ( i = 0 ; i < str.length ; i++ )

	{

		if ( str.charAt(i) != 0 && str.charAt(i) != ' ' && str.charAt(i) != '\n' &&  str.charAt(i) != '\r')

		{

			break;

		}

	}

	

	startInd = i;

	

	if ( str.length == i )

	{

		return "";

	}

	

	for ( i = str.length - 1 ; i >= 0 ; i-- )

	{

		if ( str.charAt(i) != 0 && str.charAt(i) != ' ' && str.charAt(i) != '\n' &&  str.charAt(i) != '\r' )

		{

			break;

		}

	}

	

	endInd = i+1;		

	

	return str.substring( startInd , endInd );		

}

