var vanilla={Version:"0.1",namespace:function(a){if(!a){return window}var d=vanilla.window;
var c=a.split(".");for(var b=0;b<c.length;b++){var e=c[b];d[e]=d[e]||{};
d=d[e]}return d},extend:function(c,a,b){if(!c||!a){return}for(property in a){if(!b||!c[property]){c[property]=a[property]
}}},debug:function(a){if(!document.body){document.write(a+"<br />")}else{var b=document.getElementById("vanilla-debug");
if(!b){b=document.createElement("DIV");b.style.font="menu";b.style.clear="both";
b.id="vanilla-debug";document.body.appendChild(b)}b.innerHTML+=(a+"<br>")
}},exists:function(a){if(!a){return false}var d=window;var c=a.split(".");
for(var b=0;b<c.length;b++){d=d[c[b]];if(!d){return false}}return true},require:function(a){if(!vanilla.exists(a)){vanilla.console.warn("The package is required : "+a);
throw ("The package is required : "+a)}},addOnloadListener:function(b,a){if(!this.onLoadCallbacks){this.onLoadCallbacks=new Array()
}this.onLoadCallbacks.push({callback:b,target:a||window})},onload:function(){if(!vanilla.onLoadCallbacks){return
}for(var a=0;a<vanilla.onLoadCallbacks.length;a++){var b=vanilla.onLoadCallbacks[a];
b.callback.call(b.target)}},emptyFunction:function(){}};vanilla.window=this;
vanilla.isBoggyIE=(document.all&&!window.opera&&(navigator.vendor!="KDE")?true:false);
if(vanilla.isBoggyIE){window.attachEvent("onload",vanilla.onload)}else{window.addEventListener("load",vanilla.onload,false)
}if(typeof console=="undefined"){vanilla.console={log:function(){},warn:function(){}}
}else{vanilla.console=console}window.document.getElementsByTagName("html")[0].className+=" javascript";vanilla.namespace("vanilla.text");vanilla.text={trim:function(a){if(typeof a!="string"&&!(a instanceof String)){return a
}var c=0;var b=a.length;while((c<b)&&(a.charAt(c)<=" ")){c++}while((c<b)&&(a.charAt(b-1)<=" ")){b--
}return(c>0||b<a.length?a.substring(c,b):a)},DefaultDateFormat:"mm/dd/yyyy",parseDate:function(k,h){if(!k){return null
}if(!h){h=this.DefaultDateFormat}if(k.length!=h.length){return null}var b=new String();
var d=new String();var j=new String();for(var c=0;c<h.length;c++){switch(h.charAt(c)){case"d":b+=k.charAt(c);
break;case"m":d+=k.charAt(c);break;case"y":j+=k.charAt(c);break;default:if(h.charAt(c)!=k.charAt(c)){return null
}}}var g=parseInt(b,10);var e=parseInt(d,10)-1;var f=parseInt(j,10);var a=new Date(f,e,g);
if(a.getDate()!=g||a.getMonth()!=e||(f.length==2?a.getYear():a.getFullYear())!=f){return null
}return a},replaceAll:function(c,b,a){return c.replace(new RegExp(b,"g"),a)
}};vanilla.namespace("vanilla.html");vanilla.html={SCRIPT_EXPRESSION:"(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)",extractScripts:function(e){var g=new RegExp(this.SCRIPT_EXPRESSION,"img");
var f=new RegExp(this.SCRIPT_EXPRESSION,"im");var c=e.match(g);var a=new Array();
for(var d=0;d<c.length;d++){var b=c[d].match(f);if(b){a.push(b[1])}}return a
},evalScripts:function(html){var scripts=this.extractScripts(html);for(var i=0;
i<scripts.length;i++){var script=scripts[i];eval(script)}}};vanilla.html.DOM={toElement:function(a){if(typeof a=="string"){return document.getElementById(a)
}return a},nextHomonym:function(a){if(!a.nodeName){return null}for(var b=a.nextSibling;
b;b=b.nextSibling){if(b.nodeName==a.nodeName){return b}}return null},previousHomonym:function(a){if(!a.nodeName){return null
}for(var b=a.previousSibling;b;b=b.previousSibling){if(b.nodeName==a.nodeName){return b
}}return null},insertAfter:function(a,c,b){if(b.nextSibling){a.insertBefore(c,b.nextSibling)
}else{a.appendChild(c)}},getFirstChildByTagName:function(b,a){b=EL(b);if(!b){return null
}a=a.toUpperCase();for(var c=b.firstChild;c;c=c.nextSibling){if(c.tagName==a){return c
}}return null},getAncestorByTagName:function(c,a){c=EL(c);if(!c){return null
}a=a.toUpperCase();for(var b=c.parentNode;b;b=b.parentNode){if(b.tagName==a){return b
}}return null},getAncestorForTagName:function(b,a){vanilla.console("getAncestorForTagName is deprecated, use getAncestorByTagName instead");
return vanilla.html.DOM.getAncestorByTagName(b,a)},getCommonAncestor:function(c,b){var a=Array();
for(var d=c.parentNode;d;d=d.parentNode){a.push(d)}if(!a.length){return c
}for(var d=b.parentNode;d;d=d.parentNode){if(a.indexOf(d)>=0){return d}}return null
},getClassNames:function(a){return EL(a).className.split(/\s+/)},updateClassName:function(a,b){EL(a).className=b.join(" ")
},hasClassName:function(c,d){var b=vanilla.html.DOM.getClassNames(c);for(var a=0;
a<b.length;a++){if(b[a]==d){return true}}return false},addClassName:function(e,f,b){if(vanilla.html.DOM.hasClassName(e,f)){return
}var d=vanilla.html.DOM.getClassNames(e);if(b){var a=d.length;for(var c=0;
c<a;c++){d.push(d[c]+"-"+f)}}d.push(f);vanilla.html.DOM.updateClassName(e,d)
},removeClassName:function(e,g,a){var d=vanilla.html.DOM.getClassNames(e);
var h=new Array();var f=new RegExp("-?("+g+"-|"+g+"$)");var c,b;for(c=0,b=0;
c<d.length;c++){if(!a){if(d[c]!=g){h[b++]=d[c]}}else{if(!f.test(d[c])){h[b++]=d[c]
}}}vanilla.html.DOM.updateClassName(e,h)}};window.EL=vanilla.html.DOM.toElement;
vanilla.html.style={get:function(b,c){b=EL(b);var e=this.camelize(c);var d=b.style[e];
if(!d){if(b.currentStyle){d=b.currentStyle[e]}else{if(document.defaultView&&document.defaultView.getComputedStyle){var a=document.defaultView.getComputedStyle(b,null);
if(a){d=a.getPropertyValue(c)}}}}if(window.opera&&(c=="top"||c=="right"||c=="bottom"||c=="left")){if(this.get(b,"position")=="static"){return null
}}return(d=="auto"?null:d)},camelize:function(b){if(!b){return b}var d=b.split("-");
var e=(b.charAt(0)=="-"?0:1);var c=(e>0?d[0]:"");for(var a=e;a<d.length;
a++){c+=d[a].charAt(0).toUpperCase()+d[a].substring(1)}return c}};vanilla.html.position={fromStyle:function(b){b=EL(b);
var a=parseInt(vanilla.html.style.get(b,"left")||"0",10);var c=parseInt(vanilla.html.style.get(b,"top")||"0",10);
return{x:a,y:c}},getRealOffset:function(a){a=EL(a);var b={x:0,y:0};for(;
a;a=a.parentNode){b.x+=a.scrollLeft||0;b.y+=a.scrollTop||0}return b},getCumulativeOffset:function(a){a=EL(a);
var c={x:0,y:0};for(var b=a;b;b=b.offsetParent){c.x+=b.offsetLeft||0;c.y+=b.offsetTop||0
}return c},getPositionnedOffset:function(a){a=EL(a);var c={x:0,y:0};for(var b=a;
b;b=b.offsetParent){p=vanilla.html.style.get(b,"position");if(p=="relative"||p=="absolute"){break
}c.x+=b.offsetLeft||0;c.y+=b.offsetTop||0}return c},nodeContains:function(a,c){a=EL(a);
var b=this.getCumulativeOffset(a);b.w=a.offsetWidth;b.h=a.offsetHeight;
return this.boxContains(b,c)},boxContains:function(a,b){return(b.x>=a.x&&b.y>=a.y&&b.x<(a.x+a.w)&&b.y<(a.y+a.h))
}};vanilla.html.Form={NOTHING:{},serialize:function(d){d=EL(d);var c=new Array();
for(var a=0;a<d.elements.length;a++){var e=d.elements.item(a);var b=this.serializeField(e);
if(b!=this.NOTHING){c.push(b)}}return c.join("&")},serializeField:function(a){return this.serializeCouple(a.name,this.getFieldValue(a))
},serializeCouple:function(a,b){if(b!=this.NOTHING&&a!=null&&a.length){return a+"="+this.encode(b)
}return this.NOTHING},encode:function(a){if(!a){return""}a=a.replaceAll("%","%25");
a=a.replaceAll("&","%26");a=a.replaceAll("\\?","%3F");a=a.replaceAll("=","%3D");
return a},getFieldValue:function(a){a=EL(a);switch(a.type){case"textarea":return this._removeCarriageReturn(a.value);
case"password":case"hidden":case"file":case"text":return a.value;case"select-one":return vanilla.html.Form.Popup.getSelectedValue(a);
case"submit":return(a.value?a.value:"Envoyer");case"radio":case"checkbox":return(a.checked?a.value:this.NOTHING)
}return null},setFieldValue:function(b,a){b=EL(b);switch(b.type){case"textarea":case"password":case"hidden":case"text":b.value=a;
break;case"select-one":vanilla.html.Form.Popup.setSelectedValue(b,a);break;
case"radio":case"checkbox":b.checked=(b.value==a);break}},_removeCarriageReturn:function(a){if(a){a=a.replace(/\r/g,"")
}return a}};vanilla.html.Form.Popup={clear:function(b,a,c){b=EL(b);if(!b){return
}while(b.firstChild){b.removeChild(b.firstChild)}if(typeof a!="undefined"){this.addOption(b,a,c)
}},addOption:function(a,b,c){a=EL(a);if(!a){return}a.appendChild(this.createOption(b,c))
},createOption:function(a,c){var b=document.createElement("option");b.setAttribute("value",a);
b.appendChild(document.createTextNode(c));return b},getSelectedOption:function(a){a=EL(a);
if(!a){return null}if(a.selectedIndex<0){return null}return a.options[a.selectedIndex]
},getSelectedValue:function(a){var b=this.getSelectedOption(a);return(b?b.value:null)
},getSelectedText:function(a){var b=this.getSelectedOption(a);return(b?b.text:null)
},setSelectedValue:function(a,d){a=EL(a);if(!a){return false}for(var b=0;
b<a.options.length;b++){var e=a.options[b];if(e.value==d){a.selectedIndex=b;
return true}}return false}};vanilla.namespace("vanilla.lang");vanilla.require("vanilla.text");vanilla.extend(vanilla,{isInstanceOf:function(b,a){if(!b||!b.getClass){return false
}return b.getClass().isInstanceOf(a)},Class:function(a,b,c){return vanilla.lang.Class.create(a,b,false,c,false)
},Abstract:function(a,b){return vanilla.lang.Class.create(a,b,true,false)
},Interface:function(a,b){return vanilla.lang.Class.create(a,b,false,false,true)
}});vanilla.lang.classes=new Array();vanilla.lang.Class=function(c,f,a,e,g,d){this.namespace=c;
this.classname=f;this.fullname=(c?c+".":"")+f;this._super=null;this._implement=[];
this._final=(g==true);this._abstract=(e==true);this._interface=(d==true);
this._function=a;if(d&&e){throw new IllegalStateException("An interface can't be abstract")
}if(d&&g){throw new IllegalStateException("An interface can't be final")
}if(e&&g){throw new IllegalStateException("An abstract class can't be final")
}var b=this;this._function.Class=b;this._function.Extends=vanilla.lang.Class.Extends;
this._function.Implements=vanilla.lang.Class.Implements;this._function.Prototype=vanilla.lang.Class.Prototype;
this._function.Static=vanilla.lang.Class.Static;if(this.fullname!="vanilla.lang.Object"){this._function.prototype.Super=vanilla.lang.Class.prototype.Super
}this._function.prototype.getClass=function(){return b};this._function.prototype.self=this._function;
this._function.prototype["_"+f+"_"]=this._function};vanilla.extend(vanilla.lang.Class,{Extends:function(a){if(!a||!a.prototype){return
}if(a.Class){if(a.Class._final){throw new IllegalStateException("Can't inherits of a final class")
}if(this.Class._super!=null){throw new IllegalStateException("Can't inherits of two classes.")
}if(this.Class._interface&&!a.Class._interface){throw new IllegalStateException("An interface can only inherits of interface")
}if(!this.Class._interface&&a.Class._interface){throw new IllegalStateException("A class can only inherits from classes. Use the Implements method to implements interfaces")
}this.Class._super=a.Class}vanilla.extend(this.prototype,a.prototype,true)
},Implements:function(a){if(!a||!a.Class){return}if(!a.Class._interface){throw new IllegalStateException("Can only implements interfaces")
}this.Class._implement.push(a.Class);vanilla.extend(this.prototype,a.prototype,true)
},AbstractFunction:function(){throw new IllegalStateException("You need to override this method")
},Static:function(a){vanilla.extend(this,a)},Prototype:function(a){vanilla.extend(this.prototype,a)
},create:function(b,f,e,h,d){if(!f){return null}var a=null;if(e){a=function(){throw new IllegalStateException("Can't instanciate an abstract class")
}}else{if(d){a=function(){throw new IllegalStateException("Can't instanciate an interface")
}}else{a=function(){this[f].apply(this,arguments)};a.prototype[f]=function(){}
}}var g=new vanilla.lang.Class(b,f,a,e,h,d);vanilla.lang.classes[g.fullname]=g;
return(vanilla.namespace(b)[f]=a)},bundle:function(b,d,a){if(!a){return false
}var e=new vanilla.lang.Class(b,d,a,false,true);vanilla.lang.classes[e.fullname]=e;
return true},forName:function(a){return vanilla.lang.classes[a]}});vanilla.lang.Class.prototype={instanciate:function(){return new this._function()
},isInstanceOf:function(b){if(!b){return false}if(typeof b=="string"){b=vanilla.lang.Class.forName(b)
}else{if(b.Class){b=b.Class}else{if(b.getClass){b=b.getClass()}}}if(this==b){return true
}if(this._super&&this._super.isInstanceOf(b)){return true}for(var a=0;a<this._implement.length;
a++){if(this._implement[a].isInstanceOf(b)){return true}}return false},Super:function(){var a=this.getClass();
if(!a._super){return false}var b=Arr(arguments);var c=b.shift();var d=a._super._function.prototype;
if(d[c]){return d[c].apply(this,b)}return false}};vanilla.lang.Class.bundle("vanilla.lang","Class",vanilla.lang.Class);
vanilla.lang.Class.bundle("","Array",Array);vanilla.lang.Class.bundle("","Function",Function);
vanilla.lang.Class.bundle("","String",String);vanilla.Class("vanilla.lang","Exception");
vanilla.lang.Exception.Prototype({Exception:function(a,b){this.message=a;
this.cause=b},toString:function(){return this.getClass().fullname+" : "+this.message
}});vanilla.Class("vanilla.lang","IllegalStateException");vanilla.lang.IllegalStateException.Extends(vanilla.lang.Exception);
vanilla.lang.IllegalStateException.Prototype({IllegalStateException:function(a,b){this.Exception(a,b);
vanilla.console.warn(a)}});vanilla.Interface("vanilla.lang","Runnable");
vanilla.lang.Runnable.Prototype({run:vanilla.lang.Class.AbstractFunction,getDelay:vanilla.lang.Class.AbstractFunction});
vanilla.Class("vanilla.lang","Thread");vanilla.lang.Thread.Implements(vanilla.lang.Runnable);
vanilla.lang.Thread.Static({DefaultDelay:1000,Stop:-1,Pause:0,Continue:1,join:function(){var b=Arr(arguments);
var a=b.shift();var c=new Array();var d=function(){for(var e=0;e<c.length;
e++){if(c[e].isAlive()){return}}for(var e=1;e<arguments.length;c[e++].onDie.unsubscribe(d)){}a()
};b.forEach(function(e,f){e.onDie.subscribe(d);c.push(e)})}});vanilla.lang.Thread.Prototype({Thread:function(a){this.target=a;
this.delay=vanilla.lang.Thread.DefaultDelay;this.onSpawn=new vanilla.event.CustomEvent(this);
this.onDie=new vanilla.event.CustomEvent(this);this.frozen=false;this.context=null
},start:function(a){if(this.context==null){this.context={startTime:new Date(),manual:Thread.Continue,useInterval:a,timer:null};
this.onSpawn.notify();this._sleep()}},_sleep:function(){if(this.isAlive()){if(!this.context.useInterval){setTimeout(this._wakeUp.bind(this,this.context),this.getDelay())
}else{if(!this.context.timer){this.context.timer=setInterval(this._wakeUp.bind(this,this.context),this.getDelay())
}}}},_wakeUp:function(a){var b=a.manual;if(b==Thread.Continue){b=this.run()
}switch(b){case Thread.Pause:this.frozen=true;break;case Thread.Continue:this._sleep();
break;case Thread.Stop:default:this._terminate(a);break}},_terminate:function(a){if(a==this.context){if(a.useInterval){clearInterval(a.timer);
a.timer=null}this.context=null;this.onDie.notify()}},run:function(){if(this.target){return this.target.run()
}return Thread.Stop},resume:function(){if(this.isAlive()&&this.frozen){this.frozen=false;
this.context.manual=Thread.Continue;this._sleep()}},stop:function(){if(this.isAlive()){this.context.manual=Thread.Stop;
this._terminate(this.context)}},pause:function(){if(this.isAlive()){this.context.manual=Thread.Pause;
this.frozen=true}},getDelay:function(){return(this.target?this.target.getDelay():this.delay)
},isAlive:function(){return(this.context!=null)},isFrozen:function(){return(this.context!=null&&this.frozen)
}});vanilla.Class("vanilla.lang","SimpleThread");vanilla.lang.SimpleThread.Extends(vanilla.lang.Thread);
vanilla.lang.SimpleThread.Prototype({SimpleThread:function(b,a){this.Thread();
this.delay=a;this.callback=b},run:function(){var a=this.callback.apply(window,[]);
if(a==Thread.Stop||a==Thread.Pause||a==Thread.Continue){return a}return Thread.Stop
}});vanilla.extend(window,vanilla.lang);vanilla.namespace("vanilla.event");
vanilla.event={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,events:new Array(),index:0,addEventListener:function(a,b,f){var e=function(c){try{return f(c||window.event)
}catch(g){throw (vanilla.isInstanceOf(g,"vanilla.lang.Exception")?g.toString():g)
}};if(vanilla.isBoggyIE){a.attachEvent("on"+b,e)}else{a.addEventListener(b,e,false)
}var d=new Date().getTime()+"-"+(++vanilla.event.index);vanilla.event.events[d]=e;
return d},removeEnventListener:function(a,c,b){if(!vanilla.event.events[b]){return
}if(vanilla.isBoggyIE){a.detachEvent("on"+c,vanilla.event.events[b])}else{a.removeEventListener(c,vanilla.event.events[b],false)
}vanilla.event.events[b]=null},isMouseLeft:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))
},getPointerCoords:function(a){var c={};c.x=parseInt(vanilla.html.style.get(document.body,"margin-left")||"0",10);
c.y=parseInt(vanilla.html.style.get(document.body,"margin-top")||"0",10);
var b={};b.x=a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
b.y=a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
return b},stopPropagation:function(a){if(a.preventDefault){a.preventDefault();
a.stopPropagation()}else{a.returnValue=false;a.cancelBubble=true}},getTarget:function(a){return(a.target||a.srcElement)
}};vanilla.Class("vanilla.event","CustomEvent");vanilla.event.CustomEvent.Prototype({owner:null,CustomEvent:function(a){this.owner=a;
this.listeners=new Array()},subscribe:function(d,c,a){if(!d){return}if(c){d=d.bind(c)
}var b={callback:d,acceptCtx:a};this.listeners.push(b)},unsubscribe:function(c,b){if(!c){return
}if(b){c=c.bind(b)}for(var a=0;a<this.listeners.length;a++){if(this.listeners[a].callback.equals(c)){this.listeners.removeAtIndex(a);
break}}},notify:function(){var a=Arr(arguments);return this.notifyWithArguments(a)
},notifyWithArguments:function(c){var b={event:this,owner:this.owner,stopPropagation:false,preventDefault:false};
var a=Arr(c);var f=[b];f.addAll(a);for(var d=0;d<this.listeners.length;
d++){var e=this.listeners[d];if(e.callback){e.callback.apply(window,e.acceptCtx?f:a);
if(b.stopPropagation){break}}}return b}});Function.Prototype({bind:function(e){var f=this;
var a=e;var d=new Array();for(var c=1;c<arguments.length;d[c-1]=arguments[c++]){}var b=function(){var g=new Array();
for(var h=0;h<d.length;g.push(d[h++])){}for(var h=0;h<arguments.length;
g.push(arguments[h++])){}return f.apply(a,g)};b._binded=f;b._target=a;return b
},getBinded:function(){if(this._binded){return this._binded.getBinded()
}return this},getTarget:function(){if(this._binded){var a=this._binded.getTarget();
return(a==window?this._target:a)}return window},equals:function(a){if(!a){return false
}return(this.getBinded()==a.getBinded()&&this.getTarget()==a.getTarget())
}});Array.Static({createFrom:function(d){if(!d){return[]}if(vanilla.isInstanceOf(d,Array)){return d
}var b=new Array();for(var c=0;c<d.length;b.push(d[c++])){}return b}});
var Arr=Array.createFrom;Array.Prototype({first:function(){return this[0]
},last:function(){return this[this.length-1]},clear:function(){this.length=0
},shift:function(){var b=this[0];for(var a=0;a<this.length-1;this[a]=this[++a]){}this.length--;
return b},indexOf:function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return a
}}return -1},contains:function(a){return(this.indexOf(a)>=0)},removeAtIndex:function(b){if(b<0||b>=this.length){return null
}var c=this[b];for(var a=b;a<this.length-1;this[a]=this[++a]){}this.length--;
return c},remove:function(b){var a=this.indexOf(b);if(a<0){return null}return this.removeAtIndex(a)
},addAll:function(b){if(!b){return}for(var c=0;c<b.length;this.push(b[c++])){}},isEmpty:function(){return(this.length<=0)
}});vanilla.extend(Array.prototype,{forEach:function(b){for(var a=0;a<this.length;
a++){b(this[a],a)}}},true);String.Prototype({trim:function(){return vanilla.text.trim(this)
},replaceAll:function(b,a){return vanilla.text.replaceAll(this,b,a)},startsWith:function(a){return this.indexOf(a)==0
}});vanilla.require("vanilla.lang");vanilla.namespace("vanilla.net");vanilla.Class("vanilla.net","Request");
vanilla.net.Request.Static({POST_METHOD:"POST",GET_METHOD:"GET",Events:["Uninitialized","Loading","Loaded","Interactive","Complete"],getTransport:function(){return(typeof ActiveXObject!="undefined"?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest())
}});vanilla.net.Request.Prototype({Request:function(b,a){this.method=(b?b:this._Request_.GET_METHOD);
this.asynchronous=(a==false?false:true);this.transport=vanilla.net.Request.getTransport();
this.headers={"X-Requested-With":"XMLHttpRequest","X-Vanilla-Version":vanilla.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};
if(b==this._Request_.POST_METHOD){this.setHeader("Content-type","application/x-www-form-urlencoded")
}this.onUnitialized=new vanilla.event.CustomEvent(this);this.onLoading=new vanilla.event.CustomEvent(this);
this.onLoaded=new vanilla.event.CustomEvent(this);this.onInteractive=new vanilla.event.CustomEvent(this);
this.onComplete=new vanilla.event.CustomEvent(this);this.onSuccess=new vanilla.event.CustomEvent(this);
this.onFailure=new vanilla.event.CustomEvent(this)},setHeader:function(a,b){this.headers[a]=b
},setNoCache:function(){this.setHeader("If-Modified-Since","Mon, 1 Jan 2007 00:00:00 GMT")
},send:function(a,b){this.url=a;if(this.method==this._Request_.GET_METHOD&&b){this.url+=(this.url.match(/\?/)?"&":"?")+b
}if(this.asynchronous){this.transport.onreadystatechange=this._onReadyStateChanged.bind(this)
}this.transport.open(this.method,this.url,this.asynchronous);this._setRequestHeaders();
this.transport.send(this.method==this._Request_.POST_METHOD?b:null)},_setRequestHeaders:function(){for(header in this.headers){this.transport.setRequestHeader(header,this.headers[header])
}},_onReadyStateChanged:function(){var a=this.transport.readyState;if(a<=1){return
}var b=this._Request_.Events[a];this._dispatchEvent(b);if(b=="Complete"){this._dispatchEvent(this.isResponseASuccess()?"Success":"Failure");
this.transport.onreadystatechange=vanilla.emptyFunction}},_dispatchEvent:function(a){this["on"+a].notify(this)
},getResponseHeader:function(a){return this.transport.getResponseHeader(a)
},isResponseASuccess:function(){var a=(this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300));
return a},getResponseText:function(){return this.transport.responseText
},getResponseXML:function(){return this.transport.responseXML},getResponseStatus:function(){return this.transport.status
},getTransport:function(){return this.transport}});vanilla.net.ClassLoader={libraryPath:{},loaded:false,toLoad:[],addLibraryPath:function(a,b){if(b.charAt(b.length-1)!="/"){b+="/"
}this.libraryPath[a]=b},findLibraryPathFor:function(d){var c=null;var b=null;
for(var a in this.libraryPath){if(d.startsWith(a)&&(!b||b.length<a.length)){c=this.libraryPath[a];
b=a}}return c},require:function(b,a){if(this.loaded||a){this.load(b)}else{this.addToLoad(b)
}},addToLoad:function(a){if(vanilla.exists(a)){return}this.toLoad.push(a)
},loadAll:function(){this.loaded=true;this.toLoad.forEach(this.load.bind(this))
},load:function(e){if(vanilla.exists(e)){return}var path=this.findLibraryPathFor(e);
if(path){var url=path+e+".js";var request=new vanilla.net.Request(vanilla.net.GET_METHOD,false);
request.setNoCache();request.send(url);if(!request.isResponseASuccess()){throw new Exception("File not found : "+url)
}try{vanilla.window.eval(request.getResponseText())}catch(e){throw new Exception("Error while evaluating file : "+url,e)
}}if(!vanilla.exists(e)){throw new Exception("The package is required, and not loaded : "+e)
}}};vanilla.extend(vanilla,{require:function(b,a){vanilla.net.ClassLoader.require(b,a)
}});vanilla.addOnloadListener(vanilla.net.ClassLoader.loadAll,vanilla.net.ClassLoader);vanilla.namespace("vanilla.animation");vanilla.animation={DefaultFPS:60,linear:function(b,c,a){return(c+(a-c)*b)
},smoothAcceleration:function(b,c,a){return(c+(a-c)*b*b)},acceleration:function(b,c,a){return(c+(a-c)*b*b*b)
},deceleration:function(b,c,a){return(c+(a-c)*Math.pow(b,1/3))}};vanilla.Class("vanilla.animation","Animation");
vanilla.animation.Animation.Extends(vanilla.lang.Thread);vanilla.animation.Animation.Prototype({Animation:function(b,a){this.Thread();
this.startValue=b;this.currentValue=0;this.endValue=a;this.duration=1;this.fps=vanilla.animation.DefaultFPS;
this.startTime=0;this.endTime=0;this.durationInMillis=1;this.method=vanilla.animation.linear;
this.onNextValue=new vanilla.event.CustomEvent(this);this.onBegin=new vanilla.event.CustomEvent(this);
this.onComplete=new vanilla.event.CustomEvent(this)},start:function(){if(!this.isAlive()){this.onBegin.notify(this.startValue);
this.delay=(1000/this.fps);this.startTime=new Date().getTime();this.endTime=this.startTime+this.duration*1000;
this.durationInMillis=this.endTime-this.startTime;this.Super("start",true)
}},run:function(){var a=(new Date().getTime()-this.startTime)/this.durationInMillis;
if(a>1){a=1}var b=this.method(a,this.startValue,this.endValue);this.onNextValue.notify(b);
if(a<1){return Thread.Continue}this.onComplete.notify(b);return Thread.Stop
}});vanilla.Class("vanilla.toolkit.dragdrop","Draggable");vanilla.toolkit.dragdrop.Draggable.Static({activeDraggable:null,draggables:new Array(),init:function(){this.mouseMoveId=vanilla.event.addEventListener(document,"mousemove",this.update.bind(this));
this.mouseUpId=vanilla.event.addEventListener(document,"mouseup",this.end.bind(this));
this.keyPressId=vanilla.event.addEventListener(document,"keypress",this.keyPress.bind(this));
this.onStart=new vanilla.event.CustomEvent(this);this.onEnd=new vanilla.event.CustomEvent(this);
this.onDrag=new vanilla.event.CustomEvent(this)},register:function(a){if(this.draggables.length==0){this.init()
}this.draggables.push(a);a.onDrag.subscribe(this.onDrag.notify,this.onDrag);
a.onStart.subscribe(this.onStart.notify,this.onStart);a.onEnd.subscribe(this.onEnd.notify,this.onEnd)
},unregister:function(a){},activate:function(a,b){window.focus();if(this.activeDraggable){this.end(b)
}else{this.activeDraggable=a;this.update(b)}},update:function(a){if(!this.activeDraggable){return
}if(vanilla.event.isMouseLeft(a)){this.activeDraggable.update(a)}else{this.finish(a,false)
}vanilla.event.stopPropagation(a)},end:function(a){if(!this.activeDraggable){return
}this.finish(a,true);vanilla.event.stopPropagation(a)},finish:function(b,c){var a=this.activeDraggable;
this.activeDraggable=null;a.end(b,c)},keyPress:function(a){if(!this.activeDraggable){return
}if(a.keyCode==vanilla.event.KEY_ESC){this.finish(a,false);vanilla.event.stopPropagation(a)
}}});vanilla.toolkit.dragdrop.Draggable.Prototype({Draggable:function(b,a){this.element=EL(b);
this.zone=(a?EL(a):this.element);this.onStart=new vanilla.event.CustomEvent(this);
this.onEnd=new vanilla.event.CustomEvent(this);this.onDrag=new vanilla.event.CustomEvent(this);
this.dragging=null;this.ghosting=false;this.createGhostMethod=null;this.updatePosition=true;
this._Draggable_.register(this);vanilla.event.addEventListener(this.zone,"mousedown",this.init.bind(this))
},setGhosting:function(b,a){this.ghosting=(b==true);if(b){this.createGhostMethod=(a?a:this.createGhost)
}},init:function(a){if(this.dragging){return}if(!vanilla.event.isMouseLeft(a)){return
}vanilla.event.stopPropagation(a);var b=vanilla.event.getPointerCoords(a);
var c=vanilla.html.position.getCumulativeOffset(this.element);this.offset={x:b.x-c.x,y:b.y-c.y};
this._Draggable_.activate(this,a)},start:function(a){if(this.ghosting){this.dragging=this.createGhostMethod(this);
vanilla.html.DOM.addClassName(this.dragging,"draggingGhost")}else{this.dragging=this.element
}vanilla.html.DOM.addClassName(this.dragging,"dragging");this.onStart.notify(this,a,vanilla.event.getPointerCoords(a))
},createGhost:function(){var a=this.element.cloneNode(true);a.style.position="absolute";
vanilla.html.DOM.insertAfter(this.element.parentNode,a,this.element);return a
},end:function(a,b){if(!this.dragging){return}vanilla.html.DOM.removeClassName(this.dragging,"dragging");
if(this.ghosting){vanilla.html.DOM.removeClassName(this.dragging,"draggingGhost");
this.dragging.parentNode.removeChild(this.dragging)}this.dragging=null;
this.onEnd.notify(this,a,b)},update:function(event){if(!this.dragging){this.start(event)
}var delta=this.getDelta();var pointer=vanilla.event.getPointerCoords(event);
if(this.updatePosition){with(this.dragging.style){left=(pointer.x-delta.x-this.offset.x)+"px";
top=(pointer.y-delta.y-this.offset.y)+"px"}}this.onDrag.notify(this,event,pointer)
},getDelta:function(){var a=vanilla.html.position.getCumulativeOffset(this.dragging);
var c=vanilla.html.position.fromStyle(this.dragging);var b={};b.x=a.x-c.x;
b.y=a.y-c.y;return b}});vanilla.namespace("vanilla.toolkit.slide");vanilla.require("vanilla.animation");
vanilla.require("vanilla.net");vanilla.require("vanilla.toolkit.dragdrop");
vanilla.Abstract("vanilla.toolkit.slide","Slide");vanilla.toolkit.slide.Slide.Prototype({onComplete:null,onLoad:null,_lazyLoading:null,play:vanilla.lang.Class.AbstractFunction,stop:vanilla.lang.Class.AbstractFunction,isPlaying:vanilla.lang.Class.AbstractFunction,isLoaded:vanilla.lang.Class.AbstractFunction,_load:vanilla.lang.Class.AbstractFunction,Slide:function(b,a){this.onComplete=new vanilla.event.CustomEvent(this);
this.onLoad=new vanilla.event.CustomEvent(this);this.container=a;this.parent=b;
this.width=this.parent.width;this.height=this.parent.height;this.container.style.overflow="hidden";
this.container.style.width=this.width+"px";this.container.style.height=this.height+"px";
this.container.style.position="absolute";this.container.style.top=0;this.container.style.left=0
},setLazyLoading:function(a,b){this._lazyLoading={url:a,parameters:b}},init:function(){if(!this._lazyLoading){this._init()
}else{this.hide();var a=new vanilla.net.Request("POST",true);a.onFailure.subscribe(function(b){throw new IllegalStateException("Can't load the slide")
},this);a.onSuccess.subscribe(function(c){this.container.innerHTML=c.getResponseText();
var d="div-temp-"+(new Date()).getTime()+"-"+Math.round(Math.random()*100);
this.container.innerHTML+='<div id="'+d+'" style="display:none"></div>';
var b=new SimpleThread(function(){var e=EL(d);if(!e){return Thread.Continue
}e.parentNode.removeChild(e);this.show();this._init();this.hide();return Thread.Stop
}.bind(this),10);b.start()},this);a.send(this._lazyLoading.url,this._lazyLoading.parameters)
}},_init:function(){this.show();for(var a=vanilla.html.DOM.getFirstChildByTagName(this.container,"div");
a;a=vanilla.html.DOM.nextHomonym(a)){if(vanilla.html.DOM.hasClassName(a,"slide-contentContainer")){this.contentContainer=a;
break}}if(!this.contentContainer){throw new IllegalStateException("This slide has no content container")
}for(var a=vanilla.html.DOM.getFirstChildByTagName(this.contentContainer,"div");
a;a=vanilla.html.DOM.nextHomonym(a)){if(vanilla.html.DOM.hasClassName(a,"slide-content")){this.content=a;
break}}if(!this.content){throw new IllegalStateException("This slide has no content")
}this.contentContainer.style.width=this.width+"px";this.contentContainer.style.height=this.height+"px";
this.contentContainer.style.overflow="hidden";this._load();this.hide()},hide:function(){if(this.isVisible()){this.scrollTo(0,0);
this.container.style.display="none"}},show:function(){if(!this.isVisible()){this.container.style.display="block";
this.scrollTo(0,0)}},isVisible:function(){return(vanilla.html.style.get(this.container,"display")!="none")
},scrollTo:function(a,b){if(this.contentContainer){this.contentContainer.scrollLeft=a;
this.contentContainer.scrollTop=b}},getScroll:function(){return{x:this.contentContainer.scrollLeft,y:this.contentContainer.scrollTop}
}});vanilla.Class("vanilla.toolkit.slide","RichTextSlide");vanilla.toolkit.slide.RichTextSlide.Extends(vanilla.toolkit.slide.Slide);
vanilla.toolkit.slide.RichTextSlide.Prototype({loaded:false,tempo:null,RichTextSlide:function(b,a){this.Slide(b,a)
},_load:function(){var a=Arr(this.container.getElementsByTagName("img"));
if(a.length){var b=[];a.forEach(function(c){var d=new Image();d.onload=function(){b.remove(d);
if(b.isEmpty()){this.loaded=true;this.onLoad.notify()}}.bind(this);b.push(d);
d.src=c.src}.bind(this))}else{this.loaded=true;this.onLoad.notify()}},play:function(){this.show();
this.tempo=new SimpleThread(function(){this.onComplete.notify()}.bind(this),3000);
this.tempo.start()},stop:function(){if(this.tempo){this.tempo.stop()}},isPlaying:function(){return(this.tempo&&this.tempo.isAlive())
},isLoaded:function(){return this.loaded}});vanilla.Class("vanilla.toolkit.slide","ImageSlide");
vanilla.toolkit.slide.ImageSlide.Extends(vanilla.toolkit.slide.Slide);vanilla.toolkit.slide.ImageSlide.Prototype({animation:null,loaded:false,playing:false,properties:{fixedImageTime:3,slidingEnabled:true,slidingSpeed:30,slidingMinTime:2,slidingMinGap:10,timeBeforeSliding:0,timeAfterSliding:0,slidingCompleteAt:0.9},ImageSlide:function(c,a,b){this.Slide(c,a);
vanilla.extend(this.properties,b)},_load:function(){var a=Arr(this.container.getElementsByTagName("img"));
var b=[];a.forEach(function(c){var d=new Image();d.onload=function(){b.remove(d);
if(b.isEmpty()){this.loaded=true;this.onLoad.notify()}}.bind(this);b.push(d);
d.src=c.src}.bind(this))},play:function(){this.content.scrollTop=0;this.show();
if(this.properties.slidingEnabled&&this.content.scrollHeight>(this.height+this.properties.slidingMinGap)){this._startSliding()
}else{this.animation=new SimpleThread(function(){this.playing=false;this.onComplete.notify()
}.bind(this),this.properties.fixedImageTime*1000);this.playing=true;this.animation.start()
}},_startSliding:function(){var b=this.content.scrollHeight-this.height;
var c=this.properties;var a=new vanilla.animation.Animation(0,b);a.onNextValue.subscribe(function(d){if(c.timeAfterSliding<=0&&d>=(b*c.slidingCompleteAt)){this.playing=false;
this.onComplete.notify()}this.scrollTo(0,d)}.bind(this));a.onComplete.subscribe(function(){if(this.playing&&c.timeAfterSliding>0){this.animation=new SimpleThread(function(){this.playing=false;
this.onComplete.notify()}.bind(this),c.timeAfterSliding*1000);this.animation.start()
}}.bind(this));a.duration=Math.max(b*1/c.slidingSpeed,c.slidingMinTime);
if(c.timeBeforeSliding>0){this.animation=new SimpleThread(function(){this.animation=a;
a.start()}.bind(this),c.timeBeforeSliding*1000)}else{this.animation=a}this.playing=true;
this.animation.start()},stop:function(){if(this.animation){this.animation.stop()
}},isPlaying:function(){return(this.animation&&this.animation.isAlive())
},isLoaded:function(){return this.loaded}});vanilla.Class("vanilla.toolkit.slide","Image360Slide");
vanilla.toolkit.slide.Image360Slide.Extends(vanilla.toolkit.slide.Slide);
vanilla.toolkit.slide.Image360Slide.Prototype({animation:null,wait:null,loaded:false,direction:1,Image360Slide:function(b,a){this.Slide(b,a)
},_load:function(){this.img=this.content.getElementsByTagName("img")[0];
if(!this.img){throw new IllegalStateException("No image for this 360 slide")
}var a=new Image();a.onload=function(){this.imgBefore=this.img.cloneNode(true);
this.content.insertBefore(this.imgBefore,this.img);this.imgAfter=this.img.cloneNode(true);
vanilla.html.DOM.insertAfter(this.content,this.imgAfter,this.img);this.content.style.width=(this.img.width*3)+"px";
this.content.style.cursor="move";this.img.style.cssFloat="left";this.imgBefore.style.cssFloat="left";
this.imgAfter.style.cssFloat="left";this.rotateTo(0);this.dragdrop=new vanilla.toolkit.dragdrop.Draggable(this.content);
this.dragdrop.updatePosition=false;this.dragdrop.onStart.subscribe(this._onDragStart,this);
this.dragdrop.onEnd.subscribe(this._onDragEnd,this);this.dragdrop.onDrag.subscribe(this._onDrag,this);
this.loaded=true;this.onLoad.notify()}.bind(this);a.src=this.img.src},play:function(){this.show();
this.animation=new vanilla.animation.Animation(0,this.img.width*this.direction);
this.animation.onNextValue.subscribe(function(b,a){this.rotateTo(b+a)}.bind(this,this.getScroll().x));
this.animation.onComplete.subscribe(function(){this.onComplete.notify()
}.bind(this));this.animation.duration=Math.max(this.img.width*0.03,5);this.animation.start()
},stop:function(){if(this.animation){this.animation.stop()}},isPlaying:function(){return(this.animation&&this.animation.isAlive())
},isLoaded:function(){return this.loaded},rotate:function(a){this.rotateTo(a+this.getScroll().x)
},rotateTo:function(a){a%=this.img.width;this.scrollTo(this.img.width+a,0)
},_onDrag:function(a,b,c){this.previousTime=this.lastTime;this.previousPointer=this.lastPointer;
this.lastTime=new Date();this.lastPointer=c;this.rotateTo(this.startRotate-(c.x-this.startX))
},_onDragStart:function(a,b,c){this.startX=c.x;this.startRotate=this.getScroll().x;
this.previousTime=null;this.previousPointer=null;this.parent.pause();this.stop()
},_onDragEnd:function(){var c=0;if(this.lastTime&&this.previousTime){var e=this.lastTime.getTime()-this.previousTime.getTime();
c=e>0?(this.lastPointer.x-this.previousPointer.x)/e:0}this.direction=(c<=0?1:-1);
var a=function(){if(this.parent.isPausing()){this.animation=null;this.parent.play()
}}.bind(this);var d=new SimpleThread(a,1000);if(Math.abs(c)>0.2){var b=0;
this.animation=new vanilla.animation.Animation(0,1);this.animation.onNextValue.subscribe(function(g){var f=c*(1-g);
this.rotate((g-b)*300*-f);b=g}.bind(this));this.animation.onComplete.subscribe(a);
this.animation.duration=1}else{this.animation=d}this.animation.start()}});
vanilla.Abstract("vanilla.toolkit.slide","Transition");vanilla.toolkit.slide.Transition.Prototype({onComplete:null,isRunning:vanilla.lang.Class.AbstractFunction,run:vanilla.lang.Class.AbstractFunction,Transition:function(){this.onComplete=new vanilla.event.CustomEvent(this)
}});vanilla.Class("vanilla.toolkit.slide","FadingTransition");vanilla.toolkit.slide.FadingTransition.Extends(vanilla.toolkit.slide.Transition);
vanilla.toolkit.slide.FadingTransition.Prototype({animation:null,FadingTransition:function(){this.Transition()
},run:function(b,d,c,a){this._setSlideOpacity(d,100);this._setSlideOpacity(c,0);
c.show();d.container.style.zIndex=0;c.container.style.zIndex=1;this.animation=new vanilla.animation.Animation(0,100);
this.animation.onNextValue.subscribe(function(e){this._setSlideOpacity(c,e)
}.bind(this));this.animation.onComplete.subscribe(function(){d.hide();this._setSlideOpacity(c,100);
this._setSlideOpacity(d,100);this.onComplete.notify()}.bind(this));this.animation.start()
},isRunning:function(){return(this.animation&&this.animation.isAlive())
},_setSlideOpacity:function(a,b){a.container.style.filter=b==100?"none":"alpha(opacity="+b+")";
a.container.style.opacity=b/100}});vanilla.Class("vanilla.toolkit.slide","SlidingTransition");
vanilla.toolkit.slide.SlidingTransition.Extends(vanilla.toolkit.slide.Transition);
vanilla.toolkit.slide.SlidingTransition.Prototype({animation:null,SlidingTransition:function(){this.Transition()
},run:function(c,e,d,b){var a=c.content.style.width;c.content.style.width=(e.width+d.width)+"px";
if(b){e.container.style.position="relative";e.container.style.cssFloat="right";
d.container.style.position="relative";d.container.style.cssFloat="left";
c.container.scrollLeft=d.width}else{e.container.style.position="relative";
e.container.style.cssFloat="left";d.container.style.position="relative";
d.container.style.cssFloat="right"}d.show();this.animation=new vanilla.animation.Animation(b?d.width:0,b?0:e.width);
this.animation.onNextValue.subscribe(function(f){c.container.scrollLeft=f
}.bind(this));this.animation.onComplete.subscribe(function(){e.container.style.position="absolute";
e.container.style.cssFloat="none";d.container.style.position="absolute";
d.container.style.cssFloat="none";c.container.scrollLeft=0;c.content.style.width=a;
e.hide();this.onComplete.notify()}.bind(this));this.animation.start()},isRunning:function(){return(this.animation&&this.animation.isAlive())
}});vanilla.Class("vanilla.toolkit.slide","UncoveringTransition");vanilla.toolkit.slide.UncoveringTransition.Extends(vanilla.toolkit.slide.Transition);
vanilla.toolkit.slide.UncoveringTransition.Prototype({animation:null,UncoveringTransition:function(){this.Transition()
},run:function(b,d,c,a){if(a){c.container.style.left=-c.width+"px";d.container.style.zIndex=0;
c.container.style.zIndex=1}else{d.container.style.zIndex=1;c.container.style.zIndex=0
}c.show();this.animation=new vanilla.animation.Animation(a?-c.width:0,a?0:-d.width);
this.animation.duration=0.5;this.animation.onNextValue.subscribe(function(e){if(a){c.container.style.left=e+"px"
}else{d.container.style.left=e+"px"}}.bind(this));this.animation.onComplete.subscribe(function(){d.hide();
c.container.style.left="0px";c.container.style.zIndex=1;d.container.style.left="0px";
d.container.style.zIndex=1;this.onComplete.notify()}.bind(this));this.animation.start()
},isRunning:function(){return(this.animation&&this.animation.isAlive())
}});vanilla.Class("vanilla.toolkit.slide","Show");vanilla.toolkit.slide.Show.Prototype({slides:[],defaultTransition:null,currentTransition:null,transitionsBySlide:[],playing:false,pausing:false,onNextSlide:null,currentSlideIndex:-1,nextSlideIndex:-1,Show:function(b,g){this.container=EL(b);
this.container.style.overflow="hidden";this.width=this.container.clientWidth;
this.height=this.container.clientHeight;this.container.style.width=this.width+"px";
this.container.style.height=this.height+"px";this.onNextSlide=new vanilla.event.CustomEvent(this);
for(var j=vanilla.html.DOM.getFirstChildByTagName(b,"div");j;j=vanilla.html.DOM.nextHomonym(j)){if(vanilla.html.DOM.hasClassName(j,"slideshow-content")){this.content=j
}}if(!this.content){throw new IllegalStateException("This slide show has no content")
}this.content.style.width=this.width+"px";this.content.style.height=this.height+"px";
this.content.style.position="absolute";for(var f=vanilla.html.DOM.getFirstChildByTagName(this.content,"div");
f;f=vanilla.html.DOM.nextHomonym(f)){var h=vanilla.html.DOM.getClassNames(f);
if(!h.contains("slide")){continue}var e=null;for(var c=0;c<h.length;c++){if(h[c].startsWith("type-")){e=h[c].substr("type-".length);
break}}if(!e){continue}var a=g(e,this,f);if(!a){throw new IllegalStateException("No slide found for type : "+e)
}a.onComplete.subscribe(this._onSlideComplete,this,true);a.onLoad.subscribe(this._onSlideLoaded,this,true);
this.slides.push(a);a.init()}if(this.slides.length<=0){throw new IllegalStateException("This slideshow contains no slide")
}},setTransition:function(a){if(this.defaultTransition){this.defaultTransition.onComplete.unsubscribe(this._onTransitionComplete,this)
}this.defaultTransition=a;this.defaultTransition.onComplete.subscribe(this._onTransitionComplete,this,true)
},setTransitionForSlide:function(a,c){var b=this.findTransitionContainerBySlide(a);
if(b){b.transition.onComplete.unsubscribe(this._onTransitionComplete,this);
this.transitionsBySlide.remove(b)}this.transitionsBySlide.push({transition:c,slide:a});
c.onComplete.subscribe(this._onTransitionComplete,this,true)},findTransitionContainerBySlide:function(a){for(var c=0;
c<this.transitionsBySlide.length;c++){var b=this.transitionsBySlide[c];
if(b.slide==a){return b}}return null},findTransitionBySlide:function(a){var b=this.findTransitionContainerBySlide(a);
return(b?b.transition:null)},init:function(a){this.goToSlide(a)},play:function(){if(this.playing&&!this.pausing){return
}this.playing=true;this.pausing=false;if(this.currentSlideIndex<0||this.slides[this.currentSlideIndex].isPlaying()){return
}this.slides[this.currentSlideIndex].play()},pause:function(){if(this.playing&&!this.pausing){this.pausing=true;
this.slides[this.currentSlideIndex].stop()}},stop:function(){if(this.currentSlideIndex>=0){this.slides[this.currentSlideIndex].stop()
}this.pausing=false;this.playing=false},next:function(){var a=(this.currentSlideIndex+1)%this.slides.length;
this.goToSlide(a)},previous:function(){var a=this.currentSlideIndex-1;if(a<0){a=this.slides.length-1
}this.goToSlide(a)},isPlaying:function(){return this.playing},isPausing:function(){return this.pausing
},goToSlide:function(b){if(b<0||b>=this.slides.length){throw new Exception("Slide index out of bounds : 0 > "+b+" >= "+this.slides.length)
}if(this.nextSlideIndex>-1&&this.currentTransition&&this.currentTransition.isRunning()){return
}if(this.currentSlideIndex==b){return}this.nextSlideIndex=b;this.waitFor=null;
var a=this.slides[b];if(a.isLoaded()){this._playNextSlide()}else{this.waitFor=a
}},_playNextSlide:function(){if(this.playing){this.slides[this.nextSlideIndex].play()
}else{this.slides[this.nextSlideIndex].show()}if(this.currentSlideIndex>-1){var a=this.nextSlideIndex<this.currentSlideIndex;
var b=this.slides[this.nextSlideIndex];var c=this.slides[this.currentSlideIndex];
var d=a?this.findTransitionBySlide(b):this.findTransitionBySlide(c);if(!d){d=this.defaultTransition
}if(d){this.currentTransition=d;d.run(this,c,b,a);return}}this._nextSlide()
},_nextSlide:function(){if(this.currentSlideIndex>-1&&this.currentSlideIndex!=this.nextSlideIndex){this.slides[this.currentSlideIndex].stop();
this.slides[this.currentSlideIndex].hide()}this.currentSlideIndex=this.nextSlideIndex;
this.nextSlideIndex=-1;this.onNextSlide.notify(this.slides[this.currentSlideIndex])
},_onSlideLoaded:function(a){if(a.owner==this.waitFor){this.waitFor=null;
this._playNextSlide()}},_onSlideComplete:function(a){if(this.playing){this.next()
}},_onTransitionComplete:function(a){this.currentTransition=null;this._nextSlide()
}});