/*メールアドレス表示（スパム防止のため、@マークを切り分けたフォーム形式）*/
      function mail_le080122() {
	document.write('<span id="e1">kumasaki</span><i class="none">(＠を半角にしてください)</i>@<span id="e2">s.jniosh.go.jp</span>');
      }
      function ms_le080122() {
      	  var at="@"
         location.href = "mailto:" + "kumasaki" + at + "s.jniosh.go.jp";
      }
      function ms() {
         location.href = "mailto:" + document.getElementById("e1").innerHTML + "@" + document.getElementById("e2").innerHTML;
      }

/* safetyheartの前後ナビ */
function shnavi1(nm) {
	document.write("<ul class='safetyheart_list'><li><a href='../safetyheart.shtml'>一覧</a></li><li><a href='no",nm-1,".shtml'>←第",nm-1,"号</a></li></ul>");
}
function shnavi2(nm) {
	document.write("<ul class='safetyheart_list'><li><a href='../safetyheart.shtml'>一覧</a></li><li><a href='no",nm-1,".shtml'>←第",nm-1,"号</a></li><li><a href='no",nm+1,".shtml'>第",nm+1,"号→</a></li></ul>");
}
function shnavi3(nm) {
	document.write("<ul class='safetyheart_list'><li><a href='../safetyheart.shtml'>一覧</a></li><li><a href='no",nm+1,".shtml'>第",nm+1,"号→</a></li></ul>");
}

/* target="_blank"を使わずに別ウィンドウで開く */
/* http://css-happylife.com/log/javascript/000075.shtml */

function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
	var anchor = anchors[i];
	if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
	anchor.target = "_blank";
	}
}
window.onload=externalLinks;


/*戻る*/
function back(){
	document.write('<div class="navi2 center"><a href="javascript:history.back();" class="ref">≫戻る</a></div>');
}
function pm_5(){
	document.write(p0+'"apper5()" id="p_5"'+p+'"disapper5();" id="m_5"'+m);
}


/* new_mark */

	/*『差がつくWEBデザインの技』MDN p.064 */
	/* デフォルトでは n <= 0（掲示前にUPしている状態）を
	想定していないので n <= 0 を追加。*/
function new_mark(y,m,d){
oldDay = new Date(y+"/"+m+"/"+d);
newDay = new Date();
n = (newDay - oldDay)/(1000*60*60*24);
	if (n <= 0) {
	document.write('');
	}
	else if (n <= 7)/* 掲載日数 */ {
document.write(' <img src="http://wwwsoc.nii.ac.jp/jsse3/images/icon_new.gif">');
	}
	else{
	document.write('');
	}
}


/* tab */
function tab(){
	document.getElementById("csstab01dd").style.display = "block";
	document.getElementById("csstab01dd").style.visibility = "visible";
	document.getElementById("csstab01dd").style.position = "absolute";
	document.getElementById("csstab01dd").style.top = "35px";
	document.getElementById("csstab01dd").style.margin = "0";
	document.getElementById("csstab01dd").style.padding = "0 0 30px 10px";
	document.getElementById("csstab01dd").style.background = "#fff";
	document.getElementById("csstab01table").style.margin = "10px 0 0 0";
	document.getElementById("csstab01table").style.top = "0";
	document.getElementById("csstab01table").style.borderCollapse = "collapse";
	document.getElementById("csstab01table").style.width = "620px";
	document.getElementById("csstab01h2").style.margin = "0";
	document.getElementById("csstab01h2").style.color = "#00c";
	document.getElementById("csstab01h2").style.padding = "0 0 0 6px";
	document.getElementById("csstab01h2").style.border = "solid #00c";
	document.getElementById("csstab01h2").style.borderTopWidth = "0px";
	document.getElementById("csstab01h2").style.borderRightWidth = "0px";
	document.getElementById("csstab01h2").style.borderBottomWidth = "0px";
	document.getElementById("csstab01h2").style.borderLeftWidth = "10px";
	document.getElementById("csstab01h2").style.lineHeight = "1.2";
	document.getElementById("csstab01h2").style.fontSize = "1.2em";
	document.getElementById("cursor_tab").style.display = "none";
}
function tab_hide(){
	document.getElementById("csstab01dd").style.display = "none";
	document.getElementById("csstab01dd").style.visibility = "hidden";
	document.getElementById("cursor_tab").style.display = "none";
}

/* ##admission## */
function tab_admission(){
	document.getElementById("csstab01dt_admission").style.background = "url(../images/csstab_admission.jpg) 0 0  no-repeat";
	tab();
}
function tab_admission_hide(){
	document.getElementById("csstab01dt_admission").style.background = "url(../images/csstab_admission.jpg) 0 -70px no-repeat";
	tab_hide();
}
/* ##committee## */
function tab_committee(){
	document.getElementById("csstab01dt_committee").style.background = "url(../images/csstab_committee.jpg) 0 0  no-repeat";
	tab();
}
function tab_committee_hide(){
	document.getElementById("csstab01dt_committee").style.background = "url(../images/csstab_committee.jpg) 0 -70px no-repeat";
	tab_hide();
}
/* ##namelist## */
function tab_namelist(){
	document.getElementById("csstab01dt_namelist").style.background = "url(../images/csstab_namelist.jpg) 0 0  no-repeat";
	tab();
}
function tab_namelist_hide(){
	document.getElementById("csstab01dt_namelist").style.background = "url(../images/csstab_namelist.jpg) 0 -70px no-repeat";
	tab_hide();
}


