var pn,i=0,tid,joutai="stopping";
photo=new Array();
phototxt=new Array();
pn=0;
    photo[pn++]="takadabird.jpg"; phototxt[pn]="Takada Park in winter";
	photo[pn++]="takadaparkapr.jpg"; phototxt[pn]="Takada Park in spring";
	photo[pn++]="kitashiro.jpg"; phototxt[pn]="Cherry blossom in Takada Kitashiro";
	photo[pn++]="yamazakura.jpg"; phototxt[pn]="Cherry blossom in campus";
	photo[pn++]="cherry.jpg"; phototxt[pn]="Cherry blossom in Takada Park";
	photo[pn++]="sunset.jpg"; phototxt[pn]="Sunset in Takada Park";
	photo[pn++]="japanseaapr.jpg"; phototxt[pn]="Sea of Japan";
	photo[pn++]="kubikimay.jpg"; phototxt[pn]="Rice Field in Kubiki";
	photo[pn++]="nambasanmay.jpg"; phototxt[pn]="Mt. Namba in May";
	photo[pn++]="naoetsusea.jpg"; phototxt[pn]="Naoetsu Sea of Japan";
	photo[pn++]="takadaparkjune.jpg"; phototxt[pn]="Takada Park in June";
	photo[pn++]="sanrokusen.jpg"; phototxt[pn]="Shrine";
	photo[pn++]="kanayasanmorn.jpg"; phototxt[pn]="Sunrise from Mt. Kanaya";
	photo[pn++]="sanwaspring.jpg"; phototxt[pn]="Spring in Sanwa";
	photo[pn++]="nouminejo.jpg"; phototxt[pn]="A big zelkova tree in the ruins of Nomine Castle";
	photo[pn++]="tossakajo.jpg"; phototxt[pn]="View from the ruins of Tossaka Castle";
	photo[pn++]="mikamurijo.jpg"; phototxt[pn]="View from the ruins of Mikamuri Castle";
	photo[pn++]="yoneyama.jpg"; phototxt[pn]="Mt. Yoneyama from Kubiki";
	photo[pn++]="sarugejo.jpg"; phototxt[pn]="Mt. Yoneyama from the ruins of Saruge Castle";
	photo[pn++]="kasugayamatanbo.jpg"; phototxt[pn]="Rice Field in Kasugayama";	
var n=photo.length;
function sl(dousa){
	clearTimeout(tid);
	switch(dousa){
		case "prev":i--;joutai="working";break;
		case "next":i++;joutai="working";break;
		default:break;
	}
	displayimgcont();
	tid=setTimeout("sl('next')",5000);
}
function displayimg(i){
	if(i>n-1){i=0;}else if(i<0){i=n-1;}
	document.getElementById("phototitle").firstChild.nodeValue=phototxt[i+1];
	document.myimg.src=photo[i];
}
function displayimgcont(){
	if(i>n-1){i=0;}else if(i<0){i=n-1;}
	document.getElementById("phototitle").firstChild.nodeValue=phototxt[i+1];
	document.myimg.src=photo[i];
	document.getElementById("photo"+(i)).focus();
}
