function showLocalMenu(){
	var str="";
	var addtion="";
	var path=window.location.href;
	var file=path.substring(path.lastIndexOf('/',path.length)+1,path.length);
	str='<ul class="secondNavIcon">';
	var buf="";
	var targetWin="_self";
	for(var i in menuList){
		targetWin="_self";
		buf+=":"+i;
		if(menuList[i].menuTarget!=null){
			targetWin=menuList[i].menuTarget;
		}else{
			targetWin="_self";
		}
		if(menuList[i].menuLevel==2){
			addtion="Category";
		}else{
			addtion="subCategory";
		}
		if(file==menuList[i].menuFile ){
			str+='<LI class="'+addtion+'"><SPAN class="empha">'+menuList[i].menuName+'</SPAN></LI> ';
			//document.title = document.title+" | "+menuList[i].menuName;
			if(je=="e"){
				document.title = "大気海洋研究所"+" | "+menuList[i].menuName;
			}else{
				document.title = menuList[i].menuName;
			}
		}else if(menuList[i].menuLevel==2 || menuList[i].menuLevel==3){
			if(menuList[i].menuFile!=""){
				str+='<LI class="'+addtion+'"><A href="'+menuList[i].menuFile+'" target="'+targetWin+'">'+menuList[i].menuName+'</A></LI> ';
			}else{
				str+='<LI class="'+addtion+'">'+menuList[i].menuName+'</LI> ';
			}
			str+='<li class="line"></li>';
		}
		//str+=menuList[i].menuFile;
	}
	str+='</ul>';
	//alert(str);
	document.getElementById("nSecondNav").innerHTML=str;
	//alert(buf);
}
function makeBreadcrumbs(){
	alert("test");
	var str="";
	if(je=="e"){
		str="<A href='../../index_e.html'>TOP</A> > ";
	}else{
		str="<A href='../../index.html'>TOP</A> > ";
	}
	var addtion="";
	var path=window.location.href;
	var file=path.substring(path.lastIndexOf('/',path.length)+1,path.length);

	//if(localTitle == )

	var buf="";
	var secName;
	var secFile;
	for(var i in menuList){
		//---第二階層の候補を
		if(menuList[i].menuLevel==2){
			secName = menuList[i].menuName;
			secFile = menuList[i].menuFile;
		}
		if(file==menuList[i].menuFile ){
			if(secName!=localTitle){
				if(file!="index.html"){
					str+="<A href='index.html'>";
				}
				str+=localTitle;
				if(file!="index.html"){
					str+="</A> ";
				}
				str+=" > ";
			}
			//---第3階層の場合
			if(menuList[i].menuLevel==3){
				if(secFile == ""){
					str+=secName+" > ";
				}else{
					str+="<A href='"+secFile+"'>"+secName+"</A> > ";
				}
			}
			str+=menuList[i].menuName;
			break;
		}
	}


	//str='TOP > 大気海洋研とは aaa';
	//alert(str);
	document.getElementById("breadcrumbs").innerHTML=str;
}
function footerNav(){
	str='';
	if(je=="e"){
		str+='					|　<A href="../../information/e/sitemap.html">SITE MAP</A>　'
		//str+='					|　<A href="../../information/e/recruit.html">RECRUIT</A>　';
		str+='					|　<A href="../../information/e/copyright.html">COPYRIGHT</A>　';
		str+='					|　<A href="../../information/e/exemption.html">EXEMPTION</A>　|';
	}else{
		str+='					|　<A href="../../information/j/sitemap.html">サイトマップ</A>　';
		//str+='					|　<A href="../../information/j/recruit.html">採用情報</A>　';
		str+='					|　<A href="../../information/j/copyright.html">著作権・リンクについて</A>　';
		str+='					|　<A href="../../information/j/exemption.html">免責事項</A>　|';
	}
		str+='<br /><br /><div align="right"><a href="#top"><img src="../../images/backtotop.gif" class="hoverImg" /></a></div>';
	document.getElementById("footerNav").innerHTML=str;
}
function gsearch(){
	document.googleSearch.submit();
}
/*--------------------------------------------------------------
	FONT 
	--------------------------------------------------------------*/
uaName = navigator.userAgent;
appName = navigator.appVersion;
var fontSizeUnit = "%";
var perOrder = 5;
var defaultSize = 80;
var ckName = "ori";
var ckDays = 2;
var ckPath = "/"
var maxLarge=120;
var miniLarge=70;
var fsCK = GetCookie(ckName);
//alert(fsCK);
if ( fsCK == null ) {
  currentSize = defaultSize;
  //alert("NULL");
}
else{
  currentSize = Number(fsCK); 
}


function fscRef(){
  var osfont,os = navigator.userAgent;
  var uAnt = navigator.userAgent;
  if (uaName.match(/Mac|PPC/)) {
    osfont=5;
  }else{
    osfont=0;
    if (uAnt.indexOf("MSIE") > -1){ osfont=0; }
  }

  if (( document.layers )||(( appName.indexOf("Mac",0) != -1 ) && ( uaName.indexOf("MSIE 4.0",0) != -1 ))){
    return false;
  }else if( document.body ){
    currentSize2=currentSize - osfont;

    document.body.style.fontSize = currentSize2 + fontSizeUnit;
    var lh;
    if(currentSize2 > 100){
      lh = 40;
    }else{
      lh = 35;
    }
    document.body.style.lineHeight = (currentSize2 + lh) + fontSizeUnit
  }
  
}
function fsc( CMD ){
  if( CMD == "larger" ){
    var newSize = Number( currentSize + perOrder );
    SetCookie( ckName , newSize );
  }
  if( CMD == "smaller" ){
    if ( currentSize != perOrder ){
      var newSize = Number( currentSize - perOrder );
      SetCookie( ckName , newSize );
    }
    else{
      var newSize=Number(currentSize);
    }
  }

  if( CMD == "default" ){
    var newSize = defaultSize;
    DeleteCookie( ckName );
  }
  if( CMD == "init" ){
    var newSize = currentSize;
  }

  if( document.layers ){
    window.alert( "It dosen't work on Netscape Communicator4.x" );
    return false;
  }


  else if(( appName.indexOf("Mac",0) != -1 ) && ( uaName.indexOf("MSIE 4.0",0) != -1)){
    window.alert( "Sorry! MacIE4.0 is not supported." );
    return false;
  }

  else{

  if(newSize > maxLarge){
    newSize = maxLarge;
  }else if(miniLarge > newSize){
    newSize = miniLarge;
  } 
  currentSize = newSize;


  fscRef();
  }
}

