//
// JavaScripts for JJAP site
// coded on	Oct. 2007
// coded on	Apr. 2008
//

// get Path
// 2008/4 modify

var BasePath = "";
var cURL = document.URL;
if(cURL.indexOf("\\")>=0){
	var dlm	= "\\";
	var l	= 0;
	for(i=cURL.indexOf("jjap")+1 ; i<cURL.length ; i++){
		if(cURL.charAt(i)==dlm)	l = l + 1;
	}
	for(i=1;i<l;i++){
		BasePath = BasePath + "../";
	}
} else {
	BasePath = "http://www.ipap.jp/jjap/";
}

if(navigator.userAgent.indexOf("MSIE 7")>0){
	document.write('<link rel="stylesheet" href="jjapie7.css" type="text/css" />');
}

function isWinIE(){
	if(navigator.userAgent.indexOf("MSIE")>0 && navigator.userAgent.indexOf("Windows")>0){
		document.gsearch.q.focus();
	}
}
function focusTB(){
	document.getElementById("kw").style.background = "#fff";
}

function chkTB(){
	if(document.gsearch.q.value==""){
		document.getElementById("kw").style.background = "url("+BasePath+"img/src_sitesearch.gif)";
	} else {
		document.getElementById("kw").style.background = "#fff";
	}
}

function copyright(){
	var now = new Date();
	var thisYear = now.getYear();
	if(thisYear<2000) thisYear += 1900;
	if(thisYear<2007) thisYear = 2007;
	var w = new Array(6,4,5,5,6,5,5,5,5,5);
	document.write('<img src="'+BasePath+'img/c.gif" width="8" height="24" alt="copyright" />');
	for(var i=0;i<4;i++){
		document.write('<img src="'+BasePath+'img/c'+thisYear.toString().charAt(i)+'.gif" width="'+w[thisYear.toString().charAt(i)]+'" height="24" alt="" />')
	}
	document.write('<img src="'+BasePath+'img/copyright.gif" width="157" height="24" alt="&copy; Institute of Pure and Applied Physics." />');
}

function goGoogle(){
	if(document.gsearch.q.value!="") document.gsearch.submit();
}

function goQuickJump(){
	if(document.quickjump.volume.value!="" && document.quickjump.page.value!="") 
	document.quickjump.action = "http://jjap.ipap.jp/cgi-bin/getarticle";
	document.quickjump.submit();
}

function goIssue(){
	location.href = document.issue.issueList[document.issue.issueList.selectedIndex].value;
}


