$(function(){
		var photo_array = new Array("main_img1.png", "main_img2.png", "main_img3.png");
		var pl_file = new Array();
		for(i=0;i<photo_array.length;i++){
			pl_file[i] = new Image();
			pl_file[i].src="./img/"+photo_array[i];
		}
		
			   
			   //画像を切り替える速さ
		var imgChangeSpeed = 8000;
			       //一定時間毎にスクリプトを呼び出す
		var t = setInterval(imgchange, imgChangeSpeed);
		function imgchange(){ /*複数の要素*/
            thiss = document.getElementById("mainimage");
			$("#mainimage").fadeOut(300,function(){ /*jqueryでのcssの変更("#map div"）でid=”map"内のdiv要素すべて指定*/
            if(thiss.src.substr(thiss.src.length-5,1)=="1"){
				thiss.src=pl_file[1].src;
			}else if(thiss.src.substr(thiss.src.length-5,1)=="2"){
				thiss.src=pl_file[2].src;
			}else if(thiss.src.substr(thiss.src.length-5,1)=="3"){
				thiss.src=pl_file[0].src;
			}});
			$("#mainimage").fadeIn(1000);
        }
            $("[id^=focused]").css("display","none");
		
		$("[id^=tofocus]").click(function(){ /*複数の要素*/
			tofocus = this.id;
			tofocus = tofocus.substr(tofocus.length-1,1);
			if($("#focused"+tofocus).css("display")=="none"){
			$("[id^=focused]").fadeOut(300);
            $("#focused"+tofocus).fadeIn(1500);
			}
			
        });
		$("[class^=exitmark]").click(function(){ /*複数の要素*/
            $("[id^=focused]").css("display","none");
			
        });

});

