var MooTools={version:"1.11"};function $defined(a){return a!=undefined} function $type(a){if(!$defined(a))return false;if(a.htmlElement)return"element";var b=typeof a;if(b=="object"&&a.nodeName)switch(a.nodeType){case 1:return"element";case 3:return/\S/.test(a.nodeValue)?"textnode":"whitespace"}if(b=="object"||b=="function"){switch(a.constructor){case Array:return"array";case RegExp:return"regexp";case Class:return"class"}if(typeof a.length=="number"){if(a.item)return"collection";if(a.callee)return"arguments"}}return b} function $merge(){for(var a={},b=0;b-1:this.indexOf(a)>-1},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")}}); Array.extend({rgbToHex:function(a){if(this.length<3)return false;if(this.length==4&&this[3]==0&&!a)return"transparent";for(var b=[],c=0;c<3;c++){var d=(this[c]-0).toString(16);b.push(d.length==1?"0"+d:d)}return a?b:"#"+b.join("")},hexToRgb:function(a){if(this.length!=3)return false;for(var b=[],c=0;c<3;c++)b.push(parseInt(this[c].length==1?this[c]+this[c]:this[c],16));return a?b:"rgb("+b.join(",")+")"}}); Function.extend({create:function(a){var b=this;a=$merge({bind:b,event:false,arguments:null,delay:false,periodical:false,attempt:false},a);if($chk(a.arguments)&&$type(a.arguments)!="array")a.arguments=[a.arguments];return function(c){var d;if(a.event){c=c||window.event;d=[a.event===true?c:new a.event(c)];a.arguments&&d.extend(a.arguments)}else d=a.arguments||arguments;function f(){return b.apply($pick(a.bind,b),d)}if(a.delay)return setTimeout(f,a.delay);if(a.periodical)return setInterval(f,a.periodical); if(a.attempt)try{return f()}catch(g){return false}return f()}},pass:function(a,b){return this.create({arguments:a,bind:b})},attempt:function(a,b){return this.create({arguments:a,bind:b,attempt:true})()},bind:function(a,b){return this.create({bind:a,arguments:b})},bindAsEventListener:function(a,b){return this.create({bind:a,event:true,arguments:b})},delay:function(a,b,c){return this.create({delay:a,bind:b,arguments:c})()},periodical:function(a,b,c){return this.create({periodical:a,bind:b,arguments:c})()}}); Number.extend({toInt:function(){return parseInt(this)},toFloat:function(){return parseFloat(this)},limit:function(a,b){return Math.min(b,Math.max(a,this))},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a},times:function(a){for(var b=0;b"}a=document.createElement(a)}a=$(a);return!b||!a?a:a.set(b)}}),Elements=new Class({initialize:function(a){return a?$extend(a,this):this}});Elements.extend=function(a){for(var b in a){this.prototype[b]=a[b];this[b]=$native.generic(b)}}; function $(a){if(!a)return null;if(a.htmlElement)return Garbage.collect(a);if([window,document].contains(a))return a;var b=$type(a);if(b=="string")b=(a=document.getElementById(a))?"element":false;if(b!="element")return null;if(a.htmlElement)return Garbage.collect(a);if(["object","embed"].contains(a.tagName.toLowerCase()))return a;$extend(a,Element.prototype);a.htmlElement=function(){};return Garbage.collect(a)}document.getElementsBySelector=document.getElementsByTagName; function $$(){for(var a=[],b=0,c=arguments.length;b0&&a<13)this.key="f"+a}this.key=this.key||String.fromCharCode(this.code).toLowerCase()}else if(this.type.test(/(click|mouse|menu)/)){this.page={x:a.pageX||a.clientX+document.documentElement.scrollLeft,y:a.pageY||a.clientY+document.documentElement.scrollTop};this.client={x:a.pageX?a.pageX-window.pageXOffset:a.clientX,y:a.pageY?a.pageY-window.pageYOffset:a.clientY};this.rightClick=a.which==3||a.button==2;switch(this.type){case "mouseover":this.relatedTarget= a.relatedTarget||a.fromElement;break;case "mouseout":this.relatedTarget=a.relatedTarget||a.toElement}this.fixRelatedTarget()}return this},stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation)this.event.stopPropagation();else this.event.cancelBubble=true;return this},preventDefault:function(){if(this.event.preventDefault)this.event.preventDefault();else this.event.returnValue=false;return this}}); Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3)this.relatedTarget=this.relatedTarget.parentNode},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this)}catch(a){this.relatedTarget=this.target}}};Event.prototype.fixRelatedTarget=window.gecko?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46}); Element.Methods.Events={addEvent:function(a,b){this.$events=this.$events||{};this.$events[a]=this.$events[a]||{keys:[],values:[]};if(this.$events[a].keys.contains(b))return this;this.$events[a].keys.push(b);var c=a,d=Element.Events[a];if(d){d.add&&d.add.call(this,b);if(d.map)b=d.map;if(d.type)c=d.type}this.addEventListener||(b=b.create({bind:this,event:true}));this.$events[a].values.push(b);return Element.NativeEvents.contains(c)?this.addListener(c,b):this},removeEvent:function(a,b){if(!this.$events|| !this.$events[a])return this;var c=this.$events[a].keys.indexOf(b);if(c==-1)return this;var d=this.$events[a].keys.splice(c,1)[0];c=this.$events[a].values.splice(c,1)[0];if(d=Element.Events[a]){d.remove&&d.remove.call(this,b);if(d.type)a=d.type}return Element.NativeEvents.contains(a)?this.removeListener(a,c):this},addEvents:function(a){return Element.setMany(this,"addEvent",a)},removeEvents:function(a){if(!this.$events)return this;if(a){if(this.$events[a]){this.$events[a].keys.each(function(c){this.removeEvent(a, c)},this);this.$events[a]=null}}else{for(var b in this.$events)this.removeEvents(b);this.$events=null}return this},fireEvent:function(a,b,c){this.$events&&this.$events[a]&&this.$events[a].keys.each(function(d){d.create({bind:this,delay:c,arguments:b})()},this);return this},cloneEvents:function(a,b){if(!a.$events)return this;if(b)a.$events[b]&&a.$events[b].keys.each(function(d){this.addEvent(b,d)},this);else for(var c in a.$events)this.cloneEvents(a,c);return this}};window.extend(Element.Methods.Events); document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({mouseenter:{type:"mouseover",map:function(a){a=new Event(a);a.relatedTarget!=this&&!this.hasChild(a.relatedTarget)&&this.fireEvent("mouseenter",a)}},mouseleave:{type:"mouseout",map:function(a){a=new Event(a);a.relatedTarget!=this&&!this.hasChild(a.relatedTarget)&&this.fireEvent("mouseleave",a)}},mousewheel:{type:window.gecko?"DOMMouseScroll":"mousewheel"}}); Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];Function.extend({bindWithEvent:function(a,b){return this.create({bind:a,arguments:b,event:Event})}}); Elements.extend({filterByTag:function(a){return new Elements(this.filter(function(b){return Element.getTag(b)==a}))},filterByClass:function(a,b){var c=this.filter(function(d){return d.className&&d.className.contains(a," ")});return b?c:new Elements(c)},filterById:function(a,b){var c=this.filter(function(d){return d.id==a});return b?c:new Elements(c)},filterByAttribute:function(a,b,c,d){var f=this.filter(function(g){g=Element.getProperty(g,a);if(!g)return false;if(!b)return true;switch(b){case "=":return g== c;case "*=":return g.contains(c);case "^=":return g.substr(0,c.length)==c;case "$=":return g.substr(g.length-c.length)==c;case "!=":return g!=c;case "~=":return g.contains(c," ")}return false});return d?f:new Elements(f)}});function $E(a,b){return($(b)||document).getElement(a)}function $ES(a,b){return($(b)||document).getElementsBySelector(a)} $$.shared={regexp:/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,xpath:{getParam:function(a,b,c,d){b=[b.namespaceURI?"xhtml:":"",c[1]];c[2]&&b.push('[@id="',c[2],'"]');c[3]&&b.push('[contains(concat(" ", @class, " "), " ',c[3],' ")]');if(c[4])if(c[5]&&c[6])switch(c[5]){case "*=":b.push("[contains(@",c[4],', "',c[6],'")]');break;case "^=":b.push("[starts-with(@",c[4],', "',c[6],'")]');break;case "$=":b.push("[substring(@",c[4],", string-length(@",c[4],") - ", c[6].length,' + 1) = "',c[6],'"]');break;case "=":b.push("[@",c[4],'="',c[6],'"]');break;case "!=":b.push("[@",c[4],'!="',c[6],'"]')}else b.push("[@",c[4],"]");a.push(b.join(""));return a},getItems:function(a,b,c){var d=[];a=document.evaluate(".//"+a.join("//"),b,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);b=0;for(var f=a.snapshotLength;b<\/script>');$("ie_ready").onreadystatechange=function(){this.readyState=="complete"&&b()}}}else{window.addListener("load",b);document.addListener("DOMContentLoaded",b)}}}};window.onDomReady=function(a){return this.addEvent("domready",a)}; window.extend({getWidth:function(){if(this.webkit419)return this.innerWidth;if(this.opera)return document.body.clientWidth;return document.documentElement.clientWidth},getHeight:function(){if(this.webkit419)return this.innerHeight;if(this.opera)return document.body.clientHeight;return document.documentElement.clientHeight},getScrollWidth:function(){if(this.ie)return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth);if(this.webkit)return document.body.scrollWidth; return document.documentElement.scrollWidth},getScrollHeight:function(){if(this.ie)return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight);if(this.webkit)return document.body.scrollHeight;return document.documentElement.scrollHeight},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop},getSize:function(){return{size:{x:this.getWidth(),y:this.getHeight()}, scrollSize:{x:this.getScrollWidth(),y:this.getScrollHeight()},scroll:{x:this.getScrollLeft(),y:this.getScrollTop()}}},getPosition:function(){return{x:0,y:0}}});var Fx={}; Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(a){return-(Math.cos(Math.PI*a)-1)/2},duration:500,unit:"px",wait:true,fps:50},initialize:function(a){this.element=this.element||null;this.setOptions(a);this.options.initialize&&this.options.initialize.call(this)},step:function(){var a=$time();if(a=(7-4*c)/11){b=-Math.pow((11-6*c-11*a)/4,2)+d*d;break}return b},Elastic:function(a,b){return Math.pow(2,10*--a)*Math.cos(20*a*Math.PI*(b[0]||1)/3)}}); ["Quad","Cubic","Quart","Quint"].each(function(a,b){Fx.Transitions[a]=new Fx.Transition(function(c){return Math.pow(c,[b+2])});Fx.Transitions.compat(a)});var Drag={}; Drag.Base=new Class({options:{handle:false,unit:"px",onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:"left",y:"top"},grid:false,snap:6},initialize:function(a,b){this.setOptions(b);this.element=$(a);this.handle=$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.bound={start:this.start.bindWithEvent(this),check:this.check.bindWithEvent(this),drag:this.drag.bindWithEvent(this), stop:this.stop.bind(this)};this.attach();this.options.initialize&&this.options.initialize.call(this)},attach:function(){this.handle.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handle.removeEvent("mousedown",this.bound.start);return this},start:function(a){this.fireEvent("onBeforeStart",this.element);this.mouse.start=a.page;var b=this.options.limit;this.limit={x:[],y:[]};for(var c in this.options.modifiers)if(this.options.modifiers[c]){this.value.now[c]=this.element.getStyle(this.options.modifiers[c]).toInt(); this.mouse.pos[c]=a.page[c]-this.value.now[c];if(b&&b[c])for(var d=0;d<2;d++)if($chk(b[c][d]))this.limit[c][d]=$type(b[c][d])=="function"?b[c][d]():b[c][d]}if($type(this.options.grid)=="number")this.options.grid={x:this.options.grid,y:this.options.grid};document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);this.fireEvent("onStart",this.element);a.stop()},check:function(a){var b=Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y- this.mouse.start.y,2)));if(b>this.options.snap){document.removeListener("mousemove",this.bound.check);document.addListener("mousemove",this.bound.drag);this.drag(a);this.fireEvent("onSnap",this.element)}a.stop()},drag:function(a){this.out=false;this.mouse.now=a.page;for(var b in this.options.modifiers)if(this.options.modifiers[b]){this.value.now[b]=this.mouse.now[b]-this.mouse.pos[b];if(this.limit[b])if($chk(this.limit[b][1])&&this.value.now[b]>this.limit[b][1]){this.value.now[b]=this.limit[b][1]; this.out=true}else if($chk(this.limit[b][0])&&this.value.now[b]a.left&&b.xa.top},stop:function(){this.overed&&!this.out?this.overed.fireEvent("drop",[this.element,this]):this.element.fireEvent("emptydrop",this);this.parent();return this}});Element.extend({makeDraggable:function(a){return new Drag.Move(this,a)}}); var XHR=new Class({options:{method:"post",async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:"utf-8",autoCancel:false,headers:{}},setTransport:function(){this.transport=window.XMLHttpRequest?new XMLHttpRequest:window.ie?new ActiveXObject("Microsoft.XMLHTTP"):false;return this},initialize:function(a){this.setTransport().setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method== "post"){a=this.options.encoding?"; charset="+this.options.encoding:"";this.setHeader("Content-type","application/x-www-form-urlencoded"+a)}this.options.initialize&&this.options.initialize.call(this)},onStateChange:function(){if(!(this.transport.readyState!=4||!this.running)){this.running=false;var a=0;try{a=this.transport.status}catch(b){}this.options.isSuccess.call(this,a)?this.onSuccess():this.onFailure();this.transport.onreadystatechange=Class.empty}},isSuccess:function(a){return a>=200&&a<300}, onSuccess:function(){this.response={text:this.transport.responseText,xml:this.transport.responseXML};this.fireEvent("onSuccess",[this.response.text,this.response.xml]);this.callChain()},onFailure:function(){this.fireEvent("onFailure",this.transport)},setHeader:function(a,b){this.headers[a]=b;return this},send:function(a,b){if(this.options.autoCancel)this.cancel();else if(this.running)return this;this.running=true;if(b&&this.options.method=="get"){a=a+(a.contains("?")?"&":"?")+b;b=null}this.transport.open(this.options.method.toUpperCase(), a,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);this.options.method=="post"&&this.transport.overrideMimeType&&this.setHeader("Connection","close");$extend(this.headers,this.options.headers);for(var c in this.headers)try{this.transport.setRequestHeader(c,this.headers[c])}catch(d){}this.fireEvent("onRequest");this.transport.send($pick(b,null));return this},cancel:function(){if(!this.running)return this;this.running=false;this.transport.abort();this.transport.onreadystatechange= Class.empty;this.setTransport();this.fireEvent("onCancel");return this}});XHR.implement(new Chain,new Events,new Options); var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(a,b){this.addEvent("onSuccess",this.onComplete);this.setOptions(b);this.options.data=this.options.data||this.options.postBody;if(!["post","get"].contains(this.options.method)){this._method="_method="+this.options.method;this.options.method="post"}this.parent();this.setHeader("X-Requested-With","XMLHttpRequest");this.setHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*"); this.url=a},onComplete:function(){this.options.update&&$(this.options.update).empty().setHTML(this.response.text);if(this.options.evalScripts||this.options.evalResponse)this.evalScripts();this.fireEvent("onComplete",[this.response.text,this.response.xml],20)},request:function(a){a=a||this.options.data;switch($type(a)){case "element":a=$(a).toQueryString();break;case "object":a=Object.toQueryString(a)}if(this._method)a=a?[this._method,a].join("&"):this._method;return this.send(this.url,a)},evalScripts:function(){var a, b;if(this.options.evalResponse||/(ecma|java)script/.test(this.getHeader("Content-type")))b=this.response.text;else{b=[];for(var c=/]*>([\s\S]*?)<\/script>/gi;a=c.exec(this.response.text);)b.push(a[1]);b=b.join("\n")}if(b)window.execScript?window.execScript(b):window.setTimeout(b,0)},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){}return null}}); Object.toQueryString=function(a){var b=[];for(var c in a)b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")};Element.extend({send:function(a){return(new Ajax(this.getProperty("action"),$merge({data:this.toQueryString()},a,{method:"post"}))).request()}}); var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(a,b,c){c=$merge(this.options,c);b=encodeURIComponent(b);if(c.domain)b+="; domain="+c.domain;if(c.path)b+="; path="+c.path;if(c.duration){var d=new Date;d.setTime(d.getTime()+c.duration*24*60*60*1000);b+="; expires="+d.toGMTString()}if(c.secure)b+="; secure";document.cookie=a+"="+b;return $extend(c,{key:a,value:b})},get:function(a){return(a=document.cookie.match("(?:^|;)\\s*"+a.escapeRegExp()+"=([^;]*)"))? decodeURIComponent(a[1]):false},remove:function(a,b){$type(a)=="object"?this.set(a.key,"",$merge(a,{duration:-1})):this.set(a,"",$merge(b,{duration:-1}))}}),Json={toString:function(a){switch($type(a)){case "string":return'"'+a.replace(/(["\\])/g,"\\$1")+'"';case "array":return"["+a.map(Json.toString).join(",")+"]";case "object":var b=[];for(var c in a)b.push(Json.toString(c)+":"+Json.toString(a[c]));return"{"+b.join(",")+"}";case "number":if(isFinite(a))break;case false:return"null"}return String(a)}, evaluate:function(a,b){return $type(a)!="string"||b&&!a.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)?null:eval("("+a+")")}};Json.Remote=XHR.extend({initialize:function(a,b){this.url=a;this.addEvent("onSuccess",this.onComplete);this.parent(b);this.setHeader("X-Request","JSON")},send:function(a){return this.parent(this.url,"json="+Json.toString(a))},onComplete:function(){this.fireEvent("onComplete",[Json.evaluate(this.response.text,this.options.secure)])}}); var Asset=new Abstract({javascript:function(a,b){b=$merge({onload:Class.empty},b);a=(new Element("script",{src:a})).addEvents({load:b.onload,readystatechange:function(){this.readyState=="complete"&&this.fireEvent("load")}});delete b.onload;return a.setProperties(b).inject(document.head)},css:function(a,b){return(new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:a},b))).inject(document.head)},image:function(a,b){b=$merge({onload:Class.empty,onabort:Class.empty,onerror:Class.empty}, b);var c=new Image;c.src=a;var d=new Element("img",{src:a});["load","abort","error"].each(function(f){var g=b["on"+f];delete b["on"+f];d.addEvent(f,function(){this.removeEvent(f,arguments.callee);g.call(this)})});c.width&&c.height&&d.fireEvent("load",d,1);return d.setProperties(b)},images:function(a,b){b=$merge({onComplete:Class.empty,onProgress:Class.empty},b);a.push||(a=[a]);var c=[],d=0;a.each(function(f){f=new Asset.image(f,{onload:function(){b.onProgress.call(this,d);d++;d==a.length&&b.onComplete()}}); c.push(f)});return new Elements(c)}}),Hash=new Class({length:0,initialize:function(a){this.obj=a||{};this.setLength()},get:function(a){return this.hasKey(a)?this.obj[a]:null},hasKey:function(a){return a in this.obj},set:function(a,b){this.hasKey(a)||this.length++;this.obj[a]=b;return this},setLength:function(){this.length=0;for(var a in this.obj)this.length++;return this},remove:function(a){if(this.hasKey(a)){delete this.obj[a];this.length--}return this},each:function(a,b){$each(this.obj,a,b)},extend:function(a){$extend(this.obj, a);return this.setLength()},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));return this.setLength()},empty:function(){this.obj={};this.length=0;return this},keys:function(){var a=[];for(var b in this.obj)a.push(b);return a},values:function(){var a=[];for(var b in this.obj)a.push(this.obj[b]);return a}});function $H(a){return new Hash(a)} Hash.Cookie=Hash.extend({initialize:function(a,b){this.name=a;this.options=$extend({autoSave:true},b||{});this.load()},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);return true}var a=Json.toString(this.obj);if(a.length>4096)return false;Cookie.set(this.name,a,this.options);return true},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};this.setLength()}});Hash.Cookie.Methods={}; ["extend","set","merge","empty","remove"].each(function(a){Hash.Cookie.Methods[a]=function(){Hash.prototype[a].apply(this,arguments);this.options.autoSave&&this.save();return this}});Hash.Cookie.implement(Hash.Cookie.Methods); var Color=new Class({initialize:function(a,b){b=b||(a.push?"rgb":"hex");switch(b){case "rgb":b=a;a=b.rgbToHsb();break;case "hsb":b=a.hsbToRgb();a=a;break;default:b=a.hexToRgb(true);a=b.rgbToHsb()}b.hsb=a;b.hex=b.rgbToHex();return $extend(b,Color.prototype)},mix:function(){var a=$A(arguments),b=$type(a[a.length-1])=="number"?a.pop():50,c=this.copy();a.each(function(d){d=new Color(d);for(var f=0;f<3;f++)c[f]=Math.round(c[f]/100*(100-b)+d[f]/100*b)});return new Color(c,"rgb")},invert:function(){return new Color(this.map(function(a){return 255- a}))},setHue:function(a){return new Color([a,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(a){return new Color([this.hsb[0],a,this.hsb[2]],"hsb")},setBrightness:function(a){return new Color([this.hsb[0],this.hsb[1],a],"hsb")}});function $RGB(a,b,c){return new Color([a,b,c],"rgb")}function $HSB(a,b,c){return new Color([a,b,c],"hsb")} Array.extend({rgbToHsb:function(){var a=this[0],b=this[1],c=this[2],d,f,g=Math.max(a,b,c);d=Math.min(a,b,c);var h=g-d;f=g/255;d=g!=0?h/g:0;if(d==0)a=0;else{var j=(g-a)/h,i=(g-b)/h;c=(g-c)/h;a=a==g?c-i:b==g?2+j-c:4+i-j;a/=6;a<0&&a++}return[Math.round(a*360),Math.round(d*100),Math.round(f*100)]},hsbToRgb:function(){var a=Math.round(this[2]/100*255);if(this[1]==0)return[a,a,a];else{var b=this[0]%360,c=b%60,d=Math.round(this[2]*(100-this[1])/10000*255),f=Math.round(this[2]*(6000-this[1]*c)/600000*255); c=Math.round(this[2]*(6000-this[1]*(60-c))/600000*255);switch(Math.floor(b/60)){case 0:return[a,c,d];case 1:return[f,a,d];case 2:return[d,a,c];case 3:return[d,f,a];case 4:return[c,d,a];case 5:return[a,d,f]}}return false}}); var Scroller=new Class({options:{area:20,velocity:1,onChange:function(a,b){this.element.scrollTo(a,b)}},initialize:function(a,b){this.setOptions(b);this.element=$(a);this.mousemover=[window,document].contains(a)?$(document.body):this.element},start:function(){this.coord=this.getCoords.bindWithEvent(this);this.mousemover.addListener("mousemove",this.coord)},stop:function(){this.mousemover.removeListener("mousemove",this.coord);this.timer=$clear(this.timer)},getCoords:function(a){this.page=this.element== window?a.client:a.page;if(!this.timer)this.timer=this.scroll.periodical(50,this)},scroll:function(){var a=this.element.getSize(),b=this.element.getPosition(),c={x:0,y:0};for(var d in this.page)if(this.page[d]a.size[d]+b[d]&&a.scroll[d]+a.size[d]!=a.scrollSize[d])c[d]=(this.page[d]-a.size[d]+this.options.area-b[d])*this.options.velocity;if(c.y||c.x)this.fireEvent("onChange", [a.scroll.x+c.x,a.scroll.y+c.y])}});Scroller.implement(new Events,new Options); var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(a){this.knob.setStyle(this.p,a)},mode:"horizontal",steps:100,offset:0},initialize:function(a,b,c){this.element=$(a);this.knob=$(b);this.setOptions(c);this.step=this.previousEnd=this.previousChange=-1;this.element.addEvent("mousedown",this.clickedElement.bindWithEvent(this));var d,f;switch(this.options.mode){case "horizontal":this.z="x";this.p="left";d={x:"left",y:false};f="offsetWidth";break;case "vertical":this.z= "y";this.p="top";d={x:false,y:"top"};f="offsetHeight"}this.max=this.element[f]-this.knob[f]+this.options.offset*2;this.half=this.knob[f]/2;this.getPos=this.element["get"+this.p.capitalize()].bind(this.element);this.knob.setStyle("position","relative").setStyle(this.p,-this.options.offset);a={};a[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:a,modifiers:d,snap:0,onStart:function(){this.draggedKnob()}.bind(this),onDrag:function(){this.draggedKnob()}.bind(this), onComplete:function(){this.draggedKnob();this.end()}.bind(this)});this.options.initialize&&this.options.initialize.call(this)},set:function(a){this.step=a.limit(0,this.options.steps);this.checkStep();this.end();this.fireEvent("onTick",this.toPosition(this.step));return this},clickedElement:function(a){a=a.page[this.z]-this.getPos()-this.half;a=a.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(a);this.checkStep();this.end();this.fireEvent("onTick",a)},draggedKnob:function(){this.step= this.toStep(this.drag.value.now[this.z]);this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("onChange",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("onComplete",this.step+"")}},toStep:function(a){return Math.round((a+this.options.offset)/this.max*this.options.steps)},toPosition:function(a){return this.max*a/this.options.steps}});Slider.implement(new Events);Slider.implement(new Options); var SmoothScroll=Fx.Scroll.extend({initialize:function(a){this.parent(window,a);this.links=this.options.links?$$(this.options.links):$$(document.links);var b=window.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(c){if(c.href.indexOf(b)==0){var d=c.href.substr(b.length);d&&$(d)&&this.useLink(c,d)}},this);window.webkit419||this.addEvent("onComplete",function(){window.location.hash=this.anchor})},useLink:function(a,b){a.addEvent("click",function(c){this.anchor=b;this.toElement(b);c.stop()}.bindWithEvent(this))}}), Sortables=new Class({options:{handles:false,onStart:Class.empty,onComplete:Class.empty,ghost:true,snap:3,onDragStart:function(a,b){b.setStyle("opacity",0.7);a.setStyle("opacity",0.7)},onDragComplete:function(a,b){a.setStyle("opacity",1);b.remove();this.trash.remove()}},initialize:function(a,b){this.setOptions(b);this.list=$(a);this.elements=this.list.getChildren();this.handles=this.options.handles?$$(this.options.handles):this.elements;this.bound={start:[],moveGhost:this.moveGhost.bindWithEvent(this)}; a=0;for(b=this.handles.length;a0,c=this.active.getPrevious(),d=this.active.getNext();c&&b&&ad.getCoordinates().top&&this.active.injectAfter(d);this.previous=a},serialize:function(a){return this.list.getChildren().map(a|| function(b){return this.elements.indexOf(b)},this)},end:function(){this.previous=null;document.removeListener("mousemove",this.bound.move);document.removeListener("mouseup",this.bound.end);if(this.options.ghost){document.removeListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragComplete",[this.active,this.ghost])}this.fireEvent("onComplete",this.active)}});Sortables.implement(new Events,new Options); var Tips=new Class({options:{onShow:function(a){a.setStyle("visibility","visible")},onHide:function(a){a.setStyle("visibility","hidden")},maxTitleChars:30,showDelay:100,hideDelay:100,className:"tool",offsets:{x:16,y:16},fixed:false},initialize:function(a,b){this.setOptions(b);this.toolTip=(new Element("div",{"class":this.options.className+"-tip",styles:{position:"absolute",top:"0",left:"0",visibility:"hidden"}})).inject(document.body);this.wrapper=(new Element("div")).inject(this.toolTip);$$(a).each(this.build, this);this.options.initialize&&this.options.initialize.call(this)},build:function(a){a.$tmp.myTitle=a.href&&a.getTag()=="a"?a.href.replace("http://",""):a.rel||false;if(a.title){var b=a.title.split("::");if(b.length>1){a.$tmp.myTitle=b[0].trim();a.$tmp.myText=b[1].trim()}else a.$tmp.myText=a.title;a.removeAttribute("title")}else a.$tmp.myText=false;if(a.$tmp.myTitle&&a.$tmp.myTitle.length>this.options.maxTitleChars)a.$tmp.myTitle=a.$tmp.myTitle.substr(0,this.options.maxTitleChars-1)+"…";a.addEvent("mouseenter", function(c){this.start(a);this.options.fixed?this.position(a):this.locate(c)}.bind(this));this.options.fixed||a.addEvent("mousemove",this.locate.bindWithEvent(this));b=this.end.bind(this);a.addEvent("mouseleave",b);a.addEvent("trash",b)},start:function(a){this.wrapper.empty();if(a.$tmp.myTitle)this.title=(new Element("span")).inject((new Element("div",{"class":this.options.className+"-title"})).inject(this.wrapper)).setHTML(a.$tmp.myTitle);if(a.$tmp.myText)this.text=(new Element("span")).inject((new Element("div", {"class":this.options.className+"-text"})).inject(this.wrapper)).setHTML(a.$tmp.myText);$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this)},end:function(a){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this)},position:function(a){a=a.getPosition();this.toolTip.setStyles({left:a.x+this.options.offsets.x,top:a.y+this.options.offsets.y})},locate:function(a){var b={x:window.getWidth(),y:window.getHeight()},c={x:window.getScrollLeft(),y:window.getScrollTop()}, d={x:this.toolTip.offsetWidth,y:this.toolTip.offsetHeight},f={x:"left",y:"top"};for(var g in f){var h=a.page[g]+this.options.offsets[g];if(h+d[g]-c[g]>b[g])h=a.page[g]-this.options.offsets[g]-d[g];this.toolTip.setStyle(f[g],h)}},show:function(){if(this.options.timeout)this.timer=this.hide.delay(this.options.timeout,this);this.fireEvent("onShow",[this.toolTip])},hide:function(){this.fireEvent("onHide",[this.toolTip])}});Tips.implement(new Events,new Options); var Group=new Class({initialize:function(){this.instances=$A(arguments);this.events={};this.checker={}},addEvent:function(a,b){this.checker[a]=this.checker[a]||{};this.events[a]=this.events[a]||[];if(this.events[a].contains(b))return false;else this.events[a].push(b);this.instances.each(function(c,d){c.addEvent(a,this.check.bind(this,[a,c,d]))},this);return this},check:function(a,b,c){this.checker[a][c]=true;if(c=this.instances.every(function(d,f){return this.checker[a][f]||false},this)){this.checker[a]= {};this.events[a].each(function(d){d.call(this,this.instances,b)},this)}}}),Accordion=Fx.Elements.extend({options:{onActive:Class.empty,onBackground:Class.empty,display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var a,b,c,d;$each(arguments,function(h,j){switch($type(h)){case "object":a=h;break;case "element":d=$(h);break;default:h=$$(h);if(b)c=h;else b=h}});this.togglers=b||[];this.elements=c||[];this.container= $(d);this.setOptions(a);this.previous=-1;if(this.options.alwaysHide)this.options.wait=true;if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity)this.effects.opacity="fullOpacity";if(this.options.width)this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth";if(this.options.height)this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"; for(var f=0,g=this.togglers.length;f0;this.fireEvent(f?"onBackground":"onActive", [this.togglers[d],c]);for(var g in this.effects)b[d][g]=f?0:c[this.effects[g]]},this);return this.start(b)},showThisHideOpen:function(a){return this.display(a)}});Fx.Accordion=Accordion;if(typeof jeroenwijering=="undefined"){var jeroenwijering=new Object();jeroenwijering.utils=new Object()}jeroenwijering.Player=function(B,C,A){this.configuration={backgroundcolor:"ffffff",file:"video.wmv",height:"260",image:"",backcolor:"FFFFFF",frontcolor:"000000",lightcolor:"000000",screencolor:"000000",width:"320",logo:"",overstretch:"false",showicons:"true",shownavigation:"true",showstop:"false",showdigits:"true",usefullscreen:"true",usemute:"false",autostart:"false",bufferlength:"3",duration:"0",repeat:"false",sender:"",volume:"90",link:"",linkfromdisplay:"false",linktarget:"_self"};for(itm in this.configuration){if(A[itm]!=undefined){if(itm.indexOf("color")>0){this.configuration[itm]=A[itm].substr(-6)}else{this.configuration[itm]=A[itm]}}}Silverlight.createObjectEx({source:C,parentElement:B,properties:{width:this.configuration.width,height:this.configuration.height,version:"1.0",inplaceInstallPrompt:true,isWindowless:"false",background:"#"+this.configuration.backgroundcolor},events:{onLoad:this.onLoadHandler},context:this})};jeroenwijering.Player.prototype={onLoadHandler:function(A,F,E){F.configuration.sender=E;var C=new jeroenwijering.Controller(F.configuration);var D=new jeroenwijering.View(F.configuration,C);var B=new jeroenwijering.Model(F.configuration,C,D);C.startMVC(D,B)}};jeroenwijering.Controller=function(A){this.configuration=A};jeroenwijering.Controller.prototype={startMVC:function(B,A){this.view=B;this.model=A;if(this.configuration.usemute=="true"){this.view.onVolume(0);this.view.onMute(true);this.model.goVolume(0)}else{this.view.onVolume(this.configuration.volume);this.model.goVolume(this.configuration.volume)}if(this.configuration.autostart=="true"){this.model.goStart()}else{this.model.goPause()}},setState:function(A,B){this.state=B},setLink:function(){if(this.configuration.linktarget.indexOf("javascript:")==0){return Function(this.configuration.linktarget).apply()}else{if(this.configuration.linktarget=="_blank"){window.open(this.configuration.link)}else{if(this.configuration.linktarget!=""){window.location=this.configuration.link}}}},setMute:function(){if(this.configuration.usemute=="true"){this.configuration.usemute="false";this.model.goVolume(this.configuration.volume);this.view.onMute(false)}else{this.configuration.usemute="true";this.model.goVolume(0);this.view.onMute(true)}},setPlay:function(){if(this.state=="Buffering"||this.state=="Playing"){this.model.goPause()}else{this.model.goStart()}},setScrub:function(A){if(A<2){A=0}else{if(A>this.configuration.duration-4){A=this.configuration.duration-4}}if(this.state=="Buffering"||this.state=="Playing"){this.model.goStart(A)}else{this.model.goPause(A)}},setStop:function(){this.model.goStop()},setVolume:function(A){if(A<0){A=0}else{if(A>100){A=100}}this.configuration.volume=Math.round(A);this.model.goVolume(A);this.view.onVolume(A);if(this.configuration.usemute=="true"){this.configuration.usemute="false";this.view.onMute(false)}},setFullscreen:function(){var A=!this.configuration.sender.getHost().content.FullScreen;this.configuration.sender.getHost().content.FullScreen=A;jeroenwijering.utils.delegate(this.view,this.view.onFullscreen)}};jeroenwijering.View=function(A,B){this.configuration=A;this.controller=B;this.fstimeout;this.fslistener;this.display=this.configuration.sender.findName("PlayerDisplay");this.controlbar=this.configuration.sender.findName("PlayerControls");this.configuration.sender.getHost().content.onResize=jeroenwijering.utils.delegate(this,this.resizePlayer);this.configuration.sender.getHost().content.onFullScreenChange=jeroenwijering.utils.delegate(this,this.onFullscreen);this.assignColorsClicks();this.resizePlayer()};jeroenwijering.View.prototype={onBuffer:function(B){var A=this.configuration.sender;if(B==0){A.findName("BufferText").Text=null}else{B<10?B="0"+B:B=""+B;A.findName("BufferText").Text=B}},onFullscreen:function(C){var A=this.configuration.sender;var B=A.getHost().content.FullScreen;if(B){this.fstimeout=setTimeout(jeroenwijering.utils.delegate(this,this.hideFSControls),2000);this.fslistener=this.display.addEventListener("MouseMove",jeroenwijering.utils.delegate(this,this.showFSControls));A.findName("FullscreenSymbol").Visibility="Collapsed";A.findName("FullscreenOffSymbol").Visibility="Visible"}else{clearTimeout(this.fstimeout);this.display.removeEventListener("MouseMove",this.fslistener);this.controlbar.Visibility="Visible";this.display.Cursor="Hand";A.findName("FullscreenSymbol").Visibility="Visible";A.findName("FullscreenOffSymbol").Visibility="Collapsed"}this.resizePlayer()},showFSControls:function(D,A){var B=D.findName("PlayerControls");var C=A.GetPosition(B).Y;clearTimeout(this.fstimeout);this.controlbar.Visibility="Visible";this.display.Cursor="Hand";if(C<0){this.fstimeout=setTimeout(jeroenwijering.utils.delegate(this,this.hideFSControls),2000)}},hideFSControls:function(){this.controlbar.Visibility="Collapsed";this.display.Cursor="None"},onLoad:function(C){var B=this.configuration.sender;var A=B.findName("TimeSlider").Width;B.findName("DownloadProgress").Width=Math.round(A*C/100)},onMute:function(B){var A=this.configuration.sender;this.configuration.usemute=""+B;if(B){A.findName("VolumeHighlight").Visibility="Collapsed";A.findName("MuteSymbol").Visibility="Visible";A.findName("MuteOffSymbol").Visibility="Collapsed";if(this.state=="Playing"){A.findName("MuteIcon").Visibility="Visible"}}else{A.findName("VolumeHighlight").Visibility="Visible";A.findName("MuteSymbol").Visibility="Collapsed";A.findName("MuteOffSymbol").Visibility="Visible";A.findName("MuteIcon").Visibility="Collapsed"}},onState:function(B,C){var A=this.configuration.sender;this.state=C;if(C=="Buffering"||C=="Playing"||C=="Opening"){A.findName("PlayIcon").Visibility="Collapsed";A.findName("PlaySymbol").Visibility="Collapsed";A.findName("PlayOffSymbol").Visibility="Visible";if(C=="Playing"||this.configuration.showicons=="false"){A.findName("BufferIcon").Visibility="Collapsed";A.findName("BufferText").Visibility="Collapsed";if(this.configuration.usemute=="true"){A.findName("MuteIcon").Visibility="Visible"}}else{if(this.configuration.showicons=="true"){A.findName("BufferIcon").Visibility="Visible";A.findName("BufferText").Visibility="Visible"}else{A.findName("BufferIcon").Visibility="Collapsed";A.findName("BufferText").Visibility="Collapsed"}}}else{A.findName("MuteIcon").Visibility="Collapsed";A.findName("BufferIcon").Visibility="Collapsed";A.findName("BufferText").Visibility="Collapsed";A.findName("PlaySymbol").Visibility="Visible";A.findName("PlayOffSymbol").Visibility="Collapsed";if(this.configuration.showicons=="true"){A.findName("PlayIcon").Visibility="Visible"}else{A.findName("PlayIcon").Visibility="Collapsed"}}},onTime:function(D,C){var B=this.configuration.sender;var B=this.configuration.sender;var A=B.findName("TimeSlider").Width;var E=Math.round(A*D/C);if(isNaN(E)){E=0}this.configuration.duration=C;B.findName("ElapsedText").Text=jeroenwijering.utils.timestring(D);B.findName("RemainingText").Text=jeroenwijering.utils.timestring(C-D);B.findName("TimeSymbol")["Canvas.Left"]=E+4;B.findName("TimeHighlight").Width=E-2},onVolume:function(B){var A=this.configuration.sender;A.findName("VolumeHighlight").Width=Math.round(B/5)},assignColorsClicks:function(){this.display.Cursor="Hand";this.display.Background="#FF"+this.configuration.screencolor;if(this.configuration.linkfromdisplay=="false"){this.display.addEventListener("MouseLeftButtonUp",jeroenwijering.utils.delegate(this.controller,this.controller.setPlay))}else{this.display.addEventListener("MouseLeftButtonUp",jeroenwijering.utils.delegate(this.controller,this.controller.setLink))}if(this.configuration.logo!=""){this.display.findName("OverlayCanvas").Visibility="Visible";this.display.findName("OverlayLogo").ImageSource=this.configuration.logo}this.controlbar.findName("ControlbarBack").Fill="#FF"+this.configuration.backcolor;this.assignButton("Play",this.controller.setPlay);this.assignButton("Stop",this.controller.setStop);this.configuration.sender.findName("ElapsedText").Foreground="#FF"+this.configuration.frontcolor;this.assignSlider("Time",this.changeTime);this.configuration.sender.findName("DownloadProgress").Fill="#FF"+this.configuration.frontcolor;this.configuration.sender.findName("RemainingText").Foreground="#FF"+this.configuration.frontcolor;this.assignButton("Link",this.controller.setLink);this.assignButton("Fullscreen",this.controller.setFullscreen);this.assignButton("Mute",this.controller.setMute);this.assignSlider("Volume",this.changeVolume)},assignButton:function(C,A){var B=this.configuration.sender.findName(C+"Button");B.Cursor="Hand";B.addEventListener("MouseLeftButtonUp",jeroenwijering.utils.delegate(this.controller,A));B.addEventListener("MouseEnter",jeroenwijering.utils.delegate(this,this.rollOver));B.addEventListener("MouseLeave",jeroenwijering.utils.delegate(this,this.rollOut));this.configuration.sender.findName(C+"Symbol").Fill="#FF"+this.configuration.frontcolor;try{this.configuration.sender.findName(C+"OffSymbol").Fill="#FF"+this.configuration.frontcolor}catch(D){}},assignSlider:function(C,A){var B=this.configuration.sender.findName(C+"Button");B.Cursor="Hand";B.addEventListener("MouseLeftButtonUp",jeroenwijering.utils.delegate(this,A));B.addEventListener("MouseEnter",jeroenwijering.utils.delegate(this,this.rollOver));B.addEventListener("MouseLeave",jeroenwijering.utils.delegate(this,this.rollOut));this.configuration.sender.findName(C+"Slider").Fill="#FF"+this.configuration.frontcolor;this.configuration.sender.findName(C+"Highlight").Fill="#FF"+this.configuration.frontcolor;this.configuration.sender.findName(C+"Symbol").Fill="#FF"+this.configuration.frontcolor},rollOver:function(C){var B=C.Name.substr(0,C.Name.length-6);this.configuration.sender.findName(B+"Symbol").Fill="#FF"+this.configuration.lightcolor;try{this.configuration.sender.findName(B+"OffSymbol").Fill="#FF"+this.configuration.lightcolor}catch(A){}},rollOut:function(C){var B=C.Name.substr(0,C.Name.length-6);this.configuration.sender.findName(B+"Symbol").Fill="#FF"+this.configuration.frontcolor;try{this.configuration.sender.findName(B+"OffSymbol").Fill="#FF"+this.configuration.frontcolor}catch(A){}},changeTime:function(E,B){var A=E.findName("TimeSlider");var C=B.GetPosition(A).X;var D=Math.floor(C/A.Width*this.configuration.duration);this.controller.setScrub(D)},changeVolume:function(D,A){var C=D.findName("VolumeButton");var B=A.GetPosition(C).X;this.controller.setVolume(B*5)},resizePlayer:function(){var B=this.configuration.sender.getHost().content.actualWidth;var C=this.configuration.sender.getHost().content.actualHeight;var A=this.configuration.sender.getHost().content.FullScreen;if(this.configuration.shownavigation=="true"){if(A==true){this.resizeDisplay(B,C);this.controlbar["Canvas.Left"]=Math.round(B/2-250);this.resizeControlbar(500,C-this.controlbar.Height-16);this.controlbar.findName("ControlbarBack")["Opacity"]=0.5}else{this.resizeDisplay(B,C-20);this.controlbar["Canvas.Left"]=0;this.resizeControlbar(B,C-this.controlbar.Height);this.controlbar.findName("ControlbarBack")["Opacity"]=1}}else{this.resizeDisplay(B,C)}},resizeDisplay:function(A,B){this.stretchElement("PlayerDisplay",A,B);this.stretchElement("VideoWindow",A,B);this.stretchElement("PlaceholderImage",A,B);this.centerElement("PlayIcon",A,B);this.centerElement("MuteIcon",A,B);this.centerElement("BufferIcon",A,B);this.centerElement("BufferText",A,B);this.display.findName("OverlayCanvas")["Canvas.Left"]=A-110;this.display.Visibility="Visible"},resizeControlbar:function(D,F,A){this.controlbar["Canvas.Top"]=F;this.stretchElement("PlayerControls",D);this.stretchElement("ControlbarBack",D);this.placeElement("PlayButton",0);var C=17;this.placeElement("VolumeButton",D-24);this.placeElement("MuteButton",D-37);var B=37;if(this.configuration.showstop=="true"){this.placeElement("StopButton",C);C+=17}else{this.controlbar.findName("StopButton").Visibility="Collapsed"}if(this.configuration.usefullscreen=="true"){B+=18;this.placeElement("FullscreenButton",D-B)}else{this.controlbar.findName("FullscreenButton").Visibility="Collapsed"}if(this.configuration.link!=""){B+=18;this.placeElement("LinkButton",D-B)}else{this.controlbar.findName("LinkButton").Visibility="Collapsed"}if(this.configuration.showdigits=="true"&&D-B-C>160){B+=35;this.controlbar.findName("RemainingButton").Visibility="Visible";this.controlbar.findName("ElapsedButton").Visibility="Visible";this.placeElement("RemainingButton",D-B);this.placeElement("ElapsedButton",C);C+=35}else{this.controlbar.findName("RemainingButton").Visibility="Collapsed";this.controlbar.findName("ElapsedButton").Visibility="Collapsed"}this.placeElement("TimeButton",C);this.stretchElement("TimeButton",D-C-B);this.stretchElement("TimeShadow",D-C-B);this.stretchElement("TimeStroke",D-C-B);this.stretchElement("TimeFill",D-C-B);this.stretchElement("TimeSlider",D-C-B-10);this.stretchElement("DownloadProgress",D-C-B-10);var E=this.configuration.sender.findName("TimeSymbol");this.stretchElement("TimeHighlight",E["Canvas.Left"]-5);this.controlbar.Visibility="Visible"},centerElement:function(B,A,D){var C=this.configuration.sender.findName(B);C["Canvas.Left"]=Math.round(A/2-C.Width/2);C["Canvas.Top"]=Math.round(D/2-C.Height/2)},stretchElement:function(B,A,D){var C=this.configuration.sender.findName(B);C.Width=A;if(D!=undefined){C.Height=D}},placeElement:function(B,A,C){var D=this.configuration.sender.findName(B);D["Canvas.Left"]=A;if(C){D["Canvas.Top"]=C}}};jeroenwijering.Model=function(A,B,D){this.configuration=A;this.controller=B;this.view=D;this.video=this.configuration.sender.findName("VideoWindow");this.preview=this.configuration.sender.findName("PlaceholderImage");var C={"true":"UniformToFill","false":"Uniform",fit:"Fill",none:"None"};this.state=this.video.CurrentState;this.timeint;this.video.Stretch=C[this.configuration.overstretch];this.preview.Stretch=C[this.configuration.overstretch];this.video.BufferingTime=jeroenwijering.utils.spanstring(this.configuration.bufferlength);this.video.AutoPlay=true;this.video.AddEventListener("CurrentStateChanged",jeroenwijering.utils.delegate(this,this.stateChanged));this.video.AddEventListener("MediaEnded",jeroenwijering.utils.delegate(this,this.mediaEnded));this.video.AddEventListener("BufferingProgressChanged",jeroenwijering.utils.delegate(this,this.bufferChanged));this.video.AddEventListener("DownloadProgressChanged",jeroenwijering.utils.delegate(this,this.downloadChanged));if(this.configuration.image!=""){this.preview.Source=this.configuration.image}};jeroenwijering.Model.prototype={goPause:function(A){this.video.pause();if(!isNaN(A)){this.video.Position=jeroenwijering.utils.spanstring(A)}this.timeChanged()},goStart:function(A){this.video.Visibility="Visible";this.preview.Visibility="Collapsed";if(this.state=="Closed"){this.video.Source=this.configuration.file}else{this.video.play()}if(!isNaN(A)){this.video.Position=jeroenwijering.utils.spanstring(A)}},goStop:function(){this.video.Visibility="Collapsed";this.preview.Visibility="Visible";this.goPause(0);this.video.Source="null"},goVolume:function(A){this.video.Volume=A/100},stateChanged:function(){var A=this.video.CurrentState;if(A!=this.state){this.controller.setState(this.state,A);this.view.onState(this.state,A);this.state=A;this.configuration.duration=Math.round(this.video.NaturalDuration.Seconds*10)/10;if(A!="Playing"&&A!="Buffering"&&A!="Opening"){clearInterval(this.timeint)}else{this.timeint=setInterval(jeroenwijering.utils.delegate(this,this.timeChanged),100)}}},mediaEnded:function(){if(this.configuration.repeat=="true"){this.goStart(0)}else{this.video.Visibility="Collapsed";this.preview.Visibility="Visible";this.goPause(0)}},bufferChanged:function(){var A=Math.round(this.video.BufferingProgress*100);this.view.onBuffer(A)},downloadChanged:function(){var A=Math.round(this.video.DownloadProgress*100);this.view.onLoad(A)},timeChanged:function(){var A=Math.round(this.video.Position.Seconds*10)/10;this.view.onTime(A,this.configuration.duration)}};jeroenwijering.utils.delegate=function(A,B){return function(){return B.apply(A,arguments)}};jeroenwijering.utils.timestring=function(A){var C=Math.floor(A/3600);var B=Math.floor(A%3600/60);var D=Math.round(A%60);var E="";D>9?E+=D:E+="0"+D;B>9?E=B+":"+E:E="0"+B+":"+E;C>0?E=C+":"+E:null;return E};jeroenwijering.utils.spanstring=function(A){var C=Math.floor(A/3600);var B=Math.floor(A%3600/60);var D=Math.round(A%60*10)/10;var E=C+":"+B+":"+D;return E};var swfobject=function(){var j="undefined",o="object",S="Shockwave Flash",ca="ShockwaveFlash.ShockwaveFlash",B="application/x-shockwave-flash",T="SWFObjectExprInst",U="onreadystatechange",m=window,i=document,r=navigator,V=false,C=[da],s=[],D=[],x=[],z,E,K,W,v=false,F=false,p,L,X=true,f=function(){var a=typeof i.getElementById!=j&&typeof i.getElementsByTagName!=j&&typeof i.createElement!=j,b=r.userAgent.toLowerCase(),c=r.platform.toLowerCase(),d=c?/win/.test(c):/win/.test(b);c=c?/mac/.test(c):/mac/.test(b); b=/webkit/.test(b)?parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;var e=!+"\u000b1",g=[0,0,0],h=null;if(typeof r.plugins!=j&&typeof r.plugins[S]==o){if((h=r.plugins[S].description)&&!(typeof r.mimeTypes!=j&&r.mimeTypes[B]&&!r.mimeTypes[B].enabledPlugin)){V=true;e=false;h=h.replace(/^.*\s+(\S+\s+\S+$)/,"$1");g[0]=parseInt(h.replace(/^(.*)\..*$/,"$1"),10);g[1]=parseInt(h.replace(/^.*\.(.*)\s.*$/,"$1"),10);g[2]=/[a-zA-Z]/.test(h)?parseInt(h.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof m.ActiveXObject!= j)try{var k=new ActiveXObject(ca);if(k)if(h=k.GetVariable("$version")){e=true;h=h.split(" ")[1].split(",");g=[parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10)]}}catch(l){}return{w3:a,pv:g,wk:b,ie:e,win:d,mac:c}}(),ea=function(){if(f.w3){if(typeof i.readyState!=j&&i.readyState=="complete"||typeof i.readyState==j&&(i.getElementsByTagName("body")[0]||i.body))y();if(!v){typeof i.addEventListener!=j&&i.addEventListener("DOMContentLoaded",y,false);if(f.ie&&f.win){i.attachEvent(U,function(){if(i.readyState== "complete"){i.detachEvent(U,arguments.callee);y()}});m==top&&function(){if(!v){try{i.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}y()}}()}f.wk&&function(){v||(/loaded|complete/.test(i.readyState)?y():setTimeout(arguments.callee,0))}();Y(y)}}}();function y(){if(!v){try{var a=i.getElementsByTagName("body")[0].appendChild(t("span"));a.parentNode.removeChild(a)}catch(b){return}v=true;a=C.length;for(var c=0;c0)for(var b=0;b0){var g=n(c);if(g)if(G(s[b].swfVersion)&&!(f.wk&&f.wk<312)){w(c,true);if(d){e.success=true;e.ref=N(c);d(e)}}else if(s[b].expressInstall&&O()){e={};e.data=s[b].expressInstall;e.width=g.getAttribute("width")||"0";e.height= g.getAttribute("height")||"0";if(g.getAttribute("class"))e.styleclass=g.getAttribute("class");if(g.getAttribute("align"))e.align=g.getAttribute("align");var h={};g=g.getElementsByTagName("param");for(var k=g.length,l=0;l';e.outerHTML='"+h+"";D[D.length]=a.id;d= n(a.id)}else{k=t(o);k.setAttribute("type",B);for(g in a)if(a[g]!=Object.prototype[g])if(g.toLowerCase()=="styleclass")k.setAttribute("class",a[g]);else g.toLowerCase()!="classid"&&k.setAttribute(g,a[g]);for(var l in b)b[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"&&ia(k,l,b[l]);e.parentNode.replaceChild(k,e);d=k}}return d}function ia(a,b,c){var d=t("param");d.setAttribute("name",b);d.setAttribute("value",c);a.appendChild(d)}function $(a){var b=n(a);if(b&&b.nodeName=="OBJECT")if(f.ie&&f.win){b.style.display= "none";(function(){b.readyState==4?ja(a):setTimeout(arguments.callee,10)})()}else b.parentNode.removeChild(b)}function ja(a){if(a=n(a)){for(var b in a)if(typeof a[b]=="function")a[b]=null;a.parentNode.removeChild(a)}}function n(a){var b=null;try{b=i.getElementById(a)}catch(c){}return b}function t(a){return i.createElement(a)}function fa(a,b,c){a.attachEvent(b,c);x[x.length]=[a,b,c]}function G(a){var b=f.pv;a=a.split(".");a[0]=parseInt(a[0],10);a[1]=parseInt(a[1],10)||0;a[2]=parseInt(a[2],10)||0;return b[0]> a[0]||b[0]==a[0]&&b[1]>a[1]||b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]?true:false}function aa(a,b,c,d){if(!(f.ie&&f.mac)){var e=i.getElementsByTagName("head")[0];if(e){c=c&&typeof c=="string"?c:"screen";if(d)L=p=null;if(!p||L!=c){d=t("style");d.setAttribute("type","text/css");d.setAttribute("media",c);p=e.appendChild(d);if(f.ie&&f.win&&typeof i.styleSheets!=j&&i.styleSheets.length>0)p=i.styleSheets[i.styleSheets.length-1];L=c}if(f.ie&&f.win)p&&typeof p.addRule==o&&p.addRule(a,b);else p&&typeof i.createTextNode!= j&&p.appendChild(i.createTextNode(a+" {"+b+"}"))}}}function w(a,b){if(X){b=b?"visible":"hidden";if(v&&n(a))n(a).style.visibility=b;else aa("#"+a,"visibility:"+b)}}function ba(a){var b=/[\\\"<>\.;]/;return(b=b.exec(a)!=null)&&typeof encodeURIComponent!=j?encodeURIComponent(a):a}ea=function(){f.ie&&f.win&&window.attachEvent("onunload",function(){for(var a=x.length,b=0;b0)){G[0].src="about:blank"}};SqueezeBox.fromElement(B,D)}else{var A=window.open(decodeURIComponent(D.url),"avrpopup"+F,"status=no,toolbar=no,scrollbars=no,titlebar=no,menubar=no,resizable=no,width="+D.size.x+",height="+D.size.y+",directories=no,location=no");A.focus()}}}; var AccordionExt = Fx.Elements.extend({ options: { onActive: Class.empty, onBackground: Class.empty, display: 0, show: false, height: true, width: false, opacity: true, fixedHeight: false, fixedWidth: false, wait: false, alwaysHide: false }, initialize: function(){ var options, togglers, elements, container; $each(arguments, function(argument, i){ switch($type(argument)){ case 'object': options = argument; break; case 'element': container = $(argument); break; default: var temp = $$(argument); if (!togglers) togglers = temp; else elements = temp; } }); this.togglers = togglers || []; this.elements = elements || []; this.container = $(container); this.setOptions(options); this.previous = -1; if (this.options.alwaysHide) this.options.wait = true; if ($chk(this.options.show)){ this.options.display = false; this.previous = this.options.show; } if (this.options.start){ this.options.display = false; this.options.show = false; } this.effects = {}; if (this.options.opacity) this.effects.opacity = 'fullOpacity'; if (this.options.width) this.effects.width = this.options.fixedWidth ? 'fullWidth' : 'offsetWidth'; if (this.options.height) this.effects.height = this.options.fixedHeight ? 'fullHeight' : 'scrollHeight'; for (var i = 0, l = this.togglers.length; i < l; i++) this.addSection(this.togglers[i], this.elements[i]); this.elements.each(function(el, i){ if (this.options.show === i || this.togglers[i].hasClass('fullopen')){ this.fireEvent('onActive', [this.togglers[i], el]); this.previous = i; } else { for (var fx in this.effects) el.setStyle(fx, 0); } }, this); this.parent(this.elements); //if ($chk(this.options.display)) this.display(this.options.display); }, /* Property: addSection Dynamically adds a new section into the accordion at the specified position. Arguments: toggler - (dom element) the element that toggles the accordion section open. element - (dom element) the element that stretches open when the toggler is clicked. pos - (integer) the index where these objects are to be inserted within the accordion. */ addSection: function(toggler, element, pos){ toggler = $(toggler); element = $(element); var test = this.togglers.contains(toggler); var len = this.togglers.length; this.togglers.include(toggler); this.elements.include(element); if (len && (!test || pos)){ pos = $pick(pos, len - 1); toggler.injectBefore(this.togglers[pos]); element.injectAfter(toggler); } else if (this.container && !test){ toggler.inject(this.container); element.inject(this.container); } var idx = this.togglers.indexOf(toggler); toggler.addEvent('click', this.display.bind(this, idx)); if (this.options.height) element.setStyles({'padding-top': 0, 'border-top': 'none', 'padding-bottom': 0, 'border-bottom': 'none'}); if (this.options.width) element.setStyles({'padding-left': 0, 'border-left': 'none', 'padding-right': 0, 'border-right': 'none'}); element.fullOpacity = 1; if (this.options.fixedWidth) element.fullWidth = this.options.fixedWidth; if (this.options.fixedHeight) element.fullHeight = this.options.fixedHeight; element.setStyle('overflow', 'hidden'); if (!test){ for (var fx in this.effects) element.setStyle(fx, 0); } return this; }, /* Property: display Shows a specific section and hides all others. Useful when triggering an accordion from outside. Arguments: index - integer, the index of the item to show, or the actual element to show. */ display: function(index){ index = ($type(index) == 'element') ? this.elements.indexOf(index) : index; if ((this.timer && this.options.wait) || (index === this.previous && !this.options.alwaysHide)) return this; this.previous = index; var obj = {}; this.elements.each(function(el, i){ obj[i] = {}; var hide = (i != index) || (this.options.alwaysHide && (el.offsetHeight > 0)); this.fireEvent(hide ? 'onBackground' : 'onActive', [this.togglers[i], el]); for (var fx in this.effects) obj[i][fx] = hide ? 0 : el[this.effects[fx]]; }, this); return this.start(obj); }, showThisHideOpen: function(index){return this.display(index);} }); Fx.AccordionExt = AccordionExt;function accordionOfflajn(count,duration){ if(window.ie6){ var heightValue = '100%'; }else{ var heightValue = ''; } var togglerName = 'dt.accordion'+count+'_toggler_'; var contentName = 'dd.accordion'+count+'_content_'; var counter = 1; var toggler = $$(togglerName + counter); var content = $$(contentName + counter); while(toggler.length > 1) { new AccordionExt(toggler, content, { opacity : false, duration:duration, alwaysHide : true, display : -1, onComplete : function() { var element = $(this.elements[this.previous]); if(element && element.offsetHeight > 0) element.setStyle('height', heightValue); } , onActive : function(toggler, content) { toggler.addClass('open'); } , onBackground : function(toggler, content) { toggler.removeClass('open'); } }); counter++; toggler = $$(togglerName + counter); content = $$(contentName + counter); } }