/**
 * witoPreQueryProtect
 */
wito_useOwnjQuery = function() {
    /* leave function open; jQuery inlined below */

/*
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
 * $Rev: 5685 $
 */
(function(){function H(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function r(a,b){return a[0]&&parseInt(c.curCSS(a[0],b,true),10)||0}function C(){if(!D){D=true;document.addEventListener&&!c.browser.opera&&document.addEventListener("DOMContentLoaded",c.ready,false);c.browser.msie&&window==top&&function(){if(!c.isReady){try{document.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,
0);return}c.ready()}}();c.browser.opera&&document.addEventListener("DOMContentLoaded",function(){if(!c.isReady){for(var b=0;b<document.styleSheets.length;b++)if(document.styleSheets[b].disabled){setTimeout(arguments.callee,0);return}c.ready()}},false);if(c.browser.safari){var a;(function(){if(!c.isReady)if(document.readyState!="loaded"&&document.readyState!="complete")setTimeout(arguments.callee,0);else{if(a===n)a=c("style, link[rel=stylesheet]").length;document.styleSheets.length!=a?setTimeout(arguments.callee,
0):c.ready()}})()}c.event.add(window,"load",c.ready)}}var I=window.jQuery,J=window.$,c=window.jQuery=window.$=function(a,b){return new c.fn.init(a,b)},K=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,E=/^.[^:#\[\.]*$/,n;c.fn=c.prototype={init:function(a,b){a=a||document;if(a.nodeType){this[0]=a;this.length=1;return this}if(typeof a=="string"){var d=K.exec(a);if(d&&(d[1]||!b))if(d[1])a=c.clean([d[1]],b);else{var e=document.getElementById(d[3]);if(e){if(e.id!=d[3])return c().find(a);return c(e)}a=[]}else return c(b).find(a)}else if(c.isFunction(a))return c(document)[c.fn.ready?
"ready":"load"](a);return this.setArray(c.makeArray(a))},jquery:"1.2.6",size:function(){return this.length},length:0,get:function(a){return a==n?c.makeArray(this):this[a]},pushStack:function(a){a=c(a);a.prevObject=this;return a},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return c.each(this,a,b)},index:function(a){return c.inArray(a&&a.jquery?a[0]:a,this)},attr:function(a,b,d){var e=a;if(a.constructor==String)if(b===n)return this[0]&&c[d||
"attr"](this[0],a);else{e={};e[a]=b}return this.each(function(g){for(a in e)c.attr(d?this.style:this,a,c.prop(this,e[a],d,g,a))})},css:function(a,b){if((a=="width"||a=="height")&&parseFloat(b)<0)b=n;return this.attr(a,b,"curCSS")},text:function(a){if(typeof a!="object"&&a!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a));var b="";c.each(a||this,function(){c.each(this.childNodes,function(){if(this.nodeType!=8)b+=this.nodeType!=1?this.nodeValue:c.fn.text([this])})});
return b},wrapAll:function(a){this[0]&&c(a,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){for(var b=this;b.firstChild;)b=b.firstChild;return b}).append(this);return this},wrapInner:function(a){return this.each(function(){c(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,false,function(a){this.nodeType==1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,
true,true,function(a){this.nodeType==1&&this.insertBefore(a,this.firstChild)})},before:function(){return this.domManip(arguments,false,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,true,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||c([])},find:function(a){var b=c.map(this,function(d){return c.find(a,d)});return this.pushStack(/[^+>] [^+>]/.test(a)||a.indexOf("..")>-1?c.unique(b):
b)},clone:function(a){var b=this.map(function(){if(c.browser.msie&&!c.isXMLDoc(this)){var e=this.cloneNode(true),g=document.createElement("div");g.appendChild(e);return c.clean([g.innerHTML])[0]}else return this.cloneNode(true)}),d=b.find("*").andSelf().each(function(){if(this[s]!=n)this[s]=null});a===true&&this.find("*").andSelf().each(function(e){if(this.nodeType!=3){var g=c.data(this,"events");for(var f in g)for(var h in g[f])c.event.add(d[e],f,g[f][h],g[f][h].data)}});return b},filter:function(a){return this.pushStack(c.isFunction(a)&&
c.grep(this,function(b,d){return a.call(b,d)})||c.multiFilter(a,this))},not:function(a){if(a.constructor==String)if(E.test(a))return this.pushStack(c.multiFilter(a,this,true));else a=c.multiFilter(a,this);var b=a.length&&a[a.length-1]!==n&&!a.nodeType;return this.filter(function(){return b?c.inArray(this,a)<0:this!=a})},add:function(a){return this.pushStack(c.unique(c.merge(this.get(),typeof a=="string"?c(a):c.makeArray(a))))},is:function(a){return!!a&&c.multiFilter(a,this).length>0},hasClass:function(a){return this.is("."+
a)},val:function(a){if(a==n){if(this.length){var b=this[0];if(c.nodeName(b,"select")){var d=b.selectedIndex,e=[],g=b.options;b=b.type=="select-one";if(d<0)return null;var f=b?d:0;for(d=b?d+1:g.length;f<d;f++){var h=g[f];if(h.selected){a=c.browser.msie&&!h.attributes.value.specified?h.text:h.value;if(b)return a;e.push(a)}}return e}else return(this[0].value||"").replace(/\r/g,"")}return n}if(a.constructor==Number)a+="";return this.each(function(){if(this.nodeType==1)if(a.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=
c.inArray(this.value,a)>=0||c.inArray(this.name,a)>=0;else if(c.nodeName(this,"select")){var i=c.makeArray(a);c("option",this).each(function(){this.selected=c.inArray(this.value,i)>=0||c.inArray(this.text,i)>=0});if(!i.length)this.selectedIndex=-1}else this.value=a})},html:function(a){return a==n?this[0]?this[0].innerHTML:null:this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,
arguments))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},andSelf:function(){return this.add(this.prevObject)},data:function(a,b){var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===n){var e=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(e===n&&this.length)e=c.data(this[0],a);return e===n&&d[1]?this.data(d[0]):e}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,
a)})},domManip:function(a,b,d,e){var g=this.length>1,f;return this.each(function(){if(!f){f=c.clean(a,this.ownerDocument);d&&f.reverse()}var h=this;if(b&&c.nodeName(this,"table")&&c.nodeName(f[0],"tr"))h=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var i=c([]);c.each(f,function(){var j=g?c(this).clone(true)[0]:this;if(c.nodeName(j,"script"))i=i.add(j);else{if(j.nodeType==1)i=i.add(c("script",j).remove());e.call(h,j)}});i.each(H)})}};c.fn.init.prototype=
c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,e=false,g;if(a.constructor==Boolean){e=a;a=arguments[1]||{};b=2}if(typeof a!="object"&&typeof a!="function")a={};if(d==b){a=this;--b}for(;b<d;b++)if((g=arguments[b])!=null)for(var f in g){var h=a[f],i=g[f];if(a!==i)if(e&&i&&typeof i=="object"&&!i.nodeType)a[f]=c.extend(e,h||(i.length!=null?[]:{}),i);else if(i!==n)a[f]=i}return a};var s="jQuery"+ +new Date,L=0,F={},M=/z-?index|font-?weight|opacity|zoom|line-?height/i,
A=document.defaultView||{};c.extend({noConflict:function(a){window.$=J;if(a)window.jQuery=I;return c},isFunction:function(a){return!!a&&typeof a!="string"&&!a.nodeName&&a.constructor!=Array&&/^[\s[]?function/.test(a+"")},isXMLDoc:function(a){return a.documentElement&&!a.body||a.tagName&&a.ownerDocument&&!a.ownerDocument.body},globalEval:function(a){if(a=c.trim(a)){var b=document.getElementsByTagName("head")[0]||document.documentElement,d=document.createElement("script");d.type="text/javascript";if(c.browser.msie)d.text=
a;else d.appendChild(document.createTextNode(a));b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()==b.toUpperCase()},cache:{},data:function(a,b,d){a=a==window?F:a;var e=a[s];e||(e=a[s]=++L);if(b&&!c.cache[e])c.cache[e]={};if(d!==n)c.cache[e][b]=d;return b?c.cache[e][b]:e},removeData:function(a,b){a=a==window?F:a;var d=a[s];if(b){if(c.cache[d]){delete c.cache[d][b];b="";for(b in c.cache[d])break;b||c.removeData(a)}}else{try{delete a[s]}catch(e){a.removeAttribute&&
a.removeAttribute(s)}delete c.cache[d]}},each:function(a,b,d){var e,g=0,f=a.length;if(d)if(f==n)for(e in a){if(b.apply(a[e],d)===false)break}else for(;g<f;){if(b.apply(a[g++],d)===false)break}else if(f==n)for(e in a){if(b.call(a[e],e,a[e])===false)break}else for(d=a[0];g<f&&b.call(d,g,d)!==false;d=a[++g]);return a},prop:function(a,b,d,e,g){if(c.isFunction(b))b=b.call(a,e);return b&&b.constructor==Number&&d=="curCSS"&&!M.test(g)?b+"px":b},className:{add:function(a,b){c.each((b||"").split(/\s+/),function(d,
e){if(a.nodeType==1&&!c.className.has(a.className,e))a.className+=(a.className?" ":"")+e})},remove:function(a,b){if(a.nodeType==1)a.className=b!=n?c.grep(a.className.split(/\s+/),function(d){return!c.className.has(b,d)}).join(" "):""},has:function(a,b){return c.inArray(b,(a.className||a).toString().split(/\s+/))>-1}},swap:function(a,b,d){var e={};for(var g in b){e[g]=a.style[g];a.style[g]=b[g]}d.call(a);for(g in b)a.style[g]=e[g]},css:function(a,b,d){if(b=="width"||b=="height"){var e;d={position:"absolute",
visibility:"hidden",display:"block"};var g=b=="width"?["Left","Right"]:["Top","Bottom"],f=function(){e=b=="width"?a.offsetWidth:a.offsetHeight;var h=0,i=0;c.each(g,function(){h+=parseFloat(c.curCSS(a,"padding"+this,true))||0;i+=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0});e-=Math.round(h+i)};c(a).is(":visible")?f():c.swap(a,d,f);return Math.max(0,e)}return c.curCSS(a,b,d)},curCSS:function(a,b,d){function e(i){if(!c.browser.safari)return false;i=A.getComputedStyle(i,null);return!i||i.getPropertyValue("color")==
""}var g,f=a.style;if(b=="opacity"&&c.browser.msie){g=c.attr(f,"opacity");return g==""?"1":g}if(c.browser.opera&&b=="display"){var h=f.outline;f.outline="0 solid black";f.outline=h}if(b.match(/float/i))b=y;if(!d&&f&&f[b])g=f[b];else if(A.getComputedStyle){if(b.match(/float/i))b="float";b=b.replace(/([A-Z])/g,"-$1").toLowerCase();if((g=A.getComputedStyle(a,null))&&!e(a))g=g.getPropertyValue(b);else{f=[];d=[];h=a;for(a=0;h&&e(h);h=h.parentNode)d.unshift(h);for(;a<d.length;a++)if(e(d[a])){f[a]=d[a].style.display;
d[a].style.display="block"}g=b=="display"&&f[d.length-1]!=null?"none":g&&g.getPropertyValue(b)||"";for(a=0;a<f.length;a++)if(f[a]!=null)d[a].style.display=f[a]}if(b=="opacity"&&g=="")g="1"}else if(a.currentStyle){g=b.replace(/\-(\w)/g,function(i,j){return j.toUpperCase()});g=a.currentStyle[b]||a.currentStyle[g];if(!/^\d+(px)?$/i.test(g)&&/^\d/.test(g)){b=f.left;d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;f.left=g||0;g=f.pixelLeft+"px";f.left=b;a.runtimeStyle.left=d}}return g},clean:function(a,
b){var d=[];b=b||document;if(typeof b.createElement=="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||document;c.each(a,function(e,g){if(g){if(g.constructor==Number)g+="";if(typeof g=="string"){g=g.replace(/(<(\w+)[^>]*?)\/>/g,function(j,k,l){return l.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?j:k+"></"+l+">"});var f=c.trim(g).toLowerCase(),h=b.createElement("div"),i=!f.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!f.indexOf("<leg")&&[1,"<fieldset>",
"</fieldset>"]||f.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!f.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!f.indexOf("<td")||!f.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!f.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||c.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];for(h.innerHTML=i[1]+g+i[2];i[0]--;)h=h.lastChild;if(c.browser.msie){f=!f.indexOf("<table")&&f.indexOf("<tbody")<0?h.firstChild&&h.firstChild.childNodes:
i[1]=="<table>"&&f.indexOf("<tbody")<0?h.childNodes:[];for(i=f.length-1;i>=0;--i)c.nodeName(f[i],"tbody")&&!f[i].childNodes.length&&f[i].parentNode.removeChild(f[i]);/^\s/.test(g)&&h.insertBefore(b.createTextNode(g.match(/^\s*/)[0]),h.firstChild)}g=c.makeArray(h.childNodes)}if(!(g.length===0&&!c.nodeName(g,"form")&&!c.nodeName(g,"select")))if(g[0]==n||c.nodeName(g,"form")||g.options)d.push(g);else d=c.merge(d,g)}});return d},attr:function(a,b,d){if(!a||a.nodeType==3||a.nodeType==8)return n;var e=
!c.isXMLDoc(a),g=d!==n,f=c.browser.msie;b=e&&c.props[b]||b;if(a.tagName){var h=/href|src|style/.test(b);if(b in a&&e&&!h){if(g){if(b=="type"&&c.nodeName(a,"input")&&a.parentNode)throw"type property can't be changed";a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;return a[b]}if(f&&e&&b=="style")return c.attr(a.style,"cssText",d);g&&a.setAttribute(b,""+d);a=f&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?n:a}if(f&&b=="opacity"){if(g){a.zoom=
1;a.filter=(a.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(d)+""=="NaN"?"":"alpha(opacity="+d*100+")")}return a.filter&&a.filter.indexOf("opacity=")>=0?parseFloat(a.filter.match(/opacity=([^)]*)/)[1])/100+"":""}b=b.replace(/-([a-z])/ig,function(i,j){return j.toUpperCase()});if(g)a[b]=d;return a[b]},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var b=[];if(a!=null){var d=a.length;if(d==null||a.split||a.setInterval||a.call)b[0]=a;else for(;d;)b[--d]=a[d]}return b},
inArray:function(a,b){for(var d=0,e=b.length;d<e;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=0,e,g=a.length;if(c.browser.msie)for(;e=b[d++];){if(e.nodeType!=8)a[g++]=e}else for(;e=b[d++];)a[g++]=e;return a},unique:function(a){var b=[],d={};try{for(var e=0,g=a.length;e<g;e++){var f=c.data(a[e]);if(!d[f]){d[f]=true;b.push(a[e])}}}catch(h){b=a}return b},grep:function(a,b,d){for(var e=[],g=0,f=a.length;g<f;g++)!d!=!b(a[g],g)&&e.push(a[g]);return e},map:function(a,b){for(var d=[],e=0,
g=a.length;e<g;e++){var f=b(a[e],e);if(f!=null)d[d.length]=f}return d.concat.apply([],d)}});var u=navigator.userAgent.toLowerCase();c.browser={version:(u.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(u),opera:/opera/.test(u),msie:/msie/.test(u)&&!/opera/.test(u),mozilla:/mozilla/.test(u)&&!/(compatible|webkit)/.test(u)};var y=c.browser.msie?"styleFloat":"cssFloat";c.extend({boxModel:!c.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className",
"float":y,cssFloat:y,styleFloat:y,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});c.each({parent:function(a){return a.parentNode},parents:function(a){return c.dir(a,"parentNode")},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},
contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d){var e=c.map(this,b);if(d&&typeof d=="string")e=c.multiFilter(d,e);return this.pushStack(c.unique(e))}});c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(){var d=arguments;return this.each(function(){for(var e=0,g=d.length;e<g;e++)c(d[e])[b](this)})}});
c.each({removeAttr:function(a){c.attr(this,a,"");this.nodeType==1&&this.removeAttribute(a)},addClass:function(a){c.className.add(this,a)},removeClass:function(a){c.className.remove(this,a)},toggleClass:function(a){c.className[c.className.has(this,a)?"remove":"add"](this,a)},remove:function(a){if(!a||c.filter(a,[this]).r.length){c("*",this).add(this).each(function(){c.event.remove(this);c.removeData(this)});this.parentNode&&this.parentNode.removeChild(this)}},empty:function(){for(c(">*",this).remove();this.firstChild;)this.removeChild(this.firstChild)}},
function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn[d]=function(e){return this[0]==window?c.browser.opera&&document.body["client"+b]||c.browser.safari&&window["inner"+b]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+b]||document.body["client"+b]:this[0]==document?Math.max(Math.max(document.body["scroll"+b],document.documentElement["scroll"+b]),Math.max(document.body["offset"+b],document.documentElement["offset"+
b])):e==n?this.length?c.css(this[0],d):null:this.css(d,e.constructor==String?e:e+"px")}});var v=c.browser.safari&&parseInt(c.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uffff*_-]|\\\\.)",N=RegExp("^>\\s*("+v+"+)"),O=RegExp("^("+v+"+)(#)("+v+"+)"),P=RegExp("^([#.]?)("+v+"*)");c.extend({expr:{"":function(a,b,d){return d[2]=="*"||c.nodeName(a,d[2])},"#":function(a,b,d){return a.getAttribute("id")==d[2]},":":{lt:function(a,b,d){return b<d[3]-0},gt:function(a,b,d){return b>d[3]-0},nth:function(a,
b,d){return d[3]-0==b},eq:function(a,b,d){return d[3]-0==b},first:function(a,b){return b==0},last:function(a,b,d,e){return b==e.length-1},even:function(a,b){return b%2==0},odd:function(a,b){return b%2},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a},"last-child":function(a){return c.nth(a.parentNode.lastChild,1,"previousSibling")==a},"only-child":function(a){return!c.nth(a.parentNode.lastChild,2,"previousSibling")},parent:function(a){return a.firstChild},empty:function(a){return!a.firstChild},
contains:function(a,b,d){return(a.textContent||a.innerText||c(a).text()||"").indexOf(d[3])>=0},visible:function(a){return"hidden"!=a.type&&c.css(a,"display")!="none"&&c.css(a,"visibility")!="hidden"},hidden:function(a){return"hidden"==a.type||c.css(a,"display")=="none"||c.css(a,"visibility")=="hidden"},enabled:function(a){return!a.disabled},disabled:function(a){return a.disabled},checked:function(a){return a.checked},selected:function(a){return a.selected||c.attr(a,"selected")},text:function(a){return"text"==
a.type},radio:function(a){return"radio"==a.type},checkbox:function(a){return"checkbox"==a.type},file:function(a){return"file"==a.type},password:function(a){return"password"==a.type},submit:function(a){return"submit"==a.type},image:function(a){return"image"==a.type},reset:function(a){return"reset"==a.type},button:function(a){return"button"==a.type||c.nodeName(a,"button")},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},has:function(a,b,d){return c.find(d[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},
animated:function(a){return c.grep(c.timers,function(b){return a==b.elem}).length}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,RegExp("^([:.#]*)("+v+"+)")],multiFilter:function(a,b,d){for(var e,g=[];a&&a!=e;){e=a;var f=c.filter(a,b,d);a=f.t.replace(/^\s*,\s*/,"");g=d?b=f.r:c.merge(g,f.r)}return g},find:function(a,b){if(typeof a!="string")return[a];if(b&&b.nodeType!=1&&b.nodeType!=9)return[];b=b||document;for(var d=[b],e=[],g,f;a&&g!=
a;){var h=[];g=a;a=c.trim(a);f=false;var i=N,j=i.exec(a);if(j){f=j[1].toUpperCase();for(var k=0;d[k];k++)for(j=d[k].firstChild;j;j=j.nextSibling)if(j.nodeType==1&&(f=="*"||j.nodeName.toUpperCase()==f))h.push(j);d=h;a=a.replace(i,"");if(a.indexOf(" ")==0)continue;f=true}else{i=/^([>+~])\s*(\w*)/i;if((j=i.exec(a))!=null){h=[];k={};f=j[2].toUpperCase();j=j[1];for(var l=0,p=d.length;l<p;l++)for(var o=j=="~"||j=="+"?d[l].nextSibling:d[l].firstChild;o;o=o.nextSibling)if(o.nodeType==1){var m=c.data(o);if(j==
"~"&&k[m])break;if(!f||o.nodeName.toUpperCase()==f){if(j=="~")k[m]=true;h.push(o)}if(j=="+")break}d=h;a=c.trim(a.replace(i,""));f=true}}if(a&&!f)if(a.indexOf(",")){i=O;if(j=i.exec(a))j=[0,j[2],j[3],j[1]];else{i=P;j=i.exec(a)}j[2]=j[2].replace(/\\/g,"");f=d[d.length-1];if(j[1]=="#"&&f&&f.getElementById&&!c.isXMLDoc(f)){d=f.getElementById(j[2]);if((c.browser.msie||c.browser.opera)&&d&&typeof d.id=="string"&&d.id!=j[2])d=c('[@id="'+j[2]+'"]',f)[0];d=h=d&&(!j[3]||c.nodeName(d,j[3]))?[d]:[]}else{for(k=
0;d[k];k++){f=j[1]=="#"&&j[3]?j[3]:j[1]!=""||j[0]==""?"*":j[2];if(f=="*"&&d[k].nodeName.toLowerCase()=="object")f="param";h=c.merge(h,d[k].getElementsByTagName(f))}if(j[1]==".")h=c.classFilter(h,j[2]);if(j[1]=="#"){d=[];for(k=0;h[k];k++)if(h[k].getAttribute("id")==j[2]){d=[h[k]];break}h=d}d=h}a=a.replace(i,"")}else{b==d[0]&&d.shift();e=c.merge(e,d);h=d=[b];a=" "+a.substr(1,a.length)}if(a){h=c.filter(a,h);d=h.r;a=c.trim(h.t)}}if(a)d=[];d&&b==d[0]&&d.shift();return e=c.merge(e,d)},classFilter:function(a,
b,d){b=" "+b+" ";for(var e=[],g=0;a[g];g++){var f=(" "+a[g].className+" ").indexOf(b)>=0;if(!d&&f||d&&!f)e.push(a[g])}return e},filter:function(a,b,d){for(var e;a&&a!=e;){e=a;for(var g=c.parse,f,h=0;g[h];h++)if(f=g[h].exec(a)){a=a.substring(f[0].length);f[2]=f[2].replace(/\\/g,"");break}if(!f)break;if(f[1]==":"&&f[2]=="not")b=E.test(f[3])?c.filter(f[3],b,true).r:c(b).not(f[3]);else if(f[1]==".")b=c.classFilter(b,f[2],d);else if(f[1]=="["){g=[];var i=f[3];h=0;for(var j=b.length;h<j;h++){var k=b[h],
l=k[c.props[f[2]]||f[2]];if(l==null||/href|src|selected/.test(f[2]))l=c.attr(k,f[2])||"";if((i==""&&!!l||i=="="&&l==f[5]||i=="!="&&l!=f[5]||i=="^="&&l&&!l.indexOf(f[5])||i=="$="&&l.substr(l.length-f[5].length)==f[5]||(i=="*="||i=="~=")&&l.indexOf(f[5])>=0)^d)g.push(k)}b=g}else if(f[1]==":"&&f[2]=="nth-child"){i={};g=[];e=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(f[3]=="even"&&"2n"||f[3]=="odd"&&"2n+1"||!/\D/.test(f[3])&&"0n+"+f[3]||f[3]);k=e[1]+(e[2]||1)-0;e=e[3]-0;h=0;for(j=b.length;h<j;h++){l=b[h];var p=
l.parentNode,o=c.data(p);if(!i[o]){var m=1;for(p=p.firstChild;p;p=p.nextSibling)if(p.nodeType==1)p.nodeIndex=m++;i[o]=true}o=false;if(k==0){if(l.nodeIndex==e)o=true}else if((l.nodeIndex-e)%k==0&&(l.nodeIndex-e)/k>=0)o=true;o^d&&g.push(l)}b=g}else{var q=c.expr[f[1]];if(typeof q=="object")q=q[f[2]];if(typeof q=="string")q=eval("false||function(a,i){return "+q+";}");b=c.grep(b,function(t,w){return q(t,w,f,b)},d)}}return{r:b,t:a}},dir:function(a,b){for(var d=[],e=a[b];e&&e!=document;){e.nodeType==1&&
d.push(e);e=e[b]}return d},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType==1&&++e==b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType==1&&a!=b&&d.push(a);return d}});c.event={add:function(a,b,d,e){if(!(a.nodeType==3||a.nodeType==8)){if(c.browser.msie&&a.setInterval)a=window;if(!d.guid)d.guid=this.guid++;if(e!=n){var g=d;d=this.proxy(g,function(){return g.apply(this,arguments)});d.data=e}var f=c.data(a,"events")||c.data(a,"events",{}),h=c.data(a,"handle")||
c.data(a,"handle",function(){if(typeof c!="undefined"&&!c.event.triggered)return c.event.handle.apply(arguments.callee.elem,arguments)});h.elem=a;c.each(b.split(/\s+/),function(i,j){var k=j.split(".");j=k[0];d.type=k[1];k=f[j];if(!k){k=f[j]={};if(!c.event.special[j]||c.event.special[j].setup.call(a)===false)if(a.addEventListener)a.addEventListener(j,h,false);else a.attachEvent&&a.attachEvent("on"+j,h)}k[d.guid]=d;c.event.global[j]=true});a=null}},guid:1,global:{},remove:function(a,b,d){if(!(a.nodeType==
3||a.nodeType==8)){var e=c.data(a,"events"),g;if(e){if(b==n||typeof b=="string"&&b.charAt(0)==".")for(var f in e)this.remove(a,f+(b||""));else{if(b.type){d=b.handler;b=b.type}c.each(b.split(/\s+/),function(h,i){var j=i.split(".");i=j[0];if(e[i]){if(d)delete e[i][d.guid];else for(d in e[i])if(!j[1]||e[i][d].type==j[1])delete e[i][d];for(g in e[i])break;if(!g){if(!c.event.special[i]||c.event.special[i].teardown.call(a)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);
else a.detachEvent&&a.detachEvent("on"+i,c.data(a,"handle"));g=null;delete e[i]}}})}for(g in e)break;if(!g){if(b=c.data(a,"handle"))b.elem=null;c.removeData(a,"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,e,g){b=c.makeArray(b);if(a.indexOf("!")>=0){a=a.slice(0,-1);var f=true}if(d){if(d.nodeType==3||d.nodeType==8)return n;var h,i=c.isFunction(d[a]||null),j=!b[0]||!b[0].preventDefault;if(j){b.unshift({type:a,target:d,preventDefault:function(){},stopPropagation:function(){},timeStamp:+new Date});
b[0][s]=true}b[0].type=a;if(f)b[0].exclusive=true;if(f=c.data(d,"handle"))h=f.apply(d,b);if((!i||c.nodeName(d,"a")&&a=="click")&&d["on"+a]&&d["on"+a].apply(d,b)===false)h=false;j&&b.shift();if(g&&c.isFunction(g)){b=g.apply(d,h==null?b:b.concat(h));if(b!==n)h=b}if(i&&e!==false&&h!==false&&!(c.nodeName(d,"a")&&a=="click")){this.triggered=true;try{d[a]()}catch(k){}}this.triggered=false}else this.global[a]&&c("*").add([window,document]).trigger(a,b);return h},handle:function(a){var b,d,e,g,f;a=arguments[0]=
c.event.fix(a||window.event);e=a.type.split(".");a.type=e[0];e=e[1];g=!e&&!a.exclusive;f=(c.data(this,"events")||{})[a.type];for(var h in f){d=f[h];if(g||d.type==e){a.handler=d;a.data=d.data;d=d.apply(this,arguments);if(b!==false)b=d;if(d===false){a.preventDefault();a.stopPropagation()}}}return b},fix:function(a){if(a[s]==true)return a;var b=a;a={originalEvent:b};for(var d="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" "),
e=d.length;e;e--)a[d[e]]=b[d[e]];a[s]=true;a.preventDefault=function(){b.preventDefault&&b.preventDefault();b.returnValue=false};a.stopPropagation=function(){b.stopPropagation&&b.stopPropagation();b.cancelBubble=true};a.timeStamp=a.timeStamp||+new Date;if(!a.target)a.target=a.srcElement||document;if(a.target.nodeType==3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement==a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){d=document.documentElement;
e=document.body;a.pageX=a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d.clientLeft||0);a.pageY=a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},proxy:function(a,b){b.guid=a.guid=a.guid||b.guid||this.guid++;return b},special:{ready:{setup:function(){C()},teardown:function(){}},
mouseenter:{setup:function(){if(c.browser.msie)return false;c(this).bind("mouseover",c.event.special.mouseenter.handler);return true},teardown:function(){if(c.browser.msie)return false;c(this).unbind("mouseover",c.event.special.mouseenter.handler);return true},handler:function(a){if(G(a,this))return true;a.type="mouseenter";return c.event.handle.apply(this,arguments)}},mouseleave:{setup:function(){if(c.browser.msie)return false;c(this).bind("mouseout",c.event.special.mouseleave.handler);return true},
teardown:function(){if(c.browser.msie)return false;c(this).unbind("mouseout",c.event.special.mouseleave.handler);return true},handler:function(a){if(G(a,this))return true;a.type="mouseleave";return c.event.handle.apply(this,arguments)}}}};c.fn.extend({bind:function(a,b,d){return a=="unload"?this.one(a,b,d):this.each(function(){c.event.add(this,a,d||b,d&&b)})},one:function(a,b,d){var e=c.event.proxy(d||b,function(g){c(this).unbind(g,e);return(d||b).apply(this,arguments)});return this.each(function(){c.event.add(this,
a,e,d&&b)})},unbind:function(a,b){return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,b,d){return this.each(function(){c.event.trigger(a,b,this,true,d)})},triggerHandler:function(a,b,d){return this[0]&&c.event.trigger(a,b,this[0],false,d)},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.event.proxy(a,b[d++]);return this.click(c.event.proxy(a,function(e){this.lastToggle=(this.lastToggle||0)%d;e.preventDefault();return b[this.lastToggle++].apply(this,arguments)||false}))},
hover:function(a,b){return this.bind("mouseenter",a).bind("mouseleave",b)},ready:function(a){C();c.isReady?a.call(document,c):c.readyList.push(function(){return a.call(this,c)});return this}});c.extend({isReady:false,readyList:[],ready:function(){if(!c.isReady){c.isReady=true;if(c.readyList){c.each(c.readyList,function(){this.call(document)});c.readyList=null}c(document).triggerHandler("ready")}}});var D=false;c.each("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error".split(","),
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)}});var G=function(a,b){for(var d=a.relatedTarget;d&&d!=b;)try{d=d.parentNode}catch(e){d=b}return d==b};c(window).bind("unload",function(){c("*").add(document).unbind()});c.fn.extend({_load:c.fn.load,load:function(a,b,d){if(typeof a!="string")return this._load(a);var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}d=d||function(){};e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else{b=c.param(b);e="POST"}var f=
this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(h,i){if(i=="success"||i=="notmodified")f.html(g?c("<div/>").append(h.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(g):h.responseText);f.each(d,[h.responseText,i,h])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return c.nodeName(this,"form")?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||
/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:d.constructor==Array?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});var Q=+new Date;c.extend({get:function(a,b,d,e){if(c.isFunction(b)){d=b;b=null}return c.ajax({type:"GET",url:a,data:b,
success:d,dataType:e})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",
html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(a){function b(){a.success&&a.success(h,f);a.global&&c.event.trigger("ajaxSuccess",[m,a])}function d(){a.complete&&a.complete(m,f);a.global&&c.event.trigger("ajaxComplete",[m,a]);a.global&&!--c.active&&c.event.trigger("ajaxStop")}a=c.extend(true,a,c.extend(true,{},c.ajaxSettings,a));var e,g=/=\?(&|$)/g,f,h,i=a.type.toUpperCase();
if(a.data&&a.processData&&typeof a.data!="string")a.data=c.param(a.data);if(a.dataType=="jsonp"){if(i=="GET")a.url.match(g)||(a.url+=(a.url.match(/\?/)?"&":"?")+(a.jsonp||"callback")+"=?");else if(!a.data||!a.data.match(g))a.data=(a.data?a.data+"&":"")+(a.jsonp||"callback")+"=?";a.dataType="json"}if(a.dataType=="json"&&(a.data&&a.data.match(g)||a.url.match(g))){e="jsonp"+Q++;if(a.data)a.data=(a.data+"").replace(g,"="+e+"$1");a.url=a.url.replace(g,"="+e+"$1");a.dataType="script";window[e]=function(z){h=
z;b();d();window[e]=n;try{delete window[e]}catch(R){}k&&k.removeChild(l)}}if(a.dataType=="script"&&a.cache==null)a.cache=false;if(a.cache===false&&i=="GET"){g=+new Date;var j=a.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+g+"$2");a.url=j+(j==a.url?(a.url.match(/\?/)?"&":"?")+"_="+g:"")}if(a.data&&i=="GET"){a.url+=(a.url.match(/\?/)?"&":"?")+a.data;a.data=null}a.global&&!c.active++&&c.event.trigger("ajaxStart");g=/^(?:\w+:)?\/\/([^\/?#]+)/;if(a.dataType=="script"&&i=="GET"&&g.test(a.url)&&g.exec(a.url)[1]!=
location.host){var k=document.getElementsByTagName("head")[0],l=document.createElement("script");l.src=a.url;if(a.scriptCharset)l.charset=a.scriptCharset;if(!e){var p=false;l.onload=l.onreadystatechange=function(){if(!p&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){p=true;b();d();k.removeChild(l)}}}k.appendChild(l);return n}var o=false,m=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest;a.username?m.open(i,a.url,a.async,a.username,a.password):
m.open(i,a.url,a.async);try{a.data&&m.setRequestHeader("Content-Type",a.contentType);if(a.ifModified)m.setRequestHeader("If-Modified-Since",c.lastModified[a.url]||"Thu, 01 Jan 1970 00:00:00 GMT");m.setRequestHeader("X-Requested-With","XMLHttpRequest");m.setRequestHeader("Accept",a.dataType&&a.accepts[a.dataType]?a.accepts[a.dataType]+", */*":a.accepts._default)}catch(q){}if(a.beforeSend&&a.beforeSend(m,a)===false){a.global&&c.active--;m.abort();return false}a.global&&c.event.trigger("ajaxSend",[m,
a]);var t=function(z){if(!o&&m&&(m.readyState==4||z=="timeout")){o=true;if(w){clearInterval(w);w=null}f=z=="timeout"&&"timeout"||!c.httpSuccess(m)&&"error"||a.ifModified&&c.httpNotModified(m,a.url)&&"notmodified"||"success";if(f=="success")try{h=c.httpData(m,a.dataType,a.dataFilter)}catch(R){f="parsererror"}if(f=="success"){var B;try{B=m.getResponseHeader("Last-Modified")}catch(T){}if(a.ifModified&&B)c.lastModified[a.url]=B;e||b()}else c.handleError(a,m,f);d();if(a.async)m=null}};if(a.async){var w=
setInterval(t,13);a.timeout>0&&setTimeout(function(){if(m){m.abort();o||t("timeout")}},a.timeout)}try{m.send(a.data)}catch(S){c.handleError(a,m,null,S)}a.async||t();return m},handleError:function(a,b,d,e){a.error&&a.error(b,d,e);a.global&&c.event.trigger("ajaxError",[b,a,e])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol=="file:"||a.status>=200&&a.status<300||a.status==304||a.status==1223||c.browser.safari&&a.status==n}catch(b){}return false},httpNotModified:function(a,b){try{var d=
a.getResponseHeader("Last-Modified");return a.status==304||d==c.lastModified[b]||c.browser.safari&&a.status==n}catch(e){}return false},httpData:function(a,b,d){var e=a.getResponseHeader("content-type");a=(e=b=="xml"||!b&&e&&e.indexOf("xml")>=0)?a.responseXML:a.responseText;if(e&&a.documentElement.tagName=="parsererror")throw"parsererror";if(d)a=d(a,b);b=="script"&&c.globalEval(a);if(b=="json")a=eval("("+a+")");return a},param:function(a){var b=[];if(a.constructor==Array||a.jquery)c.each(a,function(){b.push(encodeURIComponent(this.name)+
"="+encodeURIComponent(this.value))});else for(var d in a)a[d]&&a[d].constructor==Array?c.each(a[d],function(){b.push(encodeURIComponent(d)+"="+encodeURIComponent(this))}):b.push(encodeURIComponent(d)+"="+encodeURIComponent(c.isFunction(a[d])?a[d]():a[d]));return b.join("&").replace(/%20/g,"+")}});c.fn.extend({show:function(a,b){return a?this.animate({height:"show",width:"show",opacity:"show"},a,b):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(c.css(this,"display")==
"none"){var d=c("<"+this.tagName+" />").appendTo("body");this.style.display=d.css("display");if(this.style.display=="none")this.style.display="block";d.remove()}}).end()},hide:function(a,b){return a?this.animate({height:"hide",width:"hide",opacity:"hide"},a,b):this.filter(":visible").each(function(){this.oldblock=this.oldblock||c.css(this,"display");this.style.display="none"}).end()},_toggle:c.fn.toggle,toggle:function(a,b){return c.isFunction(a)&&c.isFunction(b)?this._toggle.apply(this,arguments):
a?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},a,b):this.each(function(){c(this)[c(this).is(":hidden")?"show":"hide"]()})},slideDown:function(a,b){return this.animate({height:"show"},a,b)},slideUp:function(a,b){return this.animate({height:"hide"},a,b)},slideToggle:function(a,b){return this.animate({height:"toggle"},a,b)},fadeIn:function(a,b){return this.animate({opacity:"show"},a,b)},fadeOut:function(a,b){return this.animate({opacity:"hide"},a,b)},fadeTo:function(a,b,d){return this.animate({opacity:b},
a,d)},animate:function(a,b,d,e){var g=c.speed(b,d,e);return this[g.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var f=c.extend({},g),h,i=c(this).is(":hidden"),j=this;for(h in a){if(a[h]=="hide"&&i||a[h]=="show"&&!i)return f.complete.call(this);if(h=="height"||h=="width"){f.display=c.css(this,"display");f.overflow=this.style.overflow}}if(f.overflow!=null)this.style.overflow="hidden";f.curAnim=c.extend({},a);c.each(a,function(k,l){var p=new c.fx(j,f,k);if(/toggle|show|hide/.test(l))p[l==
"toggle"?i?"show":"hide":l](a);else{var o=l.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),m=p.cur(true)||0;if(o){var q=parseFloat(o[2]),t=o[3]||"px";if(t!="px"){j.style[k]=(q||1)+t;m=(q||1)/p.cur(true)*m;j.style[k]=m+t}if(o[1])q=(o[1]=="-="?-1:1)*q+m;p.custom(m,q,t)}else p.custom(m,l,"")}});return true})},queue:function(a,b){if(c.isFunction(a)||a&&a.constructor==Array){b=a;a="fx"}if(!a||typeof a=="string"&&!b)return x(this[0],a);return this.each(function(){if(b.constructor==Array)x(this,a,b);else{x(this,
a).push(b);x(this,a).length==1&&b.call(this)}})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem==this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});var x=function(a,b,d){if(a){b=b||"fx";var e=c.data(a,b+"queue");if(!e||d)e=c.data(a,b+"queue",c.makeArray(d))}return e};c.fn.dequeue=function(a){a=a||"fx";return this.each(function(){var b=x(this,a);b.shift();b.length&&b[0].call(this)})};c.extend({speed:function(a,
b,d){var e=a&&a.constructor==Object?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&b.constructor!=Function&&b};e.duration=(e.duration&&e.duration.constructor==Number?e.duration:c.fx.speeds[e.duration])||c.fx.speeds.def;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*Math.PI)/2+0.5)*e+d}},timers:[],timerId:null,fx:function(a,
b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||
0},custom:function(a,b,d){function e(f){return g.step(f)}this.startTime=+new Date;this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var g=this;e.elem=this.elem;c.timers.push(e);if(c.timerId==null)c.timerId=setInterval(function(){for(var f=c.timers,h=0;h<f.length;h++)f[h]()||f.splice(h--,1);if(!f.length){clearInterval(c.timerId);c.timerId=null}},13)},show:function(){this.options.orig[this.prop]=c.attr(this.elem.style,this.prop);this.options.show=
true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=+new Date;if(a||b>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();a=this.options.curAnim[this.prop]=true;for(var d in this.options.curAnim)if(this.options.curAnim[d]!==true)a=false;
if(a){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(c.css(this.elem,"display")=="none")this.elem.style.display="block"}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.attr(this.elem.style,e,this.options.orig[e])}a&&this.options.complete.call(this.elem);return false}else{d=b-this.startTime;this.state=d/this.options.duration;this.pos=c.easing[this.options.easing||
(c.easing.swing?"swing":"linear")](this.state,d,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(a){a.elem.scrollLeft=a.now},scrollTop:function(a){a.elem.scrollTop=a.now},opacity:function(a){c.attr(a.elem.style,"opacity",a.now)},_default:function(a){a.elem.style[a.prop]=a.now+a.unit}}});c.fn.offset=function(){function a(o){b(c.curCSS(o,"borderLeftWidth",true),c.curCSS(o,
"borderTopWidth",true))}function b(o,m){d+=parseInt(o,10)||0;e+=parseInt(m,10)||0}var d=0,e=0,g=this[0],f;if(g)with(c.browser){var h=g.parentNode,i=g,j=g.offsetParent;f=g.ownerDocument;var k=safari&&parseInt(version)<522&&!/adobeair/i.test(u),l=c.curCSS,p=l(g,"position")=="fixed";if(g.getBoundingClientRect){g=g.getBoundingClientRect();b(g.left+Math.max(f.documentElement.scrollLeft,f.body.scrollLeft),g.top+Math.max(f.documentElement.scrollTop,f.body.scrollTop));b(-f.documentElement.clientLeft,-f.documentElement.clientTop)}else{for(b(g.offsetLeft,
g.offsetTop);j;){b(j.offsetLeft,j.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(j.tagName)||safari&&!k)a(j);if(!p&&l(j,"position")=="fixed")p=true;i=/^body$/i.test(j.tagName)?i:j;j=j.offsetParent}for(;h&&h.tagName&&!/^body|html$/i.test(h.tagName);){/^inline|table.*$/i.test(l(h,"display"))||b(-h.scrollLeft,-h.scrollTop);mozilla&&l(h,"overflow")!="visible"&&a(h);h=h.parentNode}if(k&&(p||l(i,"position")=="absolute")||mozilla&&l(i,"position")!="absolute")b(-f.body.offsetLeft,-f.body.offsetTop);p&&b(Math.max(f.documentElement.scrollLeft,
f.body.scrollLeft),Math.max(f.documentElement.scrollTop,f.body.scrollTop))}f={top:e,left:d}}return f};c.fn.extend({position:function(){var a;if(this[0]){a=this.offsetParent();var b=this.offset(),d=/^body|html$/i.test(a[0].tagName)?{top:0,left:0}:a.offset();b.top-=r(this,"marginTop");b.left-=r(this,"marginLeft");d.top+=r(a,"borderTopWidth");d.left+=r(a,"borderLeftWidth");a={top:b.top-d.top,left:b.left-d.left}}return a},offsetParent:function(){for(var a=this[0].offsetParent;a&&!/^body|html$/i.test(a.tagName)&&
c.css(a,"position")=="static";)a=a.offsetParent;return c(a)}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){if(this[0])return e!=n?this.each(function(){this==window||this==document?window.scrollTo(!a?e:c(window).scrollLeft(),a?e:c(window).scrollTop()):this[d]=e}):this[0]==window||this[0]==document?self[a?"pageYOffset":"pageXOffset"]||c.boxModel&&document.documentElement[d]||document.body[d]:this[0][d]}});c.each(["Height","Width"],function(a,b){var d=a?"Left":"Top",e=a?
"Right":"Bottom";c.fn["inner"+b]=function(){return this[b.toLowerCase()]()+r(this,"padding"+d)+r(this,"padding"+e)};c.fn["outer"+b]=function(g){return this["inner"+b]()+r(this,"border"+d+"Width")+r(this,"border"+e+"Width")+(g?r(this,"margin"+d)+r(this,"margin"+e):0)}})})();
/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 */

