$(function(){autoreplay=0;tstop=0;tstop2=0;html5=0;var isMSIE = /*@cc_on!@*/false;html5video=document.getElementById("html5Player");$('#photos').galleryView({panel_width:500,panel_height:340,frame_width:40,frame_height:40,transition_speed:2500,interval:20000,background_color:'transparent'});$('div.readme').click(function(){if($("div.readme").css("height")=="120px"){$("div.readme").animate({height:"40px"},"slow");$("div.readme").stopTime();}
if($("div.readme").css("height")=="40px"){$("div.readme").animate({height:"120px"},"slow");$("div.readme").oneTime(20000,function(){readmebox();});}});if($("article.video").length){if(html5video=="[object HTMLVideoElement]"){html5=1;}else{if(isMSIE){autoreplay=1;$("#html5Player").replaceWith("<script type='text/javascript' src='movie/flowplayer-3.2.2.min.js'></script><a href='#' id='myPlayer'></a><button class='play'></button>");$("p.sw span").text("InternetExplorerをお使いの方へ、動作環境の早いChrome、Safari、Operaをお薦めします");$("#myPlayer").css("filter","alpha(opacity=0);");}else{$("#html5Player").replaceWith("<script type='text/javascript' src='movie/flowplayer-3.2.2.min.js'></script><a href='#' id='myPlayer'></a>");}}
if(html5==1){html5video.addEventListener("ended",function(){html5video.pause();tstop=0;tstop2=0;autoreplay=1;$("p.sw").addClass("playbutton");$("p.sw span").text("再生エリアをクリックすると、動画が再生します");},true);}else{$f("myPlayer",{src:'movie/flowplayer-3.2.2.swf',wmode:'transparent'},{playlist:[{url:'movie/movie/run.flv',autoPlay:false,autoBuffering:true}],plugins:{controls:null},clip:{onBegin:function(){if(autoreplay==0){tstop=1;tstop2=0;autoreplay=0;}$f("myPlayer").mute();},onStart:function(){if(autoreplay==0){tstop=1;tstop2=1;autoreplay=1;$f("myPlayer").play();}$f("myPlayer").mute();},onLastSecond:function(){$f("myPlayer").pause();tstop=0;tstop2=0;autoreplay=1;$("p.sw span").text("再生エリアをクリックすると、動画が再生します");}}});}
if(autoreplay==0){tstop=1;tstop2=1;autoreplay=1;if(html5==1){html5video.muted=true;html5video.play();$("p.sw").removeClass("stopplaybutton");$("p.sw").removeClass("playbutton");}else{$f("myPlayer").mute();$f("myPlayer").play();}
$("p.sw span").text("再生エリアをクリックすると、動画を停止します");}
$("p.sw").click(function(){if(tstop2==0){if(html5==1){html5video.play();$("p.sw").removeClass("stopplaybutton");$("p.sw").removeClass("playbutton");}else{$f("myPlayer").play();if(isMSIE){$("#myPlayer").css("filter","alpha(opacity=100);");$("button.play").css("display","none");}}
$("article.video").stopTime();tstop=1;tstop2=1;$("p.sw span").text("再生エリアをクリックすると、動画を停止します");}else{if(html5==1){document.getElementById("html5Player").pause();$("p.sw").addClass("playbutton");}else{$f("myPlayer").pause();}
tstop2=0;$("p.sw span").text("再生エリアをクリックすると、動画が再生します");$("article.video").oneTime(3000,function(){if(html5==1){document.getElementById("html5Player").pause();document.getElementById("html5Player").currentTime=0;$("p.sw").removeClass("stopplaybutton");}else{$f("myPlayer").stop();}
tstop=0;});}});$("#photoflame article.video p button").toggle(function(){$(this).css("background","url(images/unmute.png)");if(html5==1){document.getElementById("html5Player").muted=false;}else{$f("myPlayer").unmute();}},function(){$(this).css("background","url(images/mute.png)");if(html5==1){document.getElementById("html5Player").muted=true;}else{$f("myPlayer").mute();}});}
$("div.readme").oneTime(5000,function(){readmebox();});function readmebox(){$("div.readme").animate({height:"40px"},"slow");};});
