var a,Browser=new (function(){var b=navigator.userAgent.toLowerCase(),c=function(d){return d.test(b)};this.isStrict=document.compatMode=="CSS1Compat";this.isOpera=c(/opera/);this.isChrome=c(/chrome/);this.isWebKit=c(/webkit/);this.isSafari2=(this.isSafari=!this.isChrome&&c(/safari/))&&c(/applewebkit\/4/);this.isSafari3=this.isSafari&&c(/version\/3/);this.isSafari4=this.isSafari&&c(/version\/4/);this.isIE7=(this.isIE=!this.isOpera&&c(/msie/))&&c(/msie 7/);this.isIE8=this.isIE&&c(/msie 8/);this.isIE6= this.isIE&&!this.isIE7&&!this.isIE8;this.isGecko2=(this.isGecko=!this.isWebKit&&c(/gecko/))&&c(/rv:1\.8/);this.isGecko3=this.isGecko&&c(/rv:1\.9/);this.isBorderBox=this.isIE&&!this.isStrict;this.isWindows=c(/windows|win32/);this.isMac=c(/macintosh|mac os x/);this.isAir=c(/adobeair/);this.isLinux=c(/linux/);this.isSecure=/^https/i.test(window.location.protocol)});if(Browser.isIE6)try{document.execCommand("BackgroundImageCache",false,true)}catch(e){} function $(b){return typeof b==="string"?document.getElementById(b):b}function $$(b){return $A(document.querySelectorAll(b))}var $A=function(b){return function(c){try{return b.call(c)}catch(d){for(var f=[],g=0,h=c.length;g<h;g++)f[g]=c[g];return f}}}(Array.prototype.slice);function isEmpty(b,c){return b===null||b===undefined||(!c?b==="":false)}function isNull(b){return b===null||b===undefined}function isArray(b){return Object.prototype.toString.apply(b)==="[object Array]"} function isDate(b){return Object.prototype.toString.apply(b)==="[object Date]"}function isObject(b){return!!b&&Object.prototype.toString.call(b)==="[object Object]"}function isPrimitive(b){return isString(b)||isNumber(b)||isBoolean(b)}function isFunction(b){return Object.prototype.toString.apply(b)==="[object Function]"}function isNumber(b){return typeof b==="number"&&isFinite(b)}function isString(b){return typeof b==="string"}function isBoolean(b){return typeof b==="boolean"} function isElement(b){return!!b&&b.tagName}function isDefined(b){return typeof b!=="undefined"}a=Element.prototype;a.getChildren=function(){for(var b=[],c=0;c<this.childNodes.length;c++)this.childNodes[c].nodeType==1&&b.push(this.childNodes[c]);return b};a.getChildAt=function(b){return this.getChildren()[b]};a.getChildByName=function(b){for(var c=this.getChildren(),d=0;d<c.length;d++)if(c[d].get("name")==b||c[d].getAttribute("name")==b)return c[d];return null}; a.getChildIndex=function(b){var c;this.getChildren().every(function(d,f){return d==b&&(c=f)?false:true});return c};a.getPreviousChild=function(){var b=this.getParent().getChildren();return b.indexOf(this)>0?b[b.indexOf(this)-1]:null};a.getNextChild=function(){var b=this.getParent().getChildren(),c=b.indexOf(this);return c>=0&&b.length>c+1?b[c+1]:null};a.bindEvent=function(){return Browser.isIE?function(b,c){this.attachEvent("on"+b,c)}:function(b,c){this.addEventListener(b,c,true)}}();a.on=Element.prototype.bindEvent; document.bindEvent=Element.prototype.bindEvent;document.on=Element.prototype.on;window.on=Element.prototype.on;Element.prototype.unbindEvent=function(b,c){this.removeEventListener?this.removeEventListener(b,c,true):this.detachEvent("on"+b,c)};document.unbindEvent=Element.prototype.unbindEvent;a=Element.prototype;a.get=function(b,c){var d="get"+b.ucfirst();b=d in this?this[d].call():this[b];return b==null&&c?c:b}; a.set=function(b,c){var d="set"+b.ucfirst();if(d in this)this[d].call(this,c);else this[b]=c};a.move=function(b,c){this.style.left=/\d+px/.test(b)?b:isNull(b)||isEmpty(b)?"0px":b+"px";this.style.top=/\d+px/.test(c)?c:isNull(c)||isEmpty(c)?"0px":c+"px"};a.setSize=function(b,c){if(!isNull(b))this.style.width=b+"px";if(!isNull(c))this.style.height=c+"px"};a.getWidth=function(){return this.getStyle("width")};a.setWidth=function(b){this.style.width=isNumber(b)||/^\d+$/.test(b)?b+"px":b};a.getHeight=function(){return this.offsetHeight}; a.setHeight=function(b){this.style.height=isNumber(b)||/^\d+$/.test(b)?b+"px":b};a.getStyle=function(b){return this.style[b]};a.setStyle=function(b,c){this.style[b]=c};a.toggleStyle=function(b,c,d){if(arguments.length==2)d="";this.setStyle(b,this.getStyle(b)==c?d:c)};a.mutate=function(b){App.Xaml.mutate(this,b)};a.empty=function(){};a.getParent=function(){return this.parentNode}; a.fire=function(){return Browser.isIE?function(b,c){document.createEventObject().details=c}:function(b,c){var d=document.createEvent("Events");d.initEvent(b,false,false);if(arguments.length>1)d.details=c;this.dispatchEvent(d)}}();a.setDisplay=function(b){this.setStyle("display",b?b:"none")};a.isPopUp=false;a.addClass=function(b){var c=" "+this.className+" ";if(c.indexOf(" "+b+" ")===-1)this.className+=(c===" "?"":" ")+b;return this}; a.removeClass=function(b){this.className=(" "+this.className+" ").replace(" "+b+" "," ").trim();return this};a.toggleClass=function(b){return this[this.hasClass(b)?"removeClass":"addClass"](b)};a.hasClass=function(b){return(" "+this.className+" ").indexOf(" "+b+" ")!==-1};a.remove=function(){this.parentNode&&this.parentNode.removeChild(this)};a.getNodeName=function(){return Browser.isIE?function(){return this.scopeName+":"+this.nodeName}:function(){return this.nodeName}}(); a.owns=function(b){return b.getParent?b.getParent()==this?true:this.owns(b.getParent()):false};if(!Element.prototype.insertAfter)Element.prototype.insertAfter=function(b){b.getParent().insertBefore(this,b.nextSibling)};a=Event.prototype;a.stop=function(){return Browser.isIE?function(){this.returnValue=false}:function(){this.preventDefault();this.stopPropagation()}}();a.getLocalX=function(){return Browser.isIE||Browser.isOpera?function(){return this.offsetX}:function(){return this.layerX}}(); a.getLocalY=function(){return Browser.isIE||Browser.isOpera?function(){return this.offsetY}:function(){return this.layerY}}();a.getTarget=function(){return Browser.isIE?function(){return this.srcElement}:function(){return this.target}}();a.getRootNode=function(b,c){if(arguments.length==1)c=this.getTarget();return c.parentNode==b?c:this.getRootNode(b,c.parentNode)};Array.prototype.forEach=function(b,c){for(var d=0,f=this.length;d<f;d++)b.call(c,this[d],d,this)}; Array.prototype.every=function(b,c){for(var d=0,f=this.length;d<f;d++)if(!b.call(c,this[d],d,this))return false;return true};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(b,c){for(c=c<0?Math.max(0,this.length+c):c||0;c<this.length;c++)if(this[c]===b)return c;return-1};String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+(this.length>1?this.substr(1):"")};String.prototype.lcfirst=function(){return this.substr(0,1).toLowerCase()+(this.length>1?this.substr(1):"")}; String.prototype.trim||(String.prototype.trim=function(){for(var b=this.replace(/^\s\s*/,""),c=b.length;/\s/.test(b.charAt(--c)););return b.slice(0,c+1)});