(function(e){function g(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],16),parseInt(a[2],
16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];return i[e.trim(c).toLowerCase()]}e.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(c,a){e.fx.step[a]=function(b){if(b.state==0){var d;d=b.elem;var h=a,f;do{f=e.curCSS(d,h);if(f!=""&&f!="transparent"||e.nodeName(d,"body"))break;h="backgroundColor"}while(d=d.parentNode);
d=g(f);b.start=d;b.end=g(b.end)}b.elem.style[a]="rgb("+[Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0]),255),0),Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1]),255),0),Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2]),255),0)].join(",")+")"}});var i={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,
100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,
128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);

    /* close wito_useOwnjQuery function; jQuery inlined above */
}

var witoQuery = function(){};
witoQuery.protectedTemp = function() {
    // if no jQuery on the page, fetch our version
    if (!window.jQuery) {
        wito_useOwnjQuery();
        witoQuery = jQuery.noConflict(true);
        // alert('no jQuery, using own');
    } else {
        if (window.jQuery().jquery.replace(/\./ig,"") == 126) {
            // INSERT check for plugins
            if (false) {
                // include missing plugins
            }
            // use version on-the-page
            witoQuery = window.jQuery;
            // alert('using on-the-page version');
        } else {
            // store their version
            var userjQuery = jQuery;
            var userDollar = null;
            if (window.$) userDollar = $;
            // load ours
            witoQuery = jQuery.noConflict(true);
            // restore theirs
            window.jQuery = userjQuery;
            if (userDollar) window.$ = userDollar;
            // alert('preserving user version, using own version');
        }
    }
}

