// JavaScript Document

<!--
var execCounter = 0;
var pn=0;
photo=new Array();
imgLinkArray = new Array();
//********************************書き換える部分****************************************

var hayasa = 5000;      //--- スライドショーの速さ（ミリ秒単位）
var bannerHeight = 212;  //--- バナーの画像高さ
var zoomMinHeight = 100; //--- ズーム最小高さ
var execInterval = 80;  //--- 処理間隔（ミリ秒）
var wipePx = 50;         //--- 処理間隔毎に画像をずらすピクセル数
var heightPxStep = 10;   //--- 処理間隔ごとのズームで変更する高さ（px）


imgLinkArray[pn]="http://laffmori.laff.jp/4anniv/2012/02/2012-0f43.html";
photo[pn++]="http://laff.jp/inc/topflash/slides/fla_4anniv.jpg";

imgLinkArray[pn]="http://www.yoshimoto.co.jp/100th/monogatari/";
photo[pn++]="http://laff.jp/inc/topflash/slides/fla_100.jpg";

imgLinkArray[pn]="http://www.r-1gp.com/";
photo[pn++]="http://laff.jp/inc/topflash/slides/r_1680x212.jpg";

imgLinkArray[pn]="http://warotar.jp/";
photo[pn++]="http://laff.jp/inc/topflash/slides/fla_warotar.jpg";

imgLinkArray[pn]="http://tsy-movie.com/";
photo[pn++]="http://laff.jp/inc/topflash/slides/tsy_680_212.jpg";

imgLinkArray[pn]="http://www.oimf.jp/";
photo[pn++]="http://laff.jp/inc/topflash/slides/fla_oimf.jpg";

imgLinkArray[pn]="http://yoshimotonews.laff.jp/news/2011/11/post-fd35.html";
photo[pn++]="http://laff.jp/inc/topflash/slides/fla_pigg.jpg";

imgLinkArray[pn]="http://yoshimotonews.laff.jp/news/2012/01/2012-d825.html";
photo[pn++]="http://laff.jp/inc/topflash/slides/fla_gekkan01.jpg";


//***************************************************************************************

var n=photo.length;
p_obj=new Array();
for(t=0;t<n;t++){
	p_obj[t]=new Image();
	p_obj[t].src=photo[t];
}

var zi,z_tid,hata=false,tid,i=0;

function kaisi(){
	document.getElementById("wipeoutimg").src=p_obj[0].src;
	document.getElementById("mainimg").src=p_obj[0].src;
	document.getElementById("mainlink").href=imgLinkArray[0];

	clearInterval(tid);
	hata=true;
	tugi();
	tid=setInterval("tugi();",hayasa);
}

function tugi(){
	if(hata){
		hata = false;
		return;
	}
	if(i<n-1){
		i++;
		p_hyouji_off();
	}else{
		i=0;
		p_hyouji_off();
	}
}

function p_hyouji_off(){
	document.getElementById("mainimg").src=p_obj[i].src;
	document.getElementById("mainlink").href=imgLinkArray[i];
	zoom_off();
}

function zoom_off(){
	clearInterval(z_tid);
	execCounter = 0;
	zi=0;
	z_tid=setInterval("kakudai();",execInterval);
}

function kakudai(){
	execCounter++;
	addHeight = heightPxStep*execCounter;
	if(zoomMinHeight+addHeight < bannerHeight){
		document.getElementById("mainimg").style.height = zoomMinHeight + addHeight;
		document.getElementById("wipeoutimg").style.top = execCounter * wipePx;
	}else{
		clearInterval(z_tid);
		document.getElementById("wipeoutimg").src=p_obj[i].src;
		document.getElementById("mainimg").style.height=bannerHeight;

		document.getElementById("wipeoutimg").style.top=0;
	}
}
//-->

