/*
    Mooi - jQuery plugin - image slider
    Copyright (C) 2011 Erik Landvall

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see http://www.gnu.org/licenses/.
*/

(function($)
{var Mooi=function(target,options)
{var _settings,_target,_li,_viewport,_wrapper,_buttonBack,_buttonForword,_totalWidth,_animationInProgress=false,_this=this;var _bootstrap=function()
{if(_target==null)
{_target=$(target);_target.css($.extend(true,_this.getSettings().target.css,{'width':_this.getTotalWidth()+'px','position':'absolute'}));}
if(_li==null)
{_li=$('li',_target);_li.css(_this.getSettings().li.css);$('img',_li).css(_this.getSettings().img.css);}
if(_viewport==null)
{_target.wrap('<div class="mooi-viewport"></div>');_viewport=_target.parent();if(_this.getSettings().viewport.css.height==null)
{var height=0;_li.each(function()
{height=$(this).outerHeight(true)>height?$(this).outerHeight(true):height;});$.extend(true,_this.getSettings().viewport.css,{'height':height+'px'});}
_viewport.css(_this.getSettings().viewport.css);}
if(_wrapper==null)
{_viewport.wrap('<div class="mooi-wrapper"></div>');_wrapper=_viewport.parent();if(_this.getSettings().wrapper.css.width==null)
_wrapper.css($.extend(true,_this.getSettings().wrapper.css,{'width':_li.first().outerWidth(true)
+'px'}));else
_wrapper.css(_this.getSettings().wrapper.css);}}
this.getSettings=function()
{if(_settings==null)
{_settings=options?$.extend(true,{},Mooi.DefaultSettings,options):$.extend(true,{},Mooi.DefaultSettings);_settings.animation.type=_settings.animation.direction
+'-'
+_settings.animation.separation
+'-'
+_settings.animation.type;_settings.animation.type=_settings.animation.type.toLowerCase();_settings.animation.direction=_settings.animation.direction.toLowerCase();}
return _settings;}
this.getTarget=function()
{if(_target==null)
_bootstrap();return _target;}
this.getLi=function()
{if(_li==null)
_bootstrap();return _li;}
this.getViewport=function()
{if(_viewport==null)
_bootstrap();return _viewport;}
this.getWrapper=function()
{if(_wrapper==null)
_bootstrap();return _wrapper;}
this.getButtonBack=function()
{if(_buttonBack==null)
{_buttonBack=$('<div class="back"></div>');_buttonBack.html(this.getSettings().button.back.inner);_buttonBack.css(this.getSettings().button.back.css);_buttonBack.click(function()
{_this.browseBack(_this.getSettings().button.back.pages);});}
return _buttonBack;}
this.getButtonForword=function()
{if(_buttonForword==null)
{_buttonForword=$('<div class="forword"></div>');_buttonForword.html(this.getSettings().button.forword.inner);_buttonForword.css(this.getSettings().button.forword.css);_buttonForword.click(function()
{_this.browseForword(_this.getSettings().button.forword.pages);});}
return _buttonForword;}
this.getTotalWidth=function()
{if(_totalWidth==null)
{_totalWidth=0;this.getLi().each(function()
{_totalWidth+=$(this).outerWidth(true);});}
return _totalWidth;}
this.getLeftOffset=function()
{return this.getTarget().position().left;}
this.getLeftDisproportion=function()
{return this.getLeftOffset()*-1;}
this.setLeftDisproportion=function(offset)
{this.getTarget().css('left',(offset*-1)+'px');}
this.getTopOffset=function()
{return this.getTarget().position().top;}
this.setTopOffset=function(offset)
{this.getTarget().css('top',offset+'px');}
this.browseForword=function(pages)
{new Mooi.Browse(this,pages);}
this.browseBack=function(pages)
{new Mooi.Browse(this,pages*-1);}
this.isAnimationInProgress=function()
{if(arguments.length>0)
_animationInProgress=arguments[0];return _animationInProgress;}
this.getWrapper().append(this.getButtonBack());this.getWrapper().append(this.getButtonForword());}
Mooi.Animations={}
Mooi.Animations.Bell=function(length,position)
{position=position||0.5;var h=length/(((180/3395)*length)+84.09425626),s=length/10,j=length*position,x=[],y=[],z,v,u=[],temp=length%h,cumsum=function(vektor)
{var _cumsum=[];_cumsum[0]=vektor[0];for(var i=1,n=vektor.length;i<n;i++)
_cumsum[i]=_cumsum[i-1]+vektor[i];return _cumsum;};temp=length-temp;for(var n=0,i=0;n<temp;n+=h,i++)
x[i]=n;x[i]=length;temp=h*(1/(s*(Math.sqrt(2*Math.PI))));for(n in x)
y[n]=temp*Math.exp(-(Math.pow(x[n]-j,2)/Math.pow(2*s,2)));z=cumsum(y);v=length/z[z.length-1];for(n in z)
u[n]=Math.round(v*z[n]);if(u.length>0)
u[u.length-1]=length;return u;}
Mooi.Animations.Bounce=function(iH)
{var y=0,v=0,y0=iH,v0=0,g=125,n=0.6,s=15,t=0,fv0,data=[];for(var m=0;m<s;m++)
{fv0=v0;while(y>=0)
{y=y0+(v0*t)-(0.5*g*Math.pow(t,2));y=Math.round(y);v=v0-(g*t);t+=0.1;data[data.length]=Math.round(iH-(y<0?0:y));}
y=0;t=0;y0=0;v0=-v*n;if(m>0&&fv0<v0)
break;}
if(data.length>0)
data[data.length-1]=iH;return data;}
Mooi.Animations.ConstantMotion=function(distance,speed)
{speed=speed||3;var value=0,aniArray=[];while(value<=distance)
{value+=speed;aniArray[aniArray.length]=Math.round(value);}
if(aniArray.length>0)
aniArray[aniArray.length-1]=distance;return aniArray;}
Mooi.Animations.DampedOscillation=function(a,d)
{d=d||-0.7;var t=0,f=1.8,yv=[],r,i=0;do
{t+=0.1;r=a*Math.pow(Math.E,(d*t))*Math.cos((f*t)+Math.PI);yv[i++]=Math.round(a+r);}
while(Math.abs(r)>=0.005);if(yv.length>0)
yv[yv.length-1]=a;return yv;}
Mooi.Animations.Fall=function(distance)
{var value=0,t=0,aniArray=[];while(value<distance)
{t+=0.8;value=t*t;aniArray[aniArray.length]=Math.round(value);}
if(aniArray.length>0)
aniArray[aniArray.length-1]=distance;return aniArray;}
Mooi.Animations.Jump=function(distance)
{var value=0,t=0,pull=0,aniArray=[];while(value<distance)
{t+=0.9;pull+=12;value=t*t-pull;aniArray[aniArray.length]=Math.round(value);}
if(aniArray.length>0)
aniArray[aniArray.length-1]=distance;return aniArray;}
Mooi.Browse=function(mooiInst,pages)
{var _endPositionDiff,_animationLength,_animation,_animationTarget,_endPos,_clones=[],_this=this;var _bootstrapAnimationElements=function()
{switch(mooiInst.getSettings().animation.type)
{case'horizontal-no-separation-motion':_animationTarget=mooiInst.getTarget();break;case'horizontal-no-separation-overlapping-add':var i=_this.addClone(new Mooi.Clone.HorizontalOverlappingAdd(_this));this.getClone(i).getWrapper().insertAfter(mooiInst.getTarget());_animationTarget=_this.getClone(i).getWrapper();break;case'horizontal-no-separation-overlapping-remove':var i=_this.addClone(new Mooi.Clone.HorizontalOverlappingRemove(_this));_this.getClone(i).getWrapper().insertAfter(mooiInst.getTarget());_animationTarget=_this.getClone(i).getWrapper();break;case'vertical-no-separation-motion':var i=_this.addClone(new Mooi.Clone.VerticalMotion(_this));this.getClone(i).getWrapper().insertBefore(mooiInst.getTarget());_animationTarget=mooiInst.getTarget().add(_this.getClone(i).getWrapper());break;case'vertical-no-separation-overlapping-add':var i=_this.addClone(new Mooi.Clone.VerticalOverlappingAdd(_this));_this.getClone(i).getWrapper().insertBefore(mooiInst.getTarget());_animationTarget=mooiInst.getTarget();break;case'vertical-no-separation-overlapping-remove':var i=_this.addClone(new Mooi.Clone.VerticalOverlappingRemove(_this));_this.getClone(i).getWrapper().insertAfter(mooiInst.getTarget());_animationTarget=_this.getClone(i).getWrapper();break;case'horizontal-column-overlapping-remove':var columns=mooiInst.getSettings().animation.columns;if(Math.abs(_this.getPages())>1)
columns=columns*(_this.getPages()>0?mooiInst.getSettings().button.forword.pages:mooiInst.getSettings().button.back.pages);for(var i=1;i<=columns;i++)
{var n=_this.addClone(new Mooi.Clone.ColumnHorizontalOffsetOffset(mooiInst.getSettings().animation.columns,i,_this));_this.getClone(n).getWrapper().insertAfter(mooiInst.getTarget());_animationTarget=_animationTarget==null?_this.getClone(n).getWrapper():_animationTarget.add(_this.getClone(n).getWrapper());}
break;case'vertical-column-overlapping-remove':var columns=mooiInst.getSettings().animation.columns;for(var i=1;i<=columns;i++)
{var n=_this.addClone(new Mooi.Clone.Column(columns,i,_this));_this.getClone(n).getWrapper().insertAfter(mooiInst.getTarget());_animationTarget=_animationTarget==null?_this.getClone(n).getWrapper():_animationTarget.add(_this.getClone(n).getWrapper());}
break;case'vertical-column-overlapping-add':var columns=mooiInst.getSettings().animation.columns;for(var i=1;i<=columns;i++)
{var n=_this.addClone(new Mooi.Clone.ColumnVerticalOffset(columns,i,_this));_this.getClone(n).getWrapper().insertAfter(mooiInst.getTarget());_animationTarget=_animationTarget==null?_this.getClone(n).getWrapper():_animationTarget.add(_this.getClone(n).getWrapper());}
break;case'horizontal-column-overlapping-add':var columns=mooiInst.getSettings().animation.columns,repeat=columns*(Math.abs(_this.getPages())>1?Math.abs(_this.getPages()):1);for(var i=1;i<=repeat;i++)
{var n=_this.addClone(new Mooi.Clone.ColumnHorizontalOffset(columns,i,_this));_this.getClone(n).getWrapper().insertAfter(mooiInst.getTarget());_animationTarget=_animationTarget==null?_this.getClone(n).getWrapper():_animationTarget.add(_this.getClone(n).getWrapper());}
break;case'vertical-column-motion':var columns=mooiInst.getSettings().animation.columns;for(var i=1;i<=columns;i++)
{var n=[_this.addClone(new Mooi.Clone.ColumnVerticalOffset(columns,i,_this)),_this.addClone(new Mooi.Clone.Column(columns,i,_this))];for(var j in n)
_this.getClone(n[j]).getWrapper().insertAfter(mooiInst.getTarget());for(var j in n)
_animationTarget=_animationTarget==null?_this.getClone(n[j]).getWrapper():_animationTarget.add(_this.getClone(n[j]).getWrapper());}
break;case'horizontal-column-motion':var columns=mooiInst.getSettings().animation.columns,repeat=columns*(Math.abs(_this.getPages())>1?Math.abs(_this.getPages()):1);for(var i=1;i<=repeat;i++)
{var n=_this.addClone(new Mooi.Clone.ColumnHorizontalOffset(columns,i,_this));_this.getClone(n).getWrapper().insertAfter(mooiInst.getTarget());_animationTarget=_animationTarget==null?_this.getClone(n).getWrapper():_animationTarget.add(_this.getClone(n).getWrapper());}
for(var i=1,w=0;i<=repeat;i++)
{var clone=new Mooi.Clone.Column(columns,i,_this);w+=clone.getWidth();var isDuplicated=_this.getEndPositionDiff()
-(mooiInst.getViewport().width()*(Math.abs(_this.getPages())>1?Math.abs(_this.getPages()):1))
+w<=0;if(!isDuplicated)
{var n=_this.addClone(clone);_this.getClone(n).getWrapper().insertAfter(mooiInst.getTarget());_animationTarget=_animationTarget==null?_this.getClone(n).getWrapper():_animationTarget.add(_this.getClone(n).getWrapper());}}
break;default:throw'Invalid animation combination';}
_endPos=mooiInst.getLeftDisproportion()
+(_this.getPages()>0?_this.getEndPositionDiff():_this.getEndPositionDiff()*-1);switch(mooiInst.getSettings().animation.type)
{case'horizontal-column-motion':case'vertical-column-motion':mooiInst.getTarget().css('visibility','hidden');break;case'horizontal-no-separation-overlapping-remove':mooiInst.getTarget()[0].style.left=(_endPos*-1)
+'px';break;case'vertical-no-separation-motion':case'vertical-no-separation-overlapping-add':var topOffset=_this.getPages()>0?mooiInst.getTarget().height()*-1:mooiInst.getTarget().height();mooiInst.setTopOffset(topOffset);case'vertical-no-separation-overlapping-remove':case'vertical-column-overlapping-remove':case'horizontal-column-overlapping-remove':_this.getPages()>0?mooiInst.setLeftDisproportion(mooiInst.getLeftDisproportion()
+_this.getEndPositionDiff()):mooiInst.setLeftDisproportion(mooiInst.getLeftDisproportion()
-_this.getEndPositionDiff());break;}}
this.getMooiInst=function()
{return mooiInst;}
this.getPages=function()
{return pages;}
this.getEndPositionDiff=function()
{if(_endPositionDiff==null)
{var diff=Math.abs(this.getPages())*mooiInst.getViewport().width();if(this.getPages()>0)
{var maxOffset=mooiInst.getTotalWidth()
-mooiInst.getViewport().width()
-mooiInst.getLeftDisproportion();if(maxOffset<0)
maxOffset=0;if(diff>maxOffset)
diff=maxOffset;}
else
if(diff>mooiInst.getLeftDisproportion())
diff=mooiInst.getLeftDisproportion();_endPositionDiff=diff;}
return _endPositionDiff;}
this.getAnimationLength=function()
{if(_animationLength==null)
switch(mooiInst.getSettings().animation.direction)
{case'vertical':_animationLength=mooiInst.getTarget().height();break;case'horizontal':_animationLength=this.getEndPositionDiff();break;default:throw'Invalid animation direction';}
return _animationLength;}
this.setAnimation=function(length,animationName)
{switch(animationName)
{case'random':var allAnimationName=['bell','dampedOscillation','jump','bounce','fall','constantMotion'],i=Math.floor(Math.random()*allAnimationName.length);this.setAnimation(length,allAnimationName[i]);return;case'bell':_animation=Mooi.Animations.Bell(length);break;case'dampedOscillation':_animation=Mooi.Animations.DampedOscillation(length);break;case'jump':_animation=Mooi.Animations.Jump(length);break;case'bounce':_animation=Mooi.Animations.Bounce(length);break;case'fall':_animation=Mooi.Animations.Fall(length);break;case'constantMotion':_animation=Mooi.Animations.ConstantMotion(length);break;default:throw'Invalid animation type.';}
if(pages<0)
for(var n in _animation)
_animation[n]*=-1;}
this.getAnimation=function()
{return _animation;}
this.getAnimationTarget=function()
{if(_animationTarget==null)
_bootstrapAnimationElements();return _animationTarget;}
this.getEndPos=function()
{if(_endPos==null)
_bootstrapAnimationElements();return _endPos;}
this.getClones=function()
{return _clones;}
this.addClone=function(clone)
{this.getClones().push(clone);return this.getClones().length-1;}
this.getClone=function(index)
{return this.getClones()[index];}
this.removeClone=function(index)
{this.getClones().splice(index,1)[0].remove();}
this.removeAllClones=function()
{while(this.getClones().length>0)
this.getClones().pop().remove();}
if(this.getPages()!=0)
if(!mooiInst.isAnimationInProgress())
{mooiInst.isAnimationInProgress(true);if(this.getEndPositionDiff()==0)
{var reflect=function()
{var browsePages,diff=mooiInst.getTotalWidth()
-mooiInst.getViewport().width();if(diff<0)
diff=0;browsePages=diff/mooiInst.getViewport().width();browsePages=_this.getPages()>0?browsePages*-1:browsePages;Mooi.Browse(mooiInst,browsePages);}
mooiInst.isAnimationInProgress(false);switch(mooiInst.getSettings().animation.reflectAtEnd)
{case'both':case'yes':case true:reflect();break;case'forword':if(this.getPages()>0)
reflect();break;case'back':if(this.getPages()<0)
reflect();break;case'no':case false:break;default:throw'Invalid value for "reflectAtEnd" param';}
return;}
this.setAnimation(this.getAnimationLength(),mooiInst.getSettings().animation.name);if(this.getAnimation().length>0)
{switch(mooiInst.getSettings().animation.direction)
{case'vertical':case'horizontal':Mooi.Browse.Animate(this);break;default:throw'Invalid animation direction';}}
else
{this.removeAllClones();mooiInst.isAnimationInProgress(false);return;}}};Mooi.Browse.Animate=function(browseInst)
{var
i=0,animation=browseInst.getAnimation(),animations=[],length=browseInst.getAnimation().length-1,animationTargets=[],verticalThread=function()
{for(var n in animationTargets)
animationTargets[n].style.top=animations[n][i];if(i++<length)
setTimeout(verticalThread,20);else
endThread();},verticalDelayedAnimation=function()
{var BootThread=function(n)
{var
i=0,thread=function()
{animationTargets[n].style.top=animations[n][i];if(i++<length)
setTimeout(thread,20);else
BootThread.endedThread();};setTimeout(thread,browseInst.getMooiInst().getSettings().animation.delay*BootThread.startedThreads++);};BootThread.startedThreads=0;BootThread.endedThreads=0;BootThread.endedThread=function()
{if(++BootThread.endedThreads==animationTargets.length)
endThread();};for(var n in animationTargets)
new BootThread(n);},horizontalThread=function()
{for(var n in animationTargets)
animationTargets[n].style.left=animations[n][i];if(i++<length)
setTimeout(horizontalThread,20);else
endThread();},horizontalDelayedAnimation=function()
{var BootThread=function(n)
{var
i=0,thread=function()
{animationTargets[n].style.left=animations[n][i];if(i++<length)
setTimeout(thread,20);else
BootThread.endedThread();};setTimeout(thread,browseInst.getMooiInst().getSettings().animation.delay*BootThread.startedThreads++);};BootThread.startedThreads=0;BootThread.endedThreads=0;BootThread.endedThread=function()
{if(++BootThread.endedThreads==animationTargets.length)
endThread();};for(var n in animationTargets)
new BootThread(n);},endThread=function()
{browseInst.getMooiInst().getTarget().css('visibility','visible');browseInst.getMooiInst().setLeftDisproportion(browseInst.getEndPos())
browseInst.getMooiInst().setTopOffset(0);browseInst.removeAllClones();browseInst.getMooiInst().isAnimationInProgress(false);};browseInst.getAnimationTarget().each(function()
{var tmpAnimation=[],starterOffset=browseInst.getMooiInst().getSettings().animation.direction=='horizontal'?$(this).position().left*-1:$(this).position().top;for(var i in animation)
tmpAnimation.push(((starterOffset
+animation[i])*-1)
+'px');animations.push(tmpAnimation);animationTargets.push($(this)[0]);});var threadName=browseInst.getMooiInst().getSettings().animation.direction
+'-'
+browseInst.getMooiInst().getSettings().animation.separation;switch(threadName)
{case'horizontal-no-separation':setTimeout(horizontalThread,0);break;case'vertical-no-separation':setTimeout(verticalThread,0);break;case'horizontal-column':horizontalDelayedAnimation();break;case'vertical-column':verticalDelayedAnimation();break;default:throw'Invalid animation';}}
Mooi.Clone={}
Mooi.Clone.Abstract=function(browseInst)
{var _clone,_cloneViewport,_cloneWrapper;_clone=browseInst.getMooiInst().getTarget().clone(true);_clone.wrap('<div></div>');_cloneViewport=_clone.parent();_cloneViewport.wrap('<div></div>');_cloneWrapper=_cloneViewport.parent();_cloneWrapper.attr('style',_clone.attr('style'));_cloneViewport.css({'overflow':'hidden','height':browseInst.getMooiInst().getSettings().viewport.css.height});this.getTarget=function()
{return _clone;}
this.getViewport=function()
{return _cloneViewport;}
this.getWrapper=function()
{return _cloneWrapper;}
this.remove=function()
{this.getWrapper().remove();}}
Mooi.Clone.Column=function(divisor,partition,browseInst)
{$.extend(this,new Mooi.Clone.Abstract(browseInst));var dividend=browseInst.getMooiInst().getViewport().width(),quotient=Math.floor(dividend/divisor),remainder=dividend%divisor,width=partition==divisor?quotient+remainder:quotient,position=browseInst.getPages()>0?divisor-partition:partition-1,leftOffset=(position*quotient)
+browseInst.getMooiInst().getLeftDisproportion()
+(browseInst.getPages()>0&&partition!=divisor?remainder:0);this.getTarget().css({'position':'absolute','left':(leftOffset*-1)+'px'});this.getViewport().css({'width':width+'px','height':browseInst.getMooiInst().getTarget().height(),'position':'absolute','left':leftOffset+'px'});this.getLeftOffset=function()
{return leftOffset;}
this.getWidth=function()
{return width;}}
Mooi.Clone.ColumnDubbel=function(divisor,partition,browseInst)
{$.extend(this,new Mooi.Clone.ColumnVerticalOffset(divisor,partition,browseInst));var viewport=this.getViewport().clone();viewport.css('top',this.getTopOffset()+'px');viewport.children(':nth-child(1)').css('left',(this.getLeftOffset()*-1)+'px');this.getWrapper().append(viewport);};Mooi.Clone.ColumnHorizontalOffset=function(divisor,partition,browseInst)
{$.extend(this,new Mooi.Clone.Column(divisor,partition,browseInst));var leftOffset=this.getLeftOffset()
+(browseInst.getPages()>0?browseInst.getEndPositionDiff():browseInst.getEndPositionDiff()*-1);this.getTarget().css('left',(leftOffset*-1)+'px');this.getViewport().css('left',leftOffset+'px');this.getLeftOffset=function()
{return leftOffset;}}
Mooi.Clone.ColumnHorizontalOffsetOffset=function(divisor,partition,browseInst)
{$.extend(this,new Mooi.Clone.Column(divisor,partition,browseInst));var offset=Math.abs(browseInst.getPages())>1?(browseInst.getEndPositionDiff()
-browseInst.getMooiInst().getViewport().width()):0,leftOffset=this.getLeftOffset()
+(browseInst.getPages()>0?offset:offset*-1);this.getTarget().css('left',(leftOffset*-1)+'px');this.getViewport().css('left',leftOffset+'px');this.getLeftOffset=function()
{return leftOffset;}}
Mooi.Clone.ColumnVerticalOffset=function(divisor,partition,browseInst)
{$.extend(this,new Mooi.Clone.Column(divisor,partition,browseInst));var leftOffset=this.getLeftOffset()
+(browseInst.getPages()>0?browseInst.getEndPositionDiff():browseInst.getEndPositionDiff()*-1),topOffset=browseInst.getPages()>0?browseInst.getMooiInst().getTarget().height()*-1:browseInst.getMooiInst().getTarget().height();this.getTarget().css('left',(leftOffset*-1)+'px');this.getWrapper().css('top',topOffset+'px');this.getTopOffset=function()
{return topOffset;}}
Mooi.Clone.HorizontalOverlappingAdd=function(browseInst)
{$.extend(this,new Mooi.Clone.Abstract(browseInst));var aniBeginning,getAniBeginning=function()
{if(aniBeginning==null)
aniBeginning=browseInst.getEndPositionDiff()<browseInst.getMooiInst().getViewport().width()?browseInst.getEndPositionDiff():browseInst.getMooiInst().getViewport().width();return aniBeginning;};if(browseInst.getPages()>0)
{var removeWidth=browseInst.getMooiInst().getLeftDisproportion()
+getAniBeginning();this.getViewport().width(this.getWrapper().width()
-removeWidth);this.getTarget().css({'position':'absolute','left':(removeWidth*-1)+'px'});this.getViewport().css({'position':'absolute','left':removeWidth+'px'});}
else
{this.getTarget().css('position','static');this.getViewport().width(browseInst.getMooiInst().getLeftDisproportion()
+browseInst.getMooiInst().getViewport().width()
-browseInst.getMooiInst().getAniBeginning());}}
Mooi.Clone.HorizontalOverlappingRemove=function(browseInst)
{$.extend(this,new Mooi.Clone.Abstract(browseInst));if(browseInst.getPages()>0)
{this.getTarget().css('position','static');this.getViewport().width(this.getWrapper().width()
-(this.getWrapper().width()
-(browseInst.getMooiInst().getLeftDisproportion()
+browseInst.getMooiInst().getViewport().width())));}
else
{this.getViewport().width(this.getWrapper().width()
-browseInst.getMooiInst().getLeftDisproportion());this.getTarget().css({'position':'absolute','left':browseInst.getMooiInst().getLeftOffset()+'px'});this.getViewport().css({'position':'absolute','left':browseInst.getMooiInst().getLeftDisproportion()+'px'});}}
Mooi.Clone.VerticalMotion=function(browseInst)
{$.extend(this,new Mooi.Clone.Abstract(browseInst));this.getTarget().css({'position':'absolute','left':browseInst.getMooiInst().getLeftOffset()+'px'});this.getViewport().css({'width':browseInst.getMooiInst().getViewport().width(),'height':browseInst.getMooiInst().getTarget().height(),'position':'absolute','left':browseInst.getMooiInst().getLeftDisproportion()+'px'});}
Mooi.Clone.VerticalOverlappingAdd=Mooi.Clone.VerticalMotion;Mooi.Clone.VerticalOverlappingRemove=Mooi.Clone.VerticalMotion;Mooi.DefaultSettings={target:{css:{'width':'','position':'','listStyle':'none','left':'0','padding':'0','margin':'0'}},img:{css:{'display':'block'}},li:{css:{'display':'block','float':'left','margin':'0','padding':'0'}},wrapper:{css:{'position':'relative','margin':'0','padding':'0'}},viewport:{css:{'overflow':'hidden','position':'relative','margin':'0','padding':'0'}},button:{back:{inner:'',pages:1,css:{'position':'absolute','top':'50%','left':'0','width':'30px','height':'30px','margin':'-15px 0 0 -30px','background':'#ff0','cursor':'pointer'}},forword:{inner:'',pages:1,css:{'position':'absolute','top':'50%','right':'0','width':'30px','height':'30px','margin':'-15px -30px 0 0','background':'#00f','cursor':'pointer'}}},animation:{reflectAtEnd:'both',direction:'horizontal',separation:'no-separation',type:'motion',columns:1,delay:0,name:'bell'}};$.fn.mooi=function(options)
{var mooiInstances=[];$(this).each(function()
{mooiInstances.push(new Mooi($(this),options));});return mooiInstances;};})(jQuery);

