var _os=null,OS=Class.create({initialize:function(){this.appVersion="0";this.sources=[];this.scriptsToLoad=[];this.loadedScripts=[];this.completedScripts=[];this.completeCallbacks=[];this.scriptLoadListeners=[];this.pageLoading=true},addScriptLoadListener:function(a,b){var c={};c.callback=a;c.associatedScripts=b;this.scriptLoadListeners.push(c)},requireAll:function(a,b,c){c=c||{};c.onComplete&&this.scriptsToLoad.push(c.onComplete);if(c.extendedWatchScripts){a=c.extendedWatchScripts;for(var d=0;d<
a.length;d++)b.push(a[d])}c.scriptLoadListener&&this.addScriptLoadListener(c.scriptLoadListener,b);typeof b=="string"?this.scriptsToLoad.push(b):$A(b.reverse()).each(function(e){this.sources[e]||this.scriptsToLoad.push(e)}.bind(this));this.load()},scriptLoaded:function(a){var b=[];$A(this.scriptsToLoad).each(function(c){c!=a&&b.push(c)});this.scriptsToLoad=b;if(this.completeCallbacks[a]){this.completeCallbacks[a]();this.completeCallbacks[a]=false}$A(this.scriptLoadListeners).each(function(c){var d=
0,e=0;$A(c.associatedScripts).each(function(f){this.completedScripts[f]&&e++;d++}.bind(this));try{c.callback(e,d)}catch(g){}}.bind(this))},loadNext:function(){if(this.queueLoading){this.requireNext();setTimeout(function(){this.loadNext()}.bind(this),50)}},load:function(){if(!this.queueLoading){this.queueLoading=true;this.loadNext()}},loadComplete:function(){this.queueLoading=false},requireNext:function(){this.scriptLoadListener&&this.scriptLoadListener(this.scriptsToLoad.length);if(this.scriptsToLoad.length==
0)this.loadComplete();else{var a=this.scriptsToLoad[this.scriptsToLoad.length-1];if(typeof a=="function"){a();this.scriptsToLoad.pop();this.load()}else this.require(a,function(){this.load()}.bind(this))}},require:function(a,b){if(this.sources[a])b&&setTimeout(b,10);else{this.sources[a]=true;if(OS.Path){var c=document.getElementsByTagName("head").item(0),d=document.createElement("script");d.setAttribute("type","text/javascript");d.setAttribute("src",OS.Path()+a);c.appendChild(d);this.waitForLoadComplete(a,
b)}else _os.showMessage("Error: Unknown JsOS")}},waitForLoadComplete:function(a,b){if(this.isQueueLoading(a))setTimeout(function(){this.waitForLoadComplete(a,b)}.bind(this),10);else if(!this.completedScripts[a]){this.completedScripts[a]=true;b&&setTimeout(b,10)}},isQueueLoading:function(a){if(!this.loadedScripts[a])return true;return false},onLoadComplete:function(a){this.loadedScripts[a]=true;this.scriptLoaded(a)}});OS.Path=function(){return"../../js/slider/"};OS.Load=function(){_os=new OS;OS.OnLoadComplete()};
OS.CreateElement=function(a,b,c){if($(b)){a=document.createElement(a);b=$(b).appendChild(a);if(c)b.id=c;return b}};OS.CreateDiv=function(a,b){return OS.CreateElement("div",a,b)};OS.CreateList=function(a,b){return OS.CreateElement("ul",a,b)};OS.AddListItem=function(a,b){return OS.CreateElement("li",a,b)};OS.OnLoadComplete=function(){!Prototype||!Element?setTimeout(OS.OnLoadComplete,300):_os.onLoadComplete("os.js")};
OS.PageLoadComplete=function(){_os.pageLoading=false;$A(OS.BehaviourQueue).each(function(a){OS.ApplyBehaviour(a)});OS.BehaviourQueue=[]};Event.observe(document,"dom:loaded",function(){OS.PageLoadComplete()});OS.BehaviourQueue=[];OS.RegisterBehaviour=function(a){_os.pageLoading?OS.BehaviourQueue.push(a):OS.ApplyBehaviour(a)};OS.ApplyBehaviour=function(a){$H(a).each(function(b){$$(b.key).each(function(c){b.value(c)})})};OS.Load();