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

var Warp=Warp||{};
Warp.Spotlight=new Class({initialize:function(c,d){var a=this;this.setOptions({effect:"fade",effectOptions:{duration:300}},d);this.element=$(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().size.x,height:a.slides[0].getSize().size.y});this.element.addEvents({mouseenter:function(){switch(a.options.effect){case "right":a.slides[1].setStyles({right:a.slides[1].getSize().size.x*-1,
visibility:"visible"});a.fx.start({right:[a.slides[1].getSize().size.x*-1,0]});break;case "left":a.slides[1].setStyles({left:a.slides[1].getSize().size.x*-1,visibility:"visible"});a.fx.start({left:[a.slides[1].getSize().size.x*-1,0]});break;case "top":a.slides[1].setStyles({left:0,top:a.slides[1].getSize().size.y*-1,visibility:"visible"});a.fx.start({top:[a.slides[1].getSize().size.y*-1,0]});break;case "bottom":a.slides[1].setStyles({left:0,bottom:a.slides[1].getSize().size.y*-1,visibility:"visible"});
a.fx.start({bottom:[a.slides[1].getSize().size.y*-1,0]});break;default:a.fx.start({opacity:[0,1],visibility:["hidden","visible"]})}},mouseleave:function(){switch(a.options.effect){case "right":a.fx.start({right:[0,a.slides[1].getSize().size.x*-1]});break;case "left":a.fx.start({left:[0,a.slides[1].getSize().size.x*-1]});break;case "top":a.fx.start({top:[0,a.slides[1].getSize().size.y*-1]});break;case "bottom":a.fx.start({bottom:[0,a.slides[1].getSize().size.y*-1]});break;default:a.fx.start({visibility:["visible",
"hidden"],opacity:[1,0]})}}});this.fx=new Fx.Styles(this.slides[1],this.options.effectOptions)}});Warp.Spotlight.implement(new Options);