/*催物一覧テーブルのソート*/
function sortTable1(sortCell,sortType) { 
    obj = document.getElementById('sortTable1'); 

    for(i = 0;i < obj.rows.length;i++) { 
        sortNo = 0; 
        num = obj.rows[i].cells[sortCell].firstChild.nodeValue; 

        for(j = i + 1;j < obj.rows.length;j++) { 
            if(sortType){ 
                if(num < obj.rows[j].cells[sortCell].firstChild.nodeValue) { 
                    sortNo = j; 
                } 
            }else{ 
                if(num > obj.rows[j].cells[sortCell].firstChild.nodeValue) { 
                    sortNo = j; 
                } 
            } 
        } 
        if(sortNo){ 
            obj.insertBefore(obj.rows[sortNo],obj.rows[i]); 
        } 
    } 
}

function sortTable2(sortCell,sortType) { 
    obj = document.getElementById('sortTable2'); 

    for(i = 0;i < obj.rows.length;i++) { 
        sortNo = 0; 
        num = obj.rows[i].cells[sortCell].firstChild.nodeValue; 

        for(j = i + 1;j < obj.rows.length;j++) { 
            if(sortType){ 
                if(num < obj.rows[j].cells[sortCell].firstChild.nodeValue) { 
                    sortNo = j; 
                } 
            }else{ 
                if(num > obj.rows[j].cells[sortCell].firstChild.nodeValue) { 
                    sortNo = j; 
                } 
            } 
        } 
        if(sortNo){ 
            obj.insertBefore(obj.rows[sortNo],obj.rows[i]); 
        } 
    } 
} 


/**/
function resize() {
	resizeTo(830,600);
}


/**/
function printit() {
	document.write('<div class="noprint printbutton"><a href="javascript:window.print();">印刷する</a></div>');
}

/* ---Left menu open and close behaviour--- */

function apper1(){
	document.getElementById("list1").style.display = "block";
	document.getElementById("id_1").style.visibility = "visible";
	document.getElementById("p_1").style.display = "none";
	document.getElementById("m_1").style.display = "inline";
  }
function disapper1(){
	document.getElementById("list1").style.display = "none";
	document.getElementById("id_1").style.visibility = "hidden";
	document.getElementById("p_1").style.display = "inline";
	document.getElementById("m_1").style.display = "none";
  }
function apper2(){
	document.getElementById("list2").style.display = "block";
	document.getElementById("id_2").style.visibility = "visible";
	document.getElementById("p_2").style.display = "none";
	document.getElementById("m_2").style.display = "inline";
  }
function disapper2(){
	document.getElementById("list2").style.display = "none";
	document.getElementById("id_2").style.visibility = "hidden";
	document.getElementById("p_2").style.display = "inline";
	document.getElementById("m_2").style.display = "none";
  }
function apper3(){
	document.getElementById("list3").style.display = "block";
	document.getElementById("id_3").style.visibility = "visible";
	document.getElementById("p_3").style.display = "none";
	document.getElementById("m_3").style.display = "inline";
  }
function disapper3(){
	document.getElementById("list3").style.display = "none";
	document.getElementById("id_3").style.visibility = "hidden";
	document.getElementById("p_3").style.display = "inline";
	document.getElementById("m_3").style.display = "none";
  }
function apper4(){
	document.getElementById("list4").style.display = "block";
	document.getElementById("id_4").style.visibility = "visible";
	document.getElementById("p_4").style.display = "none";
	document.getElementById("m_4").style.display = "inline";
  }
function disapper4(){
	document.getElementById("list4").style.display = "none";
	document.getElementById("id_4").style.visibility = "hidden";
	document.getElementById("p_4").style.display = "inline";
	document.getElementById("m_4").style.display = "none";
  }
function apper5(){
	document.getElementById("list5").style.display = "block";
	document.getElementById("id_5").style.visibility = "visible";
	document.getElementById("p_5").style.display = "none";
	document.getElementById("m_5").style.display = "inline";
  }
function disapper5(){
	document.getElementById("list5").style.display = "none";
	document.getElementById("id_5").style.visibility = "hidden";
	document.getElementById("p_5").style.display = "inline";
	document.getElementById("m_5").style.display = "none";
  }

var p0='<a href="#top" onClick='
var p1='><img src="http://wwwsoc.nii.ac.jp/jsse3/images/button_'
var p2='" style="width:14px;height:14px;margin-left:6px;" alt="" title="'
var p3='">'
var p=p1+'p.gif'+p2+'Open'+p3+'</a>'+p0
var m=p1+'m.gif'+p2+'Close'+p3+'</a>'

function pm_1(){
	document.write(p0+'"apper1()" id="p_1"'+p+'"disapper1();" id="m_1"'+m);
}
function pm_2(){
	document.write(p0+'"apper2()" id="p_2"'+p+'"disapper2();" id="m_2"'+m);
}
function pm_3(){
	document.write(p0+'"apper3()" id="p_3"'+p+'"disapper3();" id="m_3"'+m);
}
function pm_4(){
	document.write(p0+'"apper4()" id="p_4"'+p+'"disapper4();" id="m_4"'+m);
}
function pm_5(){
	document.write(p0+'"apper5()" id="p_5"'+p+'"disapper5();" id="m_5"'+m);
}

/* ---/Left menu open and close behaviour--- */


