function __loadCompat(a){a.Debug=function(){};a.Debug._fail=function(a){throw new Error(a+" ");};a.Debug.writeln=function(b){if(a.console)if(a.console.debug)a.console.debug(b);else if(a.console.log)a.console.log(b)};a.__getNonTextNode=function(a){try{while(a&&a.nodeType!=1)a=a.parentNode}catch(b){a=null}return a};a.__getLocation=function(a){var b={x:0,y:0};while(a){b.x+=a.offsetLeft;b.y+=a.offsetTop;a=a.offsetParent}return b};FunctionHelper.isSpecialMember=function(b,a){return !b.hasOwnProperty(a)};FunctionHelper._wrapMethodImpl=function(f,e,b,d){var c=function(){try{return b.apply(this,arguments)}catch(j){if(a.__lastKnownException!==j){a.__lastKnownException=j;a.__stack=[]}b.args=[];var i=arguments.length;for(var c=0;c<i;c++)b.args.push(arguments[c]);if(d)a.__stack.push(b.__tcw);else a.__stack.push(b);if(d&&a.onerror){var h=j.lineNumber||j.line,g=j.fileName||j.sourceURL;a.onerror(String.format("{0}.{1} - {2}",f,e,j.message),g,h);return}throw j;}};if(d)b.__tcw=c;c.__original=b;c.__debugName=f+"."+e;return c};FunctionHelper.wrapMethod=function(b,a,c){return FunctionHelper._wrapMethodImpl(b,a,c,false)};FunctionHelper.wrapTopLevelMethod=function(b,a,c){return FunctionHelper._wrapMethodImpl(b,a,c,true)};FunctionHelper.needsWrapping=function(a){return typeof a=="function"&&a.__typeName===undefined&&a.__original===undefined};a.__lastKnownException=null}function _loadMozillaCompat(a){a.navigate=function(b){a.setTimeout('window.location = "'+b+'";',0)};var b=function(c,b){b._mozillaEventHandler=function(d){a.event=d;var e=b();return d._returnValueSet&&c!="onbeforeunload"?d.returnValue:e};this.addEventListener(c.slice(2),b._mozillaEventHandler,false)},c=function(c,a){if(a._mozillaEventHandler){var b=a._mozillaEventHandler;delete a._mozillaEventHandler;this.removeEventListener(c.slice(2),b,false)}};a.attachEvent=b;a.detachEvent=c;a.HTMLDocument.prototype.attachEvent=b;a.HTMLDocument.prototype.detachEvent=c;a.HTMLElement.prototype.attachEvent=b;a.HTMLElement.prototype.detachEvent=c;a.HTMLDocument.prototype.__defineGetter__("body",function(){return a.document.documentElement.getElementsByTagName("body")[0]})}function _loadSafariCompat(a,e){a.navigate=function(b){a.setTimeout('window.location = "'+b+'";',0)};function d(){}a["HTMLElement"]=d;a["HTMLHtmlElement"]=a.document.createElement("html").constructor;a.HTMLElement.prototype=HTMLHtmlElement.__proto__;if(e){a.HTMLElement.prototype=a.HTMLHtmlElement.__proto__.__proto__;a.__getEventObj=function(d){var b={};for(var c in d){if(FunctionHelper.isSpecialMember(d,c))continue;b[c]=d[c]}b.srcElement=a.__getNonTextNode(d.srcElement);b.returnValue=undefined;return b}}var f=a.document.createTextNode("").constructor;Node=f;a.HTMLDocument=document.constructor;var b=function(c,b){if(this.addEventListener){b.__safariEventHandler=function(d){if(a.__isSafari2){if(!this.__eventTimeStamp)this.__eventTimeStamp=d.timeStamp;else{if(d.timeStamp-this.__eventTimeStamp<20)return null;this.__eventTimeStamp=d.timeStamp}a.event=a.__getEventObj(d);var e=b();return a.event.returnValue!=undefined&&c!="onbeforeunload"?a.event.returnValue:e}else{a.event=d;return b()}};this.addEventListener(c.slice(2),b.__safariEventHandler,false)}else if(this._events)Events._attachEvent.call(this,c,b);else throw new Error("Method not defined on this object");},c=function(b,a){if(this.removeEventListener){if(a.__safariEventHandler){var c=a.__safariEventHandler;delete a.__safariEventHandler;this.removeEventListener(b.slice(2),c,false)}}else Events._detachEvent.call(this,b,a)};a.attachEvent=b;a.detachEvent=c;a.HTMLDocument.prototype.attachEvent=b;a.HTMLDocument.prototype.detachEvent=c;a.HTMLElement.prototype.attachEvent=b;a.HTMLElement.prototype.detachEvent=c}function _loadCompatCore(a){a.Event.prototype._returnValSet=false;a.Event.prototype.__defineGetter__("srcElement",function(){return __getNonTextNode(this.target)||this.currentTarget});a.Event.prototype.__defineGetter__("cancelBubble",function(){return this._bubblingCanceled||false});a.Event.prototype.__defineSetter__("cancelBubble",function(a){if(a){this._bubblingCanceled=true;this.stopPropagation()}});a.Event.prototype.__defineGetter__("returnValue",function(){return !this._cancelDefault});a.Event.prototype.__defineSetter__("returnValue",function(a){this._returnValSet=true;if(!a){this._cancelDefault=true;if(this.preventDefault)this.preventDefault()}});a.Event.prototype.__defineGetter__("fromElement",function(){var b;if(this.type=="mouseover")b=this.relatedTarget;else if(this.type=="mouseout")b=this.target;else if(this.type=="focusin")b=a.__lastElt;return __getNonTextNode(b)});a.Event.prototype.__defineGetter__("toElement",function(){var b;if(this.type=="mouseout")b=this.relatedTarget;else if(this.type=="mouseover")b=this.target;else if(this.type=="focusout")b=a.__lastElt;return __getNonTextNode(b)});a.Event.prototype.__defineGetter__("button",function(){return this.which==1?1:this.which==3?2:0});a.Event.prototype.__defineGetter__("offsetX",function(){return a.pageXOffset+this.clientX-__getLocation(this.srcElement).x});a.Event.prototype.__defineGetter__("offsetY",function(){return a.pageYOffset+this.clientY-__getLocation(this.srcElement).y});function b(c,b){if(a.navigator.userAgent.indexOf("AppleWebKit")<0)return;if(!(c instanceof a.HTMLElement)){var d=new Error("Attempting to access property '"+b+"' which is only meant for HTML elements, not javascript objects.  Do not access this member in this context.  See MozillaCompat.js for details on why this exception is happening.");throw d;}}a.HTMLElement.prototype.__defineGetter__("parentElement",function(){b(this,"parentElement");return this.parentNode});a.HTMLElement.prototype.__defineGetter__("firstChild",function(){b(this,"firstChild");var d=this.childNodes.length;for(var a=0;a<d;a++){var c=this.childNodes[a];if(c.nodeType==1)return c}return null});a.HTMLElement.prototype.__defineGetter__("children",function(){b(this,"children");var d=[],e=this.childNodes.length;for(var a=0;a<e;a++){var c=this.childNodes[a];if(c.nodeType==1)d.push(c)}return d});a.HTMLElement.prototype.__defineGetter__("innerText",function(){b(this,"innerText");try{return this.textContent}catch(e){var c="",d=this.childNodes.length;for(var a=0;a<d;a++)if(this.childNodes[a].nodeType==3)c+=this.childNodes[a].textContent;return c}});a.HTMLElement.prototype.__defineSetter__("innerText",function(c){b(this,"innerText");var a=document.createTextNode(c);this.innerHTML="";this.appendChild(a)});a.HTMLElement.prototype.__defineGetter__("currentStyle",function(){b(this,"currentStyle");return a.getComputedStyle(this,null)});a.HTMLElement.prototype.__defineGetter__("runtimeStyle",function(){b(this,"runtimeStyle");return a.getOverrideStyle(this,null)});a.HTMLElement.prototype.removeNode=function(){b(this);return this.parentNode.removeChild(this)};a.HTMLElement.prototype.contains=function(a){b(this);while(a!=null&&a!=this)a=a.parentNode;return a!=null};a.HTMLElement.prototype.setCapture=function(){b(this);var d=this;this.capture=["click","mousedown","mouseup","mousemove","mouseover","mouseout"];this._capture=function(b){if(b.isCapturing)return;var c=a.document.createEvent("MouseEvents");c.initMouseEvent(b.type,b.bubbles,b.cancelable,b.view,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget);c._data=b.target;c.isCapturing=true;d.dispatchEvent(c)};for(var c=this.capture.length-1;c>=0;c--)a.addEventListener(this.capture[c],this._capture,true)};a.HTMLElement.prototype.releaseCapture=function(){b(this);if(!this.capture)return;for(var c=this.capture.length-1;c>=0;c--)a.removeEventListener(this.capture[c],this._capture,true);this._capture=null};Node.prototype.__defineGetter__("text",function(){return this.textContent});Node.prototype.__defineSetter__("text",function(a){this.textContent=a});a.__getEventObj=function(a){return a}}function __loadCompatLayer(a){a.__usingCompat=true;__loadCompat(a);var b=a.navigator.userAgent,c=b.indexOf("Chrome")>=0;a.__isSafari=b.indexOf("AppleWebKit")>=0||c;a.__isSafari2=a.__isSafari&&b.indexOf("Version")<0&&!c;if(a.__isSafari)_loadSafariCompat(a,__isSafari2);else _loadMozillaCompat(a);if(__isSafari2)return;_loadCompatCore(a);__loadAllCompatEx(a)}function __loadAllCompatEx(b){for(var a in CompatExtension)if(a.indexOf("c_")==0)CompatExtension[a](b)}CompatExtension={};CompatExtension.load=function(b,c){var a=CompatExtension[b];if(a)a(c)};FunctionHelper={};__loadCompatLayer(window);CompatExtension["c_focus"]=function CompatEx$Focus(a){if(__isSafari2)return;if(!a.__lastElt)a.__lastElt=a.document;a.__blurTimeout=0;a.HTMLDocument.prototype.__defineGetter__("parentWindow",function(){return a});var c=a.document.documentElement;c.addEventListener("focus",g,true);c.addEventListener("mousedown",d,true);c.addEventListener("keydown",f,true);a.addEventListener("focus",h,true);a.addEventListener("blur",i,true);function d(c){if(a.__lastElt!=c.srcElement){b("beforedeactivate",a.__lastElt);var d=c.srcElement;a.setTimeout(function(){b("focus",d)},0)}}function f(c){if(c.keyCode==9)b("beforedeactivate",a.__lastElt)}function h(){if(a.__blurTimeout!=0){a.clearTimeout(a.__blurTimeout);a.__blurTimeout=0}if(a.__userLeftBrowser){b("focusin",a.__lastElt);a.__userLeftBrowser=false}}function i(){if(a.__blurTimeout==0)a.__blurTimeout=a.setTimeout(e,100)}function e(){var c=a.__lastElt;a.__lastElt=null;a.__userLeftBrowser=true;a.__blurTimeout==0;b("focusout",c);a.__lastElt=c}function g(c){if(a.__lastElt){var d=a.__lastElt;a.__lastElt=c.srcElement;b("focusout",d);a.__lastElt=d}b("focusin",c.srcElement);a.__lastElt=c.srcElement}function b(c,d){var b=a.document.createEvent("Event");b.initEvent(c,true,false);d.dispatchEvent(b)}a.HTMLElement.prototype.setActive=function(){this.focus()};if(!a.document.activeElement)a.HTMLDocument.prototype.__defineGetter__("activeElement",function(){return a.__lastElt})};CompatExtension.load("c_focus",window);CompatExtension["c_iframe"]=function CompatEx$IFrame(a){if(__isSafari2)return;a.HTMLElement.prototype.__defineGetter__("document",function(){return a.document})};CompatExtension.load("c_iframe",window);CompatExtension["c_textRange"]=function CompatEx$TextRange(a){if(__isSafari2)return;var l=a.HTMLDocument.prototype;a.__oldCR=a.document.createRange;a.document.createRange=function(){var b=a.__oldCR.call(a.document);return e(b)};function e(b){b.__defineGetter__("text",function(){return this.cloneContents().textContent||""});b.__defineSetter__("text",function(b){this.insertNode(a.document.createTextNode(b))});b.__defineGetter__("htmlText",function(){var b=a.document.createElement("div");b.appendChild(this.cloneContents());return b.innerHTML});b.__defineGetter__("parentElement",function(){return this.commonAncestorContainer});b.moveToElementText=function(a){b.selectNodeContents(a)};b.execCommand=function(c,d,b){return a.document.execCommand(c,d||false,b||null)};b.queryCommandEnabled=function(b){return a.document.queryCommandEnabled(b)};b.queryCommandState=function(b){try{return a.document.queryCommandState(b)||false}catch(c){return false}};b.queryCommandIndeterm=function(b){return a.document.queryCommandIndeterm(b)};var c=["bold","italic","underline","fontname","fontsize","justifyleft","justifyright","justifycenter","insertorderedlist","insertunorderedlist","indent","outdent","createlink","forecolor","hilitecolor","inserthorizontalrule"];b.queryCommandSupported=function(a){return c.contains(a)};b.queryCommandValue=function(b){return a.document.queryCommandValue(b)};b.select=function(){if(a.document.designMode=="on")a.focus();else{a.getSelection().removeAllRanges();a.getSelection().addRange(b)}};b.__defineGetter__("parentElement",function(){return function(){var a=this.commonAncestorContainer;if(a.nodeType==3)a=a.parentNode;return a}});b.pasteHTML=function(a){b.execCommand("insertHTML",false,a)};return b}function c(){}function i(){a.getSelection().deleteFromDocument()}function j(){a.getSelection().removeAllRanges()}function f(){var b=a.getSelection();if(b.rangeCount==0)b.collapse(a.document.body,0);return e(b.getRangeAt(0))}c.prototype={clear:i,empty:j,createRange:f};c.prototype.__defineGetter__("type",function(){var b=a.getSelection();if(b.rangeCount>0)return "Text";return "None"});l.selection=new c;a.__selChangeTimeout=null;function h(a){while(a&&a.tagName!="BODY"){if(a.getAttribute&&a.getAttribute("contenteditable")=="true")return true;a=a.parentNode}return false}function b(b){if(a.document.designMode=="on"||h(b.srcElement)){if(a.__selChangeTimeout)clearTimeout(a.__selChangeTimeout);a.__selChangeTimeout=setTimeout(g,100)}}function g(){clearTimeout(a.__selChangeTimeout);a.__selChangeTimeout=null;k("selectionchange",a.document)}function k(c,d){var b=a.document.createEvent("Event");b.initEvent(c,true,false);d.dispatchEvent(b)}function d(){var c=a.document;c.addEventListener("DOMCharacterDataModified",b,false);c.addEventListener("mouseup",b,false);c.addEventListener("keydown",b,false);c.addEventListener("keyup",b,false)}if(!a.document.body)a.addEventListener("load",d,false);else d()};CompatExtension.load("c_textRange",window);CompatExtension["c_onresize"]=function CompatEx$KeyEvent(a){var h=a.HTMLElement.prototype.attachEvent;function f(b,c){if(b=="onresize"&&this!=a){if(this._onResized)return;this._onResized=true;if(c._isFirst)a.__firstElt={elt:this,width:-1,height:-1};else a.__eltsToScan.push({elt:this,width:-1,height:-1});b="__compatOnResize"}h.call(this,b,c)}var i=a.HTMLElement.prototype.detachEvent;function g(c,d){if(c=="onresize"&&this!=a)for(var b=a.__eltsToScan.length-1;b>=0;b--){if(a.__eltsToScan[b].elt!=this)continue;a.__eltsToScan.splice(b,1)}i.call(this,c,d)}a.attachEvent=a.HTMLDocument.prototype.attachEvent=a.HTMLElement.prototype.attachEvent=f;a.detachEvent=a.HTMLDocument=a.HTMLElement.prototype.detachEvent=g;var k=false;a.__eltsToScan=[];a.__firstElt=null;function c(){var f=a.document.getElementsByTagName("S"),c;for(var b=f.length-1;b>=0;b--){c=f[b];if(c.getAttribute("ns")!="rs")continue;var g=c[c.getAttribute("ref")||"parentElement"],e=new Function(g.getAttribute("onresize"));e._isFirst=c.getAttribute("doFirst")!=null;g.attachEvent("onresize",e)}if(a.__firstElt&&!a.__checkElement(a.__firstElt,true))a.__firstElt=null;var d=a.__eltsToScan;for(var b=d.length-1;b>=0;b--)if(!a.__checkElement(d[b],false))d.splice(b,1);a.__forceUpdate=false}a.__checkElement=function(b,e){if(!b)return false;var c=b.elt;while(c&&c.tagName!="HTML")c=c.parentElement;if(!c||!c.tagName)return false;if(a.__forceUpdate||b.elt.offsetWidth!=b.width||b.elt.offsetHeight!=b.height){var d=a.document.createEvent("UIEvents");d.initUIEvent("compatOnResize",false,false,a,1);b.elt.dispatchEvent(d);b.width=b.elt.offsetWidth;b.height=b.elt.offsetHeight;if(e)a.__forceUpdate=true}return true};a.__rsTimer=null;function e(){if(a.__rsTimer!=null){a.clearTimeout(a.__rsTimer);a.__rsTimer=null}}function b(){if(a.__rsTimer&&a.__rsTimer.type=="interval")return;e();a.__rsTimer=a.setTimeout(function(){c();e()},100);a.__rsTimer.type="timeout"}function d(){if(a.__rsTimer!=null){a.clearInterval(a.__rsTimer);a.__rsTimer=null}}function j(){d();a.__rsTimer=a.setInterval(c,250);a.__rsTimer.type="interval"}a.__scanUI=function(){a.__forceUpdate=true;b()};a.addEventListener("keydown",function(b){if(b.keyCode==17&&a.__rsTimer==null)j()},true);a.addEventListener("keyup",function(a){if(a.keyCode==17){c();d()}},true);a.addEventListener("resize",function(){b()},true);a.attachEvent("onresize",function(){b()});a.attachEvent("onfocusin",function(){if(a.__userLeftBrowser)c()});a.addEventListener("load",function(){if(!a.__isSafari){var c=a.CSSStyleDeclaration;c._oldDisplay=c.prototype.__lookupSetter__("display");c.prototype.__defineSetter__("display",function(a){c._oldDisplay.call(this,a);b()});c._oldHeight=c.prototype.__lookupSetter__("height");c.prototype.__defineSetter__("height",function(a){c._oldHeight.call(this,a);b()});c._oldWidth=c.prototype.__lookupSetter__("width");c.prototype.__defineSetter__("width",function(a){c._oldWidth.call(this,a);b()})}a.document.body.addEventListener("DOMAttrModified",function(){b()},true);a.document.body.addEventListener("DOMNodeInserted",function(){b()},true);a.document.body.addEventListener("DOMNodeRemoved",function(){b()},true);b()},false)};CompatExtension.load("c_onresize",window)