witoQuery.protectedTemp();
function witoClass(){}
witoClass.prototype.init=function(){if(window.wito_domainID){this.init_timering();this.init_constants();this.init_vars();this.timer&&this.timer.add("CINICONS","Initialised constants and vars");this.init_server();this.init_presession();this.timer&&this.timer.add("CINISERV","Initialised server paths");this.init_page();this.timer&&this.timer.add("CINIPAGE","Initialised page (UI)");this.init_styles();this.timer&&this.timer.add("CINISTYL","Fired initialisation of styles, e.g. dynamic background paths");this.init_ui();
this.timer&&this.timer.add("CINIUIUI","Initialised UI manager");this.init_ajax();this.timer&&this.timer.add("CINIAJAX","Fired initialisation of server");this.init_toolbox();this.timer&&this.timer.add("CINITOOL","Initialised toolbox, processed queued tools");this.init_sitebox();this.timer&&this.timer.add("CINISITE","Initialised sites, processed queued sites")}};witoClass.prototype.init_timering=function(){this.timer=new witoTimeringClass;this.timer.init(this)};
witoClass.prototype.init_vars=function(){this.urlParams=this.__fetchUrlParams(location.href);var a=location.href.replace(/(witoqref=([^\&^\#]*)\&*)+/ig,"");a=a.replace(/(\#|\?|\&|\/)+$/ig,"");this.url=escape(a);this.feedback_visible=true;this.serverName="";this.page=null;this.styles_loaded=false;this.online=this.status_DONTKNOW;this.DEBUG_LOSEC=this.ref_UNSET;this.heartbeat=new witoHeartbeatClass;this.heartbeat.init(this);this.intUpdQueue=new witoInterfaceUpdateQueue;this.intUpdQueue.init(this);this.showToolbox=
false};
witoClass.prototype.init_constants=function(){this.valid=12648430;this.version=108003;this.scriptName="wito_";this.serverReceiver="/wito_receiver.php?";this.rcvAlias="/sites/all/modules/wito6/receiver";this.threadBaseID="wito_threadBase";this.pageLinkClass="wito_embed_link";this.ref_UNSET=-1;this.status_ONLINE=1;this.status_OFFLINE=0;this.status_DONTKNOW=2;this.delay_processCALLBACK=200;this.delay_discardUPDATE=2E4;this.delay_fadeAwayTEXT=800;this.hash_tableCRC="00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D";this.hash_fieldsTOP=
null;this.hash_fieldsSESSION=["data"];this.hash_fieldsTHREAD=["data","left","top","width","height","flagdisp","minishape","colour","z"];this.hash_fieldsPOST=["data","flagdisp"];this.url_argBASE="witoq";this.url_argNameREF=this.url_argBASE+"ref";this.url_argNameCOORD=this.url_argBASE+"coord";this.url_argNameSFAC=this.url_argBASE+"sfac";this.url_argNameSEXP=this.url_argBASE+"sexp";this.url_argSEPARATOR="&";this.url_argEQUAL="=";this.url_fieldsSEPARATOR=",";this.fieldlist_objectDOCUMENT=["referrer",
"compatMode"];this.fieldlist_objectNAVIGATOR=["userAgent","appVersion","appName"];this.lockType_toLocalForFOREIGN=1;this.lockType_toForeignForLOCAL=2;this.lockType_toForeignForSERVER=4;this.lockType_toForeign=this.lockType_toForeignForLOCAL|this.lockType_toForeignForSERVER;this.flag_statusNONE=this.flag_BASE=0;this.flag_statusPENDING=1;this.flag_statusSENDING=4;this.flag_statusSENT=8;this.flag_statusFAILED=16;this.flag_statusRCVDBACK=32;this.flag_statusDISCARDED=64;this.flag_targetMASK=61440;this.flag_targetSERVER=
this.flag_BASE;this.flag_targetTHREAD=4096;this.flag_targetPOST=8192;this.flag_targetSESSION=16384;this.flag_actionMASK=2147422207;this.flag_actionNONE=0;this.flag_actionUNCONFDEL=1;this.flag_actionEDIT=2;this.flag_actionAPPEND=4;this.flag_actionMOVE=8;this.flag_actionDELETE=16;this.flag_actionMINIMISE_RESTORE=32;this.flag_actionCOLCHANGE=64;this.flag_actionCONFDEL=128;this.flag_actionRESIZE=256;this.flag_actionSELECT=512;this.flag_actionHIDE=1024;this.flag_actionSHOW=2048;this.flag_actionGET=65536;
this.flag_actionNEW=this.flag_actionUPDATEALL=this.flag_actionMASK;this.flag_actionSRVREHASH=this.flag_actionMASK^1073741824;this.flag_actionNEW=this.flag_actionMASK^536870912;this.flag_displayNONE=this.flag_displayMASK=this.flag_actionMASK;this.flag_displayVISIBLE=1;this.flag_displayDELETED=16;this.flag_displayMINIMISED=64;this.flag_displayCONFDEL=128;this.flag_displaySELECTED=512;this.flag_displayVISIFSEL=1024;this.flag_displayVISIFNOT=2048;this.flag_USASNONE=0;this.flag_USASUSER=1;this.flag_USASGROUP=
2;this.flag_USASALL=4;this.flag_USASOWNER=8;this.filter_MAXLEN=4096;this.cookie_useCookie=false;this.cookie_NAME="WIThinkerOf";this.server_side_toolList_NAME="sso_tool_list";this.server_side_sessionList_NAME="sso_session_list";this.server_side_threadList_NAME="sso_thread_list";this.server_side_postList_NAME="sso_post_list";this.server_side_updatedObject_NAME="sso_updated";this.server_side_notList_NAME="sso_not_list";this.server_side_clearForList_NAME="q4nxt";this.tool_refNEWTHREAD=0;this.tool_refSHOWHIDE=
1;this.tool_refNEWSESSION=2;this.tool_refBACKTOACCOUNT=3;this.tool_refPAGESWEEP=4;this.save_UNKNOWN=0;this.save_SUCCESS=1;this.save_FAIL=2;this.save_PENDING=3;this.axis_X=0;this.axis_Y=1;this.axis_Z=2};
witoClass.prototype.init_server=function(){for(var a=document.getElementsByTagName("script"),b=0;b<a.length;++b){var c=a[b].src;if(c.indexOf(this.scriptName)!=-1){if(c.substring(0,1)=="/")c=window.location.toString();this.protocol=c.substring(0,7);if(c.substring(0,8)=="https://")this.protocol=c.substring(0,8);var d=c.indexOf("/",this.protocol.length);this.serverName=c.substring(this.protocol.length,d)}}};witoClass.prototype.init_styles=function(){setTimeout(this.init_styles_event_callback(this),1)};
witoClass.prototype.init_styles_event_callback=function(a){return function(){a.init_styles_callback()}};
witoClass.prototype.init_styles_callback=function(){this.timer&&this.timer.add("CIN3STYL","Initialise styles (forked)");this.stylesheet_attach();var a=this.page_getAssetPath()+"images/";this.attach_image(a+"backadd.gif",document.body,"image/gif","wito_hidden");this.attach_image(a+"backedit.gif",document.body,"image/gif","wito_hidden");this.attach_image(a+"backdel.gif",document.body,"image/gif","wito_hidden");this.attach_image(a+"arrow_right.gif",document.body,"image/gif","wito_hidden");this.attach_image(a+
"arrow_down.gif",document.body,"image/gif","wito_hidden");this.attach_image(a+"deletex.gif",document.body,"image/gif","wito_hidden");this.attach_image(a+"editpen.gif",document.body,"image/gif","wito_hidden");this.attach_image(a+"resize.gif",document.body,"image/gif","wito_hidden");this.attach_styles(" \r\n /* Image references */ \r\n div.wito_glyphright { background-image: url('"+a+"arrow_right.gif'); } \r\n div.wito_glyphdown { background-image: url('"+a+"arrow_down.gif'); } \r\n div.wito_deletex { background-image: url('"+
a+"deletex.gif'); } \r\n div.wito_editpen { background-image: url('"+a+"editpen.gif'); } \r\n div.wito_add { background-image: url('"+a+"backadd.gif'); } \r\n div.wito_debug { background-image: url('"+a+"arrow_right.gif'); } \r\n div.wito_resize { background-image: url('"+a+"resize.gif'); } \r\n a.wito_link_look { background-image: url('"+a+"logo_thought.gif'); } \r\n div.wito_toolbox_tools { background-image: url('"+a+"plinth.jpg'); } \r\n ");this.timer&&this.timer.add("CIN3STY2","Initialise styles (completed)")};
witoClass.prototype.stylesheet_attach=function(){if(document.getElementById("wito_uidc_wito_.css"))this.styles_loaded=true;else{this.styles_css=document.createElement("link");this.styles_css.id="wito_uidc_wito_.css";this.styles_css.type="text/css";this.styles_css.rel="stylesheet";this.styles_css.href=this.page_getAssetPath()+"css/wito_.css"}witoQuery("head").append(this.styles_css);witoQuery(this.styles_css).bind("load",this.event_stylesheet_attached(this))};
witoClass.prototype.event_stylesheet_attached=function(a){return function(){a.styles_loaded=true}};witoClass.prototype.stylesheet_isLoaded=function(){if(this.styles_loaded)return true;try{if(this.styles_css.sheet.cssRules==null)return false}catch(a){return false}return true};
witoClass.prototype.attach_styles=function(a){if(document.createStyleSheet){a=a.split("\r\n");for(var b=document.createStyleSheet(),c=0;c<a.length;++c){var d=a[c].indexOf("{");if(d>0){var e=a[c].substring(0,d),g=a[c].indexOf("}");d=a[c].substring(d+1,g);b.addRule(e,d)}}}else{b=document.createElementNS&&this.page.head.tagName=="head"?this.page.head.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml","style")):this.page.head.appendChild(document.createElement("style"));if(witoQuery.browser.mozilla)b.innerHTML=
a;else b.innerText=a;b.type="text/css";b.media="screen"}};witoClass.prototype.attach_image=function(a,b,c){c="img";if(typeof b=="string")b=document.getElementById(b);var d=document.createElementNS?b.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml",c)):b.appendChild(document.createElement(c));d.src=a;d.type=c;d.style.display="none";if(arguments.length>3)d.className=arguments[3]};
witoClass.prototype.cookie=function(a){if(arguments.length==1){var b=document.cookie.split(";");for(i=0;i<b.length;i++){var c=b[i].split("=");if(c[0].replace(/^\s+|\s+$/g,"")==a)if(c.length>1)return unescape(c[1].replace(/^\s+|\s+$/g,""))}return false}else{b=arguments[1];c=arguments[2];var d=arguments[3],e=arguments[4],g=new Date;msnow=g.getTime();g.setTime(msnow);g=new Date(msnow+c);document.cookie=a+"="+escape(b)+(c?";expires="+g.toGMTString():"")+";path=/"+(d?";domain="+d:"")+(e?";secure":"")}};
witoClass.prototype.init_page=function(){this.page={};witoQuery("body").append(this.page_getBaseCode());this.page.threadBase=witoQuery("#"+this.threadBaseID);witoQuery("."+this.pageLinkClass).is("*")&&witoQuery("."+this.pageLinkClass).click(this.event_pageLinkClick(this));this.page.head=document.getElementsByTagName("head")[0]};witoClass.prototype.event_pageLinkClick=function(a){return function(b){a.pageLinkClick();a.event_stop_bubble(b)}};
witoClass.prototype.pageLinkClick=function(){switch(this.online){case this.status_ONLINE:var a=this.sessionList.getCurrent();a&&a.new_thread();break}};
witoClass.prototype.page_getBaseCode=function(){html="";html+='<style>div.wito_noInitialDisplay {visibility: hidden;}</style><div id="'+this.threadBaseID+'_outer" class="wito_threadBaseOuter wito_noInitialDisplay">';html+='<div id="'+this.threadBaseID+'_itile" class="wito_threadBaseInnerTile">';html+='<div id="'+this.threadBaseID+'" class="wito_threadBaseInnerDrag">';html+="</div><!-- /baseInnerDrag --\>";html+="</div><!-- /baseInnerTile --\>";html+="</div><!-- /baseOuter --\>";return html};
witoClass.prototype.page_getAssetPath=function(){return this.protocol+this.serverName+this.rcvAlias+"/"};
witoClass.prototype.page_getDimensions=function(){var a={},b=document.body,c=document.documentElement;if(typeof window.innerWidth!="undefined"){a.viewwidth=window.innerWidth;a.viewheight=window.innerHeight}else if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){a.viewwidth=document.documentElement.clientWidth;a.viewheight=document.documentElement.clientHeight}else{a.viewwidth=document.getElementsByTagName("body")[0].clientWidth;
a.viewheight=document.getElementsByTagName("body")[0].clientHeight}if(typeof window.pageYOffset=="number"){a.scrollx=window.pageXOffset;a.scrolly=window.pageYOffset}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){a.scrollx=document.body.scrollLeft;a.scrolly=document.body.scrollTop}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){a.scrollx=document.documentElement.scrollLeft;a.scrolly=document.documentElement.scrollTop}a.docwidth=
Math.max(b.scrollWidth,c.scrollWidth,b.offsetWidth,c.offsetWidth,b.clientWidth,c.clientWidth);a.docheight=Math.max(b.scrollHeight,c.scrollHeight,b.offsetHeight,c.offsetHeight,b.clientHeight,c.clientHeight);return a};witoClass.prototype.init_ajax=function(){this.ajaxUpdateList=new witoNetPacketUpdateListClass;this.ajaxUpdateList.init(this,this);this.ajax_server_init()};witoClass.prototype.ajax_countOutstanding=function(){return this.ajaxUpdateList.count()};
witoClass.prototype.ajax_prep=function(a,b){var c=new witoNetPacketUpdateClass;c.init(this,a.ajaxUpdateList,b);return c};
witoClass.prototype.ajax_server_init=function(){var a=this.ajax_prep(this,this.flag_actionINIT|this.flag_targetSERVER);a.postObj.callback=this.event_ajax_server_init_callback(this);a.postObj.doc=this.filterWhiteByKey(document,this.fieldlist_objectDOCUMENT);var b=this.filterWhiteByKey(navigator,this.fieldlist_objectNAVIGATOR);this.generic_copyFromTargetted(a.postObj.doc,b);b=this.page_getDimensions();this.generic_copyFromTargetted(a.postObj.doc,b);a.send()};
witoClass.prototype.event_ajax_server_init_callback=function(a){return function(b){a.ajax_server_init_callback(b)}};
witoClass.prototype.ajax_server_init_callback=function(a){this.timer&&this.timer.add("CIN2AJAX","Reply from server, callback executed");if(a[this.server_side_sessionList_NAME]){this.DEBUG_LOSEC=a.DEBUG_SECSTATE?a.DEBUG_SECSTATE:0;this.init_session(a);this.timer&&this.timer.add("CIN2SESS","Initialised session");a[this.server_side_sessionList_NAME]=null}else this.error("Invalid response from receiver.");if(a[this.server_side_toolList_NAME]){this.toolbox.recv_tools(a[this.server_side_toolList_NAME]);
this.timer&&this.timer.add("CIN2TOOL","Received dynamic tools")}this.uim.show();this.timer&&this.timer.add("CIN2UIUI","Bring up UI")};witoClass.prototype.isLocked=function(){return false};witoClass.prototype.presessionFormSubmit=function(){if(this.sessionFormSubmitted==0){this.sessionFormSubmitted=1;$("#wito_sessionform").submit()}};
witoClass.prototype.init_presession=function(){if(/Safari/.test(navigator.userAgent)){var a=this.page_getAssetPath()+"cookie-unblock/";this.sessionFormSubmitted=0;$("body").append('<iframe id="wito_sessionframe" name="wito_sessionframe" onload="witoGlobal.presessionFormSubmit();" src="'+a+'blank.php" style="display:none;"></iframe><form id="wito_sessionform" enctype="application/x-www-form-urlencoded" action="'+a+'startsession.php" target="wito_sessionframe" action="post"></form>')}};
witoClass.prototype.init_session=function(a){if(a.default_session){var b=new witoSessionListClass;b.wito=this;b.recv_default(a.default_session)}if(a.default_thread){b=new witoThreadListClass;b.wito=this;b.recv_default(a.default_thread)}if(a.default_post){b=new witoPostListClass;b.wito=this;b.recv_default(a.default_post)}if(a.default_tool){b=new witoToolboxClass;b.wito=this;b.recv_default(a.default_tool)}this.sessionList=new witoSessionListClass;this.sessionList.init(this,a[this.server_side_sessionList_NAME]);
if(a.cookie){this.cookie(this.cookie_NAME,a.cookie,6048E5,false,false);this.cookie_useCookie=true}if(this.cookie_useCookie){this.sessionList.cookie=this.cookie(this.cookie_NAME);if(!this.sessionList.cookie)this.sessionList.cookie=a.cookie}this.hash=new witoHashClass;this.hash.init(this,this.hash_fieldsTOP,this,this.sessionList,null);this.hash.hash_calculate(false);this.hash.hash_aggregate(false,true,"|");a=this.sessionList.getCount();if(a>1)this.showToolbox=true;else if(a==1)if(this.sessionList.getCurrent().threadList.getCount()>
0)this.showToolbox=true;this.online=this.status_ONLINE};witoClass.prototype.generic_copyFrom=function(a){var b=a;if(arguments.length>1)b=arguments[1];witoClass.prototype.generic_copyFrom_manual(this,a,b)};witoClass.prototype.generic_copyFromTargetted=function(a,b){var c=b;if(arguments.length>2)c=arguments[2];witoClass.prototype.generic_copyFrom_manual(a,b,c)};witoClass.prototype.generic_copyFrom_manual=function(a,b,c){for(key in c)if(b[key]!=undefined)a[key]=b[key]};
witoClass.prototype.generic_filter=function(a){var b=a;if(b.length>this.filter_MAXLEN)b=a.substr(0,this.filter_MAXLEN);return b=b.replace(/[\r\n]+/g," ").replace(/<[^>]*>/g,"")};witoClass.prototype.generic_compareList=function(a,b){for(var c=[],d=0;d<b.length;++d){var e=b[d];if(e){var g=e.ref,h=a.get(g);if(h)h.compare(e);else{if(e.flagdisp&this.flag_displayDELETED)continue;a.receive(e)}c[c.length]=g}}};
witoClass.prototype.generic_processUpdateToQueue=function(a,b,c){var d;d=this.generic_validateUpdateHash(b,a);if(d==b.hval)for(var e in b){if(!(e=="hval"||e=="hchild")){c=typeof b[e];c=="object"||c=="array"||b[e]!=a[e]&&this.intUpdQueue.add(a,e,a[e],b[e])}}else{a.updateSendRehash();this.debug("REHASH: our hash["+d+" from "+a.data+"] server hash["+b.hval+"]\r\nfiring rehash for "+c+" ref("+a.ref+")")}};
witoClass.prototype.generic_validateUpdateHash=function(a,b){var c=new witoHashClass;c.init(this,b.hash.fields,a,null,null);c.hash_calculate(false);return c.hval};witoClass.prototype.generic_get=function(a){if(a==null)return null;if(a<=this.list.length){var b=this.list[a];if(!b)return null;if(a==b.ref)return b}return null};witoClass.prototype.generic_add=function(a){if(a.ref==this.wito.ref_UNSET)a.ref=this.list.length;this.list[a.ref]=a};
witoClass.prototype.generic_getNextUsedRef=function(a){if(this.count==0)return this.wito.ref_UNSET;if(a>=this.list.length)return this.wito.ref_UNSET;for(a=a+1;a<this.list.length;a++)if(this.list[a]!=null)if(this.list[a].jq!=null)return a;return this.wito.ref_UNSET};witoClass.prototype.generic_processPreInitQueue=function(){for(var a=this.preInitQueue,b=0;b<a.length;b++)this.receiver(a[b])};witoClass.prototype.generic_ui_event_deletex=function(a){return function(b){a.deletex(true);a.wito.event_stop_bubble(b)}};
witoClass.prototype.generic_ui_deletex=function(a){if(this.cso.testFeas_deletex()){this.hide();this.detach();this.cso.enact_deletex(a)}};witoClass.prototype.generic_ui_event_editBegin=function(a){return function(b){a.editBegin();a.wito.event_stop_bubble(b)}};witoClass.prototype.generic_ui_editBegin=function(){this.cso.testFeas_editBegin()&&this.cso.enact_editBegin()};witoClass.prototype.generic_ui_editCommit=function(a){this.cso.testFeas_editCommit()&&this.cso.enact_editCommit(a)};
witoClass.prototype.generic_lock=function(a){var b=false;if(a&this.wito.lockType_toLocalForFOREIGN){b|=this.lockedToLocalForForeign==false;this.lockedToLocalForForeign=true}if(a&this.wito.lockType_toForeignForLOCAL){b|=this.lockedToForeignForLocal==false;this.lockedToForeignForLocal=true}if(a&this.wito.lockType_toForeignForSERVER){b|=this.lockedToForeignForServer==false;this.lockedToForeignForServer=true}return b};
witoClass.prototype.generic_unlock=function(a){var b=false;if(a&this.wito.lockType_toLocalForFOREIGN){b|=this.lockedToLocalForForeign==true;this.lockedToLocalForForeign=false}if(a&this.wito.lockType_toForeignForLOCAL){b|=this.lockedToForeignForLocal==true;this.lockedToForeignForLocal=false}if(a&this.wito.lockType_toForeignForSERVER){b|=this.lockedToForeignForServer==true;this.lockedToForeignForServer=false}return b};
witoClass.prototype.generic_isLocked=function(a){var b=false;if(a&this.wito.lockType_toLocalForFOREIGN)b|=this.lockedToLocalForForeign;if(a&this.wito.lockType_toForeignForLOCAL)b|=this.lockedToForeignForLocal;if(a&this.wito.lockType_toForeignForSERVER)b|=this.lockedToForeignForServer;return b};
witoClass.prototype.generic_processServerChanges=function(a){if(a.length>0){this.detach();for(name in a)if(name=="ref"){var b=this.ref;this.ref=a[name];this.parentList.reref(this,b)}else if(this[name]){this[name]=a[name];this.wito.intUpdQueue.processDerived(this,this[name])}this.ui.renderAttachShow()}};witoClass.prototype.generic_testFeas_editBegin=function(){if(this.lockedToLocalForForeign)return false;return true};witoClass.prototype.generic_enact_editBegin=function(){this.api_editBegin()};
witoClass.prototype.generic_api_editBegin=function(){this.wito.edit_begin(this)};witoClass.prototype.generic_testFeas_editCommit=function(){if(this.lockedToLocalForForeign)return false;return true};
witoClass.prototype.generic_enact_editCommit=function(a){this.data=a;a=this.upd;name="thread";if(this.targetFlag==this.wito.flag_targetPOST)name="post";if(this.upd)a.postObj[name]=this.createPartial(this.wito.flag_actionNEW);else{a=this.wito.ajax_prep(this,this.wito.flag_actionEDIT|this.targetFlag);a.postObj[name]=this.createPartial(this.wito.flag_actionEDIT)}a.send();this.upd=null};witoClass.prototype.generic_eventAttach=function(a,b,c){if(!b)return null;b.bind(c,null,a);return a};
witoClass.prototype.ajaxUpdateReceiver=function(a){a&&this.ajaxUpdateList.receiver(a)};witoClass.receiverQ_site=witoClass.receiverQ_site||[];witoClass.prototype.init_sitebox=function(){this.sitebox=new witoSiteboxClass;this.sitebox.init(this);this.sitebox.processQueue()};witoClass.receiverQ_tool=witoClass.receiverQ_tool||[];witoClass.prototype.init_toolbox=function(){this.toolbox=new witoToolboxClass;this.toolbox.init(this);this.toolbox.processQueue()};
witoClass.prototype.edit_begin=function(a){var b=this.sessionList.getCurrent();b&&b.edit_begin(a)};witoClass.prototype.edit_commit=function(){var a=this.sessionList.getCurrent();if(a)if(a.editing){a.editing.commit();a.editing=null}};witoClass.prototype.init_ui=function(){this.uim=new witoUiManagerClass;this.uim.init(this,this.urlParams)};
witoClass.prototype.event_stop_bubble=function(a){if(!a)a=window.event;a.cancelBubble=true;a.returnValue=false;a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation()};witoClass.prototype.__object_toURL=function(a){var b="",c="";if(arguments.length==2)c=arguments[1]+"__";for(var d in a)if(d!="__internal")if(typeof a[d]=="object")b+=this.__object_toURL(a[d],c+d);else if(typeof a[d]!="function")b+=c+d+"="+this.__dataEscape(a[d])+"&";return b};
witoClass.prototype.__dataEscape=function(a){a=escape(a);return a=a.replace(/\+/g,"%2B")};witoClass.prototype.__objectToString=function(a,b){var c="";for(var d in a){if(a[d]&&!b)if(a[d].toString().indexOf("{")!=-1)continue;c+=d+" value :"+(a[d]?a[d]:"0")+"\n"}return c};witoClass.prototype.__propsToString=function(a){str="";for(var b in a)try{str+=b+" ["+(a[b]?typeof a[b]:"null")+"]\n"}catch(c){str+=b+" [err]\n"}return str};
witoClass.prototype.filterWhiteByType=function(a){var b={},c=null;if(arguments.length>1)c=arguments[1];for(var d in a)try{var e=typeof a[d];if(e&&c)if(c.indexOf(e)!=-1)b[d]=a[d]}catch(g){}return b};witoClass.prototype.filterWhiteByKey=function(a,b){for(var c={},d=0;d<b.length;++d){var e=b[d];if(a[e]!=undefined)c[e]=a[e]}return c};witoClass.prototype.__arrayToString=function(a){str="";for(var b=0;b<a.length;++b){var c=a[b];str+="["+b+"] "+(c?c:"NULL")+"\n"}return str};
witoClass.prototype.__fetchUrlParams=function(a){for(var b=-1,c=this.url_argBASE.length,d={};(b=a.indexOf(this.url_argBASE,b+1))!=-1;){var e=a.indexOf(this.url_argSEPARATOR,b+1);if(e==-1)e=a.length;var g=a.indexOf(this.url_argEQUAL,b+1);if(g==-1)g=e;var h=a.substring(b+c,g),j="";if(g+1<=e)j=a.substring(g+1,e);if(j.indexOf(this.url_fieldsSEPARATOR)!=-1){vals=[];e=-1;for(g=0;(e=j.indexOf(this.url_fieldsSEPARATOR,e+1))!=-1;){g=j.substring(g,e);vals[vals.length]=parseInt(g);g=e+1}vals[vals.length]=parseInt(j.substring(g));
d[h]=vals}else d[h]=parseInt(j)}return d};witoClass.prototype.pad=function(a){var b="";if(a<=99)b+="0";if(a<=9)b+="0";b+=a;return b};witoClass.prototype.padHex=function(a,b){for(var c=a.toString(16),d="",e=c.length;e<b;++e)d+="0";return""+d+c};witoClass.prototype.colourThreshold=function(a,b){var c=0.114*(a&255),d=0.587*((a&65280)>>8),e=0.299*((a&16711680)>>16);return Math.sqrt(e*e+d*d+c*c)<b};
witoClass.prototype.colourMathDarken=function(a,b,c){var d=[];c=true;d[0]=a&255;d[1]=(a&65280)>>8;d[2]=(a&16711680)>>16;if(c)b*=-1;for(a=0;a<3;++a){d[a]=Math.round(d[a]+b*255);if(d[a]>255)d[a]=255;if(d[a]<0)d[a]=0}return d[0]+(d[1]<<8)+(d[2]<<16)};witoClass.prototype.debug=function(a){this.DEBUG_LOSEC&&window.console&&console.debug(a)};
witoClass.prototype.debugCacheMess=function(a){if(this.DEBUG_LOSEC){if(!this.debugCache)this.debugCache=[];this.debugCache[this.debugCache.length]=a;this.debugCache.length>=20&&this.debugCacheClear()}};witoClass.prototype.debugCacheClear=function(){if(this.DEBUG_LOSEC){for(var a="",b=0;b<this.debugCache.length;++b)a+=this.debugCache[b]+"\r\n";this.debug(a);this.debugCache.length=0;this.debugCache=null}};witoClass.prototype.warning=function(){};witoClass.prototype.error=function(){};
witoClass.prototype.wobble=function(a){this.debug(a);wob={type:this.mess_typeWOBBLE,mess:a};this.record(wob)};witoClass.prototype.record=function(a){if(!a.type)a.type=this.mess_typeRECORD;this.recordObj(a)};witoClass.prototype.recordObj=function(a){if(this.timer)a.time=this.timer.getTime();a.mess&&this.debug("Object recorded["+a.time+"]: "+a.mess);this.ajaxUpdateList.queueForNext(a)};
witoClass.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=b.prototype;a.prototype=new c;a.prototype.constructor=a};witoEditingClass=function(){};witoEditingClass.prototype.init=function(a,b,c){this.wito=a;this.parent=b;this.obj=c};
witoEditingClass.prototype.begin=function(){if(this.obj.isLocked(this.wito.lockType_toForeignForLOCAL))return false;else this.obj.lock(this.wito.lockType_toForeignForLOCAL);this.id=this.obj.targetFlag==this.wito.flag_targetTHREAD?"wito_thread_paratbar-"+this.obj.ref:"wito_post-"+this.obj.postList.thread.ref+"-"+this.obj.ref+"_data";var a={};a.jq=witoQuery("#"+this.id);a.text=a.jq.html();a.text_changed=false;a.text_pos_px=-1;a.text_height=a.jq.height();if(a.text_height.indexOf)if(a.text_pos_px=a.text_height.indexOf("px"))a.text_height=
a.text_height.substr(0,a.text_pos_px);a.colBack="FFFFFF";a.colText="000000";a.text_minHeight=0;this.obj.ui.listenerTextEdit&&this.obj.ui.listenerTextEdit(a);a.jq.html('<textarea class="wito_editbox" type="text" style="height:'+a.text_height+"px;"+(a.text_minHeight?"min-height:"+a.text_minHeight+"px;":"")+"background-color:#"+a.colBack+";color:#"+a.colText+';" wordwrap="true" id="text_'+this.id+'" >'+a.text+"</textarea>");a.text_changed&&this.listenerTextUpdated();this.jq=witoQuery("#text_"+this.id);
this.dummyChecked=false;this.setCaret("text_"+this.id);this.jq.keydown(this.event_keydown(this));witoQuery(document).click(this.event_click(this));return true};witoEditingClass.prototype.destroy=function(){this.dummy&&this.dummy.destroy();this.dummy=null};witoEditingClass.prototype.setCaret=function(a){a=document.getElementById(a);if(a.createTextRange){a=a.createTextRange();a.collapse(false);a.select()}else if(a.setSelectionRange){a.focus();var b=a.value.length;a.setSelectionRange(b,b)}};
witoEditingClass.prototype.commit=function(){var a=witoQuery("#"+this.id),b=this.jq.val();a.html(b);a=this.wito.generic_filter(b);this.obj.ui.editCommit(a);if(a!=b){this.obj.ui.setText&&this.obj.ui.setText(this.obj.data);this.obj.ui.setMessage&&this.obj.ui.setMessage("Text filtered for security.")}this.obj.targetFlag==this.wito.flag_targetTHREAD&&this.obj.ui.applyDimensionIfHeightChange();this.obj.unlock(this.wito.lockType_toForeignForLOCAL);this.destroy()};
witoEditingClass.prototype.checkDummy=function(){this.dummyChecked=true;if(this.obj.autoGrow){this.dummy=new witoEditingDummyClass;this.dummy.init(this.wito,this,this.jq)}};witoEditingClass.prototype.event_keydown=function(a){return function(b){if(!b)b=window.event;var c=b.keyCode?b.keyCode:b.which;a.dummyChecked||a.checkDummy();if(c==13){a.wito.edit_commit();a.wito.event_stop_bubble(b);return false}return true}};
witoEditingClass.prototype.event_click=function(a){return function(b){if(!b)b=window.event;if((witoQuery.browser.msie?b.srcElement:b.target).id!="text_"+a.id)a.wito.edit_commit();return true}};witoEditingClass.prototype.listenerTextUpdated=function(){this.obj.ui.listenerTextUpdated&&this.obj.ui.listenerTextUpdated()};witoEditingDummyClass=function(){};
witoEditingDummyClass.prototype.init=function(a,b,c){this.ref=0;this.wito=a;this.editing=b;this.tajq=c;this.delay=400;this.minHeight=this.tajq.css("min-height");this.wito.page.threadBase.append('<div class="wito_dummy" style="font-size:'+this.tajq.css("font-size")+";font-family:"+this.tajq.css("font-family")+";line-height:"+this.tajq.css("line-height")+";min-height:"+this.minHeight+";width:"+this.tajq.width()+"px;padding:"+this.tajq.css("padding")+';" id="wito_dummy-'+this.ref+'" "></div>');this.dumjq=
witoQuery("#wito_dummy-"+this.ref);a=this.event_callback(this);this.callback=setInterval(a,this.delay)};witoEditingDummyClass.prototype.destroy=function(){clearInterval(this.callback);if(this.dumjq){this.dumjq.remove();this.dumjq=null}};witoEditingDummyClass.prototype.beat=function(){this.dumjq.html(this.tajq.val()+" word word");var a=this.dumjq.height();if(this.tajq.height()!=a){this.tajq.height(a);this.editing.listenerTextUpdated()}};witoEditingDummyClass.prototype.event_callback=function(a){return function(){a.beat()}};
window.witoGlobal=new witoClass;witoQuery(document).ready(function(){window.witoGlobal.init()});witoHashClass=function(){};witoHashClass.prototype.init=function(a,b,c,d,e){this.wito=a;this.serial="";this.hval=0;this.hchild=-1;this.fields=b;this.obj=c;this.childList=d;this.parent=e};witoHashClass.prototype.convertUTF8=function(a){for(var b,c=-1,d=(a=a.split("")).length,e=String.fromCharCode;++c<d;a[c]=(b=a[c].charCodeAt(0))>=127?e(192|b>>>6)+e(128|b&63):a[c]);return a+""};
witoHashClass.prototype.crc32=function(a){for(var b=this.wito.hash_tableCRC,c=0^-1,d=0,e=d=0,g=a.length;e<g;e++){d=(c^a.charCodeAt(e))&255;d="0x"+b.substr(d*9,8);c=c>>>8^d}return c^-1};witoHashClass.prototype.serialise=function(){var a="";for(key in this.fields){if(a.length>0)a+=";";a+=this.obj[this.fields[key]]}return this.serial=a};
witoHashClass.prototype.hash_calculate=function(a){this.serialise();this.hval=this.crc32(this.serial);a&&this.parent&&this.parent.hash.hash_aggregate(a,false,false);return this.hval};
witoHashClass.prototype.hash_aggregate=function(a,b,c){if(c===false)c="";var d="";if(!this.childList){this.hchild=0;return""}for(var e=this.childList.getList(),g=0,h=0;h<e.length;++h)if(e[h])if(!e[h].isDeleted()){if(b){var j=e[h].hash.hash_aggregate(a,b,c+"  "+this.wito.pad(h)+"| ");if(j)d+="\r\n"+j}j=e[h].hash.hchild;g^=j;var k=e[h].hash.hval;g^=k;d+="\r\n"+c+". "+this.wito.pad(h)+"| h("+k+") a("+j+")"}if(g!=this.hchild){this.hchild=g;a&&this.parent&&this.parent.hash.hash_aggregate(a,b,c+"")}return d};
witoHashClass.prototype.debugHash=function(a){return(a?a+"\r\n":"")+"v("+this.hval+") ch("+this.hchild+")"};witoHashClass.prototype.debugHashTree=function(a){var b=this.hash_aggregate(false,true,"|");return b=a+"\r\n"+b+"\r\n\r\nOverall v("+this.hval+") ch("+this.hchild+")"};witoHeartbeatClass=function(){};witoHeartbeatClass.prototype.init=function(a){this.wito=a;this.time=0;this.nextBeat=null;this.suspended=false};witoHeartbeatClass.prototype.event_heartbeat=function(a){return function(){a.beat()}};
witoHeartbeatClass.prototype.cancel=function(){if(this.nextBeat){clearTimeout(this.nextBeat);this.nextBeat=null}};witoHeartbeatClass.prototype.schedule=function(a){if(this.wito.online==this.wito.status_ONLINE)if(!this.wito.ajax_countOutstanding()){if(a<1E3)a=1E3;this.time=a;this.reschedule()}};witoHeartbeatClass.prototype.reschedule=function(){if(!this.suspended){this.cancel();this.nextBeat=setTimeout(this.event_heartbeat(this),this.time)}};
witoHeartbeatClass.prototype.beat=function(){var a=true;if(this.wito.online!=this.wito.status_ONLINE)a=false;if(this.wito.ajax_countOutstanding())a=false;var b=this.wito.sessionList.getCurrent();if(b==null)a=false;if(a){a=b.wito.ajax_prep(b,this.wito.flag_actionNONE|this.wito.flag_targetSESSION);a.postObj.session=b.createPartial(this.wito.flag_actionNONE);a.send()}else this.reschedule()};witoHeartbeatClass.prototype.suspend=function(){if(!this.suspended){this.cancel();this.suspended=true}};
witoHeartbeatClass.prototype.resume=function(){if(this.suspended){if(!this.time)this.time=1E3;this.suspended=false;this.schedule(this.time)}};witoHoverTargetClass=function(){};witoHoverTargetClass.prototype.init=function(a,b,c){this.wito=a;this.parent=b;this.id="witoHoverTarget-"+c;this.mess="";this.jq=null;this.tjqlist=[];this.listenerOver=null};witoHoverTargetClass.prototype.render=function(){var a="";a+='<p class="wito_hovertarget" id="'+this.id+'">';a+=this.mess;a+="</p>";return a};
witoHoverTargetClass.prototype.attach=function(a,b){if(this.jq)return null;if(!a)return null;a.after(b);return this.jq=witoQuery("#"+this.id)};witoHoverTargetClass.prototype.detach=function(){if(this.jq){for(var a=0;a<this.tjqlist.length;++a)this.tjqlist[a].unbind();this.timeout&&clearTimeout(this.timeout);this.jq.remove()}};witoHoverTargetClass.prototype.setMessage=function(a){if(this.jq){this.mess=a;this.jq.html(a)}};
witoHoverTargetClass.prototype.attachOver=function(a,b){a.bind("mouseover",null,this.event_over(this,b));a.bind("mouseout",null,this.event_out(this,b));a.bind("click",null,this.event_click(this));this.tjqlist[this.tjqlist.length]=a};witoHoverTargetClass.prototype.event_over=function(a,b){return function(){if(b){var c=b;if(typeof b=="function")c=b();a.over(c)}}};
witoHoverTargetClass.prototype.over=function(a){this.setMessage(a);this.hook_over&&this.hook_over();this.timeout&&clearTimeout(this.timeout);witoQuery.browser.msie?this.jq.css({opacity:"show"}):this.jq.animate({opacity:"show"},100)};witoHoverTargetClass.prototype.event_out=function(a,b){return function(){a.out(b)}};witoHoverTargetClass.prototype.out=function(){this.timeout=setTimeout(this.event_fadeAway(this),this.wito.delay_fadeAwayTEXT)};witoHoverTargetClass.prototype.event_click=function(a){return function(){a.click()}};
witoHoverTargetClass.prototype.click=function(){};witoHoverTargetClass.prototype.event_fadeAway=function(a){return function(){a.fadeAway()}};witoHoverTargetClass.prototype.fadeAway=function(){if(witoQuery.browser.msie)this.jq.css({opacity:"hide"});else{var a=500;this.jq.animate({opacity:"hide"},a)}this.timeout=setTimeout(this.event_shrinkAfterFade(this),a)};witoHoverTargetClass.prototype.event_shrinkAfterFade=function(a){return function(){a.shrinkAfterFade()}};
witoHoverTargetClass.prototype.shrinkAfterFade=function(){this.setMessage("")};witoHoverTargetClass.prototype.attachListenerOver=function(a){this.listenerOver=a};witoInterfaceUpdateQueue=function(){};witoInterfaceUpdateQueueElement=function(){};witoInterfaceUpdateQueue.prototype.init=function(a){this.wito=a;this.q=[];this.anim={}};witoInterfaceUpdateQueueElement.prototype.init=function(a,b,c,d,e,g){this.wito=a;this.q=b;this.obj=c;this.prop=d;this.before=e;this.after=g;this.ref=this.wito.ref_UNSET};
witoInterfaceUpdateQueue.prototype.add=function(a,b,c,d){var e=new witoInterfaceUpdateQueueElement;e.init(this.wito,this,a,b,c,d);e.ref=this.q.length;this.q[e.ref]=e};witoInterfaceUpdateQueue.prototype.inQueue=function(a){for(var b=0;b<this.q.length;++b){var c=this.q[b];if(c!=null)if(c.prop==a)return c}return null};
witoInterfaceUpdateQueue.prototype.process=function(){if(this.q.length!=0){for(var a=["flagdisp"],b=0;b<a.length;++b){var c=this.inQueue(a[b]);if(c!=null){this.processElement(c);c.obj.updateUI(c.prop,c.before,c.after);c.prop="skip"}}for(b=0;b<this.q.length;++b){c=this.q[b];if(c!=null){this.processElement(c);c.obj.hash&&c.obj.hash.hash_calculate(true)}}a=[["top","left"],["width","height"]];for(b=0;b<a.length;++b){c=this.inQueue(a[b][0]);var d=this.inQueue(a[b][1]);if(c&&d)if(c.obj==d.obj){c.prop+=
d.prop;d.prop="skip"}}for(b=0;b<this.q.length;++b){c=this.q[b];c!=null&&c.obj.updateUI(c.prop,c.before,c.after)}for(b=0;b<this.q.length;++b){c=this.q[b];c!=null&&c.obj.unlock(this.wito.lockType_toLocalForFOREIGN)&&c.obj.updateUI("endUpdate")}this.q.length=0}};witoInterfaceUpdateQueue.prototype.processElement=function(a){a.obj.lock(this.wito.lockType_toLocalForFOREIGN)&&a.obj.updateUI("beginUpdate");a.obj.updateData(a.prop,a.before,a.after)};
witoInterfaceUpdateQueue.prototype.debugQueue=function(){for(var a="",b=0;b<this.q.length;++b){var c=this.q[b];if(c!=null)a+="["+b+"] "+c.prop+" from "+c.before+" to "+c.after+"\r\n"}return a};witoNetPacketUpdateClass=function(){};
witoNetPacketUpdateClass.prototype.init=function(a,b,c){this.wito=a;this.list=b;this.status=this.wito.flag_statusNONE;this.ref=this.wito.ref_UNSET;this.masterlist=this.wito.ajaxUpdateList;this.masterref=this.wito.ref_UNSET;this.postObj={};this.postObj.action=c;this.delayLastLen=this.delayNoTimes=0;this.retDataObj=null;this.masterlist.add(this);this.list!=this.masterlist&&this.list.add(this);this.locking=false};witoNetPacketUpdateClass.prototype.isActive=function(){return!(this.status&this.wito.flag_statusDISCARDED)};
witoNetPacketUpdateClass.prototype.tag=function(){this.postObj.url=this.wito.url;window.wito_domainID||(wito_domainID=1);this.postObj.domain_id=wito_domainID;if(this.wito.sessionList)if(this.wito.sessionList.cookie)this.postObj.cookie=this.wito.sessionList.cookie;if(this.wito.cookie_useCookie)upd.postObj.cookie=this.wito.cookie(this.wito.cookie_NAME);var a=(new Date).getTime();this.postObj.version_embed=this.wito.version;this.postObj.time_dispatched=a;if(this.wito.hash){this.postObj.top__hval=this.wito.hash.hval;
this.postObj.top__hchild=this.wito.hash.hchild}};witoNetPacketUpdateClass.prototype.add=function(a,b){this.postObj[a]=b};witoNetPacketUpdateClass.prototype.send=function(){if(this.list!=this.masterlist)if(this.list.isExactDuplicate(this)){this.masterlist.remove(this);this.list.remove(this);return}if(!this.locking&&this.list.parent.isLocked(this.wito.lockType_toForeignForSERVER))this.status=this.wito.flag_statusPENDING;else this.fire()};
witoNetPacketUpdateClass.prototype.fire=function(){this.masterlist.clearForNext(this);this.status=this.wito.flag_statusSENDING;this.tag();var a=this.wito.protocol+this.wito.serverName+this.wito.serverReceiver+"type=js&";a+=this.wito.__object_toURL(this.postObj);this.attach_javascript(a,this.event_callback(this),null)};witoNetPacketUpdateClass.prototype.ajaxJson_set_data=function(a){this.retDataObj=a};
witoNetPacketUpdateClass.prototype.callback_get_data=function(){var a=this.retDataObj;this.retDataObj=null;return a};witoNetPacketUpdateClass.prototype.event_callback=function(a){return function(){a.pre_callback()}};
witoNetPacketUpdateClass.prototype.pre_callback=function(){var a=this.callback_get_data();if(this.isActive())if(!a||this.masterlist.isLocked()){if(this.delayNoTimes==0)this.delayLastLen=this.wito.delay_processCALLBACK+Math.floor(Math.random()*this.wito.delay_processCALLBACK);else this.delayLastLen*=2;this.delayNoTimes++;this.wito.wobble("delayed update "+this.masterref+" by "+this.delayLastLen+"ms.");setTimeout(this.event_callback(this),this.delayLastLen)}else this.callback(a)};
witoNetPacketUpdateClass.prototype.callback=function(a){this.masterlist.lock();if(a.errorcode)this.wito.error("Error ("+a.errorcode+"): "+a.message);else{if(a.saveSuccess)switch(a.saveSuccess){case this.save_SUCCESS:break;case this.save_PENDING:break;case this.save_FAIL:break}this.status=this.wito.flag_statusRCVDBACK;this.masterlist.remove(this);this.list!=this.masterlist&&this.list.remove(this);if(a.loadjs)for(var b=this.wito.page_getAssetPath(),c=0;c<a.loadjs.length;++c)this.attach_javascript(b+
"js/"+a.loadjs[c]);a[this.wito.server_side_updatedObject_NAME]&&this.list.processServerChanges(a[this.wito.server_side_updatedObject_NAME]);if(this.locking){this.list.parent.unlock(this.wito.lockType_toForeignForSERVER);this.list.next()}this.postObj.callback&&this.postObj.callback(a);if(a[this.wito.server_side_sessionList_NAME]){this.wito.sessionList.compare(a[this.wito.server_side_sessionList_NAME]);this.wito.intUpdQueue.process()}a[this.wito.server_side_notList_NAME]&&this.wito.toolbox.notifier.recv_nots(a[this.wito.server_side_notList_NAME]);
a.timetobeat?this.wito.heartbeat.schedule(a.timetobeat):this.wito.heartbeat.cancel()}this.masterlist.unlock()};witoNetPacketUpdateClass.prototype.getInner=function(){var a=["post","thread","session"];for(field in a)if(this.postObj[a[field]])return a[field]};witoNetPacketUpdateClass.prototype.processServerChanges=function(a){var b=this.getInner();for(name in a){var c=this.postObj[b];if(c[name])c[name]=a[name]}};witoNetPacketUpdateClass.prototype.receiver=function(a){this.ajaxJson_set_data(a)};
witoNetPacketUpdateClass.prototype.attach_javascript=function(a,b,c){if(c==null||!document.getElementById("uids"+c)){var d=document.createElementNS&&this.wito.page.head.tagName=="head"?this.wito.page.head.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml","script")):this.wito.page.head.appendChild(document.createElement("script"));if(c!=null)d.id="uidc"+c;d.src=a;d.type="text/javascript";this.attach_javascript_add_listener(d,b,true)}};
witoNetPacketUpdateClass.prototype.attach_javascript_add_listener=function(a,b,c){witoQuery.browser.msie?witoQuery(a).bind("readystatechange",null,function(){if(a.readyState=="loaded"){b&&b(a);c&&witoGlobal.page.head.removeChild(a)}}):witoQuery(a).bind("load",null,function(){b&&b(a);c&&witoGlobal.page.head.removeChild(a)})};witoNetPacketUpdateListClass=function(){};
witoNetPacketUpdateListClass.prototype.init=function(a,b){this.wito=a;this.parent=b;this.list=[];this.total=this.list.length=0;this.locked=false;this.seqCounter=0;this.nextBuffer=[]};witoNetPacketUpdateListClass.prototype.count=function(){return this.total};witoNetPacketUpdateListClass.prototype.lock=function(){this.locked=true};witoNetPacketUpdateListClass.prototype.unlock=function(){this.locked=false};witoNetPacketUpdateListClass.prototype.isLocked=function(){return this.locked==true};
witoNetPacketUpdateListClass.prototype.add=function(a){var b=this.list.length;if(this==this.wito.ajaxUpdateList){a.masterref=b;a.postObj.update_ref=b;a.postObj.update_seq=this.nextSeq()}else a.ref=b;this.list[b]=a;this.total++};witoNetPacketUpdateListClass.prototype.remove=function(a){this.list[this==this.wito.ajaxUpdateList?a.masterref:a.ref]=null;a=-1;for(var b=0;b<this.list.length;++b)if(this.list[b]!=null)a=b;this.list.length=a+1;this.total--};
witoNetPacketUpdateListClass.prototype.queueForNext=function(a){var b=this.wito.ajaxUpdateList,c=b.nextBuffer.length;b.nextBuffer[c]=a;return c};witoNetPacketUpdateListClass.prototype.clearForNext=function(a){var b=this.wito.ajaxUpdateList.nextBuffer;if(b.length!=0){for(var c=0;c<b.length;++c)a.add(this.wito.server_side_clearForList_NAME+"__"+c,b[c]);b.length=0}};
witoNetPacketUpdateListClass.prototype.next=function(){for(var a=0;a<this.list.length;++a){var b=this.list[a];b!=null&&b.status==this.wito.flag_statusPENDING&&b.fire()}};witoNetPacketUpdateListClass.prototype.nextSeq=function(){return this.seqCounter++};witoNetPacketUpdateListClass.prototype.processServerChanges=function(a){this.parent.processServerChanges(a);for(var b=0;b<this.list.length;++b){var c=this.list[b];c!=null&&c.status==this.wito.flag_statusPENDING&&c.processServerChanges(a)}};
witoNetPacketUpdateListClass.prototype.isExactDuplicate=function(a){for(var b=0;b<this.list.length;++b){var c=this.list[b];if(c!=null)if(c.masterref!=a.masterref)if(c.postObj.action==a.postObj.action){var d=c.getInner();if(a.postObj[d])return this.isExactDuplicateCompareObject(c.postObj[d],a.postObj[d])}}return false};
witoNetPacketUpdateListClass.prototype.isExactDuplicateCompareObject=function(a,b){if(a.ref!=b.ref)return false;if(a.hupd!=b.hupd)return false;for(field in a)if(field.indexOf("hval")==-1)if(field.indexOf("hchild")==-1)if(typeof a[field]=="object"){if(!this.isExactDuplicateCompareObject(a[field],b[field]))return false}else if(a[field]!=b[field])return false;return true};
witoNetPacketUpdateListClass.prototype.receiver=function(a){for(var b=false,c=a.update_ref;c<this.list.length;++c){var d=this.list[c];if(d!=null)if(d.postObj.update_seq==a.update_seq){b=true;d.receiver(a)}}b||this.wito.debug("Attempt to reconcile update (seq "+a.update_seq+") was unsuccessful.")};witoNotifierClass=function(){};witoNotifierClass.prototype.init=function(a,b,c){this.wito=a;this.toolbox=b;this.hovertarget=c};
witoNotifierClass.prototype.recv_nots=function(a){this.wito.debug("got nots: "+this.wito.__objectToString(a))};function witoPostClass(){}
witoPostClass.prototype.init=function(a,b){this.wito=a;this.targetFlag=this.wito.flag_targetPOST;this.parentList=this.postList=b;this.hash=new witoHashClass;this.hash.init(a,this.wito.hash_fieldsPOST,this,null,this.postList.parent);this.hash.hchild=0;this.ajaxUpdateList=new witoNetPacketUpdateListClass;this.ajaxUpdateList.init(this.wito,this);this.upd=null;this.lockedToForeignForServer=this.lockedToForeignForLocal=this.lockedToLocalForForeign=false;this.ui=new witoPostUiClass;this.ui.init(this.wito,
this)};witoPostClass.prototype.preInit_defaults=function(a){this.data="Enter your comment here";this.flagdisp=a.flag_displayVISIBLE;this.flagedit=a.flag_actionEDIT;this.autoGrow=true};witoPostClass.prototype.clone=function(){var a=new witoPostClass;a.copyFrom(this);return a};witoPostClass.prototype.copyFrom=witoClass.prototype.generic_copyFrom;witoPostClass.prototype.updateUI=function(a,b,c){this.ui.update(a,b,c)};witoPostClass.prototype.updateData=function(a,b,c){this[a]=c};
witoPostClass.prototype.compare=function(a){this.isLocked(this.wito.lockType_toForeign)||this.hash.hval!=a.hval&&this.update(a)};witoPostClass.prototype.update=function(a){this.incomplete(a)?this.updateSendRequest():this.wito.generic_processUpdateToQueue(this,a,"post")};witoPostClass.prototype.updateSendRequest=function(){var a=this.wito.ajax_prep(this,this.wito.flag_actionGET|this.wito.flag_targetPOST);a.postObj.post=this.createPartial(this.wito.flag_actionGET);a.send()};
witoPostClass.prototype.updateSendRehash=function(){var a=this.wito.ajax_prep(this,this.wito.flag_actionSRVREHASH|this.wito.flag_targetPOST);a.postObj.post=this.createPartial(this.wito.flag_actionSRVREHASH);a.send()};witoPostClass.prototype.incomplete=function(a){a||(a=this);return!a.flagedit};witoPostClass.prototype.lock=witoClass.prototype.generic_lock;witoPostClass.prototype.unlock=witoClass.prototype.generic_unlock;witoPostClass.prototype.isLocked=witoClass.prototype.generic_isLocked;
witoPostClass.prototype.isVisible=function(){return this.flagdisp&this.wito.flag_displayVISIBLE&&this.postList.thread.isVisible()};witoPostClass.prototype.isEditable=function(){return this.flagedit&this.wito.flag_actionEDIT};witoPostClass.prototype.isDeleted=function(){return this.flagdisp&this.wito.flag_displayDELETED};
witoPostClass.prototype.createPartial=function(a){this.hash.hash_calculate(true);var b={};b.session={};b.session.ref=this.postList.thread.threadList.session.ref;b.session.hval=this.postList.thread.threadList.session.hash.hval;b.session.hchild=this.postList.thread.threadList.session.hash.hchild;b.thread={};b.thread.ref=this.postList.thread.ref;b.thread.hval=this.postList.thread.hash.hval;b.thread.hchild=this.postList.thread.hash.hchild;b.ref=this.ref;b.hupd=0;if(a&this.wito.flag_actionEDIT)b.data=
this.data;if(a&this.wito.flag_actionMINIMISE_RESTORE||a&this.wito.flag_actionDELETE){b.flagdisp=this.flagdisp;b.hupd^=this.flagdisp}return b};witoPostClass.prototype.processServerChanges=witoClass.prototype.generic_processServerChanges;witoPostClass.prototype.testFeas_deletex=function(){if(this.lockedToLocalForForeign)return false;return true};
witoPostClass.prototype.enact_deletex=function(a){this.flagdisp=this.wito.flag_displayDELETED;if(a){a=this.wito.ajax_prep(this,this.wito.flag_actionDELETE|this.wito.flag_targetPOST);a.postObj.post=this.createPartial(this.wito.flag_actionDELETE);a.send()}};witoPostClass.prototype.testFeas_editBegin=witoClass.prototype.generic_testFeas_editBegin;witoPostClass.prototype.enact_editBegin=witoClass.prototype.generic_enact_editBegin;witoPostClass.prototype.api_editBegin=witoClass.prototype.generic_api_editBegin;
witoPostClass.prototype.testFeas_editCommit=witoClass.prototype.generic_testFeas_editCommit;witoPostClass.prototype.enact_editCommit=witoClass.prototype.generic_enact_editCommit;function witoPostUiClass(){}witoPostUiClass.prototype.init=function(a,b){this.wito=a;this.cso=b};witoPostUiClass.prototype.pullData=function(a){if(a)switch(a){default:break}else this.pullAllData(false)};witoPostUiClass.prototype.pullAllData=function(){};
witoPostUiClass.prototype.update=function(a,b,c){a=="flagdisp"&&c==this.wito.flag_displayDELETED&&b!=this.wito.flag_displayDELETED&&this.deletex(false);if(this.cso.isVisible())if(this.jq)switch(a){case "data":witoQuery("#wito_post-"+this.cso.postList.thread.ref+"-"+this.cso.ref+"_data").html(c);break;case "skip":default:break}else this.renderAttachShow()};
witoPostUiClass.prototype.render=function(){var a=this.cso.isEditable(),b=this.cso.isVisible(),c=this.wito.page_getAssetPath()+"images/",d="";if(b){d+='<div class="wito_post wito_out" id="wito_post-'+this.cso.postList.thread.ref+"-"+this.cso.ref+'">';d+='<p class="wito_data" id="wito_post-'+this.cso.postList.thread.ref+"-"+this.cso.ref+'_data">'+this.cso.data+"</p>";if(a){d+='<div class="wito_button wito_button_right wito_deletex" id="wito_post_delete-'+this.cso.postList.thread.ref+"-"+this.cso.ref+
'">';d+='<a href="#" class="wito_button wito_delete"id="wito_post_delete_hook-'+this.cso.postList.thread.ref+"-"+this.cso.ref+'" >';d+='<img src="'+c+'arrow_spacer.gif" alt="delete" border="0" />';d+="</a></div><!-- wito_thread_delete-"+this.cso.postList.thread.ref+"-"+this.cso.ref+" --\>"}if(a){d+='<div class="wito_button wito_button_right wito_editpen" id="wito_post_editpen-'+this.cso.postList.thread.ref+"-"+this.cso.ref+'">';d+='<a href="#" class="wito_button wito_edit"id="wito_post_edit_hook-'+
this.cso.postList.thread.ref+"-"+this.cso.ref+'" >';d+='<img src="'+c+'arrow_spacer.gif" alt="edit post" border="0" />';d+="</a></div><!-- wito_thread_editpen-"+this.cso.postList.thread.ref+""+this.cso.ref+" --\>"}d+="</div><!-- #wito_post-"+this.cso.postList.thread.ref+"-"+this.cso.ref+" --\>"}return d};
witoPostUiClass.prototype.attach=function(a){if(!this.jq)if(this.cso.isVisible()){this.attachInOrder(a);this.jq=witoQuery("#wito_post-"+this.cso.postList.thread.ref+"-"+this.cso.ref);this.event_edit_function=this.event_editBegin(this);this.event_delete_function=this.event_deletex(this);witoQuery("#wito_post_edit_hook-"+this.cso.postList.thread.ref+"-"+this.cso.ref).bind("click",null,this.event_edit_function);witoQuery("#wito_post_delete_hook-"+this.cso.postList.thread.ref+"-"+this.cso.ref).bind("click",
null,this.event_delete_function)}};witoPostUiClass.prototype.attachInOrder=function(a){var b=this.cso.postList.getNextUsedRef(this.cso.ref);b==this.wito.ref_UNSET?this.cso.postList.thread.ui.postBase.before(a):witoQuery("#wito_post-"+this.cso.postList.thread.ref+"-"+b).before(a)};
witoPostUiClass.prototype.detach=function(){if(this.jq){witoQuery("#wito_post_edit_hook-"+this.cso.postList.thread.ref+"-"+this.cso.ref).unbind("click",this.event_edit_function);witoQuery("#wito_post_delete_hook-"+this.cso.postList.thread.ref+"-"+this.cso.ref).unbind("click",this.event_delete_function);this.jq.remove();this.jq=null}};witoPostUiClass.prototype.show=function(){};witoPostUiClass.prototype.hide=function(){this.jq&&this.jq.hide()};
witoPostUiClass.prototype.renderAttachShow=function(){if(!this.jq)if(this.attach){this.attach(this.render());this.show()}};witoPostUiClass.prototype.hideDetach=function(){if(this.jq){this.hide();this.detach()}};witoPostUiClass.prototype.setText=function(a){witoQuery("#"+("wito_post-"+this.cso.postList.thread.ref+"-"+this.cso.ref+"_data")).html(a)};witoPostUiClass.prototype.setMessage=function(){};witoPostUiClass.prototype.event_deletex=witoClass.prototype.generic_ui_event_deletex;
witoPostUiClass.prototype.deletex=witoClass.prototype.generic_ui_deletex;witoPostUiClass.prototype.event_editBegin=witoClass.prototype.generic_ui_event_editBegin;witoPostUiClass.prototype.editBegin=witoClass.prototype.generic_ui_editBegin;witoPostUiClass.prototype.editCommit=witoClass.prototype.generic_ui_editCommit;witoPostUiClass.prototype.listenerTextEdit=function(a){if(a.text==this.wito.default_post.data)a.text="";a.colBack=this.cso.postList.thread.ui.colourBack;a.colText=this.cso.postList.thread.ui.colourText};
witoPostUiClass.prototype.listenerTextUpdated=function(){};witoSessionClass=function(){};witoSessionClass.prototype.init=function(a,b){this.wito=a;this.targetFlag=this.wito.flag_targetSESSION;this.sessionList=b;this.threadList=new witoThreadListClass;this.threadList.init(this.wito,this);this.hash=new witoHashClass;this.hash.init(a,this.wito.hash_fieldsSESSION,this,this.threadList,this.wito);this.ajaxUpdateList=new witoNetPacketUpdateListClass;this.ajaxUpdateList.init(this.wito,this)};
witoSessionClass.prototype.clone=function(){var a=new witoSessionClass;a.copyFrom(this);return a};witoSessionClass.prototype.copyFrom=witoClass.prototype.generic_copyFrom;witoSessionClass.prototype.compare=function(a){if(!this.isLocked(this.wito.lockType_toForeign)){this.hash.hval!=a.hval&&this.update(a);if(this.hash.hchild!=a.hchild)this.threadList&&a[this.wito.server_side_threadList_NAME]?this.threadList.compare(a[this.wito.server_side_threadList_NAME]):this.updateSendRequest()}};
witoSessionClass.prototype.isLocked=function(){return false};witoSessionClass.prototype.update=function(a){this.incomplete(a)?this.updateSendRequest():this.wito.generic_processUpdateToQueue(this,a,"session")};witoSessionClass.prototype.updateSendRequest=function(){var a=this.wito.ajax_prep(this,this.wito.flag_actionGET|this.wito.flag_targetSESSION);a.postObj.session=this.createPartial(this.wito.flag_actionGET);a.send()};
witoSessionClass.prototype.updateSendRehash=function(){var a=this.wito.ajax_prep(this,this.wito.flag_actionSRVREHASH|this.wito.flag_targetSESSION);a.postObj.session=this.createPartial(this.wito.flag_actionSRVREHASH);a.send()};witoSessionClass.prototype.incomplete=function(a){a||(a=this);return a.data==undefined};
witoSessionClass.prototype.updateUI=function(a,b,c){switch(a){case "data":a=c;if(this.wito.toolbox)if(this.wito.toolbox.isVisible())if(this.wito.toolbox.sessionSelect)a=this.wito.toolbox.sessionSelect.makeDisplayText(this.ref,c,this.threadList.getCount());witoQuery("#wito_sess_opt-"+this.ref).html(a);break;default:break}};witoSessionClass.prototype.updateData=function(a,b,c){this[a]=c};witoSessionClass.prototype.show=function(){this.threadList.show()};witoSessionClass.prototype.hide=function(){this.threadList.hide()};
witoSessionClass.prototype.setCurrent=function(a){this.sessionList.setCurrent(this.ref);if(a){a=this.wito.ajax_prep(this,this.wito.flag_actionSELECT|this.wito.flag_targetSESSION);a.postObj.session=this.createPartial(this.wito.flag_actionSELECT);a.send()}};
witoSessionClass.prototype.createPartial=function(a){this.hash.hash_calculate(true);this.hash.hash_aggregate(true,true,"|");var b={};b.ref=this.ref;b.hval=this.hash.hval;b.hchild=this.hash.hchild;b.hupd=0;if(a&this.wito.flag_actionSELECT){b.flagdisp=this.flagdisp;b.hupd^=this.flagdisp}if(a&this.wito.flag_actionEDIT){b.flagedit=this.flagedit;b.hupd^=this.flagedit}return b};witoSessionClass.prototype.isSelected=function(){return this.flagdisp&this.wito.flag_displaySELECTED};
witoSessionClass.prototype.isVisible=function(){return this.flagdisp&this.wito.flag_displayVISIBLE};witoSessionClass.prototype.isDeleted=function(){return this.flagdisp&this.wito.flag_displayDELETED};witoSessionClass.prototype.edit_begin=function(a){if(this.editing!=null)if(this.editing.obj==a){this.editing.commit();this.editing=null;return}else{this.editing.commit();this.editing=null}this.editing=new witoEditingClass;this.editing.init(this.wito,this,a);if(!this.editing.begin())this.editing=null};
witoSessionClass.prototype.event_new_session_callback=function(a){return function(b){a.new_session_callback(b)}};witoSessionClass.prototype.new_session_callback=function(){var a=this.wito.sessionList.getCurrent();this.wito.toolbox.sessionSelect.renderAttachOption(this);this.wito.toolbox.sessionSelect.forceTo(this.ref);a&&a.hide();this.wito.sessionList.show();this.setCurrent(true);this.wito.feedback_visible&&this.show();this.wito.toolbox.sessionSelect.show()};
witoSessionClass.prototype.new_thread=function(){if(this.threadList){var a=this.threadList.new_thread();a.ui.renderAttachShow();a.api_editBegin();this.sessionList.isVisible()||this.sessionList.feedback_toggle();a=this.threadList.getCount();showToolbox=false;if(a>0)showToolbox=true;showToolbox&&this.wito.toolbox.show()}else this.wito.warning("Session thread list has yet to be initialised.")};
witoSessionClass.prototype.iterateAddOffsets=function(){this.addOffsetX=(this.addOffsetX+this.addOffsetXinc)%this.addOffsetXmod;this.addOffsetY=(this.addOffsetY+this.addOffsetYinc)%this.addOffsetYmod};witoSessionListClass=function(){};witoSessionListClass.prototype.init=function(a,b){this.list=[];this.wito=a;this.parent=null;this.current=0;this.flagdisp=this.wito.flag_displayVISIBLE;this.editing=null;this.recv_sessions(b);var c=this.deriveCurrent();c.setCurrent();this.current=c.ref;this.linkToolbox(this.wito.toolbox)};
witoSessionListClass.prototype.clone=function(){var a=new witoSessionListClass;for(key in this)a[key]=this[key];return a};
witoSessionListClass.prototype.get_default=function(){if(this.wito.default_session)return this.wito.default_session;var a=new witoSessionClass;a.ref=this.wito.ref_UNSET;a.data="no title";a.flagdisp=this.wito.flag_displayVISIBLE|this.wito.flag_displayVISIFSEL;a.flagedit=this.wito.flag_actionNONE;a.addOffsetX=0;a.addOffsetY=0;a.addOffsetXinc=15;a.addOffsetYinc=30;a.addOffsetXmod=105;a.addOffsetYmod=210;this.wito.default_session=a;return this.wito.default_session};
witoSessionListClass.prototype.recv_default=function(a){var b=this.get_default();b.copyFrom(a);this.wito.default_session=b};witoSessionListClass.prototype.new_session=function(a){a||(a=this.get_default());a=a.clone();a.init(this.wito,this);a.ref=this.wito.ref_UNSET;this.add(a);var b=this.wito.ajax_prep(a,this.wito.flag_actionNEW|this.wito.flag_targetSESSION);b.postObj.session=a.createPartial(this.wito.flag_actionNEW);b.postObj.callback=a.event_new_session_callback(a);b.send();return a};
witoSessionListClass.prototype.recv_session=function(a){var b=this.get_default().clone();b.init(this.wito,this);b.ref=this.wito.ref_UNSET;b.copyFrom(a,b);if(a[this.wito.server_side_threadList_NAME])for(var c=a[this.wito.server_side_threadList_NAME],d=0;d<c.length;++d)b.threadList.recv_thread(c[d]);this.add(b);b.incomplete(a)&&b.updateSendRequest();return b};witoSessionListClass.prototype.recv_sessions=function(a){if(typeof a.length=="undefined")this.recv_session(a);else for(var b=0;b<a.length;++b)this.recv_session(a[b])};
witoSessionListClass.prototype.compare=function(a){this.wito.generic_compareList(this,a,"session")};witoSessionListClass.prototype.add=function(a){a.hash.hash_calculate(false);if(a.ref==this.wito.ref_UNSET)a.ref=this.list.length;this.list[a.ref]=a};witoSessionListClass.prototype.get=witoClass.prototype.generic_get;witoSessionListClass.prototype.getList=function(){return this.list};witoSessionListClass.prototype.receive=function(a){return this.recv_session(a)};
witoSessionListClass.prototype.deriveCurrent=function(){for(i=0;i<this.list.length;++i){var a=this.list[i];if(a)if(a.isSelected())return this.get(a.ref)}return this.getLast()};witoSessionListClass.prototype.getCurrent=function(){var a=this.current;if(a>this.list.length-1)return null;return this.get(a)};
witoSessionListClass.prototype.setCurrent=function(a){if(a>this.list.length-1)return null;this.current=a;a=this.get(a);a.threadList.count==0&&this.wito.heartbeat.suspend();a.threadList.count>0&&this.wito.heartbeat.resume();return a};witoSessionListClass.prototype.getNext=function(){return this.getDelta(1)};witoSessionListClass.prototype.getPrevious=function(){return this.getDelta(-1)};
witoSessionListClass.prototype.getDelta=function(a){for(var b=null,c=this.current,d=0;d<this.list.length&&!b;++d){c+=a;if(c>this.list.length-1)c=0;if(c<0)c=this.list.length-1;if(b=this.get(c))break}return b};witoSessionListClass.prototype.getLast=function(){return this.get(this.list.length-1)};witoSessionListClass.prototype.getCount=function(){return this.list.length};witoSessionListClass.prototype.linkToolbox=function(a){this.toolbox=a;for(i=0;i<this.list.length;++i){var b=this.list[i];b&&a.addSelectOption(b)}};
witoSessionListClass.prototype.isVisible=function(){return this.flagdisp&this.wito.flag_displayVISIBLE};witoSessionListClass.prototype.show=function(){this.flagdisp|=this.wito.flag_displayVISIBLE;this.visibilityListener&&this.visibilityListener(true)};witoSessionListClass.prototype.hide=function(){this.flagdisp&=this.wito.flag_displayVISIBLE^this.wito.flag_displayMASK;this.visibilityListener&&this.visibilityListener(false)};
witoSessionListClass.prototype.feedback_toggle=function(){var a=this.getCurrent();if(this.isVisible()){a&&a.hide();this.visibilityListener&&this.visibilityListener(1);this.hide()}else{a&&a.show();this.visibilityListener&&this.visibilityListener(0);this.show()}};witoSessionSelectClass=function(){};
witoSessionSelectClass.prototype.init=function(a,b){this.wito=a;this.toolbox=b;this.optionSeq=0;this.toolbox.jq.append(this.render());this.jq=witoQuery("#wito_sessionSelect");this.jq.bind("change",null,this.event_change(this));this.toolbox.hovertarget&&this.toolbox.hovertarget.attachOver(this.jq,"Select session");var c=witoQuery("#wito_sessionSelect_prev");c.bind("click",null,this.event_clickDelta(this,-1));this.toolbox.hovertarget&&this.toolbox.hovertarget.attachOver(c,"View previous session");c=
witoQuery("#wito_sessionSelect_next");c.bind("click",null,this.event_clickDelta(this,1));this.toolbox.hovertarget&&this.toolbox.hovertarget.attachOver(c,"View next session")};
witoSessionSelectClass.prototype.render=function(){var a="";a+='<div class="wito_toolbox_plinth wito_toolbox_sessionSelect" style="display:none;" id="wito_sessionSelect_outer">';a+='<p class="wito_toolbox_button"><a class="pointer" href="#" id="wito_sessionSelect_prev">&laquo;</a></p>';a+='<p class="wito_toolbox_elem">';a+='<select name="wito_sessionSelect" id="wito_sessionSelect">';a+="</select>";a+="</p>";a+='<p class="wito_toolbox_button"><a class="pointer" href="#" id="wito_sessionSelect_next">&raquo;</a></p>';
a+='<div class="wito_clear"></div>';a+="</div>";return a};witoSessionSelectClass.prototype.event_change=function(a){return function(b){a.change(b)}};witoSessionSelectClass.prototype.change=function(){var a=this.wito.sessionList.get(this.jq.val()),b=this.wito.sessionList.getCurrent();if(a.ref!=b.ref){b.hide();this.wito.sessionList.show();this.wito.feedback_visible&&a.show();a.setCurrent(true)}};witoSessionSelectClass.prototype.event_clickDelta=function(a,b){return function(c){a.clickDelta(b);a.wito.event_stop_bubble(c)}};
witoSessionSelectClass.prototype.clickDelta=function(a){if(this.wito.timer){this.wito.timer.speedMetricStart("METSESSD");this.wito.timer.speedMetricStart("METSESPT")}var b=0;a=this.wito.sessionList.getDelta(a);var c=this.wito.sessionList.getCurrent();b+=c.threadList.getCount();c.hide();this.wito.sessionList.show();this.forceTo(a.ref);this.wito.feedback_visible&&a.show();a.setCurrent(true);b+=a.threadList.getCount();if(this.wito.timer){this.wito.timer.speedMetricStop("METSESPT",b,"Session switch time per thread");
this.wito.timer.speedMetricStop("METSESSD",1,"Session switch time")}};
witoSessionSelectClass.prototype.renderAttachOption=function(a){var b="",c=a.flagedit&this.wito.flag_USASUSER;b+="<option ";b+='value="'+a.ref+'" ';b+='name="wito_sess_opt-'+a.ref+'" ';b+='class="'+(c?"wito_sess_iam":"")+'" ';if(c=this.wito.sessionList.getCurrent())if(c.ref==a.ref)b+='selected="selected" ';b+='id="wito_sess_opt-'+a.ref+'" ';b+=">";b+=this.makeDisplayText(a.ref,a.data,a.threadList.getCount());b+="</option>";this.jq.append(b);this.optionSeq++};
witoSessionSelectClass.prototype.makeDisplayText=function(a,b,c){return(b==""?"untitled":b)+" ("+c+")"};witoSessionSelectClass.prototype.getCount=function(){return this.optionSeq};witoSessionSelectClass.prototype.forceTo=function(a){this.jq.val(a)};witoSessionSelectClass.prototype.show=function(){witoQuery("#wito_sessionSelect_outer").show()};witoSessionSelectClass.prototype.hide=function(){witoQuery("#wito_sessionSelect_outer").hide()};witoSiteClass=function(){};
witoSiteClass.prototype.init=function(a){this.wito=a;this.ref=this.wito.ref_UNSET};witoSiteClass.prototype.clone=function(){var a=new witoSiteClass;a.copyFrom(this);return a};witoSiteClass.prototype.copyFrom=function(a){var b=a;if(arguments.length>2)b=arguments[1];for(key in b)if(a[key]!=undefined)this[key]=a[key]};witoSiteClass.prototype.setup_preAdd=null;witoSiteboxClass=function(){};witoSiteboxClass.prototype.init=function(a){this.wito=a;this.list=[];this.preInitQueue=witoClass.receiverQ_site};
witoSiteboxClass.prototype.receiver=function(a){this.recv_site(a)};witoSiteboxClass.prototype.add=witoClass.prototype.generic_add;witoSiteboxClass.prototype.get=witoClass.prototype.generic_get;witoSiteboxClass.prototype.get_default=function(){if(this.wito.default_site)return this.wito.default_site;var a=new witoSiteClass;a.ref=this.wito.ref_UNSET;this.wito.default_site=a;return this.wito.default_site};
witoSiteboxClass.prototype.recv_site=function(a){var b,c=true;if(a.ref!=undefined)if(b=this.get(a.ref))c=false;if(c){b=this.get_default().clone();b.init(this.wito,this);b.ref=this.wito.ref_UNSET}b.copyFrom(a,b);b.setup_preAdd&&b.setup_preAdd();c&&this.add(b);return b};witoSiteboxClass.prototype.recv_sites=function(a){for(var b=0;b<a.length;++b)this.recv_site(a[b])};witoSiteboxClass.prototype.getNextUsedRef=witoClass.prototype.generic_getNextUsedRef;witoSiteboxClass.prototype.processQueue=witoClass.prototype.generic_processPreInitQueue;
function witoThreadClass(){}
witoThreadClass.prototype.init=function(a,b){this.wito=a;this.targetFlag=this.wito.flag_targetTHREAD;this.threadList=b;this.postList=new witoPostListClass;this.postList.init(this.wito,this);this.parentList=this.threadList;this.hash=new witoHashClass;this.hash.init(a,this.wito.hash_fieldsTHREAD,this,this.postList,this.threadList.parent);this.ajaxUpdateList=new witoNetPacketUpdateListClass;this.ajaxUpdateList.init(this.wito,this);this.upd=null;this.lockedToForeignForServer=this.lockedToForeignForLocal=
this.lockedToLocalForForeign=false;this.ui=new witoThreadUiThumbedClass;this.ui.init(this.wito,this)};
witoThreadClass.prototype.preInit_defaults=function(a){this.height=this.width=this.top=this.left=200;this.data="Enter your comment here";this.flagdisp=a.flag_displayVISIBLE;this.flagedit=a.flag_actionEDIT|a.flag_actionAPPEND;this.colour=16777011;this.z=1;this.colourAdd=2113664;this.autoGrow=true;this.heightShadow=this.widthShadow=5;this.shadowOffset=6;this.heightTitlebar=30;this.heightStatusbar=18;this.heightMinConfdel=this.heightMinPost=96;this.heightMinEmptyTitleTextarea=75;this.widthTitlebarIcon=
21;this.widthTitlebarIcons=2+3*this.widthTitlebarIcon;this.widthMin=160;this.marginLeftExp=this.marginTopExp=0;this.minishape="arrow";this.marginTopMini=20;this.marginLeftMini=26;this.backgroundColourThreshold=102};witoThreadClass.prototype.clone=function(){var a=new witoThreadClass;a.copyFrom(this);if(this.postList)a.postList=this.postList.clone();return a};witoThreadClass.prototype.copyFrom=witoClass.prototype.generic_copyFrom;
witoThreadClass.prototype.updateUI=function(a,b,c){this.ui.update(a,b,c)};witoThreadClass.prototype.updateData=function(a,b,c){this[a]=c;switch(a){case "z":this.threadList&&this.threadList.checkMaxZ(this.z);break}};witoThreadClass.prototype.compare=function(a){if(!this.isLocked(this.wito.lockType_toForeign)){this.hash.hval!=a.hval&&this.update(a);if(this.hash.hchild!=a.hchild)this.postList&&a[this.wito.server_side_postList_NAME]?this.postList.compare(a[this.wito.server_side_postList_NAME]):this.updateSendRequest()}};
witoThreadClass.prototype.update=function(a){this.incomplete(a)?this.updateSendRequest():this.wito.generic_processUpdateToQueue(this,a,"thread")};witoThreadClass.prototype.processServerChanges=witoClass.prototype.generic_processServerChanges;witoThreadClass.prototype.updateSendRequest=function(){var a=this.wito.ajax_prep(this,this.wito.flag_actionGET|this.targetFlag);a.postObj.thread=this.createPartial(this.wito.flag_actionGET);a.send()};
witoThreadClass.prototype.updateSendRehash=function(){var a=this.wito.ajax_prep(this,this.wito.flag_actionSRVREHASH|this.targetFlag);a.postObj.thread=this.createPartial(this.wito.flag_actionSRVREHASH);a.send()};witoThreadClass.prototype.incomplete=function(a){a||(a=this);return!a.flagedit};witoThreadClass.prototype.lock=witoClass.prototype.generic_lock;witoThreadClass.prototype.unlock=witoClass.prototype.generic_unlock;witoThreadClass.prototype.isLocked=witoClass.prototype.generic_isLocked;
witoThreadClass.prototype.offsetPosition=function(){this.left+=this.threadList.session.addOffsetX;this.top+=this.threadList.session.addOffsetY;this.threadList.session.iterateAddOffsets();this.ui.pullAllData(false)};witoThreadClass.prototype.isVisible=function(){return this.flagdisp&this.wito.flag_displayVISIBLE};witoThreadClass.prototype.isDeleted=function(){return this.flagdisp&this.wito.flag_displayDELETED};witoThreadClass.prototype.isConfdel=function(){return this.flagdisp&this.wito.flag_displayCONFDEL};
witoThreadClass.prototype.isMinimised=function(){return this.flagdisp&this.wito.flag_displayMINIMISED};witoThreadClass.prototype.isAppendable=function(){return this.flagedit&this.wito.flag_actionAPPEND};witoThreadClass.prototype.isEditable=function(){return this.flagedit&this.wito.flag_actionEDIT};
witoThreadClass.prototype.createPartial=function(a){this.hash.hash_calculate(true);this.hash.hash_aggregate(true,true,"|");var b={};b.session={};b.session.ref=this.threadList.session.ref;b.session.hval=this.threadList.session.hash.hval;b.session.hchild=this.threadList.session.hash.hchild;b.ref=this.ref;b.hupd=0;if(a&this.wito.flag_actionMOVE){b.top=this.top;b.left=this.left;b.z=this.z;b.hupd^=this.top+this.left+this.z}if(a&this.wito.flag_actionRESIZE){b.width=this.width;b.height=this.height;b.z=this.z;
b.hupd^=this.width+this.height+this.z}if(a&this.wito.flag_actionEDIT){b.data=this.data;b.colour=this.colour;b.width=this.width;b.height=this.height;b.minishape=this.minishape;b.hupd^=this.colour+this.width+this.height}if(a&this.wito.flag_actionCONFDEL||a&this.wito.flag_actionUNCONFDEL){b.height=this.height;b.flagdisp=this.flagdisp;b.hupd^=this.height+this.flagdisp}if(a&this.wito.flag_actionMINIMISE_RESTORE||a&this.wito.flag_actionDELETE){b.flagdisp=this.flagdisp;b.hupd^=this.flagdisp}if(a&this.wito.flag_actionCOLCHANGE){b.colour=
this.colour;b.hupd^=this.colour}return b};witoThreadClass.prototype.testFeas_dragStart=function(){if(this.lockedToLocalForForeign)return false;if(this.isLocked(this.wito.lockType_toForeignForLOCAL))return false;else this.lock(this.wito.lockType_toForeignForLOCAL);return true};witoThreadClass.prototype.enact_dragStart=function(){this.wito.edit_commit();this.threadList.bringToFront(this)};
witoThreadClass.prototype.enact_dragStop=function(a){this.left=this.wito.uim.xa_back(this.ui.left,this.wito.axis_X);this.top=this.wito.uim.xa_back(this.ui.top,this.wito.axis_Y);if(a){this.width=this.wito.uim.xs_back(this.ui.width);this.height=this.wito.uim.xs_back(this.ui.height);a=this.wito.flag_actionRESIZE}else a=this.wito.flag_actionMOVE;var b=this.wito.ajax_prep(this,a|this.targetFlag);b.postObj.thread=this.createPartial(a);b.send();this.unlock(this.wito.lockType_toForeignForLOCAL)};
witoThreadClass.prototype.testFeas_makeRoomInPostArea=function(){return true};witoThreadClass.prototype.enact_makeRoomInPostArea=function(a){this.height=this.wito.uim.xs_back(this.ui.height);if(a){a=this.wito.flag_actionRESIZE;var b=this.wito.ajax_prep(this,a|this.targetFlag);b.postObj.thread=this.createPartial(a);b.send()}};witoThreadClass.prototype.testFeas_minimiseRestore=function(){if(this.lockedToLocalForForeign)return false;return true};
witoThreadClass.prototype.enact_minimiseRestore=function(a,b){if(a)this.flagdisp|=this.wito.flag_displayMINIMISED;else this.flagdisp&=this.wito.flag_displayMASK^this.wito.flag_displayMINIMISED;if(b){var c=this.wito.ajax_prep(this,this.wito.flag_actionMINIMISE_RESTORE|this.targetFlag);c.postObj.thread=this.createPartial(this.wito.flag_actionMINIMISE_RESTORE);c.send()}};
witoThreadClass.prototype.testFeas_confdel_unconfdel=function(a){if(this.lockedToLocalForForeign)return false;if(a)if(!this.testFeas_makeRoomInPostArea())return false;return true};
witoThreadClass.prototype.enact_confdel_unconfdel=function(a,b){this.height=this.wito.uim.xs_back(this.ui.height);var c=this.wito.flag_actionNONE;if(a){this.flagdisp|=this.wito.flag_displayCONFDEL;this.flagdisp&=this.wito.flag_displayMASK^this.wito.flag_displayMINIMISED;c=this.wito.flag_actionCONFDEL}else{this.flagdisp&=this.wito.flag_displayMASK^this.wito.flag_displayCONFDEL;c=this.wito.flag_actionUNCONFDEL}if(b){var d=this.wito.ajax_prep(this,c|this.targetFlag);d.postObj.thread=this.createPartial(c);
d.send()}};witoThreadClass.prototype.testFeas_deletex=function(){if(this.lockedToLocalForForeign)return false;return true};witoThreadClass.prototype.enact_deletex=function(a){this.flagdisp=this.wito.flag_displayDELETED;this.threadList.remove(this);if(a){a=this.wito.ajax_prep(this,this.wito.flag_actionDELETE|this.targetFlag);a.postObj.thread=this.createPartial(this.wito.flag_actionDELETE);a.send()}};witoThreadClass.prototype.testFeas_editBegin=witoClass.prototype.generic_testFeas_editBegin;
witoThreadClass.prototype.enact_editBegin=witoClass.prototype.generic_enact_editBegin;witoThreadClass.prototype.api_editBegin=witoClass.prototype.generic_api_editBegin;witoThreadClass.prototype.testFeas_editCommit=witoClass.prototype.generic_testFeas_editCommit;witoThreadClass.prototype.enact_editCommit=witoClass.prototype.generic_enact_editCommit;witoThreadClass.prototype.testFeas_addChild=function(){if(this.lockedToLocalForForeign)return false;return true};
witoThreadClass.prototype.enact_addChild=function(){this.height=this.wito.uim.xs_back(this.ui.height);var a=this.postList.new_post(null,true);a.ui.renderAttachShow();this.wito.edit_begin(a)};witoThreadClass.prototype.testFeas_colChange=function(){if(this.lockedToLocalForForeign)return false;return true};
witoThreadClass.prototype.enact_colChange=function(a,b){this.colour=a;this.wito.default_thread.colour=this.colour;if(b){var c=this.wito.ajax_prep(this,this.wito.flag_actionCOLCHANGE|this.targetFlag);c.postObj.thread=this.createPartial(this.wito.flag_actionCOLCHANGE);c.send()}};witoThreadClass.prototype.testFeas_debug=function(){if(this.lockedToLocalForForeign)return false;return true};
witoThreadClass.prototype.enact_debug=function(){this.height=this.wito.uim.xs_back(this.ui.height);var a=this.postList.new_post(null,false),b=this.wito.__objectToString(this);a.data=b.replace(/\n/g,"<br />").replace(/ value :/g,": ");a.ui.renderAttachShow()};witoThreadListClass=function(){};witoPostListClass=function(){};witoPostListClass.prototype.clone=function(){var a=new witoPostListClass;for(key in this)a[key]=this[key];return a};
witoThreadListClass.prototype.init=function(a,b){this.list=[];this.wito=a;this.parent=this.session=b;this.count=this.maxz=0};witoPostListClass.prototype.init=function(a,b){this.list=[];this.wito=a;this.parent=this.thread=b;this.count=0};witoThreadListClass.prototype.get_default=function(){if(this.wito.default_thread)return this.wito.default_thread;var a=new witoThreadClass;a.preInit_defaults(this.wito);a.postList=null;a.ref=this.wito.ref_UNSET;this.wito.default_thread=a;return this.wito.default_thread};
witoPostListClass.prototype.get_default=function(){if(this.wito.default_post)return this.wito.default_post;var a=new witoPostClass;a.preInit_defaults(this.wito);a.ref=this.wito.ref_UNSET;this.wito.default_post=a;return this.wito.default_post};witoThreadListClass.prototype.recv_default=function(a){var b=this.get_default();b.copyFrom(a);this.wito.default_thread=b};witoPostListClass.prototype.recv_default=function(a){var b=this.get_default();b.copyFrom(a);this.wito.default_post=b};
witoThreadListClass.prototype.new_thread=function(a){a||(a=this.get_default());a=a.clone();a.init(this.wito,this);a.offsetPosition();a.lock(this.wito.lockType_toForeignForSERVER);this.add(a);this.bringToFront(a);a.upd=this.wito.ajax_prep(a,this.wito.flag_actionNEW|this.wito.flag_targetTHREAD);a.upd.locking=true;return a};
witoPostListClass.prototype.new_post=function(a,b){a||(a=this.get_default());var c=a.clone();c.init(this.wito,this);this.add(c);if(b){c.upd=this.wito.ajax_prep(c,this.wito.flag_actionNEW|this.wito.flag_targetPOST);c.upd.locking=true}return c};
witoThreadListClass.prototype.recv_thread=function(a){var b=this.get_default().clone();b.init(this.wito,this);b.copyFrom(a,b);if(a[this.wito.server_side_postList_NAME])for(var c=a[this.wito.server_side_postList_NAME],d=0;d<c.length;++d)b.postList.recv_post(c[d]);b.ui.pullAllData(true);this.add(b);b.incomplete(a)&&b.updateSendRequest();return b};
witoPostListClass.prototype.recv_post=function(a){post=this.get_default().clone();post.init(this.wito,this);post.copyFrom(a,post);post.ui.pullAllData(true);this.add(post);post.incomplete(a)&&post.updateSendRequest();return post};witoThreadListClass.prototype.compare=function(a){this.wito.generic_compareList(this,a,"thread")};witoPostListClass.prototype.compare=function(a){this.wito.generic_compareList(this,a,"post")};
witoThreadListClass.prototype.add=function(a){a.hash.hash_calculate(false);if(a.ref==this.wito.ref_UNSET)a.ref=this.list.length;this.list[a.ref]=a;this.checkMaxZ(a.z);this.count++;this.count>0&&this.wito.heartbeat.resume();this.session.updateUI("data",this.session.data,this.session.data)};witoPostListClass.prototype.add=function(a){a.hash.hash_calculate(false);if(a.ref==this.wito.ref_UNSET)a.ref=this.list.length;this.list[a.ref]=a;this.count++};
witoThreadListClass.prototype.remove=function(a){this.list[a.ref]=null;this.count--;this.count==0&&this.wito.heartbeat.suspend();this.session.updateUI("data",this.session.data,this.session.data)};witoThreadListClass.prototype.reref=function(a,b){this.list[b]=null;this.list[a.ref]=a};witoPostListClass.prototype.reref=witoThreadListClass.prototype.reref;witoThreadListClass.prototype.get=witoClass.prototype.generic_get;witoPostListClass.prototype.get=witoClass.prototype.generic_get;
witoThreadListClass.prototype.getList=function(){return this.list};witoPostListClass.prototype.getList=witoThreadListClass.prototype.getList;witoThreadListClass.prototype.getNextUsedRef=witoClass.prototype.generic_getNextUsedRef;witoPostListClass.prototype.getNextUsedRef=witoClass.prototype.generic_getNextUsedRef;witoThreadListClass.prototype.receive=function(a){return this.recv_thread(a)};witoPostListClass.prototype.receive=function(a){return this.recv_post(a)};
witoThreadListClass.prototype.getCount=function(){return this.count};witoThreadListClass.prototype.show=function(){for(i=0;i<this.list.length;++i){var a=this.list[i];a&&a.ui.renderAttachShow()}};witoThreadListClass.prototype.hide=function(){for(i=0;i<this.list.length;++i){var a=this.list[i];a&&a.ui.hideDetach()}};witoThreadListClass.prototype.checkMaxZ=function(a){if(a>this.maxz)this.maxz=a};witoThreadListClass.prototype.bringToFront=function(a){this.maxz++;a.z=this.maxz;a.ui&&a.ui.bringToFront()};
function witoThreadUiClass(){}witoThreadUiClass.prototype.init=function(a,b){this.wito=a;this.cso=b;this.postBase=null;this.init_constants();this.pullAllData(true)};
witoThreadUiClass.prototype.pullData=function(a){if(a)switch(a){case "top":this.top=this.wito.uim.xa(this.cso.top,this.wito.axis_Y);break;case "left":this.left=this.wito.uim.xa(this.cso.left,this.wito.axis_X);break;case "width":this.width=this.wito.uim.xs(this.cso.width);break;case "height":this.height=this.wito.uim.xs(this.cso.height);this.heightTitlebar=this.wito.uim.xs(this.cso.heightTitlebar);break}else this.pullAllData(false)};
witoThreadUiClass.prototype.pullAllData=function(a){a&&this.copyScaleTranslate_constant();this.copyScaleTranslate_dynamic()};witoThreadUiClass.prototype.copyScaleTranslate_dynamic=function(){this.top=this.wito.uim.xa(this.cso.top,this.wito.axis_Y);this.left=this.wito.uim.xa(this.cso.left,this.wito.axis_X);this.width=this.wito.uim.xs(this.cso.width);this.height=this.wito.uim.xs(this.cso.height);this.heightTitlebar=this.wito.uim.xs(this.cso.heightTitlebar)};
witoThreadUiClass.prototype.copyScaleTranslate_constant=function(){this.heightStatusbar=this.wito.uim.xs(this.cso.heightStatusbar);this.widthShadow=this.wito.uim.xs(this.cso.widthShadow);this.heightShadow=this.wito.uim.xs(this.cso.heightShadow);this.shadowOffset=this.wito.uim.xs(this.cso.shadowOffset);this.heightMinPost=this.wito.uim.xs(this.cso.heightMinPost);this.heightMinConfdel=this.wito.uim.xs(this.cso.heightMinConfdel);this.heightMinEmptyTitleTextarea=this.wito.uim.xs(this.cso.heightMinEmptyTitleTextarea);
this.widthTitlebarIcon=this.wito.uim.xs(this.cso.widthTitlebarIcon);this.widthTitlebarIcons=this.wito.uim.xs(this.cso.widthTitlebarIcons);this.widthMin=this.wito.uim.xs(this.cso.widthMin);this.colourSub=this.colourAdd=this.cso.colourAdd;this.colourBase=16777011};witoThreadUiClass.prototype.init_constants=function(){this.colourTop=16777215};
witoThreadUiClass.prototype.update=function(a,b,c){a=="flagdisp"&&c==this.wito.flag_displayDELETED&&b!=this.wito.flag_displayDELETED&&this.deletex(false);if(this.cso.isVisible())if(this.jq)switch(a){case "top":case "left":case "topleft":this.update("fadeOut");this.pullAllData(false);this.jq.animate({top:this.top+"px",left:this.left+"px"});this.update("fadeIn");break;case "width":case "height":case "widthheight":this.pullAllData(false);this.applyDimensionChange(true,false);this.applyDimensionIfHeightChange();
break;case "z":this.jq.css("z-index",c);break;case "colour":this.colChange(c,false);break;case "data":witoQuery("#wito_thread_paratbar-"+this.cso.ref).html(c);this.applyDimensionIfHeightChange();break;case "flagdisp":a=b^c;a&this.wito.flag_displayMINIMISED&&this.ui_minimiseRestore(c&this.wito.flag_displayMINIMISED);a&this.wito.flag_displayCONFDEL&&this.ui_confdel_unconfdel(c&this.wito.flag_displayCONFDEL);break;case "fadeOut":this.jq.animate({opacity:0.5},500);break;case "fadeIn":this.jq.animate({opacity:1},
500);break;case "skip":default:break}else{this.pullAllData(false);this.renderAttachShow()}};
witoThreadUiClass.prototype.renderCalc=function(a){var b=this.height;if(arguments.length==3){b=arguments[2];b-=this.heightAdd}this.marginLeft=this.wito.uim.xs(this.cso.marginLeftExp);this.marginTop=this.wito.uim.xs(this.cso.marginTopExp);if(a){this.marginLeft=this.wito.uim.xs(this.cso.marginLeftMini);this.marginTop=this.wito.uim.xs(this.cso.marginTopMini)}this.widthAdd=this.marginLeft+this.widthShadow+2;this.heightAdd=this.marginTop+this.heightTitlebar+this.heightStatusbar+this.heightShadow+2;this.heightShadowRight=
a?this.heightTitlebar:b+this.heightTitlebar+this.heightStatusbar-this.shadowOffset+this.heightShadow+2};
witoThreadUiClass.prototype.render=function(){var a=this.wito.uim.getRenderScale(),b=this.cso.isMinimised(),c=this.cso.isConfdel(),d=this.cso.isVisible(),e=this.cso.isAppendable(),g=e&&false,h=e&&false,j=e&&false,k=this.wito.page_getAssetPath()+"images/",f="";if(!d&&!c)return"";this.renderCalc(b);this.colComputeVariants(this.cso.colour);f+='<div class="wito_thread'+(c?"_archived":"")+(b?" wito_thread_minimised":"")+'" style="top:'+(this.top-this.marginTop)+"px;left:"+(this.left-this.marginLeft)+"px;width:"+
(this.width+this.widthAdd)+"px;height:"+(b?this.heightAdd:this.height+this.heightAdd)+"px;z-index:"+this.cso.z+";color:#"+this.colourText+';" id="wito_thread-'+this.cso.ref+'">';f+='<img class="wito_yellowarrowptr" style="display: '+(b?"block":"none")+'; " src="'+k+'circle_55.png" id="wito_thread_arrowptr-'+this.cso.ref+'" />';f+='<div class="wito_titlebar wito_out" style="width:'+this.width+"px;min-height:"+this.heightTitlebar+";background-color:#"+this.colourLighten+";border-color:#"+this.colourDarken+
";font-size: "+a+"em;line-height: 170%;margin-top:"+this.marginTop+"px;margin-left:"+this.marginLeft+'px;" id="wito_thread_titlebar-'+this.cso.ref+'" >';if(g){f+='<div class="wito_titlebar_button wito_titlebar_button_left wito_glyphright '+(b?"":"wito_glyphdown")+'" id="wito_thread_arrowglyph-'+this.cso.ref+'">';f+='<a href="#" id="wito_thread_minimise_restore_hook-'+this.cso.ref+'">';f+='<img src="'+k+'arrow_spacer.gif" border="0" alt="" />';f+="</a></div><!-- #wito_thread_arrowglyph-"+this.cso.ref+
" --\>"}if(e){f+='<div class="wito_titlebar_button wito_titlebar_button_right wito_deletex" id="wito_thread_confdel-'+this.cso.ref+'">';f+='<a href="#" id="wito_thread_confdel_hook-'+this.cso.ref+'">';f+='<img src="'+k+'arrow_spacer.gif" alt="" border="0" />';f+="</a></div><!-- wito_thread_confdel-"+this.cso.ref+" --\>"}if(e){f+='<div class="wito_titlebar_button wito_titlebar_button_right wito_editpen" id="wito_thread_editpen-'+this.cso.ref+'">';f+='<a href="#" id="wito_thread_edit_hook-'+this.cso.ref+
'">';f+='<img src="'+k+'arrow_spacer.gif" alt="" border="0" id="wito_thread_editpen_img-'+this.cso.ref+'" />';f+="</a></div><!-- wito_thread_editpen-"+this.cso.ref+" --\>"}f+='<p class="wito_titlebar_text" id="wito_thread_paratbar-'+this.cso.ref+'" >'+(this.cso.data?this.cso.data:"&nbsp;")+"</p>";f+="</div><!-- #wito_thread_titlebar-"+this.cso.ref+" --\>";f+='<div class="wito_thread_posts'+(b?" wito_minimised":"")+'" style="width:'+this.width+"px;height:"+this.height+"px;background-color:#"+this.colourBack+
";border-color:#"+this.colourDarken+";margin-left:"+this.marginLeft+'px;" id="wito_thread_posts-'+this.cso.ref+'">';f+='<div class="wito_clear" id="wito_thread_button_sep-'+this.cso.ref+'"></div>';if(c){f+='<div class="wito_post">';f+='<p class="wito_button wito_archived_button wito_button_restore" id="wito_thread_restore-'+this.cso.ref+'">';f+='<a href="#" class="wito_archived_button wito_button_restore" id="wito_thread_restore_hook-'+this.cso.ref+'">restore</a>';f+="</p><!-- #wito_thread_restore-"+
this.cso.ref+"--\>";f+='<p class="wito_button wito_archived_button wito_button_confdel" id="wito_thread_delete-'+this.cso.ref+'">';f+='<a href="#" class="wito_archived_button wito_button_confdel" id="wito_thread_delete_hook-'+this.cso.ref+'">delete</a>';f+="</p><!-- #wito_thread_delete-"+this.cso.ref+"--\>";f+='<p class="wito_data" id="wito_thread_confdel_text-'+this.cso.ref+'">';f+="Are you sure you want to delete this thread, and all the posts it contains?  Click <em>Restore</em> to undo.";f+="</p><!-- #wito_thread_confdel_text-"+
this.cso.ref+"--\>";f+="</div>"}f+="</div><!-- #wito_thread_posts-"+this.cso.ref+" --\>";f+='<div class="wito_thread_status'+(b?" wito_minimised":"")+' wito_out" style="width:'+this.width+"px;height:"+this.heightStatusbar+"px;background-color:#"+this.colourBack+";border-color:#"+this.colourDarken+";font-size: "+a+"em;margin-left:"+this.marginLeft+'px;" id="wito_thread_status-'+this.cso.ref+'" >';if(!c){if(e){f+='<div class="wito_statusbar_button wito_add" id="wito_thread_add-'+this.cso.ref+'">';f+=
'<a href="#" id="wito_thread_add_hook-'+this.cso.ref+'">';f+='<img src="'+k+'arrow_spacer.gif" alt="" border="0" id="wito_thread_add_img-'+this.cso.ref+'" />';f+="</a></div>"}if(j){f+='<div class="wito_statusbar_button wito_linkto" id="wito_thread_linkto-'+this.cso.ref+'" >';f+='<a href="#" id="wito_thread_linkto_hook-'+this.cso.ref+'">';f+='<img src="'+k+'arrow_spacer.gif" alt="" border="0" id="wito_thread_linkto_img-'+this.cso.ref+'" />';f+="</a></div><!-- #wito_thread_linkto-"+this.cso.ref+" --\>"}if(h){nextCol=
this.colNext(this.cso.colour);f+='<div class="wito_statusbar_button wito_colchange" style="background-color:#'+this.wito.padHex(nextCol,6)+';"id="wito_thread_colchange-'+this.cso.ref+'" >';f+='<a href="#" id="wito_thread_colchange_hook-'+this.cso.ref+'">';f+='<img src="'+k+'arrow_spacer.gif" alt="" border="0" id="wito_thread_colchange_img-'+this.cso.ref+'" />';f+="</a></div><!-- #wito_thread_colchange-"+this.cso.ref+" --\>"}if(e){f+='<div class="wito_statusbar_button wito_resize" id="wito_resize-'+
this.cso.ref+'">';f+='<a href="#" id="wito_thread_resize_hook-'+this.cso.ref+'">';f+='<img src="'+k+'arrow_spacer.gif" alt="" border="0" id="wito_resize_img-'+this.cso.ref+'" />';f+="</a></div>"}if(this.wito.DEBUG_LOSEC){f+='<div class="wito_statusbar_button wito_debug" id="wito_thread_debug-'+this.cso.ref+'" >';f+='<a href="#" id="wito_thread_debug_hook-'+this.cso.ref+'">';f+='<img src="'+k+'arrow_spacer.gif" alt="Link to another" border="0" id="wito_thread_debug_img-'+this.cso.ref+'" />';f+="</a></div><!-- #wito_debug_linkto-"+
this.cso.ref+" --\>"}}f+='<div id="wito_thread_statusbar_sep-'+this.cso.ref+'"></div>';f+="</div><!-- #wito_thread_status-"+this.cso.ref+" --\>";f+='<div class="wito_shadow wito_shadow_right" style="width:'+this.widthShadow+"px;height:"+this.heightShadowRight+"px;top:-"+(this.heightShadowRight-this.shadowOffset)+'px;" id="wito_shadow_right-'+this.cso.ref+'" ></div>';f+='<div class="wito_shadow wito_shadow_bottom" style="width:'+this.width+"px;height:"+this.heightShadow+"px;top:"+(b?0:0)+'px;" id="wito_shadow_bottom-'+
this.cso.ref+'" >&nbsp;</div>';f+="</div><!-- #wito_thread-"+this.cso.ref+" --\>";return f};
witoThreadUiClass.prototype.attach=function(a){if(!this.jq){this.wito.page.threadBase.append(a);this.jq=witoQuery("#wito_thread-"+this.cso.ref);this.wito.stylesheet_isLoaded()&&this.applyDimensionIfHeightChange();this.hovertarget=new witoHoverTargetClass;this.hovertarget.init(this.wito,this,"thread-"+this.cso.ref);a=this.hovertarget.attach(witoQuery("#wito_thread_statusbar_sep-"+this.cso.ref),this.hovertarget.render());this.event_drag_statusbar_hover_function=this.event_dragStart(this,a[0].id);a.bind("mousedown",
null,this.event_drag_statusbar_hover_function);if(this.cso.isVisible())if(this.cso.isConfdel()){this.event_delete_function=this.event_deletex(this);witoQuery("#wito_thread_delete_hook-"+this.cso.ref).bind("click",null,this.event_delete_function);this.event_unconfdel_function=this.event_unconfdel(this);witoQuery("#wito_thread_restore_hook-"+this.cso.ref).bind("click",null,this.event_unconfdel_function);this.event_edit_function=this.event_unconfdel(this);witoQuery("#wito_thread_edit_hook-"+this.cso.ref).bind("click",
null,this.event_unconfdel_function);this.event_confdel_function=this.event_deletex(this);witoQuery("#wito_thread_confdel_hook-"+this.cso.ref).bind("click",null,this.event_delete_function)}else{this.postBase=witoQuery("#wito_thread_button_sep-"+this.cso.ref);a=witoQuery("#wito_thread_titlebar-"+this.cso.ref);var b=witoQuery("#wito_thread_posts-"+this.cso.ref),c=witoQuery("#wito_thread_status-"+this.cso.ref);if(this.event_mouseCharlie){this.event_mouseCharlie_over_function=this.wito.generic_eventAttach(this.event_mouseCharlie(this,
true),a,"mouseover");this.event_mouseCharlie_out_function=this.wito.generic_eventAttach(this.event_mouseCharlie(this,false),a,"mouseout");b.bind("mouseover",null,this.event_mouseCharlie_over_function);b.bind("mouseout",null,this.event_mouseCharlie_out_function);c.bind("mouseover",null,this.event_mouseCharlie_over_function);c.bind("mouseout",null,this.event_mouseCharlie_out_function)}if(this.event_dragStart){this.event_drag_statusbar_function=this.wito.generic_eventAttach(this.event_dragStart(this,
"wito_thread_status-"+this.cso.ref),c,"mousedown");this.event_drag_paratbar_function=this.event_dragStart(this,"wito_thread_paratbar-"+this.cso.ref);witoQuery("#wito_thread_paratbar-"+this.cso.ref).bind("mousedown",null,this.event_drag_paratbar_function);this.event_drag_arrow_function=this.event_dragStart(this,"wito_thread_arrowptr-"+this.cso.ref);witoQuery("#wito_thread_arrowptr-"+this.cso.ref).bind("mousedown",null,this.event_drag_arrow_function);this.event_drag_titlebar_function=this.event_dragStart(this,
"wito_thread_titlebar-"+this.cso.ref);a.bind("mousedown",null,this.event_drag_titlebar_function);this.event_drag_posts_function=this.event_dragStart(this,"wito_thread_posts-"+this.cso.ref,"wito_post-"+this.cso.ref);b.bind("mousedown",null,this.event_drag_posts_function)}if(this.event_editBegin){a=witoQuery("#wito_thread_edit_hook-"+this.cso.ref);this.event_edit_function=this.wito.generic_eventAttach(this.event_editBegin(this),a,"click");this.hovertarget.attachOver(a,"Edit this title")}if(this.event_confdel){this.event_confdel_function=
this.event_confdel(this);a=witoQuery("#wito_thread_confdel_hook-"+this.cso.ref);a.bind("click",null,this.event_confdel_function);this.hovertarget.attachOver(a,"Delete this feedback")}if(this.event_minimiseRestore){this.event_minimise_restore_function=this.event_minimiseRestore(this);a=witoQuery("#wito_thread_minimise_restore_hook-"+this.cso.ref);a.bind("click",null,this.event_minimise_restore_function);this.hovertarget.attachOver(a,"Collapse this feedback")}if(this.event_addChild){this.event_add_function=
this.event_addChild(this);a=witoQuery("#wito_thread_add_hook-"+this.cso.ref);a.bind("click",null,this.event_add_function);this.hovertarget.attachOver(a,"Add more detail")}if(this.event_colChange){this.event_colchange_function=this.event_colChange(this);a=witoQuery("#wito_thread_colchange_hook-"+this.cso.ref);a.bind("click",null,this.event_colchange_function);this.hovertarget.attachOver(a,"Change the colour")}if(this.event_debug){this.event_debug_function=this.event_debug(this);witoQuery("#wito_thread_debug_hook-"+
this.cso.ref).bind("click",null,this.event_debug_function)}if(this.event_resizeStart){this.event_resize_drag_function=this.event_resizeStart(this,"wito_resize_img-"+this.cso.ref);a=witoQuery("#wito_thread_resize_hook-"+this.cso.ref);a.bind("mousedown",null,this.event_resize_drag_function);this.hovertarget.attachOver(a,"Resize this container");this.event_resize_click_function=this.event_ignore(this);witoQuery("#wito_thread_resize_hook-"+this.cso.ref).bind("click",null,this.event_resize_click_function)}}}};
witoThreadUiClass.prototype.detach=function(){if(this.jq){if(this.cso.postList.list.length>0)for(var a=0;a<this.cso.postList.list.length;++a){var b=this.cso.postList.list[a];b&&b.ui.hideDetach()}this.event_edit_function&&witoQuery("#wito_thread_edit_hook-"+this.cso.ref).unbind("click",this.event_edit_function);this.event_confdel_function&&witoQuery("#wito_thread_confdel_hook-"+this.cso.ref).unbind("click",this.event_confdel_function);this.event_minimise_restore_function&&witoQuery("#wito_thread_minimise_restore_hook-"+
this.cso.ref).unbind("click",this.event_minimise_restore_function);this.event_add_function&&witoQuery("#wito_thread_add_hook-"+this.cso.ref).unbind("click",this.event_add_function);this.event_drag_paratbar_function&&witoQuery("#wito_thread_paratbar-"+this.cso.ref).unbind("mousedown",this.event_drag_paratbar_function);this.event_drag_statusbar_function&&witoQuery("#wito_thread_status-"+this.cso.ref).unbind("mousedown",this.event_drag_statusbar_function);this.event_drag_arrow_function&&witoQuery("#wito_thread_arrowptr-"+
this.cso.ref).unbind("mousedown",this.event_drag_arrow_function);this.event_drag_posts_function&&witoQuery("#wito_thread_posts-"+this.cso.ref).unbind("mousedown",this.event_drag_posts_function);this.event_resize_drag_function&&witoQuery("#wito_thread_resize_hook-"+this.cso.ref).unbind("mousedown",null,this.event_resize_drag_function);this.event_delete_function&&witoQuery("#wito_thread_delete_hook-"+this.cso.ref).unbind("click",this.event_delete_function);this.event_unconfdel_function&&witoQuery("#wito_thread_restore_hook-"+
this.cso.ref).unbind("click",this.event_unconfdel_function);this.hovertarget&&this.hovertarget.detach();this.jq.remove();this.jq=null}};witoThreadUiClass.prototype.show=function(){this.jq&&this.jq.show()};witoThreadUiClass.prototype.hide=function(){this.jq&&this.jq.hide()};
witoThreadUiClass.prototype.renderAttachShow=function(){if(!this.jq)if(this.attach){this.attach(this.render());if(this.cso.postList.list.length>0)if(this.cso.isVisible()&&!this.cso.isConfdel())for(var a=0;a<this.cso.postList.list.length;++a){var b=this.cso.postList.list[a];b&&b.ui.renderAttachShow()}this.show()}};witoThreadUiClass.prototype.hideDetach=function(){if(this.jq){this.hide();this.detach()}};witoThreadUiClass.prototype.bringToFront=function(){this.jq&&this.jq.css("z-index",this.cso.z)};
witoThreadUiClass.prototype.setText=function(a){witoQuery("#"+("wito_thread_paratbar-"+this.cso.ref)).html(a)};witoThreadUiClass.prototype.setMessage=function(){};witoThreadUiClass.prototype.applyDimensionIfHeightChange=function(){var a=this.heightTitlebar;(this.heightTitlebar=witoQuery("#wito_thread_titlebar-"+this.cso.ref).height())&&this.heightTitlebar!=a&&this.applyDimensionChange(true,false)};
witoThreadUiClass.prototype.applyDimensionChange_widthHeight=function(a,b){var c=witoQuery("#wito_thread_titlebar-"+this.cso.ref),d=witoQuery("#wito_thread_posts-"+this.cso.ref),e=witoQuery("#wito_thread_status-"+this.cso.ref),g=witoQuery("#wito_shadow_right-"+this.cso.ref),h=witoQuery("#wito_shadow_bottom-"+this.cso.ref);c.css("width",""+a+"px");d.css("width",""+a+"px");d.css("height",""+b+"px");e.css("width",""+a+"px");h.css("width",""+(a-this.shadowOffset+2)+"px");g.css("height",""+this.heightShadowRight+
"px");g.css("top",""+(0-(this.heightShadowRight-this.shadowOffset+1))+"px");c.css("marginTop",this.marginTop+"px");c.css("marginLeft",this.marginLeft+"px");d.css("marginLeft",this.marginLeft+"px");e.css("marginLeft",this.marginLeft+"px")};
witoThreadUiClass.prototype.applyDimensionChange_duringDrag=function(a,b,c){this.renderCalc(this.cso.isMinimised(),a,b);this.applyDimensionChange_widthHeight(a-this.widthAdd,b-this.heightAdd);if(c){this.jq.css("width",a+"px");this.jq.css("height",b+"px")}else this.jq.animate({width:a+"px",height:b+"px"})};
witoThreadUiClass.prototype.applyDimensionChange=function(a,b){var c=this.cso.isMinimised();this.renderCalc(c);this.applyDimensionChange_widthHeight(this.width,this.height);c=c?this.heightAdd:this.height+this.heightAdd;if(a){if(b){this.jq.css("top",this.top-this.marginTop+"px");this.jq.css("left",this.left-this.marginLeft+"px")}this.jq.css("width",this.width+this.widthAdd+"px");this.jq.css("height",c+"px")}else this.jq.animate({width:this.width+this.widthAdd+"px",height:this.height+this.heightAdd+
"px"})};witoThreadUiClass.prototype.event_deletex=witoClass.prototype.generic_ui_event_deletex;witoThreadUiClass.prototype.deletex=witoClass.prototype.generic_ui_deletex;witoThreadUiClass.prototype.event_editBegin=witoClass.prototype.generic_ui_event_editBegin;witoThreadUiClass.prototype.editBegin=witoClass.prototype.generic_ui_editBegin;witoThreadUiClass.prototype.editCommit=witoClass.prototype.generic_ui_editCommit;
witoThreadUiClass.prototype.event_dragStart=function(a,b){var c=b;if(arguments.length==3)c=arguments[2];return function(d){var e=witoQuery.browser.msie?event.srcElement:d.target,g=e.id.substr(0,c.length);if(e.id==b||g==c){withinScollbar=d.clientX>a.left+a.marginLeft+a.width-16;if(!withinScollbar){a.dragStart(d,false);a.wito.event_stop_bubble(d)}}}};
witoThreadUiClass.prototype.event_resizeStart=function(a,b){return function(c){if((witoQuery.browser.msie?event.srcElement:c.target).id==b){a.dragStart(c,true);a.wito.event_stop_bubble(c)}}};witoThreadUiClass.prototype.event_ignore=function(a){return function(b){a.wito.event_stop_bubble(b)}};
witoThreadUiClass.prototype.dragStart=function(a,b){if(!this.cso.testFeas_dragStart())return false;this.dip={};this.dip.sampleCount=0;this.wito.timer.speedMetricStart("METSAMPC");this.dip.resize=b;if(this.dip.resize){this.dip.minWidth=this.widthMin;this.dip.minHeight=this.heightAdd;this.dip.startX=parseInt(this.jq.css("width"));this.dip.startY=parseInt(this.jq.css("height"))}else{this.dip.startX=parseInt(this.jq.css("left"));this.dip.startY=parseInt(this.jq.css("top"))}if(a){this.dip.offsetX=a.clientX;
this.dip.offsetY=a.clientY}else{this.dip.offsetX=0;this.dip.offsetY=0}this.event_dragging_function=this.event_dragging(this);this.event_dragStop_function=this.event_dragStop(this);witoQuery(document).bind("mousemove",null,this.event_dragging_function);witoQuery(document).bind("mouseup",null,this.event_dragStop_function);this.jq.animate({opacity:0.5},100);this.cso.enact_dragStart();return true};witoThreadUiClass.prototype.event_dragging=function(a){return function(b){a.dragging(b);a.wito.event_stop_bubble(b)}};
witoThreadUiClass.prototype.dragging=function(a){var b=this.dip.startX+a.clientX-this.dip.offsetX;a=this.dip.startY+a.clientY-this.dip.offsetY;if(this.dip.resize){if(b<this.dip.minWidth||a<this.dip.minHeight)return;this.heightTitlebar=witoQuery("#wito_thread_titlebar-"+this.cso.ref).height();this.applyDimensionChange_duringDrag(b,a,true);this.dip.minHeight=this.heightAdd}else{this.jq.css("left",""+b+"px");this.jq.css("top",""+a+"px")}this.dip.sampleCount++};
witoThreadUiClass.prototype.event_dragStop=function(a){return function(b){a.dragStop(b);a.wito.event_stop_bubble(b);witoQuery(document).unbind("mousemove",a.event_dragging_function);witoQuery(document).unbind("mouseup",a.event_dragStop_function)}};
witoThreadUiClass.prototype.dragStop=function(){if(this.dip.resize){this.width=parseInt(this.jq.css("width"))-this.widthAdd;this.height=parseInt(this.jq.css("height"))-this.heightAdd;this.heightTitlebar=witoQuery("#wito_thread_titlebar-"+this.cso.ref).height();this.applyDimensionChange(true,false)}else{this.top=parseInt(this.jq.css("top"))+this.marginTop;this.left=parseInt(this.jq.css("left"))+this.marginLeft}this.wito.timer&&this.wito.timer.speedMetricStop("METSAMPC",this.dip.sampleCount,"Time between frames of the animation");
this.cso.enact_dragStop(this.dip.resize);this.dip=null;this.jq.animate({opacity:1},100)};witoThreadUiClass.prototype.makeRoomInPostArea=function(a,b,c){if(this.height<a){this.height=a;b&&this.applyDimensionChange(false,false);this.cso.enact_makeRoomInPostArea(c)}};witoThreadUiClass.prototype.event_minimiseRestore=function(a){return function(b){a.minimiseRestore(!a.cso.isMinimised(),true);a.wito.event_stop_bubble(b)}};
witoThreadUiClass.prototype.minimiseRestore=function(a,b){if(this.cso.testFeas_minimiseRestore()){this.cso.enact_minimiseRestore(a,b);this.ui_minimiseRestore(a)}};
witoThreadUiClass.prototype.ui_minimiseRestore=function(a){if(a){witoQuery("#wito_thread_arrowptr-"+this.cso.ref).show();witoQuery("#wito_thread_posts-"+this.cso.ref).hide();witoQuery("#wito_thread_arrowglyph-"+this.cso.ref).removeClass("wito_glyphdown");witoQuery("#wito_thread_status-"+this.cso.ref).hide();this.jq.addClass("wito_thread_minimised")}else{witoQuery("#wito_thread_posts-"+this.cso.ref).show();witoQuery("#wito_thread_arrowptr-"+this.cso.ref).hide();witoQuery("#wito_thread_arrowglyph-"+
this.cso.ref).addClass("wito_glyphdown");witoQuery("#wito_thread_status-"+this.cso.ref).show();this.jq.removeClass("wito_thread_minimised")}this.heightTitlebar=witoQuery("#wito_thread_titlebar-"+this.cso.ref).height();this.applyDimensionChange(true,true)};witoThreadUiClass.prototype.event_confdel=function(a){return function(b){a.confdel_unconfdel(true,true);a.wito.event_stop_bubble(b)}};witoThreadUiClass.prototype.event_unconfdel=function(a){return function(b){a.confdel_unconfdel(false,true);a.wito.event_stop_bubble(b)}};
witoThreadUiClass.prototype.confdel_unconfdel=function(a,b){if(this.cso.testFeas_confdel_unconfdel(a)){this.cso.enact_confdel_unconfdel(a,b);this.ui_confdel_unconfdel(a)}};witoThreadUiClass.prototype.ui_confdel_unconfdel=function(a){this.hide();this.detach();a&&this.makeRoomInPostArea(this.cso.heightMinConfdel,false,false);this.renderAttachShow()};witoThreadUiClass.prototype.event_mouseCharlie=function(a,b){return function(){a.mouseCharlie(b)}};
witoThreadUiClass.prototype.mouseCharlie=function(a){if(a){a=witoQuery("#wito_thread_titlebar-"+this.cso.ref).addClass("wito_over");a.removeClass("wito_out");a=witoQuery("#wito_thread_posts-"+this.cso.ref).addClass("wito_over");a.removeClass("wito_out");a=witoQuery("#wito_thread_status-"+this.cso.ref).addClass("wito_over");a.removeClass("wito_out")}else{a=witoQuery("#wito_thread_titlebar-"+this.cso.ref).removeClass("wito_over");a.addClass("wito_out");a=witoQuery("#wito_thread_posts-"+this.cso.ref).removeClass("wito_over");
a.addClass("wito_out");a=witoQuery("#wito_thread_status-"+this.cso.ref).removeClass("wito_over");a.addClass("wito_out")}};witoThreadUiClass.prototype.event_addChild=function(a){return function(b){a.addChild();a.wito.event_stop_bubble(b)}};witoThreadUiClass.prototype.addChild=function(){if(this.cso.testFeas_addChild()){this.cso.enact_addChild();this.makeRoomInPostArea(this.heightMinPost,true,true)}};witoThreadUiClass.prototype.event_colChange=function(a){return function(b){a.colChange(true);a.wito.event_stop_bubble(b)}};
witoThreadUiClass.prototype.colChange=function(a){if(this.cso.testFeas_colChange()){var b=this.colNext(this.cso.colour);this.colComputeVariants(b);var c;c=this.cso.isMinimised()?witoQuery("#wito_thread_titlenot-"+this.cso.ref):witoQuery("#wito_thread_titlebar-"+this.cso.ref);c.css("backgroundColor","#"+this.colourLighten);c.css("borderColor","#"+this.colourDarken);this.jq.css("color","#"+this.colourText);c=witoQuery("#wito_thread_posts-"+this.cso.ref);c.css("backgroundColor","#"+this.colourBack);
c.css("borderColor","#"+this.colourDarken);c=witoQuery("#wito_thread_status-"+this.cso.ref);c.css("backgroundColor","#"+this.colourBack);c.css("borderColor","#"+this.colourDarken);c=this.colNext(b);witoQuery("#wito_thread_colchange-"+this.cso.ref).css("backgroundColor","#"+this.wito.padHex(c,6));this.cso.enact_colChange(b,a)}};witoThreadUiClass.prototype.event_debug=function(a){return function(b){a.debug();a.wito.event_stop_bubble(b)}};
witoThreadUiClass.prototype.debug=function(){if(this.cso.testFeas_debug()){this.makeRoomInPostArea(this.cso.heightMinPost,true,true);this.cso.enact_debug()}};witoThreadUiClass.prototype.listenerTextEdit=function(a){if(a.text==this.wito.default_thread.data){a.text="";a.text_changed=true;a.text_height=this.heightMinEmptyTitleTextarea;a.text_minHeight=a.text_height}a.colBack=this.colourLighten;a.colText=this.colourText};
witoThreadUiClass.prototype.listenerTextUpdated=function(){this.heightTitlebar=witoQuery("#wito_thread_titlebar-"+this.cso.ref).height();this.applyDimensionChange(true,false)};witoThreadUiClass.prototype.colNext=function(a){a-=this.colourSub;if(a<=0)a=this.colourBase;return a};
witoThreadUiClass.prototype.colComputeVariants=function(a){var b=this.wito.colourThreshold(a,this.cso.backgroundColourThreshold);this.colourBack=this.wito.padHex(a,6);this.colourLighten=this.wito.padHex(this.wito.colourMathDarken(a,0.02,b),6);this.colourDarken=this.wito.padHex(this.wito.colourMathDarken(a,0.06,b),6);this.colourText=this.wito.padHex(b?"FFFFFF":"000000",6)};witoThreadUiThumbedClass=function(){};witoClass.inherits(witoThreadUiThumbedClass,witoThreadUiClass);
witoThreadUiThumbedClass.prototype.init=function(a,b){witoThreadUiThumbedClass.superClass_.init.call(this,a,b)};witoTimeringClass=function(){};witoTimeringClass.prototype.init=function(a){this.wito=a;this.list=[];this.add("CINITIME","Initialised timering class");this.mets={}};witoTimeringClass.prototype.getTime=function(){return(new Date).getTime()};witoTimeringClass.prototype.getTimeSince=function(){return this.getTime()-this.first};
witoTimeringClass.prototype.add=function(a,b){var c=this.getTime();if(this.list.length==0)this.last=this.first=c;var d=c-this.first;this.last=c;this.list[this.list.length]=[a,d,c,b]};witoTimeringClass.prototype.speedMetricStart=function(a){this.mets[a]=this.getTime()};witoTimeringClass.prototype.speedMetricStop=function(a,b){var c="Metric";if(arguments.length>=2)c=arguments[2];var d=this.getTime();this.list[this.list.length]=[a,(d-this.mets[a])/b,d,c]};
witoTimeringClass.prototype.report=function(){for(var a="",b=0;b<this.list.length;++b){var c=this.list[b];a+=c[0]+"\t\t"+c[1]+"\t\t"+c[2]+"\t\t"+c[3]+"\r\n"}return a};witoTimeringClass.prototype.getCoded=function(){for(var a=[],b=0;b<this.list.length;++b){var c=this.list[b];a[a.length]={eight:c[0],diff:c[1]}}return a};witoTimeringClass.prototype.clear=function(){this.list.length=0};witoTimeringClass.prototype.clearToCoded=function(){var a=this.getCoded();this.clear();return a};
witoTimeringClass.prototype.clearToJSON=function(){for(var a="[",b=0;b<this.list.length;++b){var c=this.list[b];if(b>0)a+=", ";a+='{"'+c[0]+'" : '+c[1]+"}"}a+="]";this.clear();return a};witoToolClass=function(){};witoToolClass.prototype.init=function(a,b){this.wito=a;this.ref=this.wito.ref_UNSET;this.toolbox=b;this.attached=this.rendered=false;this.stateArray=[];this.stateRef=0;this.jq=this.state=null};witoToolClass.prototype.clone=function(){var a=new witoToolClass;a.copyFrom(this);return a};
witoToolClass.prototype.copyFrom=function(a){var b=a;if(arguments.length>2)b=arguments[1];for(key in b)if(a[key]!=undefined)this[key]=a[key];if(this.stateArray)if(this.stateArray.length>0)this.state=this.stateArray[0]};witoToolClass.prototype.addState=function(a,b){if(!this.stateArray)this.stateArray=[];var c={};c.img=a;c.text=b;this.stateArray[this.stateArray.length]=c};witoToolClass.prototype.getState=function(a){if(!this.stateArray)return null;if(a>this.stateArray.length)return null;return this.stateArray[a]};
witoToolClass.prototype.getCurrentState=function(){return this.state};witoToolClass.prototype.event_getOverMess=function(a){return function(){return a.getOverMess()}};witoToolClass.prototype.getOverMess=function(){if(!this.state)return"";return this.state.over?this.state.over:this.state.text};witoToolClass.prototype.setState=function(a){var b=this.getState(a);if(b){var c="";c+=b.img?this.renderImg(b):b.text;this.jq.html(c);this.stateRef=a;this.state=b}};witoToolClass.prototype.isVisible=function(){return this.visible};
witoToolClass.prototype.render=function(){var a="";if(!this.isVisible())return null;if(this.rendered)return null;var b=this.getState(0);if(b){a+='<p class="wito_toolbox_button" id="wito_tool_p-'+this.ref+'"><a id="wito_tool-'+this.ref+'" href="#">';a+=b.img?this.renderImg(b):'<span class="wito_toolbox_button_text">'+b.text+"</span>";a+="</a></p>";this.rendered=true}return a};
witoToolClass.prototype.renderImg=function(a){var b='<img src="'+(this.wito.page_getAssetPath()+"images/")+a.img+'" alt="'+a.text+'" ';if(a.imgwidth)b+='width="'+a.imgwidth+'" ';if(a.imgheight)b+='height="'+a.imgheight+'" ';b+='border="0" />';return b};
witoToolClass.prototype.attach=function(a){if(a)if(this.rendered)if(!this.attached){this.setup_preAttach&&this.setup_preAttach();var b=this.toolbox.getNextUsedRef(this.ref);b==this.wito.ref_UNSET?this.toolbox.toolBase.before(a):witoQuery("#wito_tool_p-"+b).before(a);this.jq=witoQuery("#wito_tool-"+this.ref);this.attachListeners();this.attached=true}};
witoToolClass.prototype.attachListeners=function(){this.click&&this.jq.bind("click",null,this.event_click(this));this.over&&this.jq.bind("mouseover",null,this.event_over(this));this.toolbox.hovertarget&&this.toolbox.hovertarget.attachOver(this.jq,this.event_getOverMess(this))};witoToolClass.prototype.event_click=function(a){return function(b){a.click&&a.click();a.wito.event_stop_bubble(b)}};witoToolClass.prototype.event_over=function(a){return function(b){a.over&&a.over();a.wito.event_stop_bubble(b)}};
witoToolClass.prototype.setup_init=null;witoToolClass.prototype.setup_preAttach=null;witoToolClass.prototype.click=null;witoToolClass.prototype.over=null;witoToolboxClass=function(){};
witoToolboxClass.prototype.init=function(a){this.wito=a;this.sessionSelect=this.toolBase=null;this.visible=0;this.list=[];this.preInitQueue=witoClass.receiverQ_tool;this.attached=false;this.attach(this.render());this.hovertarget=new witoHoverTargetClass;this.hovertarget.init(this.wito,this,"toolbox");this.hovertarget.attach(this.toolBase,this.hovertarget.render());this.notifier=new witoNotifierClass;this.notifier.init(this.wito,this,this.hovertarget);this.renderAttachTools()};
witoToolboxClass.prototype.receiver=function(a){this.recv_tool(a)};witoToolboxClass.prototype.get=witoClass.prototype.generic_get;witoToolboxClass.prototype.add=witoClass.prototype.generic_add;witoToolboxClass.prototype.getNextUsedRef=witoClass.prototype.generic_getNextUsedRef;witoToolboxClass.prototype.get_default=function(){if(this.wito.default_tool)return this.wito.default_tool;var a=new witoToolClass;a.visible=0;a.ref=this.wito.ref_UNSET;this.wito.default_tool=a;return this.wito.default_tool};
witoToolboxClass.prototype.recv_default=function(a){tool=this.get_default();tool.copyFrom(a);this.wito.default_tool=tool};witoToolboxClass.prototype.recv_tool=function(a){var b,c=true;if(a.ref!=undefined)if(b=this.get(a.ref))c=false;if(c){b=this.get_default().clone();b.init(this.wito,this);b.ref=this.wito.ref_UNSET}b.copyFrom(a,b);b.setup_init&&b.setup_init();c&&this.add(b);this.jq&&b.attach(b.render());return b};witoToolboxClass.prototype.recv_tools=function(a){for(var b=0;b<a.length;++b)this.recv_tool(a[b])};
witoToolboxClass.prototype.render=function(){this.wito.page_getAssetPath();var a="";a+='<div class="wito_toolbox" style="display:none;" id="wito_toolbox">';a+='<div class="wito_toolbox_plinth wito_toolbox_tools">';a+='<p id="wito_toolbox_toolbase"></p>';a+='<div class="wito_clear"></div>';a+="&nbsp;";a+="</div><!-- wito_toolbox_tools --\>";a+="</div><!-- wito_toolbox --\>";return a};
witoToolboxClass.prototype.attach=function(a){if(!this.jq){if(this.wito.page.threadBase){this.wito.page.threadBase.append(a);this.jq=witoQuery("#wito_toolbox");this.toolBase=witoQuery("#wito_toolbox_toolbase")}this.attached=true}};witoToolboxClass.prototype.renderAttachTools=function(){if(!this.jq)if(this.toolBase)for(var a=0;a<this.list.length;++a){var b=this.list[a];b!=null&&b.attach(b.render)}};
witoToolboxClass.prototype.addSelectOption=function(a){if(!this.sessionSelect){this.sessionSelect=new witoSessionSelectClass;this.sessionSelect.init(this.wito,this)}this.sessionSelect.renderAttachOption(a);this.sessionSelect.getCount()>=2&&this.sessionSelect.show()};witoToolboxClass.prototype.show_nto=function(){if(!this.isVisible()){this.jq.animate({width:"42px",height:"38px",opacity:"show"},1E3,null);this.visible=1}};
witoToolboxClass.prototype.show=function(){if(this.jq)switch(this.isVisible()){case 0:this.jq.animate({height:"show",opacity:"show"},1E3,null);this.visible=2;break;case 1:this.jq.css({width:"",height:"",overflow:""});if(parseInt(this.jq.css("width"))>43)this.visible=2;break;case 2:return}};witoToolboxClass.prototype.isVisible=function(){return this.visible};witoToolboxClass.prototype.processQueue=witoClass.prototype.generic_processPreInitQueue;witoUiManagerClass=function(){};
witoUiManagerClass.prototype.init=function(a,b){this.wito=a;this.updateParams(b)};witoUiManagerClass.prototype.updateParams=function(a){this.y=this.x=0;if(a.coord){this.x=a.coord[0];this.y=a.coord[1]}this.sfac=1E3;if(a.sfac)this.sfac=a.sfac;this.sexp=-3;if(a.sexp)this.sexp=a.sexp;this.scale=this.sfac*Math.pow(10,this.sexp)};
witoUiManagerClass.prototype.show=function(){if(this.wito.online==this.wito.status_ONLINE){if(this.wito.sessionList){var a=this.wito.sessionList.getCurrent();a&&a.show()}a=witoQuery("."+this.wito.pageLinkClass);if(a.is("*")){a.animate&&a.css("opacity",0);var b=a.html();if(b=="Feedback"||b=="F eedback")a.html("F&nbsp;eedback");a.css("visibility","visible");a.animate&&a.animate({opacity:1},1E3,null)}else this.wito.showToolbox||this.wito.toolbox.show_nto();this.wito.showToolbox&&this.wito.toolbox.show()}};
witoUiManagerClass.prototype.getBase=function(){return[this.x,this.y]};witoUiManagerClass.prototype.getScale=function(){return this.scale};witoUiManagerClass.prototype.getRenderScale=function(){return this.scale};witoUiManagerClass.prototype.xs=function(a){return a*this.scale};witoUiManagerClass.prototype.xs_back=function(a){return a/this.scale};witoUiManagerClass.prototype.xa=function(a,b){return a*this.scale-(b==this.wito.axis_X?this.x:this.y)};
witoUiManagerClass.prototype.xa_back=function(a,b){return(a+(b==this.wito.axis_X?this.x:this.y))/this.scale};witoToolBackToAccountClass=function(){this.stateArray=[{img:"toolbox/ic_backaccount.png",imgwidth:33,imgheight:32,text:"Back to my account"}]};witoToolBackToAccountClass.prototype.setup_init=function(){this.ref=this.wito.tool_refBACKTOACCOUNT};witoToolBackToAccountClass.prototype.click=function(){window.location("/user")};window.witoGlobal&&witoClass.receiverQ_tool.push(new witoToolBackToAccountClass);
witoToolNewSessionClass=function(){this.stateArray=[{img:"toolbox/ics_newsess.png",imgwidth:20,imgheight:16,text:"New session"}]};witoToolNewSessionClass.prototype.setup_init=function(){this.ref=this.wito.tool_refNEWSESSION};witoToolNewSessionClass.prototype.click=function(){this.wito.sessionList.new_session()};window.witoGlobal&&witoClass.receiverQ_tool.push(new witoToolNewSessionClass);
witoToolNewThreadClass=function(){this.stateArray=[{img:"toolbox/ic_newthread.png",imgwidth:33,imgheight:32,text:"New feedback",over:"Leave some feedback"}]};witoToolNewThreadClass.prototype.setup_init=function(){this.ref=this.wito.tool_refNEWTHREAD};witoToolNewThreadClass.prototype.over=function(){this.toolbox&&this.toolbox.show()};witoToolNewThreadClass.prototype.click=function(){var a=this.wito.sessionList.getCurrent();a&&a.new_thread()};window.witoGlobal&&witoClass.receiverQ_tool.push(new witoToolNewThreadClass);
witoToolPageSweepClass=function(){this.stateArray=[{img:"toolbox/ic_threadgreen.png",imgwidth:33,imgheight:32,text:"Move page",over:"Drag the page around"},{img:"toolbox/ic_threadred.png",imgwidth:33,imgheight:32,text:"Move page",over:"Drag the page around"}]};witoToolPageSweepClass.prototype.setup_init=function(){this.ref=this.wito.tool_refPAGESWEEP};witoToolPageSweepClass.prototype.setup_preAttach=function(){this.action(0)};
witoToolPageSweepClass.prototype.click=function(){this.setState(1-this.state);this.action(this.state)};witoToolPageSweepClass.prototype.action=function(a){switch(a){case 0:witoQuery("#"+this.wito.threadBaseID+"_outer").addClass("pagesweep");break;case 1:witoQuery("#"+this.wito.threadBaseID+"_outer").removeClass("pagesweep");break}};window.witoGlobal&&witoClass.receiverQ_tool.push(new witoToolPageSweepClass);
witoToolShowhideClass=function(){this.stateArray=[{img:"toolbox/ic_feedhide.png",imgwidth:40,imgheight:32,text:"Hide feedback",over:"Hide feedback for now"},{img:"toolbox/ic_feedshow.png",text:"Show feedback",over:"Show hidden feedback"}]};witoToolShowhideClass.prototype.setup_init=function(){this.ref=this.wito.tool_refSHOWHIDE};witoToolShowhideClass.prototype.setup_preAttach=function(){var a=this;this.wito.sessionList.visibilityListener=function(b){a.setState(b?0:1)}};
witoToolShowhideClass.prototype.click=function(){this.wito.sessionList.feedback_toggle()};window.witoGlobal&&witoClass.receiverQ_tool.push(new witoToolShowhideClass);
