/* Copyright  2007 - 2010 YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */

var Warp=Warp||{};
Warp.Spotlight=new Class({Implements:Options,initialize:function(c,d){var a=this;this.setOptions({effect:"fade",effectOptions:{duration:300}},d);this.element=document.id(c);this.slides=this.element.getChildren();this.slides.each(function(e,b){e.setStyles({position:"absolute","z-index":b+1,visibility:b==0?"visible":"hidden"}).addClass("spotlight"+b)});this.element.setStyles({position:"relative",overflow:"hidden",width:a.slides[0].getSize().x,height:a.slides[0].getSize().y});this.element.addEvents({mouseenter:function(){switch(a.options.effect){case "right":a.fx.cancel().set({right:a.slides[1].getSize().x*-1,
visibility:"visible"}).start({right:[a.slides[1].getSize().x*-1,0]});break;case "left":a.fx.cancel().set({left:a.slides[1].getSize().x*-1,visibility:"visible"}).start({left:[a.slides[1].getSize().x*-1,0]});break;case "top":a.fx.cancel().set({left:0,top:a.slides[1].getSize().y*-1,visibility:"visible"}).start({top:[a.slides[1].getSize().y*-1,0]});break;case "bottom":a.fx.cancel().set({left:0,bottom:a.slides[1].getSize().y*-1,visibility:"visible"}).start({bottom:[a.slides[1].getSize().y*-1,0]});break;
default:a.fx.cancel().start({opacity:[0,1],visibility:["hidden","visible"]})}},mouseleave:function(){switch(a.options.effect){case "right":a.fx.cancel().start({right:[0,a.slides[1].getSize().x*-1]});break;case "left":a.fx.cancel().start({left:[0,a.slides[1].getSize().x*-1]});break;case "top":a.fx.cancel().start({top:[0,a.slides[1].getSize().y*-1]});break;case "bottom":a.fx.cancel().start({bottom:[0,a.slides[1].getSize().y*-1]});break;default:a.fx.cancel().start({visibility:["visible","hidden"],opacity:[1,
0]})}}});this.fx=new Fx.Morph(this.slides[1],this.options.effectOptions)}});
