
// 즐겨찾기 

function AddFavicon(title,url) {

   var url="http://english.dokdohistory.com"  
   var title="Dokdo Research Institute"            

   if (window.sidebar) // firefox 
   window.sidebar.addPanel(title, url, ""); 
   else if(window.opera && window.print)

   { // opera 
      var elem = document.createElement('a'); 
      elem.setAttribute('href',url); 
      elem.setAttribute('title',title); 
      elem.setAttribute('rel','sidebar'); 
      elem.click(); 
   } 

   else if(document.all) // ie
   window.external.AddFavorite(url, title);
}

// 독도서고 고지도 검색
	
function atlas_search()	{
  var f;
  f = document.find;
  window.location.href = "atlas_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 독도서고 고사료 검색
	
function records_search()	{
  var f;
  f = document.find;
  window.location.href = "records_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 독도서고 법률자료 검색
	
function law_search()	{
  var f;
  f = document.find;
  window.location.href = "law_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 독도서고 학술간행물 검색
	
function public_search()	{
  var f;
  f = document.find;
  window.location.href = "public_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 독도서고 학술논문 검색
	
function thesis_search()	{
  var f;
  f = document.find;
  window.location.href = "thesis_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 이슈 게시판 검색
	
function issue_search()	{
  var f;
  f = document.find;
  window.location.href = "issue_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 뉴스 게시판 검색
	
function news_search()	{
  var f;
  f = document.find;
  window.location.href = "news_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 보도자료 게시판 검색
	
function report_search()	{
  var f;
  f = document.find;
  window.location.href = "report_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 출판물 게시판 검색
	
function publish_search()	{
  var f;
  f = document.find;
  window.location.href = "publish_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 동영상 게시판 검색
	
function vod_search()	{
  var f;
  f = document.find;
  window.location.href = "vod_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 연구소 관련행사 검색
	
function event_search()	{
  var f;
  f = document.find;
  window.location.href = "event_list.asp?board_select=" + f.select_search.value + "&amp;board_search=" + f.board_search.value;
}

// 자유 게시판 검색
	
function free_search()	{
  var f;
  f = document.find;
  window.location.href = "free_list.asp?board_select=" + f.board_select.value + "&amp;board_search=" + f.board_search.value;
}

// 네티즌 갤러리 검색
	
function ng_search()	{
  var f;
  f = document.find;
  window.location.href = "gallery_list.asp?board_select=" + f.board_select.value + "&amp;board_search=" + f.board_search.value;
}

// 국내독도지킴이 검색
	
function koguard_search()	{
  var f;
  f = document.find;
  window.location.href = "internal_list.asp?board_select=" + f.board_select.value + "&amp;board_search=" + f.board_search.value;
}

// 독도지킴이협력학교 검색
	
function school_search()	{
  var f;
  f = document.find;
  window.location.href = "school_list.asp?board_select=" + f.board_select.value + "&amp;board_search=" + f.board_search.value;
}

// 해외독도지킴이 검색
	
function frguard_search()	{
  var f;
  f = document.find;
  window.location.href = "foreign_list.asp?board_select=" + f.board_select.value + "&amp;board_search=" + f.board_search.value;
}

// 독도지킴이 게시판 검색
	
function citizen_search()	{
  var f;
  f = document.find;
  window.location.href = "board_list.asp?board_select=" + f.board_select.value + "&amp;board_search=" + f.board_search.value;
}

// 사이버 독도 역사관 출력

function hisHall() {

  window.open('/history_hole/main.asp', 'history_hall', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=100,left=250,width=900,height=600');
}

// 3D 독도체험 출력

function threedDokdo() {

  window.open('/Threed/thdokdo.asp', 'Threed_dokdo', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=100,left=250,width=900,height=560');
}

// 3D 독도둘러보기 출력

function lessonDokdo() {

  window.open('/Threed_lesson/thlesson.asp', 'Threed_lesson', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=100,left=250,width=900,height=560');
}

//*****올메뉴 링크*****

// 독도연구소 소개
function all_menu01(){location.href="/01_about/intro.asp";}
function all_menu02(){location.href="/01_about/orgchart.asp";}
function all_menu03(){location.href="/01_about/work.asp";}

// 자료마당
function all_menu04(){location.href="/dokdo-history/dokdo-administrative-district.asp";}
function all_menu05(){location.href="/dokdo-history/dokdo-painful-past.asp";}
function all_menu06(){location.href="/dokdo-history/three-kingdoms-period.asp";}
function all_menu07(){location.href="/dokdo-history/dokdo-protectors-isabu.asp";}
function all_menu08(){location.href="/02_archive/photo_list.asp";}

// 이슈&뉴스
function all_menu09(){location.href="/03_inform/issue_list.asp";}
function all_menu10(){location.href="/03_inform/news_list.asp";}

// 홍보&행사
function all_menu11(){location.href="/04_public/vod_list.asp";}
function all_menu12(){location.href="/04_public/publish_list.asp";}
function all_menu13(){location.href="/04_public/event_list.asp";}

// 3D독도기행
function all_menu14(){location.href="javascript:threedDokdo();";}
function all_menu15(){location.href="javascript:lessonDokdo();";}

function CheckUIElements(){
	var yMenuFrom, yMenuTo, timeoutNextCheck, speed;
	yMenuFrom = parseInt(document.getElementById("top_btn").style.top, 10);
	yMenuTo = 300 + parseInt(document.documentElement.scrollTop, 10);
	timeoutNextCheck = 400;
	if(yMenuFrom == yMenuTo){
		setTimeout ("CheckUIElements()", timeoutNextCheck);
		return false;
	}else{
		speed = Math.ceil((yMenuTo - yMenuFrom) * 0.1);
		if (yMenuTo<600 ) {
			document.getElementById("top_btn").style.top = "375px";
			setTimeout ("CheckUIElements()", timeoutNextCheck);
		}
			else{
		document.getElementById("top_btn").style.top = (parseInt(document.getElementById("top_btn").style.top, 10) + speed) + "px";
		timeoutNextCheck = 25;
		setTimeout ("CheckUIElements()", timeoutNextCheck);
		return false;
			}
	}
}


function quick_onLoad(){
	if(!document.getElementById("top_btn")) return false;

	var start_pos = "375";
	document.getElementById("top_btn").style.top = start_pos + "px";
	document.getElementById("top_btn").style.display = "block";
	CheckUIElements();
	return false;
	
}
// window.onload Event
function addLoadEvent(func){
	var oldonload = window.onload;
	
	if(typeof window.onload != 'function'){
		window.onload = func;
		
	}else{
		window.onload = function(){
			oldonload();
			func();
		}
	}
}
addLoadEvent(quick_onLoad)
