var logo = new Image(350, 52);
logo.src = "http://www.geomexca.org/global/images/common/logo.png"

var BaseURI = "http://www.geomexca.org/";

var LastUpdate=new Date(document.lastModified);
var Y = LastUpdate.getFullYear();
var M = LastUpdate.getMonth() + 1;
var D = LastUpdate.getDate();
var H = LastUpdate.getHours();
var m = LastUpdate.getMinutes();
if(M < 10)
	M = '0' + M;
if(H < 10)
	H = '0' + H;
update = "最終更新日時："+ Y + '-' + M + '-' + D + ' ' + H + ':' + m;

var DocumentURI = document.URL;

var header =
'<div id="header">'+
	'<div id="header_top">'+
		'<ul>'+
			'<li id="today_tip"><span class="none">To the next step with your POWER!</span><span id="mt_left">&nbsp;</span></li>'+
			'<li class="language"><span class="language">日本語[<a href="http://www.excite.co.jp/world/english/web/?wb_url='+ DocumentURI +'&wb_lp=JAEN&wb_dis=2">English</a>]</span><span class="mt">&nbsp;</span></li>'+/*http://translate.google.com/translate?u='+ DocumentURI +'&langpair=ja%7Cen&hl=ja&ie=Shift_JIS&oe=Shift_JIS&prev=%2Flanguage_tools*/
			'<li class="requirement"><span class="requirement"><a href="http://www.geomexca.org/about/about.html#a3">閲覧のための必要条件</a></span><span class="mt">&nbsp;</span></li>'+
			'<li class="inform"><span class="inform"><a href="http://www.geomexca.org/about/about.html#a5">報告・連絡</a></span></li>'+
		'</ul>'+
	'<hr class="none" /></div>'+
	'<div id="logo">'+
		'<h1><a href="http://www.geomexca.org/"><span class="none">Geomexca.org</span></a></h1>'+
		'<hr class="none" />'+
		'<form action="http://www.geomexca.org/search/msearch.cgi" accept-charset="euc-jp">'+
			'<div>'+
			'<input type="hidden" name="index" value="" />'+
			'<input type="hidden" name="config" value="" />'+
			'<input type="text" name="query" id="text_form" value="サイト内検索" onfocus="text_form_change ();" onblur="text_form_return ();" />　<input type="submit" value="&#160;検索&#160;" />'+
			'<input type="hidden" name="set" value="1" />'+
			'<input type="hidden" name="num" value="10" />'+
			'<input type="hidden" name="hint" value="漢字コード判定用文字列" />'+
			'</div>'+
		'</form>'+
	'</div>'+
	'<div id="nv">'+
		'<ul id="nv_root">'+
			'<li id="home"><a href="http://www.geomexca.org/">ホーム</a></li>'+
			'<li class="nv_hl"><a href="http://www.geomexca.org/research/">研究 <span>▼</span></a>'+
				'<ul>'+
					'<li><a href="http://www.geomexca.org/research/mathematics/">数学</a></li>'+
					'<li><a href="http://www.geomexca.org/research/psychology/">心理</a></li>'+
					'<li><a href="http://www.geomexca.org/research/physics/">物理</a></li>'+
					'<li><a href="http://www.geomexca.org/research/chemistry/">化学</a></li>'+
					'<li><a href="http://www.geomexca.org/research/literature_japanese/">文学・日本語</a></li>'+
					'<li><a href="http://www.geomexca.org/research/sociology/index.html">社会</a></li>'+
					/*'<li><a href="http://www.geomexca.org/research/philosophy/index.html">哲学</a></li>'+*/
					/*'<li><a href="http://www.geomexca.org/research/phychology/">心理学</a></li>'+*/
					'<li class="bottom"><a href="http://www.geomexca.org/research/computer/">コンピュータ</a></li>'+
				'</ul>'+
			'</li>'+
			'<li class="nv_hl"><a href="http://www.geomexca.org/member/">メンバー <span>▼</span></a>'+
				'<ul>'+
					'<li><a href="http://www.geomexca.org/member/takeru/">TAKERU</a></li>'+
					/*'<li><a href="http://www.geomexca.org/member/zeus/zeus.html">Zeus</a></li>'+*/
					'<li class="bottom"><a href="http://www.geomexca.org/member/raddit/raddit.html">Raddit</a></li>'+
				'</ul>'+
			'</li>'+
			'<li class="nv_hl"><a href="http://www.geomexca.org/gallery/">ギャラリー <span>▼</span></a>'+
				'<ul>'+
					'<li><a href="http://www.geomexca.org/gallery/novel/">小説</a></li>'+
					/*'<li><a href="http://www.geomexca.org/gallery/illust.html">Illust</a></li>'+*/
					'<li><a href="http://www.geomexca.org/gallery/picture/">写真</a></li>'+
					'<li class="bottom"><a href="http://www.geomexca.org/gallery/music/">ミュージック</a></li>'+
				'</ul>'+
			'</li>'+
			'<li class="nv_hl"><a href="http://www.geomexca.org/others/">その他 <span>▼</span></a>'+
				'<ul>'+
					/*'<li><a href="http://www.geomexca.org/others/">掲示板</a></li>'+*/
					/*'<li><a href="http://www.geomexca.org/">ダウンロード</a></li>'+*/
					'<li class="bottom"><a href="http://www.geomexca.org/others/link/">リンク</a></li>'+
				'</ul>'+
			'</li>'+
		'</ul>'+
		'<ul id="valid_checker">'+
			'<li><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.geomexca.org/global/images/common/valid-xhtml1.gif" title="Valid XHTML 1.0!" alt="Valid XHTML 1.0!" /></a></li>'+
			'<li><a href="http://jigsaw.w3.org/css-validator/validator?uri='+ DocumentURI +'"><img src="http://www.geomexca.org/global/images/common/valid-css.gif" title="Valid CSS!" alt="Valid CSS!" /></a></li>'+
		'</ul>'+
	'</div>'+
	'<div id="function">'+
		'<ul>'+
			'<li id="uri_path">?</li>'+
			'<li id="last_modyfied">'+ update +'</li>'+
		'</ul>'+
	'</div>'+
