var RichJS={_builder:null,_browser:null,_platform:null,_plugins:null,_pageLoaded:false,get:function(a){return window.document.getElementById(a)},defined:function(a){return(a!==undefined)},toIntValue:function(b){var a;if(typeof(b)=="boolean"){a=(b)?1:0}else{if(typeof(b)=="string"){a=b*1;a=parseInt(b,10);if(isNaN(a)||!isFinite(a)){a=0}}else{if(typeof(b)=="number"){a=b}else{a=0}}}return a},toFloatValue:function(b){var a;if(typeof(b)=="boolean"){a=(b)?1:0}else{if(typeof(b)=="string"){a=b*1;a=parseFloat(b,10);if(isNaN(a)||!isFinite(a)){a=0}}else{if(typeof(b)=="number"){a=b}else{a=0}}}return a},getType:function(a){if(!RichJS.defined(a)){return"undefined"}else{if(a===null){return"null"}else{if(typeof(a)==="object"&&a.constructor===Array){return"array"}else{if(typeof(a)==="object"&&a.constructor===RegExp){return"regexp"}else{if(RichJS.defined(a._RichJSType)){return a._RichJSType}else{if(RichJS.defined(a.nodeName)){switch(a.nodeType){case 1:return"element";case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace"}}else{return typeof(a)}}}}}}},isArray:function(a){return(RichJS.getType(a)==="array")},isBoolean:function(a){return(RichJS.getType(a)==="boolean")},isHTMLElement:function(a){return(RichJS.getType(a)==="element")},isFunction:function(a){return(RichJS.getType(a)==="function")},isNumber:function(a){return(RichJS.getType(a)==="number")},isRegExp:function(a){return(RichJS.getType(a)==="regexp")},isString:function(a){return(RichJS.getType(a)==="string")},isNull:function(a){return(a===null)},isTypeOf:function(object,searchedType,searchParents){if(object===undefined){return false}if(RichJS.getType(object).toLowerCase()===searchedType.toLowerCase()){return true}else{if(searchParents===true){if(RichJS.defined(object._RichJSExtends)){var parentClass=eval(object._RichJSExtends);var obj;if(RichJS.isFunction(parentClass)&&RichJS.defined(parentClass.prototype)){obj=parentClass.prototype}else{obj=parentClass}return RichJS.isTypeOf(obj,searchedType)}}}return false},getBuilder:function(){if(RichJS._builder===null){RichJS._builder=new richjs.core.Builder()}return RichJS._builder},addClassPath:function(b,a){a=(RichJS.defined(a))?a:richjs.core.Builder.DEFAULT_CLASSPATH_PREFIX;RichJS.getBuilder().addClassPath(b,a)},importClass:function(b,a){a=(RichJS.defined(a))?a:null;RichJS._builder.importClass(b,a)},getBrowser:function(){if(RichJS._browser===null){RichJS._browser=new richjs.core.Browser()}return RichJS._browser},getPlatform:function(){if(RichJS._platform===null){RichJS._platform=new richjs.core.Platform()}return RichJS._platform},getPlugins:function(){if(RichJS._plugins===null){RichJS._plugins=new richjs.core.Plugins()}return RichJS._plugins},setPageLoaded:function(a){RichJS._pageLoaded=a},isPageLoaded:function(){return RichJS._pageLoaded}};richjs={};richjs.core={};richjs.core.Browser=function(){if(window.opera){var e=(arguments.callee.caller);var b=(window.document.getElementsByClassName);this._engine="presto";this._version=((e)?960:((b)?950:925))}else{if(window.ActiveXObject){var a=(window.document.querySelectorAll);this._engine="trident";this._version=((window.XMLHttpRequest)?((a)?6:5):4)}else{if(!window.navigator.taintEnabled){var c=!!(window.document.evaluate);var d=!!(window.document.querySelector);this._engine="webkit";this._version=((c)?((d)?525:420):419)}else{if(window.document.getBoxObjectFor!=null||typeof(window.mozInnerScreenX)!="undefined"){this._engine="gecko";this._version=(window.document.getElementsByClassName)?19:18;if(window.document.getBoxObjectFor==null){this._version=20}}}}}};richjs.core.Browser.prototype={_engine:"",_version:"",isGecko:function(){return this._engine==="gecko"},isTrident:function(){return this._engine==="trident"},isInternetExplorer6:function(){return(this.isTrident()&&this._version===4)},isInternetExplorer7:function(){return(this.isTrident()&&this._version===5)},isInternetExplorer8:function(){return(this.isTrident()&&this._version===6)},isPresto:function(){return this._engine==="presto"},isOpera925:function(){return(this.isPresto()&&this._version===925)},isOpera950:function(){return(this.isPresto()&&this._version===950)},isOpera960:function(){return(this.isPresto()&&this._version===960)},isWebkit:function(){return this._engine==="webkit"},isSafari2:function(){return(this.isWebkit()&&this._version===419)},isSafari3:function(){return(this.isWebkit()&&this._version===420)}};richjs.core.Builder=function(){this._importedClasses=new richjs.core.List();this._classPathes=new richjs.core.HashMap();this._importQueues=[]};richjs.core.Builder.DEFAULT_CLASSPATH_PREFIX="*";richjs.core.Builder.prototype={_RichJSExtends:"richjs.core.EventDispatcher",_classPathes:null,_importedClasses:null,_importQueues:null,_currentImportQueue:null,_currentImportQueueIterator:null,_currentLoadingClass:null,_isLoading:false,_loadingClassChilds:null,addClassPath:function(b,a){a=(RichJS.defined(a))?a:richjs.core.Builder.DEFAULT_CLASSPATH_PREFIX;this._classPathes.set(a,b)},getClassPath:function(a){var d=this._classPathes.keyIterator();while(d.hasNext()){var c=d.next();if(a.indexOf(c)==0){return this._classPathes.get(c)}}var b=this._classPathes.get(richjs.core.Builder.DEFAULT_CLASSPATH_PREFIX);if(!RichJS.isNull(b)){return b}return""},importClass:function(c,b){var a=(!RichJS.isNull(b));var d;if(!a){if(RichJS.isNull(this._currentImportQueue)){d=new richjs.core.ImportQueue();this._importQueues.push(d);this._currentImportQueue=d;this._currentImportQueueIterator=d.getClassesList().iterator()}d=this._currentImportQueue;d.addClass(c)}else{d=new richjs.core.ImportQueue();this._importQueues.push(d);d.addClass(c);d.setOnloadListener(b);if(RichJS.isNull(this._currentImportQueue)){this._currentImportQueue=d;this._currentImportQueueIterator=d.getClassesList().iterator()}}if(!this._isLoading){this._processLoading()}},prepareLoading:function(a){this._buildPackage(a);this._saveClassChilds(a)},computeClass:function(a){this._setClassType(a);this._restoreClassChilds(a);this._importedClasses.add(a)},_buildPackage:function(className){var objects=className.split(".");var tree="";for(var i=0;i<objects.length;i++){tree+=(tree!="")?".":"";tree+=objects[i];if(eval("typeof ("+tree+') == "undefined"')){eval(tree+" = new Object()")}}},_saveClassChilds:function(className){this._loadingClassChilds={};var classObject=eval(className);for(var obj in classObject){this._loadingClassChilds[obj]=classObject[obj]}},_restoreClassChilds:function(className){var classObject=eval(className);for(var obj in this._loadingClassChilds){classObject[obj]=this._loadingClassChilds[obj]}this._loadingClassChilds=null},_setClassType:function(className){var classObject=eval(className);if(RichJS.isFunction(classObject)){if(!RichJS.defined(classObject.prototype)){classObject.prototype={}}classObject.prototype._RichJSType=className}else{classObject._RichJSType=className}},_buildClassExtends:function(childClassName){var childClassObj=eval(childClassName);var parentClassName=this._getParentClassName(childClassObj);if(!RichJS.isNull(parentClassName)){var parentClassObj=eval(parentClassName);this._extendsProperties(childClassObj,parentClassObj)}},_extendsProperties:function(targetObject,sourceObject){for(var property in sourceObject){if(!RichJS.defined(targetObject[property])){targetObject[property]=sourceObject[property]}}if(RichJS.defined(sourceObject.prototype)){for(var pproperty in sourceObject.prototype){if(!RichJS.defined(targetObject.prototype[pproperty])||targetObject.prototype[pproperty]===Object.prototype[pproperty]){targetObject.prototype[pproperty]=sourceObject.prototype[pproperty]}}}var targetParentClassName=this._getParentClassName(sourceObject);if(targetParentClassName!==null){var targetParentClassObj=eval(targetParentClassName);this._extendsProperties(targetObject,targetParentClassObj)}},_getParentClassName:function(className){var classObject=eval(className);if(RichJS.defined(classObject._RichJSExtends)){return classObject._RichJSExtends}else{if(RichJS.defined(classObject.prototype)&&RichJS.defined(classObject.prototype._RichJSExtends)){return classObject.prototype._RichJSExtends}}return null},_processLoading:function(){if(this._currentImportQueueIterator.hasNext()){this._currentLoadingClass=this._currentImportQueueIterator.next();if(!this._importedClasses.contains(this._currentLoadingClass)){this._isLoading=true;var a=new richjs.core.ImportEvent(richjs.core.ImportEvent.COMPONENT_LOADING,this._currentLoadingClass);this.dispatchEvent(a);this.prepareLoading(this._currentLoadingClass);var e=window.document.createElement("script");e.setAttribute("type","text/javascript");if(RichJS.getBrowser().isTrident()){e.onreadystatechange=function(){if(this.readyState==="loaded"||this.readyState==="complete"){var i=RichJS.getBuilder();i.computeClass(i._currentLoadingClass);var h=new richjs.core.ImportEvent(richjs.core.ImportEvent.COMPONENT_LOADED,i._currentLoadingClass);i.dispatchEvent(h);this.onreadystatechange=null;window.document.getElementsByTagName("head")[0].removeChild(this);i._processLoading()}}}else{e.onload=function(){var i=RichJS.getBuilder();i.computeClass(i._currentLoadingClass);var h=new richjs.core.ImportEvent(richjs.core.ImportEvent.COMPONENT_LOADED,i._currentLoadingClass);i.dispatchEvent(h);this.onreadystatechange=null;window.document.getElementsByTagName("head")[0].removeChild(this);i._processLoading()}}e.setAttribute("src",this.getClassPath(this._currentLoadingClass)+this._currentLoadingClass.split(".").join("/")+".js");window.document.getElementsByTagName("head")[0].appendChild(e)}else{this._processLoading()}}else{var g=this._currentImportQueue;var c=g.getClassesList().iterator();while(c.hasNext()){this._buildClassExtends(c.next())}var f=g.getOnloadListener();this._importQueues.shift();if(this._importQueues.length>0){this._currentImportQueue=this._importQueues[0];this._currentImportQueueIterator=this._currentImportQueue.getClassesList().iterator()}else{this._currentImportQueue=null;this._currentImportQueueIterator=null}if(!RichJS.isNull(f)){var d=g.getClassesList().get(0);var b=function(){var h=new richjs.core.ImportEvent(richjs.core.ImportEvent.COMPONENT_CALLBACK,d);RichJS.getBuilder().dispatchEvent(h);f.execute(h)};if(RichJS.isPageLoaded()){b.call(window)}else{if(window.addEventListener){window.addEventListener("load",b,false)}else{if(window.document.addEventListener){window.document.addEventListener("load",b,false)}else{if(window.attachEvent){window.attachEvent("onload",b)}}}}}if(!RichJS.isNull(this._currentImportQueue)){this._processLoading()}else{this._isLoading=false}}}};richjs.core.Event=function(a){this.type=a};richjs.core.Event.prototype={type:"",_continuePropagation:true,stopPropagation:function(){this._continuePropagation=false},hasToContinuePropagation:function(){return this._continuePropagation}};richjs.core.EventDispatcher=function(){};richjs.core.EventDispatcher.GLOBAL_EVENT_TYPE="onEventDispatched";richjs.core.EventDispatcher.prototype={_listeners:null,addEventListener:function(c,d){if(RichJS.isNull(this._listeners)){this._listeners=new richjs.core.HashMap()}if(!this._listeners.containsKey(c)){this._listeners.set(c,new Array())}var e=this._listeners.get(c);var a=0;if(e.length>0){for(var b=0;b<e.length;b++){if(e[b].getPriority()>d.getPriority()){a=b;break}}}e.splice(a,0,d)},removeEventListener:function(c,d){if(!RichJS.isNull(this._listeners)&&this._listeners.containsKey(c)){var b=this._listeners.get(c);for(var a=0;a<b.length;a++){if(b[a].equals(d)){b.splice(a,a+1);return true}}}return false},removeAllEventListeners:function(){this._listeners.clear()},removeAllEventListenersFromType:function(a){if(!RichJS.isNull(this._listeners)&&this._listeners.containsKey(a)){this._listeners.remove(a)}},dispatchEvent:function(a){if(!RichJS.isNull(this._listeners)&&this._listeners.containsKey(a.type)){var d=this._listeners.get(a.type);for(var c=0;c<d.length;c++){if(a.hasToContinuePropagation()){d[c].execute(a)}else{break}}}var b=richjs.core.EventDispatcher.GLOBAL_EVENT_TYPE;if(!RichJS.isNull(this._listeners)&&this._listeners.containsKey(b)){var d=this._listeners.get(b);for(var c=0;c<d.length;c++){if(a.hasToContinuePropagation()){d[c].execute(a)}else{break}}}}};richjs.core.HashMap=function(){this._keys=new richjs.core.List();this._values=new richjs.core.List()};richjs.core.HashMap.prototype={_length:0,_keys:null,_values:null,clear:function(){this._length=0;this._keys.clear();this._values.clear()},clone:function(){var b=new richjs.core.HashMap();for(var a=0;a<this._length;a++){b.set(this._keys.get(a),this._values.get(a))}return b},containsKey:function(a){return this._keys.contains(a)},containsValue:function(a){return this._values.contains(a)},foreach:function(b,a){a=(RichJS.defined(a))?a:window;for(var c=0;c<this._length;c++){b.call(a,this._keys[c],this._values[c])}},get:function(b){var a=this._indexOfKey(b);if(a!=-1){return this._values.get(a)}return null},isEmpty:function(){return this._length==0},size:function(){return this._length},remove:function(b){var a=this._indexOfKey(b);if(a!=-1){this._keys.remove(a);this._values.remove(a);this._length--;return true}return false},set:function(b,c){var a=this._indexOfKey(b);if(a!=-1){this._values.set(a,c)}else{this._keys.set(this._length,b);this._values.set(this._length,c);this._length++}},keyIterator:function(){return this._keys.iterator()},valuesIterator:function(){return this._values.iterator()},_indexOfKey:function(b){for(var a=0;a<this._length;a++){if(this._keys.get(a)===b){return a}}return -1}};richjs.core.ImportEvent=function(b,a){richjs.core.Event.call(this,b);this.componentName=a};richjs.core.ImportEvent.COMPONENT_LOADED="onComponentLoaded";richjs.core.ImportEvent.COMPONENT_LOADING="onComponentLoading";richjs.core.ImportEvent.COMPONENT_CALLBACK="onComponentCallback";richjs.core.ImportEvent.prototype={_RichJSExtends:"richjs.core.Event",componentName:null};richjs.core.ImportQueue=function(){this._classes=new richjs.core.List()};richjs.core.ImportQueue.prototype={_classes:null,_onloadListener:null,addClass:function(a){this._classes.add(a)},getClassesList:function(){return this._classes},setOnloadListener:function(a){this._onloadListener=a},getOnloadListener:function(){return this._onloadListener}};richjs.core.Iterator=function(a){this._list=a};richjs.core.Iterator.prototype={_list:null,_pointer:-1,hasNext:function(){return(this._getNextItemIndex()!==-1)},next:function(){var a=this._getNextItemIndex();this._pointer=a;return this._list[this._pointer]},_getNextItemIndex:function(){var b=this._list.length;for(var a=this._pointer+1;a<b;a++){if(RichJS.defined(this._list[a])){return a}}return -1}};richjs.core.List=function(){this._items=new Array()};richjs.core.List.prototype={_length:0,_items:null,clear:function(){this._length=0;this._items=new Array()},clone:function(){var b=new richjs.core.List();for(var a=0;a<this._length;a++){b.set(a,this._items[a])}return b},contains:function(a){return this.indexOf(a)!==-1},get:function(a){if(RichJS.defined(this._items[a])){return this._items[a]}return null},isEmpty:function(){return this._length==0},indexOf:function(b){for(var a=0;a<this._length;a++){if(this._items[a]===b){return a}}return -1},lastIndexOf:function(b){for(var a=this._length-1;a>=0;a--){if(this._items[a]===b){return a}}return -1},size:function(){return this._length},remove:function(a){if(RichJS.defined(this._items[a])){delete (this._items[a]);this._length--;return true}return false},add:function(a){this._length++;this._items.push(a)},set:function(a,b){if(!RichJS.defined(this._items[a])){this._length++}this._items[a]=b},iterator:function(){return new richjs.core.Iterator(this._items)}};richjs.core.Listener=function(a,c,b){this._fct=a;this._thisObj=(RichJS.defined(c))?c:window;this._priority=(RichJS.defined(b))?b:0};richjs.core.Listener.prototype={_fct:null,_thisObj:null,_priority:0,execute:function(a){this._fct.call(this._thisObj,a)},getFunction:function(){return this._fct},getThisObj:function(){return this._thisObj},getPriority:function(){return this._priority},equals:function(c){var a=(c.getFunction()===this._fct);var b=(c.getThisObj()===this._thisObj);var d=(c.getPriority()===this._priority);return(a&&b&&d)}};richjs.core.Platform=function(){if(window.navigator.platform.match(/linux/i)){this._name="linux"}else{if(window.navigator.platform.match(/mac/i)){this._name="macos"}else{if(window.navigator.platform.match(/win/i)){this._name="windows"}}}};richjs.core.Platform.prototype={_name:"",hasOrientation:function(){return(RichJS.defined(window.orientation))},isLinux:function(){return(this._name==="linux")},isMacOS:function(){return(this._name==="macos")},isWindows:function(){return(this._name==="windows")},getScreenHeight:function(){return window.screen.height},getScreenWidth:function(){return window.screen.width}};richjs.core.Plugins=function(){this._detectFlashPlugin()};richjs.core.Plugins.prototype={_flashVersion:"",flashBuild:"",_detectFlashPlugin:function(){var a="";if(window.ActiveXObject){try{a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(b){}}else{try{a=navigator.plugins["Shockwave Flash"].description}catch(b){}}if(a!==""){var c=a.match(/\d+/g);this._flashVersion=c[0]+"."+c[1];this._flashBuild=c[2]}},isFlashEnabled:function(){return(this._flashVersion!==""&&this._flashBuild!=="")},getFlashVersion:function(){return this._flashVersion},getFlashBuild:function(){return this._flashBuild},isJavaEnabled:function(){return window.navigator.javaEnabled()}};(function(){var a=["richjs.core.Browser","richjs.core.Builder","richjs.core.Event","richjs.core.EventDispatcher","richjs.core.HashMap","richjs.core.ImportEvent","richjs.core.ImportQueue","richjs.core.Iterator","richjs.core.List","richjs.core.Listener","richjs.core.Platform","richjs.core.Plugins"];for(var c=0;c<a.length;c++){var d=a[c];var b=RichJS.getBuilder();b._setClassType(d);b._importedClasses.add(d);b._buildClassExtends(d)}})();(function(){if(window.addEventListener){window.addEventListener("load",function(){RichJS.setPageLoaded(true)},false)}else{if(window.document.addEventListener){window.document.addEventListener("load",function(){RichJS.setPageLoaded(true)},false)}else{if(attachEvent){attachEvent("onload",function(){RichJS.setPageLoaded(true)})}}}})();
