//-----------------photo--------------------
myImg=new Image();
for(i=0; i<10; i++){
	myImg.src="images/2012_nanohana"+i+".jpg";
}

ftTimer=0;
var theP;
theP = 0;
npTimer=0;
var thePC;
thePC = 0;
nPCTimer=0;

function firstIT(){
	document.images["topphoto_a"].src="images/2012_nanohana0.jpg";
	ftTimer=setTimeout("showPhoto()",1000);
}

function showPhoto(){
	clearTimeout(ftTimer);
	if (document.all){
		mainflash_b.filters["alpha"].opacity=100;
	}else{
		document.getElementById("mainflash_b").style.opacity=1;
//		document.getElementById("mainflash_b").style.MozOpacity=1;
	}
	document.getElementById("mainflash_a").style.display="block";
	document.images["topphoto_b"].src="images/2012_nanohana1.jpg";
	document.images["topphoto_a"].src="images/2012_nanohana0.jpg";
	FadeOP();
		clearTimeout(nIPTimer);
		clearTimeout(nPCTimer);
		clearTimeout(nOPTimer);
	thePC = 0;
	theIP = 0;
	photoChange();
}
function FadeOP(){
	theP++;
	if (document.all){
		mainflash_a.filters["alpha"].opacity=theP*5;
	}else{
		document.getElementById("mainflash_a").style.opacity=theP*0.05;
//		document.getElementById("mainflash_a").style.MozOpacity=theP*0.05;
	}
	npTimer=setTimeout("FadeOP()",50);
	if (theP>20){
		theP=0;
		clearTimeout(npTimer);
		document.getElementById("mainflash_b").style.display="block";
	}
}

//----------------photochange--------------------
function photoChange(){
	thePADP=document.getElementById("mainflash_a").style.display;
	thePC++;
	if (thePADP=="block"){
		FadeIPhoto();
		document.getElementById("mainflash_b").style.display="block";
		document.images["topphoto_b"].src="images/2012_nanohana"+thePC+".jpg";
	}else{
		FadeOPhoto();
		document.images["topphoto_a"].src="images/2012_nanohana"+thePC+".jpg";

	}
	if(thePC>8){ //<--channge Number
		clearTimeout(nPCTimer);
		thePC = 0;
	}
	nPCTimer=setTimeout("photoChange()",4000);
}
var theIP;
theIP = 0;
nIPTimer=0;
function FadeIPhoto(){
	theIP++;
	if (document.all){
		mainflash_a.filters["alpha"].opacity=100-theIP*5;
	}else{
		document.getElementById("mainflash_a").style.opacity=1-theIP*0.05;
//		document.getElementById("mainflash_a").style.MozOpacity=1-theIP*0.05;
	}
	nIPTimer=setTimeout("FadeIPhoto()",50);
	if (theIP>20){
		theIP=0;
		clearTimeout(nIPTimer);
		document.getElementById("mainflash_a").style.display="none";
	}
}
var theOP;
theOP = 0;
nOPTimer=0;
function FadeOPhoto(){
	theOP++;
	document.getElementById("mainflash_a").style.display="block";
	if (document.all){
		mainflash_a.filters["alpha"].opacity=theOP*5;
	}else{
		document.getElementById("mainflash_a").style.opacity=theOP*0.05;
//		document.getElementById("mainflash_a").style.MozOpacity=theOP*0.05;
	}
	nOPTimer=setTimeout("FadeOPhoto()",50);
	if (theOP>20){
		theOP=0;
		clearTimeout(nOPTimer);
		document.getElementById("mainflash_a").style.display="block";
	}
}

//----------------banner--------------------
function ShowBannerInfo(v1,v2) {
	document.images[v1].src="images/banner_ov.gif";
	document.getElementById(v2).style.display="block";
	document.getElementById("bannerinfo").style.display="block";
	document.getElementById("bannerinfo").style.top="0px";
	zoomupBannerInfo();
}
function ShowBannerInfo2(v1,v2) {
	document.images[v1].src="images/banner_ov2.gif";
	document.getElementById(v2).style.display="block";
	document.getElementById("bannerinfo").style.display="block";
	document.getElementById("bannerinfo").style.top="0px";
	zoomupBannerInfo();
}
timerID=0;
var theNum;
theNum=0;
function zoomupBannerInfo() {
theNum++;
	document.getElementById("bannerinfo").style.top=345-(theNum*20)+"px";
	timerID=setTimeout("zoomupBannerInfo()",15);
	if (theNum>15){
		theNum=0;
		document.getElementById("bannerinfo").style.top="0px";
		clearTimeout(timerID);
	}
}

function HideBannerInfo(v1,v2) {
	document.images[v1].src="images/"+v1+".gif";
	document.getElementById(v2).style.display="none";
	document.getElementById("bannerinfo").style.display="none";
}