// _______________________________________ end of function fsc() ___ 


function SetCookie(name,value){
  var dobj = new Date();
  dobj.setTime( dobj.getTime() + 24 * 60 * 60 * ckDays * 1);
  var expiryDate = dobj.toGMTString();
  document.cookie = name + '=' + escape(value)+ ';expires=' + expiryDate + ';path=' + ckPath;
}



function GetCookie (name){
  var arg  = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen){
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
    return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
   return null;
}


function getCookieVal (offset){
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
  endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset,endstr));
}

function DeleteCookie(name){
  if (GetCookie(name)) {
    document.cookie = name + '=' +
    '; expires=Thu, 01-Jan-70 00:00:01 GMT;path='+ckPath;
  }
}

function intF(){
	fsc( "init" );
}


function setBackToTop(){
	var v = document.getElementById("flashAttnLeft");
	if(v!=null){
		if(je=="e"){
			v.innerHTML='<A href="../../index_e.html"><IMG src="../../images/gototop.gif" /></A>';
		}else{
			v.innerHTML='<A href="../../index.html"><IMG src="../../images/gototop.gif" /></A>';
		}
	}
}



function movePage(prm){
	//alert("aa")
	var dir;
	if(pageID=="grandtop"){
		je = "j";
		dir = "./";
	}else if(pageID=="grandtop_e"){
		je = "e";
		dir = "./";
	}else{
		dir = "../../";
	}
		if(je=="j"){
			location.href=dir+prm+"/j/index.html";
		}else if(je=="e"){
			location.href=dir+prm+"/e/index.html";
		}else{
			alert("now page data loading")
		}
}
function jump(prm){
	if(prm=="en_top"){
		//alert("test2");
		//je = "j";
		//swapLanguage();
		location.href="/index_e.html";
	}else{
		//alert("test2");
		//je = "e";
		//swapLanguage();
		location.href="/index.html";
	}
}

function swapLanguage(){
	var path=window.location.href;
	var file=path.substring(path.lastIndexOf('/',path.length)+1,path.length);
	if(pageID=="grandtop"){
		location.href="index_e.html";
	}else if(pageID=="grandtop_e"){
		location.href="index.html";
	}else{
		if(je=="j"){
			location.href="../e/"+file;
		}else{
			location.href="../j/"+file;
		}
	}
}

function personalData(str){
	location.href="mailto:"+str+"@aori.u-tokyo.ac.jp";
}
function personalMsg(str){
	location.href="mailto:"+str+"@aori.u-tokyo.ac.jp";
}
//window.onload = stopFlash;

function mailAlert(){
	var str = "■メールをお送り頂く場合のご注意\r\n\r\n";
	str += "●×××××@、×××××@××××と表記されている場合\r\n";
	str += "メールをお送り頂く際、×××××@のあとに、\r\naori.u-tokyo.ac.jp　をつけてご送信ください。\r\n";
	str += "例）\r\n×××××@aori.u-tokyo.ac.jp\r\n";
	str += "×××××@××××.aori.u-tokyo.ac.jp\r\n\r\n";
	str += "●メールアドレスがすべて表記されている場合\r\n";
	str += "そのままのアドレスでご送信ください。";
	alert(str);
	//alert("■メールをお送り頂く場合のご注意\r\n\r\n●×××××@、×××××@××××と表記されている場合：\r\nメールをお送り頂く際、×××××@のあとに、\r\naori.u-tokyo.ac.jp　をつけてご送信ください。\r\n例）\r\n×××××@aori.u-tokyo.ac.jp\r\n×××××@××××.aori.u-tokyo.ac.jp\r\n\r\n●メールアドレスがすべて表記されている場合：\r\nそのままのアドレスでご送信ください。");
}

function rollover(){
	var targetClassName = "hoverImg";
	var suffix = "_ov";

	var overReg = new RegExp("^(.+)(\\.[a-z]+)$");
	var outReg = new RegExp("^(.+)" + suffix + "(\\.[a-z]+)$");

	var preload = new Array();
	var images = document.getElementsByTagName("img");

	for (var i = 0, il = images.length; i < il; i++) {
		var classStr = images[i].getAttribute("class") || images[i].className;
		var classNames = classStr.split(/\s+/);
		for(var j = 0, cl = classNames.length; j < cl; j++){
			if(classNames[j] == targetClassName){
					//preload
				preload[i] = new Image();
				preload[i].src = images[i].getAttribute("src").replace(overReg, "$1" + suffix + "$2");
					//mouseover
				images[i].onmouseover = function() {
					this.src = this.getAttribute("src").replace(overReg, "$1" + suffix + "$2");
				}
					//mouseout
				images[i].onmouseout = function() {
					this.src = this.getAttribute("src").replace(outReg, "$1$2");
				}
			}
		}
	}
}

