var FlowerDebug=new Class({debug:0,flowerCore:false,setFlowerCore:function(b){this.flowerCore=b;this.debug=this.flowerCore.debug;if(typeof(a)!="object"){var a={}}if(!a.log){a.log=function(){}}if(!a.warn){a.warn=a.log}if(!a.error){a.error=a.warn}},debugMsg:function(b,d){if(this.debug){var a="",c;b=b+0;if(this.flowerCore&&this.name){a="["+this.name+"] "}c=["Flower Error: ","Flower Warning: ","Flower Notice: "];switch(b){case 0:console.error(c[b]+a+d);break;case 1:console.warn(c[b]+a+d);break;default:console.log(c[b]+a+d)}}},debugLoadMsg:function(){if(this.debug){var a="Flower Module Loaded: "+this.name+" (v"+this.version+")",b=this.listAllOptions();if(b){a+="\n\tOptions:\n\t"+b}console.log(a.replace(/, /g,"\n\t"))}},listAllOptions:function(){if(!this.donotdebugoptions){var b="",a="",c="";$H(this.options).each(function(e,d){if(typeof(e)=="string"){c="'"}b+=a+d+" = "+c+e+c;a=", ";c=""});if(b){return b}else{return false}}else{return false}}});var FlowerCore=new Class({Implements:[Options,Events,FlowerDebug],options:{debug:0,autoBoot:0,timeout:500},initialize:function(a){this.setOptions(a);this.name="Flower";this.version=1;this.modules=$H();this.commonCache=$H();this.injectedFiles=[];this.debug=0; this.timeout=this.options.timeout;this.documenthead=$$("head")[0];var b=this.documenthead.getElement("script[src*=flower_core.js]");if(b){var c=b.getProperty("src");this.libpath=c.substring(0,c.lastIndexOf("/")+1)}$$("*.ifjs_visibilityhidden","div.flower_soundplayer").each(function(e){e.setStyle("visibility","hidden")});$$("*.ifjs_visibilityvisible").each(function(e){e.setStyle("visibility","visible")});$$("*.ifjs_displaynone").each(function(e){e.setStyle("display","none")});$$("*.ifjs_displayblock").each(function(e){e.setStyle("display","block")});$$("*.ifjs_displayinline").each(function(e){e.setStyle("display","inline")});this.defineLibrary();if(this.options.autoBoot){this.bootstrap()}if(this.options.debug&&typeof(console)!="undefined"){this.debug=1;var d=this.listAllOptions();if(this.libpath){console.log("Flower (v"+this.version+") loaded.\n\tPath: '"+this.libpath+"'\n\tMooTools version: "+MooTools.version+"\n\tOptions: "+d)}else{console.log("Flower loaded with errors. Version: "+this.version+' Path unknown. Please make sure the flower core JS file is named "flower_core.js"\n\tOptions: '+d)}}},injectScript:function(a,b){var c;if(b){a=this.libpath+a}if(this.injectedFiles.indexOf(a)==-1){c=new Element("script",{type:"text/javascript",src:a}).injectInside(this.documenthead); this.injectedFiles.push(a)}},htmlContentChanged:function(a){this.allModulesAutoAttach(a);this.fireEvent("htmlChanged",a)},storeModule:function(c,b,g,f,e,a){var d={path:c,dependencies:g,autoLaunch:f,attach:e,relativePath:a,pointer:null,options:null};this.modules.set(b,d)},loadModule:function(a){var c=this.modules.get(a),b;if(c){if(c.pointer===null){if(c.dependencies){b=$A(c.dependencies.split(","));b.each(function(d){if(this.modules.get(d).pointer===null){this.loadModule(d)}}.bind(this));this.loadAfterDependencies(a,b,0)}else{this.injectScript(c.path,c.relativePath)}}else{this.debugMsg(2,"requested module ('"+a+"') already loaded");return false}}else{this.debugMsg(0,"requested module ('"+a+"') is not defined, cannot load");return false}},loadAfterDependencies:function(c,h,f){var b=h.length,g=0,a,e,d;h.each(function(i){if(this.modules.get(i).pointer){g++}}.bind(this));if(g0){if(!d){$$(a).each(function(f){c.pointer.attachToElement(f)})}else{a.each(function(f){document.id(d).getElements(f).each(function(g){c.pointer.attachToElement(g)})})}}}},allModulesAutoAttach:function(a){this.modules.each(function(c,b){if(c.autoLaunch&&c.pointer){if(!a){this.moduleAutoAttach(b)}else{this.moduleAutoAttach(b,a)}}}.bind(this))},registerModule:function(d,c,a){d.implement(new FlowerDebug()); var b=this.getModuleOptions(c),e;if(b){e=new d(b)}else{e=new d()}e.setFlowerCore(this);if(a==true){return e}else{this.moduleCallback(e)}},bootstrap:function(){var b=[],a;this.modules.each(function(d,c){if(d.autoLaunch&&!d.pointer){a=$A(d.autoLaunch.split(","));if($$(a).length>0){this.loadModule(c);b.push(c)}}}.bind(this));if(b.length>0){this.debugMsg(2,"boot started, attempting to load necessary modules:"+b.join("\n\t"))}this.checkBootStatus(b,0)},checkBootStatus:function(a,d){if(a.length==0){this.fireEvent("bootComplete",true)}else{var f=a.length,e=0,b,c;a.each(function(g){if(this.modules.get(g).pointer){e++}}.bind(this));if(e