Project

General

Profile

Bug #1429 » text-bug.js

Output, generated by Wt WidgetSet with require - Boris Nagaev, 10/05/2012 10:48 AM

 
/*
Copyright (C) 2010 Emweb bvba, Kessel-Lo, Belgium.

For terms of use, see LICENSE.
Includes Array Remove - By John Resig (MIT Licensed)
Includes jQuery Caret Range plugin
Copyright (c) 2009 Matt Zabriskie
Released under the MIT and GPL licenses.

Includes Yahoo History Frameowork
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
;
if(!window.Wt3_2_1)window.Wt3_2_1=new (function(){function M(a){return a.split("/")[2]}function N(a,b,e){if(a=="auto"||a==null)return e;return(a=(a=b.exec(a))&&a.length==2?a[1]:null)?parseFloat(a):e}function F(a,b){return N(a,/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/i,b)}function K(a){if(L==null)return null;if(!a)a=window.event;if(a){for(var b=a=g.target(a);b&&b!=L;)b=b.parentNode;return b==L?g.isIElt9?a:null:L}else return L}function P(a){var b=K(a);if(b&&!X){if(!a)a=window.event;X=true;if(g.isIElt9){g.firedTarget=
a.srcElement||b;b.fireEvent("onmousemove",a);g.firedTarget=null}else g.condCall(b,"onmousemove",a);return X=false}else return true}function Y(a){var b=K(a);g.capture(null);if(b){if(!a)a=window.event;if(g.isIElt9){g.firedTarget=a.srcElement||b;b.fireEvent("onmouseup",a);g.firedTarget=null}else g.condCall(b,"onmouseup",a);g.cancelEvent(a,g.CancelPropagate);return false}else return true}function la(){if(!ea){ea=true;if(document.body.addEventListener){var a=document.body;a.addEventListener("mousemove",
P,true);a.addEventListener("mouseup",Y,true);g.isGecko&&window.addEventListener("mouseout",function(b){!b.relatedTarget&&g.hasTag(b.target,"HTML")&&Y(b)},true)}else{a=document.body;a.attachEvent("onmousemove",P);a.attachEvent("onmouseup",Y)}}}function fa(){if(!S){var a,b,e=document.styleSheets;a=0;for(b=e.length;a<b;++a){var i=e[a];if(g.hasTag(e[a].ownerNode,"STYLE")){S=i;break}}if(!S){i=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(i);S=i.sheet}}return S}function ga(a){return a.replace(/%/g,
"%25").replace(/\+/g,"%2b").replace(/ /g,"%20").replace(/#/g,"%23").replace(/&/g,"%26")}var g=this;this.condCall=function(a,b,e){a[b]&&a[b](e)};var T=this.buttons=0;this.button=function(a){try{var b=a.type;if(g.isIE&&(b=="click"||b=="dblclick"))return T;if(b!="mouseup"&&b!="mousedown"&&b!="click"&&b!="dblclick")return 0}catch(e){return 0}return!g.isGecko&&typeof a.which!=="undefined"?a.which==3?4:a.which==2?2:a.which==1?1:0:g.isIE&&typeof a.button!=="undefined"?a.button==2?4:a.button==4?2:a.button==
1?1:0:typeof a.button!=="undefined"?a.button==2?4:a.button==1?2:1:0};this.mouseDown=function(a){g.buttons|=g.button(a)};this.mouseUp=function(a){T=g.button(a);g.buttons&=~T};this.arrayRemove=function(a,b,e){e=a.slice((e||b)+1||a.length);a.length=b<0?a.length+b:b;return a.push.apply(a,e)};this.addAll=function(a,b){for(var e=0,i=b.length;e<i;++e)a.push(b[e])};var ha=function(){for(var a,b=3,e=document.createElement("div"),i=e.getElementsByTagName("i");e.innerHTML="<!--[if gt IE "+ ++b+"]><i></i><![endif]--\>",
i[0];);return b>4?b:a}(),Q=navigator.userAgent.toLowerCase();this.isIE=ha!==undefined;this.isIE6=ha===6;this.isIElt9=ha<9;this.isIEMobile=Q.indexOf("msie 4")!=-1||Q.indexOf("msie 5")!=-1;this.isOpera=typeof window.opera!=="undefined";this.isAndroid=Q.indexOf("safari")!=-1&&Q.indexOf("android")!=-1;this.isWebKit=Q.indexOf("applewebkit")!=-1;this.isGecko=Q.indexOf("gecko")!=-1&&!this.isWebKit;this.updateDelay=this.isIE?10:51;if(this.isAndroid){console.error("init console.error");console.info("init console.info");
console.log("init console.log");console.warn("init console.warn")}var Z=new Date;this.trace=function(a,b){if(b)Z=new Date;b=new Date;b=(b.getMinutes()-Z.getMinutes())*6E4+(b.getSeconds()-Z.getSeconds())*1E3+(b.getMilliseconds()-Z.getMilliseconds());window.console&&console.log("["+b+"]: "+a)};this.initAjaxComm=function(a,b){function e(k,l){var o=null,s=true;if(window.XMLHttpRequest){o=new XMLHttpRequest;if(i)if("withCredentials"in o){if(l){o.open(k,l,true);o.withCredentials="true"}}else if(typeof XDomainRequest!=
"undefined"){o=new XDomainRequest;if(l){s=false;try{o.open(k,l+"&contentType=x-www-form-urlencoded")}catch(t){o=null}}}else o=null;else l&&o.open(k,l,true)}else if(!i&&window.ActiveXObject){try{o=new ActiveXObject("Msxml2.XMLHTTP")}catch(q){try{o=new ActiveXObject("Microsoft.XMLHTTP")}catch(A){}}l&&o&&o.open(k,l,true)}o&&l&&s&&o.setRequestHeader("Content-type","application/x-www-form-urlencoded");return o}var i=a.indexOf("://")!=-1&&M(a)!=window.location.host;return e("POST",a)!=null?new (function(){function k(o,
s,t,q){function A(G){if(!C){clearTimeout(D);G?b(0,u.responseText,s):b(1,null,s);if(u){u.onreadystatechange=new Function;try{u.onload=u.onreadystatechange}catch(H){}u=null}C=true}}function w(){if(u.readyState==4){var G=u.status==200&&u.getResponseHeader("Content-Type")&&u.getResponseHeader("Content-Type").indexOf("text/javascript")==0;A(G)}}function B(){u.onreadystatechange=new Function;u=null;C=true;b(2,null,s)}var u=e("POST",l),D=null,C=false;this.abort=function(){u.onreadystatechange=new Function;
C=true;u.abort();u=null};false&&u.setRequestHeader("Connection","close");if(q>0)D=setTimeout(B,q);u.onreadystatechange=w;try{u.onload=function(){A(true)};u.onerror=function(){A(false)}}catch(p){}u.send(o)}var l=a;this.responseReceived=function(){};this.sendUpdate=function(o,s,t,q){return new k(o,s,t,q)};this.setUrl=function(o){l=o}}):new (function(){function k(s,t,q){function A(){b(1,null,t);w.parentNode.removeChild(w)}this.userData=t;var w=this.script=document.createElement("script");
w.id="script"+q;w.setAttribute("src",l+"&"+s);w.onerror=A;document.getElementsByTagName("head")[0].appendChild(w);this.abort=function(){w.parentNode.removeChild(w)}}var l=a,o=null;this.responseReceived=function(){if(o!=null){var s=o;o.script.parentNode.removeChild(o.script);o=null;b(0,"",s.userData)}};this.sendUpdate=function(s,t,q,A){return o=new k(s,t,q,A)};this.setUrl=function(s){l=s}})};this.setHtml=function(a,b,e){function i(l,o){var s,t,q;switch(l.nodeType){case 1:s=l.namespaceURI===null?document.createElement(l.nodeName):
document.createElementNS(l.namespaceURI,l.nodeName);if(l.attributes&&l.attributes.length>0){t=0;for(q=l.attributes.length;t<q;)s.setAttribute(l.attributes[t].nodeName,l.getAttribute(l.attributes[t++].nodeName))}if(o&&l.childNodes.length>0){t=0;for(q=l.childNodes.length;t<q;){var A=i(l.childNodes[t++],o);A&&s.appendChild(A)}}return s;case 3:case 4:case 5:return document.createTextNode(l.nodeValue)}return null}if(g.isIE||true&&!e)if(e)a.innerHTML+=b;else a.innerHTML=b;else{var k;k=new DOMParser;
k=k.parseFromString("<div>"+b+"</div>","application/xhtml+xml").documentElement;if(k.nodeType!=1)k=k.nextSibling;if(!e)a.innerHTML="";b=0;for(e=k.childNodes.length;b<e;)a.appendChild(i(k.childNodes[b++],true))}};this.hasTag=function(a,b){return a.nodeType==1&&a.tagName&&a.tagName.toUpperCase()===b};this.insertAt=function(a,b,e){a.childNodes.length?a.insertBefore(b,a.childNodes[e]):a.appendChild(b)};this.remove=function(a){(a=g.getElement(a))&&a.parentNode.removeChild(a)};this.contains=function(a,
b){for(b=b.parentNode;b&&!g.hasTag(b,"BODY");){if(b==a)return true;b=b.parentNode}return false};this.unstub=function(a,b,e){if(e==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.changeTag=function(a,b){var e=document.createElement(b);if(b=="img"&&e.mergeAttributes){e.mergeAttributes(a,
false);e.src=a.src}else if(a.attributes&&a.attributes.length>0){var i;b=0;for(i=a.attributes.length;b<i;b++){var k=a.attributes[b].nodeName;k!="type"&&k!="name"&&e.setAttribute(k,a.getAttribute(k))}}for(;a.firstChild;)e.appendChild(a.removeChild(a.firstChild));a.parentNode.replaceChild(e,a)};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")){if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}g.hasTag(a,"INPUT")&&a.getAttribute("type")==
"image"&&g.changeTag(a,"img")}else{var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);var e=a.getAttribute("style");if(e)g.isIE?b.style.setAttribute("cssText",e):b.setAttribute("style",e);a.parentNode.replaceChild(b,a)}};this.navigateInternalPath=function(a,b){a=a||window.event;if(!a.ctrlKey&&!a.metaKey&&g.button(a)<=1){g.history.navigate(b,true);g.cancelEvent(a,g.CancelDefaultAction)}};this.ajaxInternalPaths=function(a){$(".Wt-ip").each(function(){var b=this.getAttribute("href"),
e=b.lastIndexOf("?wtd");if(e===-1)e=b.lastIndexOf("&wtd");if(e!==-1)b=b.substr(0,e);var i;if(b.indexOf("://")!=-1){e=document.createElement("div");e.innerHTML='<a href="'+a+'">x</a>';i=b.substr(e.firstChild.href.length-1)}else i=b.substr(a.length);if(i.substr(0,3)=="?_=")i=i.substr(3);this.setAttribute("href",b);this.setAttribute("href",this.href);this.onclick=function(k){g.navigateInternalPath(k,i)};$(this).removeClass("Wt-ip")})};this.resolveRelativeAnchors=function(){$(".Wt-rr").each(function(){this.setAttribute("href",
this.href);$(this).removeClass("Wt-rr")})};var X=false;this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){if(!X){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(e){}}}};
this.$=this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var e=0;e<window.frames.length;++e)try{if(b=window.frames[e].document.getElementById(a))return b}catch(i){}return b};this.validate=function(a){var b;b=a.options?a.options.item(a.selectedIndex).text:a.value;b=a.wtValidate.validate(b);if(b.valid){a.removeAttribute("title");$(a).removeClass("Wt-invalid")}else{a.setAttribute("title",b.message);$(a).addClass("Wt-invalid")}};this.filter=function(a,b,e){a=String.fromCharCode(typeof b.charCode!==
"undefined"?b.charCode:b.keyCode);(new RegExp(e)).test(a)||g.cancelEvent(b)};this.widgetPageCoordinates=function(a){var b=0,e=0,i;if(!a.parentNode)return{x:0,y:0};if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(var k=$(document.body).hasClass("Wt-rtl");a;){b+=a.offsetLeft;e+=a.offsetTop;if(g.css(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;e+=document.body.scrollTop+document.documentElement.scrollTop;break}i=a.offsetParent;if(i==null)a=null;else{do{a=
a.parentNode;if(g.hasTag(a,"DIV")){if(k&&!g.isGecko){if(a.scrollWidth>a.parentNode.scrollWidth)b-=a.scrollLeft+a.parentNode.scrollWidth-a.scrollWidth}else b-=a.scrollLeft;e-=a.scrollTop}}while(a!=null&&a!=i)}}return{x:b,y:e}};this.widgetCoordinates=function(a,b){b=g.pageCoordinates(b);a=g.widgetPageCoordinates(a);return{x:b.x-a.x,y:b.y-a.y}};this.pageCoordinates=function(a){if(!a)a=window.event;var b=0,e=0;if(a.pageX||a.pageY){b=a.pageX;e=a.pageY}else if(a.clientX||a.clientY){b=a.clientX+document.body.scrollLeft+
document.documentElement.scrollLeft;e=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}return{x:b,y:e}};this.windowCoordinates=function(a){a=g.pageCoordinates(a);return{x:a.x-document.body.scrollLeft-document.documentElement.scrollLeft,y:a.y-document.body.scrollTop-document.documentElement.scrollTop}};this.wheelDelta=function(a){var b=0;if(a.wheelDelta)b=a.wheelDelta>0?1:-1;else if(a.detail)b=a.detail<0?1:-1;return b};this.scrollIntoView=function(a){(a=document.getElementById(a))&&
a.scrollIntoView&&a.scrollIntoView(true)};this.getSelectionRange=function(a){if(document.selection)if(g.hasTag(a,"TEXTAREA")){var b=document.selection.createRange(),e=b.duplicate();e.moveToElementText(a);var i=0;if(b.text.length>1){i-=b.text.length;if(i<0)i=0}a=-1+i;for(e.moveStart("character",i);e.inRange(b);){e.moveStart("character");a++}b=b.text.replace(/\r/g,"");return{start:a,end:b.length+a}}else{e=b=-1;if(a=$(a).val()){e=document.selection.createRange().duplicate();e.moveEnd("character",a.length);
b=e.text==""?a.length:a.lastIndexOf(e.text);e=document.selection.createRange().duplicate();e.moveStart("character",-a.length);e=e.text.length}return{start:b,end:e}}else return a.selectionStart||a.selectionStart==0?{start:a.selectionStart,end:a.selectionEnd}:{start:-1,end:-1}};this.setSelectionRange=function(a,b,e){var i=$(a).val();if(typeof b!="number")b=-1;if(typeof e!="number")e=-1;if(b<0)b=0;if(e>i.length)e=i.length;if(e<b)e=b;if(b>e)b=e;a.focus();if(typeof a.selectionStart!=="undefined"){a.selectionStart=
b;a.selectionEnd=e}else if(document.selection){a=a.createTextRange();a.collapse(true);a.moveStart("character",b);a.moveEnd("character",e-b);a.select()}};this.isKeyPress=function(a){if(!a)a=window.event;if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||g.isIE?true:g.isOpera?a.keyCode==13||a.keyCode==27||a.keyCode>=32&&a.keyCode<125:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};var U=null,aa=null;this.eventRepeat=function(a,
b,e){g.stopRepeat();b=b||500;e=e||50;a();U=setTimeout(function(){U=null;a();aa=setInterval(a,e)},b)};this.stopRepeat=function(){if(U){clearTimeout(U);U=null}if(aa){clearInterval(aa);aa=null}};var ia=null,ba=null;this.css=function(a,b){if(a.style[b])return a.style[b];else{if(a!==ia){ia=a;ba=window.getComputedStyle?window.getComputedStyle(a,null):a.currentStyle?a.currentStyle:null}return ba?ba[b]:null}};this.parsePx=function(a){return N(a,/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/i,0)};this.px=function(a,b){return g.parsePx(g.css(a,
b))};this.pxself=function(a,b){return g.parsePx(a.style[b])};this.pctself=function(a,b){return F(a.style[b],0)};this.cssPrefix=function(a){var b=["Moz","Webkit"],e=document.createElement("div"),i,k;i=0;for(k=b.length;i<k;++i)if(b[i]+a in e.style)return b[i];return null};this.boxSizing=function(a){return(a.style.boxSizing||a.style.MozBoxSizing||a.style.WebkitBoxSizing)==="border-box"};this.isHidden=function(a){if(a.style.display=="none")return true;else return(a=a.parentNode)&&!g.hasTag(a,"BODY")?
g.isHidden(a):false};this.innerWidth=function(a){var b=a.offsetWidth;g.boxSizing(a)||(b-=g.px(a,"paddingLeft")+g.px(a,"paddingRight")+g.px(a,"borderLeftWidth")+g.px(a,"borderRightWidth"));return b};this.innerHeight=function(a){var b=a.offsetHeight;g.boxSizing(a)||(b-=g.px(a,"paddingTop")+g.px(a,"paddingBottom")+g.px(a,"borderTopWidth")+g.px(a,"borderBottomWidth"));return b};this.IEwidth=function(a,b,e){if(a.parentNode){var i=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-g.px(a,
"borderLeftWidth")-g.px(a,"borderRightWidth")-g.px(a.parentNode,"paddingLeft")-g.px(a.parentNode,"paddingRight");b=F(b,0);e=F(e,1E5);return i<b?b-1:i>e?e+1:a.style.styleFloat!=""?b-1:"auto"}else return"auto"};this.hide=function(a){g.getElement(a).style.display="none"};this.inline=function(a){g.getElement(a).style.display="inline"};this.block=function(a){g.getElement(a).style.display="block"};this.show=function(a){g.getElement(a).style.display=""};var L=null;this.firedTarget=null;this.target=function(a){try{return g.firedTarget||
a.target||a.srcElement}catch(b){return null}};var ea=false;this.capture=function(a){la();if(!(L&&a)){L=a;var b=document.body;document.body.addEventListener||(a!=null?b.setCapture():b.releaseCapture());if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){b&&L&&a==L&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=
function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var e=[],i,k=0,l=b.length;k<l;k++){i=b[k];i.className.indexOf(a)!=-1&&e.push(i)}return e}};var S=null;this.addCss=function(a,b){var e=fa();e.insertRule(a+" { "+b+" }",e.cssRules?e.cssRules.length:0)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");b.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var e=
b.previousSibling;if(!e||!g.hasTag(e,"STYLE")||e.styleSheet.cssText.length>32768){e=document.createElement("style");b.parentNode.insertBefore(e,b);e.styleSheet.cssText=a}else e.styleSheet.cssText+=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var e=0;e<document.styleSheets.length;e++){var i=document.styleSheets[e],k=0,l;do{l=null;try{if(i.cssRules)l=i.cssRules[k];else if(i.rules)l=i.rules[k];if(l&&l.selectorText)if(l.selectorText.toLowerCase()==
a)if(b=="delete"){i.cssRules?i.deleteRule(k):i.removeRule(k);return true}else return l}catch(o){}++k}while(l)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var e=document.createElement("link");e.setAttribute("href",a);e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");b!=""&&b!="all"&&e.setAttribute("media",b);b=document.getElementsByTagName("link");
if(b.length>0){b=b[b.length-1];b.parentNode.insertBefore(e,b.nextSibling)}else document.body.appendChild(e)}};this.windowSize=function(){var a,b;if(typeof window.innerWidth==="number"){a=window.innerWidth;b=window.innerHeight}else{a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}return{x:a,y:b}};this.fitToWindow=function(a,b,e,i,k){var l=g.windowSize(),o=document.body.scrollLeft+document.documentElement.scrollLeft,s=document.body.scrollTop+document.documentElement.scrollTop;
if(a.offsetParent){var t=g.widgetPageCoordinates(a.offsetParent),q=["left","right"],A=["top","bottom"],w=g.px(a,"maxWidth")||a.offsetWidth,B=g.px(a,"maxHeight")||a.offsetHeight;if(w>l.x){b=o;i=0}else if(b+w>o+l.x){i-=t.x;b=a.offsetParent.offsetWidth-(i+g.px(a,"marginRight"));i=1}else{b-=t.x;b-=g.px(a,"marginLeft");i=0}if(w>l.y){e=s;k=0}else if(e+B>s+l.y){if(k>s+l.y)k=s+l.y;k-=t.y;e=a.offsetParent.offsetHeight-(k+g.px(a,"marginBottom"));k=1}else{e-=t.y;e-=g.px(a,"marginTop");k=0}a.style[q[i]]=b+"px";
a.style[q[1-i]]="";a.style[A[k]]=e+"px";a.style[A[1-k]]=""}};this.positionXY=function(a,b,e){a=g.getElement(a);g.isHidden(a)||g.fitToWindow(a,b,e,b,e)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,e,i,k){a=g.getElement(a);if((b=g.getElement(b))&&a){var l=g.widgetPageCoordinates(b);if(i){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";if(k)a.style.display="block";if(e==g.Horizontal){e=l.x+b.offsetWidth;i=l.y;k=l.x;b=l.y+b.offsetHeight}else{e=
l.x;i=l.y+b.offsetHeight;k=l.x+b.offsetWidth;b=l.y}g.fitToWindow(a,e,i,k,b);a.style.visibility=""}};this.hasFocus=function(a){try{return a==document.activeElement}catch(b){return false}};this.history=window.history&&window.history.pushState?function(){function a(o){k[l.location.pathname+l.location.search]=o}var b=null,e=null,i=null,k={},l=window;return{_initialize:function(){},_initTimeout:function(){},register:function(o,s){function t(q){q=q.state;if(q===null)q=k[l.location.pathname+l.location.search];
if(q===null)a(b);else if(q!=b){b=q;s(b!=""?b:"/")}}b=o;i=s;a(o);window.addEventListener("popstate",t,false)},initialize:function(o,s,t){g.resolveRelativeAnchors();e=t;if(e.length>=1&&e[e.length-1]=="/"){;;e=e.substr(0,e.length-1);}},navigate:function(o,s){g.resolveRelativeAnchors();b=o;var t=e+ga(o);if(e.length<3||e.substr(e.length-3)!="?_=")t+=window.location.search;else{function q(B){if(B.length>
1)B=B.substr(1);var u=B.split("&"),D,C;B="";D=0;for(C=u.length;D<C;++D)if(u[D].split("=")[0]!="_")B+=(B.length?"&":"?")+u[D];return B}var A=q(window.location.search);if(A.length>1)t+="&"+A.substr(1)}try{window.history.pushState(o?o:"",document.title,t)}catch(w){console.log(w.toString())}g.scrollIntoView(o);s&&i(o)},getCurrentState:function(){return b}}}():function(){function a(){var m,r;r=location.href;m=r.indexOf("#");return m>=0?r.substr(m+1):null}function b(){u.value=G+"|"+H;if(t)u.value+="|"+
p.join(",")}function e(){var m,r;m=0;for(r=V.length;m<r;++m)V[m](unescape(H))}function i(m){if(m){if(!m||H!==m){H=m||G;e()}}else{H=G;e()}}function k(m){var r;m='<html><body><div id="state">'+m+"</div></body></html>";try{r=B.contentWindow.document;r.open();r.write(m);r.close();return true}catch(z){return false}}function l(){var m,r,z,I;if(!B.contentWindow||!B.contentWindow.document)setTimeout(l,10);else{m=B.contentWindow.document;z=(r=m.getElementById("state"))?r.innerText:null;I=a();setInterval(function(){var E,
J;m=B.contentWindow.document;E=(r=m.getElementById("state"))?r.innerText:null;J=a();if(E!==z){z=E;i(z);J=z?z:G;I=location.hash=J;b()}else if(J!==I){I=J;k(J)}},50);D=true;w!=null&&w()}}function o(){if(!q){var m=a(),r=history.length;C&&clearInterval(C);C=setInterval(function(){var z,I;z=a();I=history.length;if(z!==m){m=z;r=I;i(m);b()}else if(I!==r&&t){m=z;r=I;z=p[r-1];i(z);b()}},50)}}function s(){var m;m=u.value.split("|");if(m.length>1){G=m[0];H=m[1]}else G=H="";if(m.length>2)p=m[2].split(",");if(q)l();
else{o();D=true;w!=null&&w()}}var t=false,q=g.isIElt9,A=false,w=null,B=null,u=null,D=false,C=null,p=[],G,H,V=[];return{_initialize:function(){u!=null&&s()},_initTimeout:function(){o()},register:function(m,r){if(!D)H=G=escape(m);V.push(r)},initialize:function(m,r){if(!D){var z=navigator.vendor||"";if(z!=="KDE")if(typeof window.opera!=="undefined")A=true;else if(!q&&z.indexOf("Apple Computer, Inc.")>-1)t=true;if(typeof m==="string")m=document.getElementById(m);if(!(!m||m.tagName.toUpperCase()!=="TEXTAREA"&&
(m.tagName.toUpperCase()!=="INPUT"||m.type!=="hidden"&&m.type!=="text"))){u=m;if(q){if(typeof r==="string")r=document.getElementById(r);!r||r.tagName.toUpperCase()!=="IFRAME"||(B=r)}}}},navigate:function(m,r){m=ga(m);if(D){m=m;if(q)k(m);else{if(m.length>0)location.hash=m;if(t){p[history.length]=m;b()}}r&&e()}},getCurrentState:function(){if(!D)return"";return unescape(H)}}}()});if(window.Wt)try{window.Wt._p_.quit()}catch(e$$28){}
window.Wt=new (function(){function M(c){c=p.pageCoordinates(c);G=c.x;H=c.y}function N(){var c=Wt3_2_1.history.getCurrentState();if(!(c.length>0&&c.substr(0,1)!="/"))if(m!=c){m=c;setTimeout(function(){a(null,"hash",null,true)},1)}}function F(c){if(!(m==c||!m&&c=="/")){m=c;p.history.navigate(c,false)}}function K(){document.body.ondragstart=function(){return false}}function P(c,d){var f=p.target(d);if(f)if(f.offsetWidth>f.clientWidth||f.offsetHeight>f.clientHeight){var h=p.widgetPageCoordinates(f),
n=p.pageCoordinates(d),j=n.y-h.y;if(n.x-h.x>f.clientWidth||j>f.clientHeight)return true}f=r;f.object=p.getElement(c.getAttribute("dwid"));if(f.object==null)return true;f.sourceId=c.getAttribute("dsid");f.objectPrevStyle={position:f.object.style.position,display:f.object.style.display,left:f.object.style.left,top:f.object.style.top,className:f.object.className};f.object.parentNode.removeChild(f.object);f.object.style.position="absolute";f.object.className="";f.object.style["z-index"]="1000";document.body.appendChild(f.object);
p.capture(null);p.capture(f.object);f.object.onmousemove=Y;f.object.onmouseup=la;f.offsetX=-4;f.offsetY=-4;f.dropTarget=null;f.mimeType=c.getAttribute("dmt");f.xy=p.pageCoordinates(d);p.cancelEvent(d,p.CancelPropagate);return false}function Y(c){if(r.object!=null){var d=r,f=p.pageCoordinates(c);if(d.object.style.display!=""&&d.xy.x!=f.x&&d.xy.y!=f.y)d.object.style.display="";d.object.style.left=f.x-d.offsetX+"px";d.object.style.top=f.y-d.offsetY+"px";f=d.dropTarget;var h=p.target(c),n="{"+d.mimeType+
":",j=null;for(d.dropTarget=null;h;){j=h.getAttribute("amts");if(j!=null&&j.indexOf(n)!=-1){d.dropTarget=h;break}h=h.parentNode;if(!h.tagName||p.hasTag(h,"HTML"))break}if(d.dropTarget!=f){if(d.dropTarget){h=j.indexOf(n)+n.length;var v=j.indexOf("}",h);j=j.substring(h,v);if(j.length!=0){d.dropTarget.setAttribute("dos",d.dropTarget.className);d.dropTarget.className=d.dropTarget.className+" "+j}}else d.object.styleClass="";if(f!=null){f.handleDragDrop&&f.handleDragDrop("end",d.object,c,"",n);j=f.getAttribute("dos");
if(j!=null)f.className=j}}if(d.dropTarget)if(d.dropTarget.handleDragDrop)d.dropTarget.handleDragDrop("drag",d.object,c,"",n);else d.object.className="Wt-valid-drop";else d.object.className="";return false}return true}function la(c){p.capture(null);var d=r;if(d.object){if(d.dropTarget){var f=d.dropTarget.getAttribute("dos");if(f!=null)d.dropTarget.className=f;d.dropTarget.handleDragDrop?d.dropTarget.handleDragDrop("drop",d.object,c,d.sourceId,d.mimeType):o(d.dropTarget,{name:"_drop",eventObject:d.dropTarget,
event:c},d.sourceId,d.mimeType)}d.object.style.position=d.objectPrevStyle.position;d.object.style.display=d.objectPrevStyle.display;d.object.style.left=d.objectPrevStyle.left;d.object.style.top=d.objectPrevStyle.top;d.object.className=d.objectPrevStyle.className;d.object=null}}function fa(c,d,f){var h,n;n=c+"=";c=0;for(h=d.length;c<h;++c){var j=d[c];if(c!=0)n+=";";n+=[j.identifier,j.clientX,j.clientY,j.pageX,j.pageY,j.screenX,j.screenY,j.pageX-f.x,j.pageY-f.y].join(";")}return n}function ga(c,d){var f,
h;h=c.event;d=d>0?"&e"+d:"&";f=d+"signal="+c.signal;if(c.id){f+=d+"id="+c.id+d+"name="+encodeURIComponent(c.name)+d+"an="+c.args.length;for(var n=0;n<c.args.length;++n)f+=d+"a"+n+"="+encodeURIComponent(c.args[n])}for(var j=0;j<z.length;++j){var v=p.getElement(z[j]),x=null,sa;if(v!=null){if(v.wtEncodeValue)x=v.wtEncodeValue(v);else if(v.type=="select-multiple"){n=0;for(sa=v.options.length;n<sa;n++)if(v.options[n].selected)f+=d+z[j]+"="+encodeURIComponent(v.options[n].value)}else if(v.type=="checkbox"||
v.type=="radio")if(v.indeterminate||v.style.opacity=="0.5")x="i";else{if(v.checked)x=v.value}else if(v.type!="file"){if($(v).hasClass("Wt-edit-emptyText"))x="";else{v.ed&&v.ed.save();x=""+v.value}if(p.hasFocus(v)){n=p.getSelectionRange(v);f+=d+"selstart="+n.start+d+"selend="+n.end}}if(x!=null)f+=d+z[j]+"="+encodeURIComponent(x)}}try{if(document.activeElement)f+=d+"focus="+document.activeElement.id}catch(ya){}if(m!=null)f+=d+"_="+encodeURIComponent(m);if(!h){c.data=f;return c}for(j=p.target(h);j&&
!j.id&&j.parentNode;)j=j.parentNode;if(j&&j.id)f+=d+"tid="+j.id;try{f+=d+"type="+h.type}catch(za){}if(h.clientX||h.clientY)f+=d+"clientX="+h.clientX+d+"clientY="+h.clientY;x=p.pageCoordinates(h);j=x.x;n=x.y;if(j||n){f+=d+"documentX="+j+d+"documentY="+n;f+=d+"dragdX="+(j-G)+d+"dragdY="+(n-H);x=p.wheelDelta(h);f+=d+"wheel="+x}if(h.screenX||h.screenY)f+=d+"screenX="+h.screenX+d+"screenY="+h.screenY;x={x:0,y:0};if(c.object&&c.object.nodeType!=9){x=p.widgetPageCoordinates(c.object);f+=d+"scrollX="+c.object.scrollLeft+
d+"scrollY="+c.object.scrollTop+d+"width="+c.object.clientWidth+d+"height="+c.object.clientHeight+d+"widgetX="+(j-x.x)+d+"widgetY="+(n-x.y)}j=p.button(h);if(!j)if(p.buttons&1)j=1;else if(p.buttons&2)j=2;else if(p.buttons&4)j=4;f+=d+"button="+j;if(typeof h.keyCode!=="undefined")f+=d+"keyCode="+h.keyCode;j=0;if(typeof h.charCode!=="undefined"){if(h.type=="keypress")j=h.charCode}else if(h.type=="keypress")j=h.keyCode;f+=d+"charCode="+j;if(h.altKey)f+=d+"altKey=1";if(h.ctrlKey)f+=d+"ctrlKey=1";if(h.metaKey)f+=
d+"metaKey=1";if(h.shiftKey)f+=d+"shiftKey=1";if(typeof h.touches!=="undefined")f+=fa(d+"touches",h.touches,x);if(typeof h.targetTouches!=="undefined")f+=fa(d+"ttouches",h.targetTouches,x);if(typeof h.changedTouches!=="undefined")f+=fa(d+"ctouches",h.changedTouches,x);if(h.scale)f+=d+"scale="+h.scale;if(h.rotation)f+=d+"rotation="+h.rotation;c.data=f;return c}function g(){for(var c="",d=false,f=0;f<E.length;++f){d=d||E[f].feedback;c+=E[f].data}I=E;E=[];return{feedback:d,result:c}}function T(){R=true;
if(ja){clearInterval(ja);ja=null}var c=$("#Wt-timers");c.size()>0&&p.setHtml(c.get(0),"",false)}function ha(){p.history._initTimeout();ka==0&&a(null,"none",null,false)}function Q(c){if(!p.isIEMobile)document.title=c}function Z(c){if(!ta){if(c){if(!window.WtLoadWidgetTree)return;p.history.initialize("Wt-history-field","Wt-history-iframe",V)}if(!("activeElement"in document)){function d(h){if(h&&h.target)document.activeElement=h.target==document?null:h.target}function f(){document.activeElement=
null}document.addEventListener("focus",d,true);document.addEventListener("blur",f,true)}$(document).mousedown(p.mouseDown).mouseup(p.mouseUp);p.history._initialize();K();ta=true;c&&window.WtLoadWidgetTree();R||ja||(ja=setInterval(ha,300000))}}function X(c){clearTimeout(c);document.body.style.cursor="auto";if(ma!=null){try{ma()}catch(d){}ma=null}}function U(){document.body.style.cursor="wait";ma=hideLoadingIndicator;showLoadingIndicator()}function aa(c){ua=c}function ia(){if(!oa){oa=
true;setTimeout(function(){oa=false;C._p_.autoJavaScript()},1)}}function ba(c){if(c){c="(function() {"+c+"})();";window.execScript?window.execScript(c):window.eval(c)}C==window.Wt&&ia()}function L(c,d,f){if(!R){if(c==0){p.resolveRelativeAnchors();;ba(d);;f&&X(f)}else E=I.concat(E);I=[];if(W){clearTimeout(W);W=null}O=null;if(c>0)++ka;else ka=0;if(!R)if(ua||E.length>0)if(c==1){c=Math.min(12E4,Math.exp(ka)*500);ca=setTimeout(function(){k()},c)}else k()}}function ea(c){J=c.indexOf("://")!=-1||c[0]=="/"?c:V+c;na&&na.setUrl(c)}function S(){O.abort();W=O=null;R||k()}function a(c,d,f,h){if(!pa){pa=true;p.checkReleaseCapture(c,f);;var n={},j=E.length;n.object=c;n.signal=d;n.event=
window.fakeEvent||f;n.feedback=h;E[j]=ga(n,j);b();ba();;pa=false}}function b(){if(!R){;if(y.state!=2)if(typeof window.WebSocket==="undefined"&&typeof window.MozWebSocket==="undefined")y.state=2;else{var c=y.socket;if(c==null||c.readyState>1)if(c!=null&&y.state==0)y.state=2;else{function d(){++y.reconnectTries;var h=Math.min(12E4,Math.exp(y.reconnectTries)*500);setTimeout(function(){b()},h)}var f;if(J.indexOf("://")!=-1)f=
"ws"+J.substr(4);else{f=J.substr(J.indexOf("?"));f="ws"+location.protocol.substr(4)+"//"+location.hostname+":"+location.port+V+f}f+="&request=ws";y.socket=typeof window.WebSocket!=="undefined"?(c=new WebSocket(f)):(c=new MozWebSocket(f));y.keepAlive&&clearInterval(y.keepAlive);y.keepAlive=null;c.onmessage=function(h){y.reconnectTries=0;y.state=1;L(0,h.data,null)};c.onerror=function(){if(reconnectTries==3&&y.state==0)y.state=2;d()};c.onclose=function(){if(y.reconnectTries==3&&y.state==0)y.state=2;
d()};c.onopen=function(){y.keepAlive=setInterval(function(){if(c.readyState==1)c.send("&signal=ping");else{clearInterval(y.keepAlive);y.keepAlive=null}},50000)}}if(c.readyState==1){k();return}};if(O!=null&&W!=null){clearTimeout(W);O.abort();O=null}if(O==null)if(ca==null){ca=setTimeout(function(){k()},p.updateDelay);va=(new Date).getTime()}else if(ka){clearTimeout(ca);k()}else if((new Date).getTime()-va>p.updateDelay){clearTimeout(ca);k()}}}function e(c,d){qa=d;ra=
c;na.responseReceived(c)}function i(c){wa=c}function k(){if(C!=window.Wt)T();else if(!O){ca=null;if(R){if(!xa){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;xa=true}}else{var c,d,f;if(E.length>0){c=g();d=c.feedback?setTimeout(U,500):null;f=false}else{c={result:"&signal=poll"};d=null;f=true}c.result+="&ackId="+ra+"&pageId="+wa;if(qa){var h="",n=$("#"+qa).get(0);if(n)for(n=n.parentNode;!p.hasTag(n,"BODY");n=n.parentNode)if(n.id){if(h!=
"")h+=",";h+=n.id}c.result+="&ackPuzzle="+encodeURIComponent(h)}c.result+="&";if(y.socket!=null&&y.socket.readyState==1){O=null;d!=null&&clearTimeout(d);f||y.socket.send(c.result)}else{O=na.sendUpdate("request=jsupdate"+c.result,d,ra,-1);W=f?setTimeout(S,50000):null}}}}function l(c,d,f){if(typeof c.wtWidth==="undefined"||c.wtWidth!=d||typeof c.wtHeight==="undefined"||c.wtHeight!=f){c.wtWidth=d;c.wtHeight=f;o(c,"resized",d,f)}}function o(c,d){var f={},h=E.length;f.signal=
"user";f.id=typeof c==="string"?c:c==C?"app":c.id;if(typeof d==="object"){f.name=d.name;f.object=d.eventObject;f.event=d.event}else{f.name=d;f.object=f.event=null}f.args=[];for(var n=2;n<arguments.length;++n){var j=arguments[n];j=j===false?0:j===true?1:j.toDateString?j.toDateString():j;f.args[n-2]=j}f.feedback=true;E[h]=ga(f,h);b()}function s(c,d,f){var h=function(){var j=p.getElement(c);if(j){if(f)j.timer=setTimeout(j.tm,d);else{j.timer=null;j.tm=null}j.onclick&&j.onclick()}},n=p.getElement(c);n.timer=
setTimeout(h,d);n.tm=h}function t(c,d){setTimeout(function(){if(da[c]===true)d();else da[c]=d},20)}function q(c){if(da[c]!==true){typeof da[c]!=="undefined"&&da[c]();da[c]=true}}function A(c,d,f){function h(){var x=f===undefined?p.isIE?1:2:f;if(x>1)A(c,d,x-1);else{alert("Fatal error: failed loading "+c);T()}}var n=false;if(d!="")try{n=!eval("typeof "+d+" === 'undefined'")}catch(j){n=false}if(n)q(c);else{var v=document.createElement("script");v.setAttribute("src",c);v.onload=function(){q(c)};v.onerror=
h;v.onreadystatechange=function(){var x=v.readyState;if(x=="loaded")p.isOpera||p.isIE?q(c):h();else x=="complete"&&q(c)};document.getElementsByTagName("head")[0].appendChild(v)}}function w(c,d){this.callback=d;this.work=c.length;this.images=[];if(c.length==0)d(this.images);else for(d=0;d<c.length;d++)this.preload(c[d])}function B(c){m=c;p.history.register(c,N)}function u(c){if(c.ieAlternativeExecuted)return"0";C.emit(c.parentNode,"IeAltnernative");c.style.width="";c.ieAlternativeExecuted=true;return"0"}
function D(c){window.onbeforeunload=c&&c!=""?function(d){if(d=d||window.event)d.returnValue=c;return c}:null}var C=this,p=Wt3_2_1,G=0,H=0,V='/text.js',m=null,r={object:null,sourceId:null,mimeType:null,dropOffsetX:null,dragOffsetY:null,dropTarget:null,objectPrevStyle:null,xy:null},z=[],I=[],E=[],J,R=false,xa=false,ta=false,O=null,W=null,ja=null,ka=0,ua=false,ca=null,ma=null,y={state:0,socket:null,keepAlive:null,reconnectTries:0},oa=false;ea('http://0.0.0.0:8000/text.js?wtd=iArJW1MqaUMrBFss&wtd=iArJW1MqaUMrBFss');var na=p.initAjaxComm(J,
L),pa=false,va,ra=28420364,qa=null,wa=0,da={};w.prototype.preload=function(c){var d=new Image;this.images.push(d);d.onload=w.prototype.onload;d.onerror=w.prototype.onload;d.onabort=w.prototype.onload;d.imagePreloader=this;d.src=c};w.prototype.onload=function(){var c=this.imagePreloader;--c.work==0&&c.callback(c.images)};window.onunload=function(){if(!R){C.emit(C,"Wt-unload");b();k()}};this._p_={ieAlternative:u,loadScript:A,onJsLoad:t,setTitle:Q,update:a,quit:T,setSessionUrl:ea,setFormObjects:function(c){z=
c},saveDownPos:M,addTimerEvent:s,load:Z,setServerPush:aa,dragStart:P,dragDrag:Y,dragEnd:la,capture:p.capture,enableInternalPaths:B,onHashChange:N,setHash:F,ImagePreloader:w,doAutoJavaScript:ia,autoJavaScript:function(){},response:e,setPage:i,setCloseMessage:D,propagateSize:l};this.WT=Wt3_2_1;this.emit=o});window.WtSignalEmit=Wt.emit;window.WtOnLoad=function(){Wt._p_.load()};
Wt._p_.setPage(0);$(document).ready(function() { Wt._p_.update(null, 'load', null, false);});
(2-2/3)