/* =====================================================================
*
*    slideshow.js
*
* =================================================================== */
var SEYA_SS=function(){function m(b){h=[];$(b).find("slide").each(function(){var i={name:$(this).text(),src:$(this).attr("url")};h.push(i)});catchcopies=[];$(b).find("catchcopy").each(function(){var i={catchcopy:$(this).text(),url:$(this).attr("url"),linktext:$(this).attr("label")};catchcopies.push(i)});k=t();c.append(d);c.css({opacity:0,overflow:"hidden",width:k.width,height:k.height});e.css({opacity:"0"});e.show();a()}function a(){d.alt=h[l].name;d.src=h[l].src}function f(){n={width:d.width,height:d.height}; var b=catchcopies[o];r.text(b.catchcopy);catchcopyLink.text(b.linktext);catchcopyLink.attr("href",b.url);s=n.height-k.height;c.animate({scrollTop:s},1,"linear",g)}function g(){c.animate({opacity:1},p,"",j)}function j(){e.animate({opacity:1},p);c.animate({scrollTop:0},u*(n.height/v),"linear",w)}function w(){e.animate({opacity:0},p);c.animate({opacity:0},x,"linear",y)}function y(){var b=l+1;l=b>=h.length?0:b;b=o+1;o=b>=catchcopies.length?0:b;a()}function t(){var b=q.width(),i=q.height();return{width:b, height:i}}var h,v=1E3,u=15E3,p=500,x=2E3,c,q,r,e,l=0,o=0,k=0,d,n,s;(function(){$(document).ready(function(){c=$("#SlideShowImage");q=$("#top-main-image-container");r=$("#Catchcopy");catchcopyLink=$("#CatchcopyLink");e=$("#TopCatchcopyContainer");$(window).load(function(){d=new Image;$(d).bind("load",f);$.ajax({type:"GET",url:"/conf/seya.xml",dataType:"xml",success:function(b){m(b)}})});e.hide()})})()}(); jQuery.extend(jQuery.easing,{easeInQuart:function(m,a,f,g,j){return g*(a/=j)*a*a*a+f},easeInOutQuint:function(m,a,f,g,j){if((a/=j/2)<1)return g/2*a*a*a*a*a+f;return g/2*((a-=2)*a*a*a*a+2)+f}});

