﻿flag=0;
function mov(){
if (flag==0){
$("title").style.top=60;
$("main").style.display="block";
$("entr").style.display="none";
flag=1;
}
return false;
}


function mov2(){
if (yy>60){
yy=yy-4;
$("title").style.top=yy;
} else {
clearInterval(moov);
}
}



window.onload = function(){
	var imgTag = document.getElementById("menu").getElementsByTagName("img");
	for (var i=0; i<imgTag.length; i++){
		imgTag[i].onmouseover = moUp;
		imgTag[i].onmouseout = moOu;
		imgTag[i].onclick = pageMove;
	}

if(location.href.indexOf("index")>0) blogkaiseki();

}
function pageMove(){
var url=this.src;

   if (url.indexOf("home")>0) {
	url="index.htm";
	}else if (url.indexOf("live")>0) {
	url="live.htm";
	}else if (url.indexOf("prof")>0) {
	url="prof.htm";
	}else if (url.indexOf("blog")>0) {
	ext("http://blog.livedoor.jp/trisuta/");
	return false;
	}else if (url.indexOf("bbs")>0) {
	ext("http://9104.teacup.com/torisuta/bbs");
	return false;
	}else if (url.indexOf("email")>0) {
	url="email.htm";
	}else{
	url="index.htm";
	}

var msec = (new Date()).getTime();
new Ajax.Request(url, {
method: "get",
parameters: "cache="+msec,
onSuccess:function(httpObj){
var htm=httpObj.responseText;
htm=htm.split('<!--contents-->')[1];
$("page").innerHTML =htm;
},
onFailure:function(httpObj){
$("page").innerHTML = "エラーで読み込めませんでした";
}
});

return false;
}

function moUp(){
this.src=this.src.split("1.gif")[0]+"2.gif";
}

function moOu(){
this.src=this.src.split("2.gif")[0]+"1.gif";
}

function ext(url){
window.open(url);
}

function blogkaiseki(){
blogdata="";
blogdata+="<a href='"+bloglink[1]+"' target='_blank'><b>◎"+blogtitle[1]+"</b></a>　<small>"+blogdate[1]+" UP!</small><br>\n";
$("blog").innerHTML=blogdata;
}