'<hr class="none" /></div>';

document.write(header);
if(document.getElementById) { WriteURIPath(DocumentURI); };


function WriteURIPath(DocumentURI)
{
	var SplitedDocumentURI = DocumentURI.split('/')
	var NewBaseURI = BaseURI;
	var DocumentTitle = document.title;
	var navi = '<a href="'+ BaseURI +'">Geomexca</a>';
	var arrow = ' > ';
	
	function AddDocumentTitle() {
		navi = navi + DocumentTitle;
	}
	function AddUpperURI(addition, UpperTitle) {
		NewBaseURI = NewBaseURI + addition;
		navi = navi + '<a href="' + NewBaseURI + '">' + UpperTitle + '</a>' + arrow;
	}
	function LastJudgeAndAdd(BaseURI, num, UpperTitle) {
		if(SplitedDocumentURI[num] == '' || SplitedDocumentURI[num] == 'index.html')
			AddDocumentTitle();
		else {
			AddUpperURI(BaseURI, UpperTitle);
			AddDocumentTitle();
		}
	}
	
	if(SplitedDocumentURI[3] != '' && SplitedDocumentURI[3] != 'index.html') {	/*http://www.geomexca.org/以外なら*/
		navi = navi + arrow;
		if(DocumentURI.indexOf("/about/") != -1) {
			LastJudgeAndAdd('about/', 4, 'About');
		} else if(DocumentURI.indexOf("/research/") != -1) {
			if(SplitedDocumentURI[4] == '' || SplitedDocumentURI[4] == 'index.html')
				AddDocumentTitle()
			else {
				AddUpperURI('research/', '研究');
				if(DocumentURI.indexOf("/mathematics/") != -1) {
					LastJudgeAndAdd('mathematics/', 5, '数学');
				} else if(DocumentURI.indexOf("/physics/") != -1) {
					LastJudgeAndAdd('psychology/', 5, '心理');
				} else if(DocumentURI.indexOf("/psychology/") != -1) {
					LastJudgeAndAdd('physics/', 5, '物理');
				} else if(DocumentURI.indexOf("/chemistry/") != -1) {
					LastJudgeAndAdd('chemistry/', 5, '化学');
				} else if(DocumentURI.indexOf("/literature_japanese/") != -1) {
					LastJudgeAndAdd('literature_japanese/', 5, '文学・日本語');
				} else if(DocumentURI.indexOf("/sociology/") != -1) {
					LastJudgeAndAdd('sociology/', 5, '社会');
				} else if(DocumentURI.indexOf("/computer/") != -1) {
					if(SplitedDocumentURI[5] == '' || SplitedDocumentURI[5] == 'index.html')
						AddDocumentTitle()
					else {
						AddUpperURI('computer/', 'コンピューター');
						if(DocumentURI.indexOf("/windows/") != -1) {
							/*AddUpperURI('', 'Windows');
							NewBaseURI = NewBaseURI + 'windows/';*/
							LastJudgeAndAdd('', 6, 'Windows');
						} else if(DocumentURI.indexOf("/web/") != -1) {
							AddUpperURI('', 'Web');
							NewBaseURI = NewBaseURI + 'web/';	/**/
							if(DocumentURI.indexOf("/web_setting/") != -1) {
								LastJudgeAndAdd('web_setting/', 7, 'Webサイト');
							} else if(DocumentURI.indexOf("/html/") != -1) {
								LastJudgeAndAdd('html/', 7, 'HTML');
							} else if(DocumentURI.indexOf("/css/") != -1) {
								LastJudgeAndAdd('css/', 7, 'CSS');
							} else if(DocumentURI.indexOf("/wordpress/") != -1) {
								LastJudgeAndAdd('wordpress/', 7, 'WordPress');
							}
						} else if(DocumentURI.indexOf("/program/") != -1) {
							AddUpperURI('', 'プログラム');
							NewBaseURI = NewBaseURI + 'program/';	/**/
							if(DocumentURI.indexOf("/C/") != -1) {
								LastJudgeAndAdd('C/', 7, 'C');
							}
						}
					}
				}
			}
		} else if(DocumentURI.indexOf("/member/") != -1) {
			if(SplitedDocumentURI[4] == '' || SplitedDocumentURI[4] == 'index.html')
				AddDocumentTitle()
			else {
				AddUpperURI('member/', 'メンバー');
				if(DocumentURI.indexOf("/takeru/") != -1) {
					LastJudgeAndAdd('takeru/', 5, 'TAKERU');
				}
			}
		} else if(DocumentURI.indexOf("/gallery/") != -1) {
			if(SplitedDocumentURI[4] == '' || SplitedDocumentURI[4] == 'index.html')
				AddDocumentTitle()
			else {
				AddUpperURI('gallery/', 'ギャラリー');
				if(DocumentURI.indexOf("/novel/") != -1) {
					LastJudgeAndAdd('novel/', 5, '小説');
				} else if(DocumentURI.indexOf("/picture/") != -1) {
					LastJudgeAndAdd('picture/', 5, '写真');
				} else if(DocumentURI.indexOf("/music/") != -1) {
					LastJudgeAndAdd('music/', 5, 'ミュージック');
				}
			}
		} else if(DocumentURI.indexOf("/others/") != -1) {
			if(SplitedDocumentURI[4] == '' || SplitedDocumentURI[4] == 'index.html')
				AddDocumentTitle()
			else {
				AddUpperURI('others/', 'その他');
				if(DocumentURI.indexOf("/link/") != -1) {
					LastJudgeAndAdd('link/', 5, 'リンク');
				}
			}
		} else if(DocumentURI.indexOf("/search/") != -1) {
			AddDocumentTitle()
		}
	}
	
	document.getElementById("uri_path").innerHTML = navi;
}


//window.onload = function(){//<head>にスクリプトを配置する場合は行先頭のコメントアウトを外す
if(document.getElementById && document.all && !navigator.userAgent.match(/Opera/)){
	var obj = document.getElementById("nv_root");
	document.write();
	for(var i=0;i<obj.childNodes.length;i++)
	{
		if(obj.childNodes[i].className=="nv_hl")
		{
			obj.childNodes[i].onmouseover = function(){pull(this)};
			obj.childNodes[i].onmouseout = function(){pull(this)};
		}
	}
}
function pull(obj){
	for(var i=0;i<obj.childNodes.length;i++)
		if(obj.childNodes[i].nodeName.toUpperCase()=="UL")
			obj.childNodes[i].style.display=obj.childNodes[i].style.display=="block"?"none":"block";
}


function text_form_change ()
{
	if (document.getElementById("text_form").value == "サイト内検索") {
		document.getElementById("text_form").value='';
	}
	document.getElementById("text_form").style.backgroundColor='#ffffff';
	document.getElementById("text_form").style.color='#000000';
}

function text_form_return ()
{
	if (document.getElementById("text_form").value == "") {
		document.getElementById("text_form").value="サイト内検索";
	}
	document.getElementById("text_form").style.backgroundColor='#dadada';
}

