/* MyTime - Copyright 2008 World Time Engine Ltd */
/* MooTools, <http://mootools.net>, My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2008 Valerio Proietti, <http://mad4milk.net>, MIT Style License. */
var MooTools={version:"1.2.0",build:""};var Native=function(e){e=e||{};var i=e.afterImplement||function(){};var h=e.generics;h=(h!==false);var g=e.legacy;var j=e.initialize;var c=e.protect;var d=e.name;var b=j||g;b.constructor=Native;b.$family={name:"native"};if(g&&j){b.prototype=g.prototype}b.prototype.constructor=b;if(d){var a=d.toLowerCase();b.prototype.$family={name:a};Native.typize(b,a)}var f=function(n,l,m,k){if(!c||k||!n.prototype[l]){n.prototype[l]=m}if(h){Native.genericize(n,l,c)}i.call(n,l,m);return n};b.implement=function(k,l,m){if(typeof k=="string"){return f(this,k,l,m)}for(var n in k){f(this,n,k[n],l)}return this};b.alias=function(n,l,m){if(typeof n=="string"){n=this.prototype[n];if(n){f(this,l,n,m)}}else{for(var k in n){this.alias(k,n[k],l)}}return this};return b};Native.implement=function(b,c){for(var d=0,a=b.length;d<a;d++){b[d].implement(c)}};Native.genericize=function(c,b,a){if((!a||!c[b])&&typeof c.prototype[b]=="function"){c[b]=function(){var d=Array.prototype.slice.call(arguments);return c.prototype[b].apply(d.shift(),d)}}};Native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b)}}};Native.alias=function(c,f,a,b){for(var d=0,e=c.length;d<e;d++){c[d].alias(f,a,b)}};(function(b){for(var a in b){Native.typize(b[a],a)}})({"boolean":Boolean,"native":Native,object:Object});(function(b){for(var a in b){new Native({name:a,initialize:b[a],protect:true})}})({String:String,Function:Function,Number:Number,Array:Array,RegExp:RegExp,Date:Date});(function(c,a){for(var b=a.length;b--;b){Native.genericize(c,a[b],true)}return arguments.callee})(Array,["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice","toString","valueOf","indexOf","lastIndexOf"])(String,["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]);function $chk(a){return !!(a||a===0)}function $clear(a){clearTimeout(a);clearInterval(a);return null}function $defined(a){return(a!=undefined)}function $empty(){}function $arguments(a){return function(){return arguments[a]}}function $lambda(a){return(typeof a=="function")?a:function(){return a}}function $extend(b,a){for(var c in (a||{})){b[c]=a[c]}return b}function $unlink(d){var e;switch($type(d)){case"object":e={};for(var b in d){e[b]=$unlink(d[b])}break;case"hash":e=$unlink(d.getClean());break;case"array":e=[];for(var c=0,a=d.length;c<a;c++){e[c]=$unlink(d[c])}break;default:return d}return e}function $merge(){var d={};for(var e=0,a=arguments.length;e<a;e++){var g=arguments[e];if($type(g)!="object"){continue}for(var f in g){var b=g[f],c=d[f];d[f]=(c&&$type(b)=="object"&&$type(c)=="object")?$merge(c,b):$unlink(b)}}return d}function $pick(){for(var b=0,a=arguments.length;b<a;b++){if(arguments[b]!=undefined){return arguments[b]}}return null}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b)}function $splat(b){var a=$type(b);return(a)?((a!="array"&&a!="arguments")?[b]:b):[]}var $time=Date.now||function(){return new Date().getTime()};function $try(){for(var c=0,a=arguments.length;c<a;c++){try{return arguments[c]()}catch(b){}}return null}function $type(a){if(a==undefined){return false}if(a.$family){return(a.$family.name=="number"&&!isFinite(a))?false:a.$family.name}if(a.nodeName){switch(a.nodeType){case 1:return"element";case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace"}}else{if(typeof a.length=="number"){if(a.callee){return"arguments"}else{if(a.item){return"collection"}}}}return typeof a}var Hash=new Native({name:"Hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getClean())}for(var b in a){this[b]=a[b]}return this}});Hash.implement({getLength:function(){var b=0;for(var a in this){if(this.hasOwnProperty(a)){b++}}return b},forEach:function(c,b){for(var a in this){if(this.hasOwnProperty(a)){c.call(b,this[a],a,this)}}},getClean:function(){var b={};for(var a in this){if(this.hasOwnProperty(a)){b[a]=this[a]}}return b}});Hash.alias("forEach","each");function $H(a){return new Hash(a)}Array.implement({forEach:function(c,b){for(var d=0,a=this.length;d<a;d++){c.call(b,this[d],d,this)}}});Array.alias("forEach","each");function $A(c){if(c.item){var b=[];for(var d=0,a=c.length;d<a;d++){b[d]=c[d]}return b}return Array.prototype.slice.call(c)}function $each(c,d,b){var a=$type(c);((a=="arguments"||a=="collection"||a=="array")?Array:Hash).each(c,d,b)}var Browser=new Hash({Engine:{name:"unknown",version:""},Platform:{name:(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime)},Plugins:{}});if(window.opera){Browser.Engine={name:"presto",version:(document.getElementsByClassName)?950:925}}else{if(window.ActiveXObject){Browser.Engine={name:"trident",version:(window.XMLHttpRequest)?5:4}}else{if(!navigator.taintEnabled){Browser.Engine={name:"webkit",version:(Browser.Features.xpath)?420:419}}else{if(document.getBoxObjectFor!=null){Browser.Engine={name:"gecko",version:(document.getElementsByClassName)?19:18}}}}}Browser.Engine[Browser.Engine.name]=Browser.Engine[Browser.Engine.name+Browser.Engine.version]=true;if(window.orientation!=undefined){Browser.Platform.name="ipod"}Browser.Platform[Browser.Platform.name]=true;Browser.Request=function(){return $try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("MSXML2.XMLHTTP")})};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var a=($try(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);return{version:parseInt(a[0]||0+"."+a[1]||0),build:parseInt(a[2]||0)}})();function $exec(b){if(!b){return b}if(window.execScript){window.execScript(b)}else{var a=document.createElement("script");a.setAttribute("type","text/javascript");a.text=b;document.head.appendChild(a);document.head.removeChild(a)}return b}Native.UID=1;var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0]}:function(a){return a.uid||(a.uid=Native.UID++)};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a);if(!a.Element){a.Element=$empty;if(Browser.Engine.webkit){a.document.createElement("iframe")}a.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}}return $extend(a,Window.Prototype)},afterImplement:function(b,a){window[b]=Window.Prototype[b]=a}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(a){$uid(a);a.head=a.getElementsByTagName("head")[0];a.html=a.getElementsByTagName("html")[0];a.window=a.defaultView||a.parentWindow;if(Browser.Engine.trident4){$try(function(){a.execCommand("BackgroundImageCache",false,true)})}return $extend(a,Document.Prototype)},afterImplement:function(b,a){document[b]=Document.Prototype[b]=a}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(c,b){for(var d=0,a=this.length;d<a;d++){if(!c.call(b,this[d],d,this)){return false}}return true},filter:function(c,b){var d=[];for(var e=0,a=this.length;e<a;e++){if(c.call(b,this[e],e,this)){d.push(this[e])}}return d},clean:function(){return this.filter($defined)},indexOf:function(c,b){var a=this.length;for(var d=(b<0)?Math.max(0,a+b):b||0;d<a;d++){if(this[d]===c){return d}}return -1},map:function(c,b){var d=[];for(var e=0,a=this.length;e<a;e++){d[e]=c.call(b,this[e],e,this)}return d},some:function(c,b){for(var d=0,a=this.length;d<a;d++){if(c.call(b,this[d],d,this)){return true}}return false},associate:function(c){var b={},d=Math.min(this.length,c.length);for(var a=0;a<d;a++){b[c[a]]=this[a]}return b},link:function(d){var a={};for(var b=0,e=this.length;b<e;b++){for(var c in d){if(d[c](this[b])){a[c]=this[b];delete d[c];break}}}return a},contains:function(a,b){return this.indexOf(a,b)!=-1},extend:function(b){for(var c=0,a=b.length;c<a;c++){this.push(b[c])}return this},getLast:function(){return(this.length)?this[this.length-1]:null},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null},include:function(a){if(!this.contains(a)){this.push(a)}return this},combine:function(b){for(var c=0,a=b.length;c<a;c++){this.include(b[c])}return this},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1)}}return this},empty:function(){this.length=0;return this},flatten:function(){var b=[];for(var d=0,a=this.length;d<a;d++){var c=$type(this[d]);if(!c){continue}b=b.concat((c=="array"||c=="collection"||c=="arguments")?Array.flatten(this[d]):this[d])}return b},hexToRgb:function(b){if(this.length!=3){return null}var a=this.map(function(c){if(c.length==1){c+=c}return c.toInt(16)});return(b)?a:"rgb("+a+")"},rgbToHex:function(b){if(this.length<3){return null}if(this.length==4&&this[3]==0&&!b){return"transparent"}var d=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16);d.push((c.length==1)?"0"+c:c)}return(b)?d:"#"+d.join("")}});Function.implement({extend:function(a){for(var b in a){this[b]=a[b]}return this},create:function(b){var a=this;b=b||{};return function(d){var e=b.arguments;e=(e!=undefined)?$splat(e):Array.slice(arguments,(b.event)?1:0);if(b.event){e=[d||window.event].extend(e)}var c=function(){return a.apply(b.bind||null,e)};if(b.delay){return setTimeout(c,b.delay)}if(b.periodical){return setInterval(c,b.periodical)}if(b.attempt){return $try(c)}return c()}},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(b,a){return this.create({bind:b,arguments:a})},bindWithEvent:function(b,a){return this.create({bind:b,event:true,arguments:a})},delay:function(c,b,a){return this.create({delay:c,bind:b,arguments:a})()},periodical:function(a,b,c){return this.create({periodical:a,bind:b,arguments:c})()},run:function(a,b){return this.apply(b,$splat(a))}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this))},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a},times:function(c,b){for(var a=0;a<this;a++){c.call(b,a,this)}},toFloat:function(){return parseFloat(this)},toInt:function(a){return parseInt(this,a||10)}});Number.alias("times","each");(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat($A(arguments)))}}});Number.implement(a)})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(a,b){return((typeof a=="string")?new RegExp(a,b):a).test(this)},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s+/g," ").trim()},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(a){return parseInt(this,a||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null},stripScripts:function(c){var a="";var b=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return""});if(c===true){$exec(a)}else{if($type(c)=="function"){c(a,b)}}return b},substitute:function(a,b){return this.replace(b||(/\\?\{([^}]+)\}/g),function(c,d){if(c.charAt(0)=="\\"){return c.slice(1)}return(a[d]!=undefined)?a[d]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a}}return null},hasValue:function(a){return(Hash.keyOf(this,a)!==null)},extend:function(a){Hash.each(a,function(b,c){Hash.set(this,c,b)},this);return this},combine:function(a){Hash.each(a,function(b,c){Hash.include(this,c,b)},this);return this},erase:function(a){if(this.hasOwnProperty(a)){delete this[a]}return this},get:function(a){return(this.hasOwnProperty(a))?this[a]:null},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b}return this},empty:function(){Hash.each(this,function(b,a){delete this[a]},this);return this},include:function(c,b){var a=this[c];if(a==undefined){this[c]=b}return this},map:function(c,b){var a=new Hash;Hash.each(this,function(d,e){a.set(e,c.call(b,d,e,this))},this);return a},filter:function(c,b){var a=new Hash;Hash.each(this,function(d,e){if(c.call(b,d,e,this)){a.set(e,d)}},this);return a},every:function(c,b){for(var a in this){if(this.hasOwnProperty(a)&&!c.call(b,this[a],a)){return false}}return true},some:function(c,b){for(var a in this){if(this.hasOwnProperty(a)&&c.call(b,this[a],a)){return true}}return false},getKeys:function(){var a=[];Hash.each(this,function(b,c){a.push(c)});return a},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b)});return a},toQueryString:function(a){var b=[];Hash.each(this,function(c,d){if(a){d=a+"["+d+"]"}var e;switch($type(c)){case"object":e=Hash.toQueryString(c,d);break;case"array":var f={};c.each(function(g,h){f[h]=g});e=Hash.toQueryString(f,d);break;default:e=d+"="+encodeURIComponent(c)}if(c!=undefined){b.push(e)}});return b.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(d,l){l=l||window;var g=l.document;d=d||l.event;if(d.$extended){return d}this.$extended=true;var h=d.type;var k=d.target||d.srcElement;while(k&&k.nodeType==3){k=k.parentNode}if(h.test(/key/)){var c=d.which||d.keyCode;var e=Event.Keys.keyOf(c);if(h=="keydown"){var a=c-111;if(a>0&&a<13){e="f"+a}}e=e||String.fromCharCode(c).toLowerCase()}else{if(h.match(/(click|mouse|menu)/i)){g=(!g.compatMode||g.compatMode=="CSS1Compat")?g.html:g.body;var i={x:d.pageX||d.clientX+g.scrollLeft,y:d.pageY||d.clientY+g.scrollTop};var b={x:(d.pageX)?d.pageX-l.pageXOffset:d.clientX,y:(d.pageY)?d.pageY-l.pageYOffset:d.clientY};if(h.match(/DOMMouseScroll|mousewheel/)){var j=(d.wheelDelta)?d.wheelDelta/120:-(d.detail||0)/3}var m=(d.which==3)||(d.button==2);var f=null;if(h.match(/over|out/)){switch(h){case"mouseover":f=d.relatedTarget||d.fromElement;break;case"mouseout":f=d.relatedTarget||d.toElement}if(!(function(){while(f&&f.nodeType==3){f=f.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){f=false}}}}return $extend(this,{event:d,type:h,page:i,client:b,rightClick:m,wheel:j,relatedTarget:f,target:k,code:c,key:e,shift:d.shiftKey,control:d.ctrlKey,alt:d.altKey,meta:d.metaKey})}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({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}});var Class=new Native({name:"Class",initialize:function(b){b=b||{};var a=function(d){for(var e in this){this[e]=$unlink(this[e])}for(var c in Class.Mutators){if(!this[c]){continue}Class.Mutators[c](this,this[c]);delete this[c]}this.constructor=a;if(d===$empty){return this}var f=(this.initialize)?this.initialize.apply(this,arguments):this;if(this.options&&this.options.initialize){this.options.initialize.call(this)}return f};$extend(a,this);a.constructor=Class;a.prototype=b;return a}});Class.implement({implement:function(){Class.Mutators.Implements(this.prototype,Array.slice(arguments));return this}});Class.Mutators={Implements:function(a,b){$splat(b).each(function(c){$extend(a,($type(c)=="class")?new c($empty):c)})},Extends:function(self,klass){var instance=new klass($empty);delete instance.parent;delete instance.parentOf;for(var key in instance){var current=self[key],previous=instance[key];if(current==undefined){self[key]=previous;continue}var ctype=$type(current),ptype=$type(previous);if(ctype!=ptype){continue}switch(ctype){case"function":if(!arguments.callee.caller){self[key]=eval("("+String(current).replace(/\bthis\.parent\(\s*(\))?/g,function(full,close){return"arguments.callee._parent_.call(this"+(close||", ")})+")")}self[key]._parent_=previous;break;case"object":self[key]=$merge(previous,current)}}self.parent=function(){return arguments.callee.caller._parent_.apply(this,arguments)};self.parentOf=function(descendant){return descendant._parent_.apply(this,Array.slice(arguments,1))}}};Document.implement({newElement:function(a,b){if(Browser.Engine.trident&&b){["name","type","checked"].each(function(c){if(!b[c]){return}a+=" "+c+'="'+b[c]+'"';if(c!="checked"){delete b[c]}});a="<"+a+">"}return $.element(this.createElement(a)).set(b)},newTextNode:function(a){return this.createTextNode(a)},getDocument:function(){return this},getWindow:function(){return this.defaultView||this.parentWindow},purge:function(){var b=this.getElementsByTagName("*");for(var c=0,a=b.length;c<a;c++){Browser.freeMem(b[c])}}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,c){var b=Element.Constructors.get(a);if(b){return b(c)}if(typeof a=="string"){return document.newElement(a,c)}return $(a).set(c)},afterImplement:function(a,b){if(!Array[a]){Elements.implement(a,Elements.multi(a))}Element.Prototype[a]=b}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var b=Array.link(arguments,{properties:Object.type,iframe:$defined});var d=b.properties||{};var e=$(b.iframe)||false;var c=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,e.id,e.name,"IFrame_"+$time());e=new Element(e||"iframe",d);var a=function(){var h=$try(function(){return e.contentWindow.location.host});if(h&&h==window.location.host){var f=new Window(e.contentWindow);var g=new Document(e.contentWindow.document);$extend(f.Element.prototype,Element.Prototype)}c.call(e.contentWindow,e.contentWindow.document)};(!window.frames[d.id])?e.addListener("load",a):a();return e}});var Elements=new Native({initialize:function(c,g){g=$extend({ddup:true,cash:true},g);c=c||[];if(g.ddup||g.cash){var b={},d=[];for(var f=0,a=c.length;f<a;f++){var e=$.element(c[f],!g.cash);if(g.ddup){if(b[e.uid]){continue}b[e.uid]=true}d.push(e)}c=d}return(g.cash)?$extend(c,this):c}});Elements.implement({filter:function(a,b){if(!a){return this}return new Elements(Array.filter(this,(typeof a=="string")?function(c){return c.match(a)}:a,b))}});Elements.multi=function(a){return function(){var f=[];var b=true;for(var d=0,e=this.length;d<e;d++){var c=this[d][a].apply(this[d],arguments);f.push(c);if(b){b=($type(c)=="element")}}return(b)?new Elements(f):f}};Window.implement({$:function(c,b){if(c&&c.$family&&c.uid){return c}var a=$type(c);return($[a])?$[a](c,b,this.document):null},$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a)}var b=[];var e=Array.flatten(arguments);for(var d=0,f=e.length;d<f;d++){var c=e[d];switch($type(c)){case"element":c=[c];break;case"string":c=this.document.getElements(c,true);break;default:c=false}if(c){b.extend(c)}}return new Elements(b)},getDocument:function(){return this.document},getWindow:function(){return this}});$.string=function(b,c,a){b=a.getElementById(b);return(b)?$.element(b,c):null};$.element=function(a,b){$uid(a);if(!b&&!a.$family&&!(/^object|embed$/i).test(a.tagName)){var d=Element.Prototype;for(var c in d){a[c]=d[c]}}return a};$.object=function(c,b,a){if(c.toElement){return $.element(c.toElement(a),b)}return null};$.textnode=$.whitespace=$.window=$.document=$arguments(0);Native.implement([Element,Document],{getElement:function(a,b){return $(this.getElements(a,true)[0]||null,b)},getElements:function(a,b){a=a.split(",");var c=[];var d=(a.length>1);a.each(function(f){var e=this.getElementsByTagName(f.trim());(d)?c.extend(e):c=e},this);return new Elements(c,{ddup:d,cash:!b})}});Element.Storage={get:function(a){return(this[a]||(this[a]={}))}};Element.Inserters=new Hash({before:function(b,a){if(a.parentNode){a.parentNode.insertBefore(b,a)}},after:function(c,a){if(!a.parentNode){return}var b=a.nextSibling;(b)?a.parentNode.insertBefore(c,b):a.parentNode.appendChild(c)},bottom:function(b,a){a.appendChild(b)},top:function(c,a){var b=a.firstChild;(b)?a.insertBefore(c,b):a.appendChild(c)}});Element.Inserters.inside=Element.Inserters.bottom;Element.Inserters.each(function(b,c){var a=c.capitalize();Element.implement("inject"+a,function(d){b(this,$(d,true));return this});Element.implement("grab"+a,function(d){b($(d,true),this);return this})});Element.implement({getDocument:function(){return this.ownerDocument},getWindow:function(){return this.ownerDocument.getWindow()},getElementById:function(b,c){var d=this.ownerDocument.getElementById(b);if(!d){return null}for(var a=d.parentNode;a!=this;a=a.parentNode){if(!a){return null}}return $.element(d,c)},set:function(b,d){switch($type(b)){case"object":for(var c in b){this.set(c,b[c])}break;case"string":var a=Element.Properties.get(b);(a&&a.set)?a.set.apply(this,Array.slice(arguments,1)):this.setProperty(b,d)}return this},get:function(b){var a=Element.Properties.get(b);return(a&&a.get)?a.get.apply(this,Array.slice(arguments,1)):this.getProperty(b)},erase:function(b){var a=Element.Properties.get(b);(a&&a.erase)?a.erase.apply(this,Array.slice(arguments,1)):this.removeProperty(b);return this},match:function(a){return(!a||Element.get(this,"tag")==a)},inject:function(b,a){Element.Inserters.get(a||"bottom")(this,$(b,true));return this},wraps:function(b,a){b=$(b,true);return this.replaces(b).grab(b,a)},grab:function(b,a){Element.Inserters.get(a||"bottom")($(b,true),this);return this},appendText:function(b,a){return this.grab(this.getDocument().newTextNode(b),a)},adopt:function(){Array.flatten(arguments).each(function(a){a=$(a,true);if(a){this.appendChild(a)}},this);return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},clone:function(a,b){switch($type(this)){case"element":var i={};for(var j=0,l=this.attributes.length;j<l;j++){var c=this.attributes[j],e=c.nodeName.toLowerCase();if(Browser.Engine.trident&&(/input/i).test(this.tagName)&&(/width|height/).test(e)){continue}var f=(e=="style"&&this.style)?this.style.cssText:c.nodeValue;if(!$chk(f)||e=="uid"||(e=="id"&&!b)){continue}if(f!="inherit"&&["string","number"].contains($type(f))){i[e]=f}}var g=new Element(this.nodeName.toLowerCase(),i);if(a!==false){for(var h=0,k=this.childNodes.length;h<k;h++){var d=Element.clone(this.childNodes[h],true,b);if(d){g.grab(d)}}}return g;case"textnode":return document.newTextNode(this.nodeValue)}return null},replaces:function(a){a=$(a,true);a.parentNode.replaceChild(this,a);return this},hasClass:function(a){return this.className.contains(a," ")},addClass:function(a){if(!this.hasClass(a)){this.className=(this.className+" "+a).clean()}return this},removeClass:function(a){this.className=this.className.replace(new RegExp("(^|\\s)"+a+"(?:\\s|$)"),"$1").clean();return this},toggleClass:function(a){return this.hasClass(a)?this.removeClass(a):this.addClass(a)},getComputedStyle:function(b){if(this.currentStyle){return this.currentStyle[b.camelCase()]}var a=this.getWindow().getComputedStyle(this,null);return(a)?a.getPropertyValue([b.hyphenate()]):null},empty:function(){$A(this.childNodes).each(function(a){Browser.freeMem(a);Element.empty(a);Element.dispose(a)},this);return this},destroy:function(){Browser.freeMem(this.empty().dispose());return null},getSelected:function(){return new Elements($A(this.options).filter(function(a){return a.selected}))},toQueryString:function(){var a=[];this.getElements("input, select, textarea").each(function(c){if(!c.name||c.disabled){return}var b=(c.tagName.toLowerCase()=="select")?Element.getSelected(c).map(function(d){return d.value}):((c.type=="radio"||c.type=="checkbox")&&!c.checked)?null:c.value;$splat(b).each(function(d){if(d){a.push(c.name+"="+encodeURIComponent(d))}})});return a.join("&")},getProperty:function(c){var d=Element.Attributes,a=d.Props[c];var b=(a)?this[a]:this.getAttribute(c,2);return(d.Bools[c])?!!b:(a)?b:b||null},getProperties:function(){var a=$A(arguments);return a.map(function(b){return this.getProperty(b)},this).associate(a)},setProperty:function(c,b){var d=Element.Attributes,e=d.Props[c],a=$defined(b);if(e&&d.Bools[c]){b=(b||!a)?true:false}else{if(!a){return this.removeProperty(c)}}(e)?this[e]=b:this.setAttribute(c,b);return this},setProperties:function(a){for(var b in a){this.setProperty(b,a[b])}return this},removeProperty:function(b){var c=Element.Attributes,d=c.Props[b],a=(d&&c.Bools[b]);(d)?this[d]=(a)?false:"":this.removeAttribute(b);return this},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this}});(function(){var a=function(g,i,b,h,e,c){var f=g[b||i];var d=[];while(f){if(f.nodeType==1&&(!h||Element.match(f,h))){d.push(f);if(!e){break}}f=f[i]}return(e)?new Elements(d,{ddup:false,cash:!c}):$(d[0],c)};Element.implement({getPrevious:function(c,b){return a(this,"previousSibling",null,c,false,b)},getAllPrevious:function(c,b){return a(this,"previousSibling",null,c,true,b)},getNext:function(c,b){return a(this,"nextSibling",null,c,false,b)},getAllNext:function(c,b){return a(this,"nextSibling",null,c,true,b)},getFirst:function(c,b){return a(this,"nextSibling","firstChild",c,false,b)},getLast:function(c,b){return a(this,"previousSibling","lastChild",c,false,b)},getParent:function(c,b){return a(this,"parentNode",null,c,false,b)},getParents:function(c,b){return a(this,"parentNode",null,c,true,b)},getChildren:function(c,b){return a(this,"nextSibling","firstChild",c,true,b)},hasChild:function(b){b=$(b,true);return(!!b&&$A(this.getElementsByTagName(b.tagName)).contains(b))}})})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a},get:function(){return this.style.cssText},erase:function(){this.style.cssText=""}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase()}};Element.Properties.href={get:function(){return(!this.href)?null:this.href.replace(new RegExp("^"+document.location.protocol+"//"+document.location.host),"")}};Element.Properties.html={set:function(){return this.innerHTML=Array.flatten(arguments).join("")}};Native.implement([Element,Window,Document],{addListener:function(b,a){if(this.addEventListener){this.addEventListener(b,a,false)}else{this.attachEvent("on"+b,a)}return this},removeListener:function(b,a){if(this.removeEventListener){this.removeEventListener(b,a,false)}else{this.detachEvent("on"+b,a)}return this},retrieve:function(d,a){var b=Element.Storage.get(this.uid);var c=b[d];if($defined(a)&&!$defined(c)){c=b[d]=a}return $pick(c)},store:function(c,a){var b=Element.Storage.get(this.uid);b[c]=a;return this},eliminate:function(a){var b=Element.Storage.get(this.uid);delete b[a];return this}});Element.Attributes=new Hash({Props:{html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident)?"innerText":"textContent"},Bools:["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"],Camels:["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]});Browser.freeMem=function(a){if(!a){return}if(Browser.Engine.trident&&(/object/i).test(a.tagName)){for(var b in a){if(typeof a[b]=="function"){a[b]=$empty}}Element.dispose(a)}if(a.uid&&a.removeEvents){a.removeEvents()}};(function(c){var b=c.Bools,a=c.Camels;c.Bools=b=b.associate(b);Hash.extend(Hash.combine(c.Props,b),a.associate(a.map(function(d){return d.toLowerCase()})));c.erase("Camels")})(Element.Attributes);window.addListener("unload",function(){window.removeListener("unload",arguments.callee);document.purge();if(Browser.Engine.trident){CollectGarbage()}});Element.Properties.events={set:function(a){this.addEvents(a)}};Native.implement([Element,Window,Document],{addEvent:function(i,g){var f=this.retrieve("events",{});f[i]=f[i]||{keys:[],values:[]};if(f[i].keys.contains(g)){return this}f[i].keys.push(g);var h=i,d=Element.Events.get(i),b=g,e=this;if(d){if(d.onAdd){d.onAdd.call(this,g)}if(d.condition){b=function(j){if(d.condition.call(this,j)){return g.call(this,j)}return false}}h=d.base||h}var a=function(){return g.call(e)};var c=Element.NativeEvents[h]||0;if(c){if(c==2){a=function(j){j=new Event(j,e.getWindow());if(b.call(e,j)===false){j.stop()}}}this.addListener(h,a)}f[i].values.push(a);return this},removeEvent:function(e,f){var g=this.retrieve("events");if(!g||!g[e]){return this}var b=g[e].keys.indexOf(f);if(b==-1){return this}var a=g[e].keys.splice(b,1)[0];var c=g[e].values.splice(b,1)[0];var d=Element.Events.get(e);if(d){if(d.onRemove){d.onRemove.call(this,f)}e=d.base||e}return(Element.NativeEvents[e])?this.removeListener(e,c):this},addEvents:function(a){for(var b in a){this.addEvent(b,a[b])}return this},removeEvents:function(c){var a=this.retrieve("events");if(!a){return this}if(!c){for(var b in a){this.removeEvents(b)}a=null}else{if(a[c]){while(a[c].keys[0]){this.removeEvent(c,a[c].keys[0])}a[c]=null}}return this},fireEvent:function(b,d,a){var c=this.retrieve("events");if(!c||!c[b]){return this}c[b].keys.each(function(e){e.create({bind:this,delay:a,"arguments":d})()},this);return this},cloneEvents:function(b,a){b=$(b);var c=b.retrieve("events");if(!c){return this}if(!a){for(var d in c){this.cloneEvents(b,d)}}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,e)},this)}}return this}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var a=function(c){var b=c.relatedTarget;if(b==undefined){return true}if(b===false){return false}return($type(this)!="document"&&b!=this&&b.prefix!="xul"&&!this.hasChild(b))};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}})})();Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this)}}};(function(){var b=function(){if(Browser.loaded){return}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};switch(Browser.Engine.name){case"webkit":(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50)})();break;case"trident":var a=document.createElement("div");(function(){($try(function(){a.doScroll("left");return $(a).inject(document.body).set("html","temp").dispose()}))?b():arguments.callee.delay(50)})();break;default:window.addEvent("load",b);document.addEvent("DOMContentLoaded",b)}})();if(!MYTIME){var Timelet=new Class({node:null,link:null,properties:{action:null,ssl:null,timestamp:null,places:null},options:{link:true},initialize:function(a){this.options=$merge(this.options,a)},bind:function(b){if(this.node!==null&&this.node!==b){try{this.node.removeChild(this.link)}catch(a){console.error(a)}}if(this.options.link==true){try{b.appendChild(this.link)}catch(a){}}this.node=b}});var TimeWidget=new Class({visible:0,wrapper:null,iframe:null,close:null,mytime:null,timelet:null,left:0,top:0,hiddenEmbeds:false,loaderHTML:"<html><head><style>body{background:#eee;color:#aaa;font:bold 14px Arial,Helvetica,sans-serif;padding:0px 0px;margin:0px;padding-top:30px;text-align:center;}</style></head><body>Calculating local time...please wait</body></html>",initialize:function(c){this.options=c;var i=document.createElement("div");i.className="wtwrapper";i.style.visibility="hidden";this.wrapper=i;try{var h=document.createElement('<iframe name="wtframe" allowTransparency="true" style="body{background:transparent;}"></iframe>')}catch(g){var h=document.createElement("iframe");h.allowTransparency="true";h.setAttribute("allowTransparency","true")}h.id="wtframe";h.className="wtframe";h.name="wtframe";h.frameBorder="0";h.scrolling="no";h.width="301px";i.appendChild(h);this.iframe=h;var b=document.createElement("a");b.href="#";b.title="close";b.className="wtclose";b.id="wte_close";b.onclick=this.hide;b.style.color="#000";var e=document.createTextNode("X");b.appendChild(e);i.appendChild(b);this.close=b},setHeight:function(a){this.iframe.height=a+"px"},show:function(a){MYTIME.widget.visible=1;MYTIME.widget.wrapper.style.left=this.left+"px";MYTIME.widget.wrapper.style.top=this.top+"px";if(MYTIME.widget.wrapper.parentNode==null||typeof(MYTIME.widget.wrapper.parentNode.tagName)=="undefined"){document.body.appendChild(MYTIME.widget.wrapper)}MYTIME.widget.wrapper.style.visibility="visible";if(a&&Boolean(a.embeds)!=true){MYTIME.widget.hiddenEmbeds=true;MYTIME.widget.hideEmbeds()}return false},hide:function(a){MYTIME.widget.visible=0;MYTIME.widget.wrapper.style.visibility="hidden";if(Boolean(MYTIME.widget.hiddenEmbeds)==true||(a&&Boolean(a.embeds)!=true)){MYTIME.widget.hiddenEmbeds=false;MYTIME.widget.showEmbeds()}return false},hideEmbeds:function(){var b=document.getElementsByTagName("embed");for(var a=0;a<b.length;a++){b[a].style.visibility="hidden"}},showEmbeds:function(){var b=document.getElementsByTagName("embed");for(var a=0;a<b.length;a++){b[a].style.visibility="visible"}},loading:function(){var a=parent.frames.wtframe;try{a.window.document.open();a.window.document.clear();a.window.document.write(this.loaderHTML);a.window.document.close()}catch(b){}}});var MyTime=new Class({version:"0.5",ready:false,readyList:[],toolbar:false,counter:0,widget:null,timelets:[],page:{},queryparams:{},meta:{hostname:location.host,location:location.pathname},initialize:function(b){var b=b||{};this.options=b;this.page=new Timelet($merge(b,{link:false}));this.widget=new TimeWidget();if(b.headerbg){var a=this.luminescence(b.headerbg);this.widget.close.style.color=a>0.5?"#000":"#fff"}var c="http://worldtimeengine.com/widget/"+this.version+"/mytime_"+b.style+".css";this.load("link",{href:(this.options.css?this.options.css:c),rel:"stylesheet",type:"text/css"});if(typeof(window.addEventListener)!="undefined"){window.addEventListener("load",this.onReady,false)}else{if(typeof(document.addEventListener)!="undefined"){document.addEventListener("load",this.onReady,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",this.onReady)}}}},selection:function(){if(window.getSelection){this.page.properties.selection=window.getSelection()}else{if(document.getSelection){this.page.properties.selection=document.getSelection()}else{if(document.selection&&document.selection.createRange){this.page.properties.selection=document.selection.createRange().text}}}},luminescence:function(d){var e={};if(d.length==7){e=[parseInt("0x"+d.substring(1,3))/255,parseInt("0x"+d.substring(3,5))/255,parseInt("0x"+d.substring(5,7))/255]}else{if(d.length==4){e=[parseInt("0x"+d.substring(1,2))/15,parseInt("0x"+d.substring(2,3))/15,parseInt("0x"+d.substring(3,4))/15]}}var i=e[0],h=e[1],c=e[2];var f=Math.min(i,Math.min(h,c));var a=Math.max(i,Math.max(h,c));return(f+a)/2},defer:function(a){if(this.ready){a.apply(document,[MYTIME])}else{this.readyList.push(function(){return a.apply(this,[MYTIME])})}},onReady:function(){MYTIME.ready=true;for(var a=0;a<MYTIME.readyList.length;++a){MYTIME.readyList[a].apply(document,[MYTIME])}},load:function(b,d){var f=document.createElement(b);for(var a in d){f.setAttribute(a,d[a])}try{document.getElementsByTagName("head")[0].appendChild(f)}catch(c){document.body.appendChild(f)}},pageSize:function(){var a=[0,0];if(typeof(window.pageYOffset)=="number"){a=[window.pageXOffset,window.pageYOffset]}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){a=[document.body.scrollLeft,document.body.scrollTop]}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){a=[document.documentElement.scrollLeft,document.documentElement.scrollTop]}}}return a},addEntry:function(e,d){var d=d||{};if(typeof(d.link)=="undefined"){d.link=true}if(typeof(d.bind)=="undefined"){d.bind=true}var f=new Timelet($merge(this.options,d));f.properties=$merge(f.properties,e);f.idx=this.timelets.push(f)-1;f.mytime=this;f.widget=this.widget;f.popup=function(l){if(f.options.onclick){var a=f.options.onclick.apply(document,[f]);if(a==false){return false}}MYTIME.selection();var i=136;i+=(f.properties.places.length>0?(f.properties.places.length)*61:61);i+=(f.properties.places.length>1?(f.properties.places.length-1)*17:0);var k=window.open("http://worldtimeengine.com/widget/loading","wtframe","status=1,toolbar=0,width=300,height="+i);f.widget.popup=k;try{k.document.open();k.document.clear();k.window.document.write(MYTIME.widget.loaderHTML);k.document.close();k.focus()}catch(h){console.error(h)}var j=MYTIME.form([f]);document.body.appendChild(j);j.submit();return false};f.attachlink=function(h){h.onclick=(Boolean(f.options.popup)==true?f.popup:f.onClick)};f.onClick=function(k){if(f.options.onclick){var a=f.options.onclick.apply(document,[f]);if(a==false){return false}}findPos=function(n){var n=n||{};if(n.parentNode&&n.parentNode.className.indexOf("wtlink")!=-1){n=n.parentNode}var m=MYTIME.pageSize();var o=m;var l=354;if(n.offsetParent){odims={offsetLeft:n.offsetLeft,scrollWidth:n.scrollWidth};o=[n.offsetLeft+n.scrollWidth,n.offsetTop+n.scrollHeight];while(n=n.offsetParent){o[0]+=n.offsetLeft;o[1]+=n.offsetTop}if(f.options.offsetLeft){o[0]+=parseInt(f.options.offsetLeft)}if(f.options.offsetTop){o[1]+=parseInt(f.options.offsetTop)}if(!f.options.offsetLeft&&!f.options.offsetTop){o[0]-=odims.scrollWidth;if(o[0]+l>document.body.scrollWidth){o[0]-=l-odims.scrollWidth}}}return o};if(!k){var k=window.event}var h=k.target||k.srcElement;var j=findPos(h);f.widget.left=j[0];f.widget.top=j[1];var i=136;i+=(f.properties.places.length>0?(f.properties.places.length)*61:61);i+=(f.properties.places.length>1?(f.properties.places.length-1)*17:0);f.widget.setHeight(i);if(f.widget.visible){if(f==f.widget.timelet){f.widget.hide(f.options)}else{f.widget.loading();f.share()}}else{if(f==f.widget.timelet){f.widget.show(f.options)}else{f.widget.show(f.options);f.widget.loading();f.share()}}return false};f.share=function(){return f.mytime.share(f)};if(typeof(f.options.link)=="undefined"||Boolean(f.options.link)!=false){var c=document.getElementById("mytime_anchor_"+f.idx);c.className+=(c.className?" wtlink":"wtlink");c.title="Convert to local time with World Time Engine";c.onclick=(Boolean(f.options.popup)==true?f.popup:f.onClick);f.link=c;if(typeof(f.options.bind)=="undefined"||Boolean(f.options.bind)!=false){var g="mytime_"+f.idx;document.write('<span id="'+g+'"></span>');var b=document.getElementById(g);if(b){b.appendChild(c)}}}this.defer(function(){MYTIME.log("view")});return f},share:function(b){this.selection();this.widget.timelet=b;this.widget.show(b.options);var a=MYTIME.form([b]);document.body.appendChild(a);a.submit()},form:function(a){field=function(g,e){var h=document.createElement("input");h.type="hidden";h.name=g;h.value=e;return h};normalize=function(e){if(e==null){return""}return encodeURIComponent(e)};var d=document.createElement("form");d.method="post";d.action="http://worldtimeengine.com/widget/"+this.version+"/s/"+a[0].properties.action+"/default.php";d.target="wtframe";for(var b in this.meta){d.appendChild(field("meta_"+b,normalize(this.meta[b])))}for(var b in this.page.properties){d.appendChild(field("page_"+b,normalize(this.page.properties[b])))}for(var b in this.queryparams){d.appendChild(field("query_"+b,normalize(this.queryparams[b])))}for(var c=0;c<a.length;c++){obj=a[c];for(var b in obj.properties){d.appendChild(field(b,normalize(obj.properties[b])))}}return d},log:function(a){}});var _query=[];_query.style="default";_query.headerbg="#eeeeee";_query.border="#cccccc";var MYTIME=new MyTime(_query);MYTIME.log("load");MYTIME.queryparams=_query;var wt=MYTIME}function checkWTELinkHref(a){var c=/^\bhttp(s?)\b\:\/\/(.*\.)?\bworldtimeengine\.com\b\/(dotime|dotimedifference|dodst|domeeting)\/(([a-z0-9_\,\.%]+\/?){1,5})(\*\/([0-9]+)\/?)?\/?$/im;var b=c.exec(a);if(b){if((b[4]+"").lastIndexOf("/")==((b[4]+"").length-1)){b[4]=(b[4]+"").substring(0,(b[4]+"").length-1)}}return b}function getMyTimeElements(){var g=new Array();if(!document){setTimeout("getMyTimeElements()",1000);return false}for(var b=0;b<(document.links).length;b++){var c=document.links[b];var e=c.href;var d=false;if(e){d=checkWTELinkHref(e)}if(d!=null){var f=document.createElement("span");c.parentNode.insertBefore(f,c);f.appendChild(c);f.setAttribute("class","wte");var a=g.push(new Array(f,d));c.setAttribute("id","mytime_anchor_"+(a-1))}}return g}window.addEvent("domready",function(){var b=getMyTimeElements();if(b!=null){for(var a=0;a<b.length;a++){var c=MYTIME.addEntry({action:b[a][1][3],ssl:(b[a][1][1]=="s"?true:false),timestamp:b[a][1][7],places:b[a][1][4].split("/")},$merge(_query,{bind:false}));c.bind(b[a][0])}}});