/*
** Copyright (c) 2005-2010 TreKnowledge Technologies Inc., All Rights Reserved.
** DO NOT EDIT THIS FILE - IT WAS AUTOMATICALLY GENERATED (build 2.2.13394)
*/
if(!window.Tk){var Tk={build:"2.2.13394",literals:{},uid:1};}if(!window.TkConfig){var TkConfig={debug:false};
}(function(){var c=navigator.userAgent.toLowerCase();var a={opera:/opera/.test(c),msie:/msie/.test(c)&&!/opera/.test(c),mozilla:/mozilla/.test(c)&&!/compatible|webkit/.test(c),webkit:/webkit/.test(c),version:(c.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],secure:(window.location.href.toLowerCase().indexOf("https")===0)};
a.msie6=(a.msie&&/msie 6/.test(c));Tk.useShims=a.msie6||(a.mozilla&&a.mac);Tk.defaultIframeSrc=(a.msie?"about:blank":"javascript:;");
if(a.msie6){try{document.execCommand("BackgroundImageCache",false,true);}catch(b){}}Tk.browser=a;})();
(function(){Tk.support={};var g=document,c=g.documentElement,d=g.createElement("script"),i=g.createElement("div"),h="script"+(new Date).getTime();
i.style.display="none";i.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
var f=i.getElementsByTagName("*"),b=i.getElementsByTagName("a")[0];if(!f||!f.length||!b){return;}Tk.support={leadingWhitespace:i.firstChild.nodeType==3,tbody:!i.getElementsByTagName("tbody").length,objectAll:!!i.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!i.getElementsByTagName("link").length,style:/red/.test(b.getAttribute("style")),hrefNormalized:b.getAttribute("href")==="/a",opacity:b.style.opacity==="0.5",cssFloat:!!b.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};
d.type="text/javascript";try{d.appendChild(g.createTextNode("window."+h+"=1;"));}catch(e){}c.insertBefore(d,c.firstChild);
if(window[h]){Tk.support.scriptEval=true;delete window[h];}c.removeChild(d);if(i.attachEvent&&i.fireEvent){i.attachEvent("onclick",function(){Tk.support.noCloneEvent=false;
i.detachEvent("onclick",arguments.callee);});i.cloneNode(true).fireEvent("onclick");}var i=g.createElement("div");
i.style.width=i.style.paddingLeft="1px";g.body.appendChild(i);Tk.support.boxModel=i.offsetWidth===2;g.body.removeChild(i).style.display="none";
})();window.extend=document.extend=function(a){for(var b in a){this[b]=a[b];}return this;};function TkStatic(a){a=a||{};
a.extend=document.extend;if(typeof a.initialize==="function"){a.initialize.apply(a);}return a;}var $array=function(a,b){a=Array.prototype.slice.call(a);
if(b){b.push.apply(b,a);return b;}return a;};try{Array.prototype.slice.call(document.documentElement.childNodes);
}catch(ex){$array=function(c,d){d=d||[];if(Object.prototype.toString.call(c)==="[object Array]"){d.push.apply(d,c);
}else{if(typeof c.length==="number"){for(var b=0,a=c.length;b<a;b++){d.push(c[b]);}}else{for(var b=0;
c[b]!==undefined;b++){d.push(c[b]);}}}return d;};}function $check(a){return !!(a||a===0);}function $clearTimer(a){clearTimeout(a);
clearInterval(a);return null;}function $defined(a){return a!==undefined;}function $doNothing(){}function $exec(b){if(b){var a=document.createElement("script");
a.setAttribute("language","javascript");if(Tk.support.scriptEval){a.appendChild(document.createTextNode(b));
}else{a.text=b;}var c=document.head;c.insertBefore(a,c.firstChild);c.removeChild(a);}return b;}function $extend(d,c){var h=($type(d)==="array"),b=(h?d:[d]);
for(var f=0,a=b.length;f<a;f++){var g=b[f];for(var e in (c||{})){g[e]=c[e];}}return(h?b:d);}function $L(a,b){a=""+a;
if(b===undefined){b=Tk.literals[a];if(b===undefined){b=Tk.literals[a]="{"+a+"}";}}else{Tk.literals[a]=b;
}return b;}function $lambda(a){return(typeof a==="function")?a:function(){return a;};}function $length(c){switch($type(c)){case"arguments":case"array":case"nodelist":return c.length;
case"object":var b=0;for(var a in c){if(c.hasOwnProperty(a)){b++;}}return b;default:return 0;}}function $merge(){var d={};
for(var c=0,a=arguments.length;c<a;c++){var g=arguments[c];if($type(g)!="object"){continue;}for(var b in g){var f=g[b],e=d[b];
d[b]=(e&&$type(f)==="object"&&$type(e)==="object")?$merge(e,f):$unlink(f);}}return d;}function $openWindow(d,f,c,b,a,h,g){c=Math.round(c?(c<=1?screen.width*c:c):screen.width);
b=Math.round(b?(b<=1?screen.height*b:b):screen.height);h=Math.round(h||(screen.width-c)/2);g=Math.round(g||(screen.height-b)/2);
f=f||"tkWindow";a=a||"";var e=window.open(d,f,a+",width="+c+",height="+b+",top="+g+",left="+h);if(e){e.focus();
}return e;}function $pick(){for(var b=0,a=arguments.length;b<a;b++){if(arguments[b]!==undefined){return arguments[b];
}}return null;}function $setConfigDefaults(a){for(var b in a){if(TkConfig[b]===undefined){TkConfig[b]=a[b];
}}}$setConfigDefaults({imagePath:"img/",clearPixelImage:"img/clear_pixel.gif"});function $splat(b){var a=$type(b);
return a?(a==="array"||a==="arguments"?b:[b]):[];}var $time=Date.now||function(){return +new Date;};function $toQueryString(c){var a=[];
for(var b in c){a.push(b+"="+encodeURIComponent(c[b]));}return a.join("&");}function $try(){for(var c=0,a=arguments.length;
c<a;c++){try{return arguments[c]();}catch(b){}}return null;}function $tryOrNotify(b){try{return b();}catch(a){if(window.TkErrorLogger){TkErrorLogger.send(a);
}else{throw a;}}return null;}function $type(a){if(a===undefined||a===null){return false;}if(a._type_){return(a._type_==="number"&&!isFinite(a))?false:a._type_;
}if(a.nodeName){switch(a.nodeType){case 1:return"element";case 3:return/\S/.test(a.nodeValue)?"textnode":"whitespace";
}}else{if(typeof a.length==="number"){if(a.callee){return"arguments";}else{if(a.item){return"nodelist";
}}}}return typeof a;}function $uid(a){if(!a){return Tk.uid++;}if(!a._uid_){a._uid_=Tk.uid++;}return a._uid_;
}function $unlink(e){var b=null;switch($type(e)){case"object":b={};for(var d in e){b[d]=$unlink(e[d]);
}break;case"array":b=[];for(var c=0,a=e.length;c<a;c++){b[c]=$unlink(e[c]);}break;default:return e;}return b;
}(function(){var c=function(d){return function(e){return this.prototype[d].apply(e,Array.prototype.slice.call(arguments,1));
};};for(var b=0,a=arguments.length;b<a;b++){arguments[b].extend=function(d){for(var e in d){if(!this.prototype[e]){this.prototype[e]=d[e];
}if(!this[e]){this[e]=c(e);}}};}})(Array,Date,Function,Number,String);(function(a){for(var b in a){var c=a[b];
c._type_="native";c.prototype._type_=b.toLowerCase();}})({Array:Array,Boolean:Boolean,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String});
$uid(window);window.extend({_type_:"window",getDocument:function(){return this.document;},getWindow:function(){return this;
}});$uid(document);document.extend({_type_:"document",head:document.getElementsByTagName("head")[0],html:document.getElementsByTagName("html")[0],getDocument:function(){return this;
},getWindow:function(){return this.defaultView||this.parentWindow;}});if(window.attachEvent){window.attachEvent("onunload",function(){window.detachEvent("onunload",arguments.callee);
document.head=document.html=null;if(window.CollectGarbage){window.CollectGarbage();}});}var TkErrorLogger={BUILD_ID:"2.2.13394",HOST_TOKEN:"__host__",MAX_REPORTS:5,REMOTE_LOGGER:"/js_error.php",URL_TOKEN:"__url__",reportCount:0,getFile:function(b){if(b.fileName){return b.fileName;
}if(b.sourceURL){return b.sourceURL;}if(window.opera){var a=b.message.match(/in\s+(.*?\:\/\/\S+)/m);return(a&&a[1])?a[1]:"";
}return"";},getLine:function(a){if(a.lineNumber){return a.lineNumber;}if(a.line){return a.line;}return"";
},getStack:function(g){var q="__anon__";var t=window.location.hostname,b=window.location.href;if(g.stack){return g.stack.split(b).join(TkErrorLogger.URL_TOKEN).split(t).join(TkErrorLogger.HOST_TOKEN).replace(/^.*?\n/,"").replace(/(?:\n@:0)?\s+$/m,"").replace(/^\(/gm,q+"(").replace(/\[object Object\]/g,"object").split("\n").join("~~");
}if(window.opera){var a=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i;var p=g.message.split("\n");
for(var f=4,e=0,d=p.length;f<d;f+=2){if(a.test(p[f])){p[e++]=(RegExp.$3?RegExp.$3+"()@"+RegExp.$2+RegExp.$1:q+RegExp.$2+":"+RegExp.$1)+" -- "+p[f+1].replace(/^\s+/,"");
}}return p.splice(e,p.length-e).join("~~").split(b).join(TkErrorLogger.URL_TOKEN).split(t).join(TkErrorLogger.HOST_TOKEN);
}var o=/function\s*([\w\-$]+)?\s*\(/i,s=15;var r,k,c=arguments.callee.caller,n,f,p,m;p=[];while(c&&p.length<=s){n=o.test(c.toString())?RegExp.$1||q:q;
k=Array.prototype.slice.call(c.arguments);f=k.length;while(f--){r=k[f];if(r===undefined){m="undefined";
}else{if(r===null){m="null";}else{try{m=$type(r);switch(m){case"boolean":case"number":m=TkErrorLogger.obj2str(r);
break;case"document":case"object":case"whitespace":case"window":break;case"element":m+=" "+r.nodeName.toLowerCase();
if(r.id){m+=" #"+r.id;}if(r.className){m+=" ."+r.className;}if(r._uid_){m+=" ["+r._uid_+"]";}break;case"event":m+=" "+r.type;
break;case"string":m='"'+TkErrorLogger.obj2str(r).replace(/"/g,'\\"')+'"';break;default:m+=" "+TkErrorLogger.obj2str(r);
}}catch(h){m="object";}}}k[f]=m;}p.push(n+"("+k.join(", ")+")");c=c.caller;}if(c&&p.length===s){p.push("...");
}return p.join("~~").split(b).join(TkErrorLogger.URL_TOKEN).split(t).join(TkErrorLogger.HOST_TOKEN);},getType:function(a){if(a instanceof EvalError){return"Eval Error";
}if(a instanceof RangeError){return"Range Error";}if(a instanceof ReferenceError){return"Reference Error";
}if(a instanceof SyntaxError){return"Syntax Error";}if(a instanceof TypeError){return"Type Error";}return"Generic Error";
},init:function(){window.onerror=function(a,b,c){TkErrorLogger.send(new Error(a,b,c));return false;};
},obj2str:function(a){try{var c=(""+a).replace(/\n/g," ");return(c.length<50)?c:c.substr(0,50)+" ...";
}catch(b){return null;}},send:function(h){if(typeof h=="string"){h=new Error(h);}TkErrorLogger.reportCount++;
if(TkErrorLogger.reportCount>TkErrorLogger.MAX_REPORTS){window.onerror=null;}else{var j,e,g,b,c,f,i,d,a;
d=new Date();d=(d.format?d.format(Date.DATE_TIME_ZONE):d.toString());j=h.message.split(window.location.href).join(TkErrorLogger.URL_TOKEN).split(window.location.hostname).join(TkErrorLogger.HOST_TOKEN);
e=TkErrorLogger.getFile(h);a=window.location.href;if(e==a){e=TkErrorLogger.URL_TOKEN;}f=["?seq="+TkErrorLogger.reportCount,"build="+TkErrorLogger.BUILD_ID,"cookie="+encodeURIComponent(document.cookie),"file="+encodeURIComponent(e),"line="+TkErrorLogger.getLine(h),"msg="+encodeURIComponent(j),"type="+encodeURIComponent(TkErrorLogger.getType(h)),"time="+encodeURIComponent(d),"url="+encodeURIComponent(a),"stack="].join("&");
i=encodeURIComponent(TkErrorLogger.getStack(h));b=TkErrorLogger.REMOTE_LOGGER.length+f.length+i.length;
if(b>2048){i=i.substr(0,2052-(b-i.length))+" ...";}g=new Image();g.src=TkErrorLogger.REMOTE_LOGGER+f+i;
}return false;}};TkErrorLogger.init();Array.extend({contains:function(b,a){return this.indexOf(b,a||0)>-1;
},copy:function(){return[].concat(this);},each:function(c,b){for(var d=0,a=this.length;d<a;d++){c.call(b,this[d],d,this);
}},empty:function(){this.length=0;return this;},extend:function(b){for(var c=0,a=b.length;c<a;c++){this.push(b[c]);
}return this;},filter:function(c,b){var e=[];for(var d=0,a=this.length;d<a;d++){var f=this[d];if(c.call(b,f,d,this)){e.push(f);
}}return e;},first:function(){return this[0];},indexOf:function(d,c){for(var b=(c<0?Math.max(0,a+c):c||0),a=this.length;
b<a;b++){if(this[b]===d){return b;}}return -1;},last:function(){return this[this.length-1];},remove:function(b){var a=0;
while(a<this.length){if(this[a]==b){this.splice(a,1);}else{a++;}}return this;},some:function(c,b){for(var d=0,a=this.length;
d<a;d++){if(c.call(b,this[d],d,this)){return true;}}return false;}});if(Array.prototype.forEach){Array.prototype.each=Array.prototype.forEach;
}Function.extend({bind:function(a,b){return this.closure({scope:a,arguments:b});},bindWithEvent:function(a,b){return this.closure({scope:a,arguments:b,event:true});
},closure:function(b){var a=this;b=b||{};if(b.arguments!==undefined){b.arguments=$splat(b.arguments);
}b.scope=b.scope||null;return function(d){var c=b.arguments;if(c===undefined){c=$array(arguments);c=b.event?c.slice(1):c;
}if(b.event){c=[d||window.event].extend(c);}var e=function(){return a.apply(b.scope,c);};if(b.delay){return setTimeout(e,b.delay);
}if(b.interval){return setInterval(e,b.interval);}return e();};},delay:function(a,b,c){return this.closure({scope:b,arguments:c,delay:a})();
},periodic:function(b,a,c){return this.closure({scope:a,arguments:c,interval:b})();},run:function(b,a){return this.closure({scope:a,arguments:b});
}});Number.extend({format:function(f,m,l,e,i){f=(f==undefined?2:f);m=m||"";l=l||".";e=e||"-";i=i||"";
var k,j,h,g;k=(this*Math.pow(10,f)).round();j=""+Math.abs(k);j="000000".substring(0,1+f-j.length)+j;h=j.split("");
g=h.length-f;h.splice(g,0,l);while(g>3){g-=3;h.splice(g,0,m);}return k<0?e+h.join("")+i:h.join("");},limit:function(a,b){return Math.min(b,Math.max(a,this));
},pad:function(b,a){return(""+this).pad(b,a);},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a;
},times:function(c,e,b){var a=this+(e||0);for(var d=(e||0);d<a;d++){c.call(b,d);}},toFloat:function(){return parseFloat(this);
},toInt:function(){return parseInt(this,10);}});String.extend({camelize:function(){return this.replace(/\-([a-z])/g,function(a,b){return b.toUpperCase();
});},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();},clean:function(){return this.replace(/\s+/g," ").trim();
},contains:function(b,a){return a?(a+this+a).indexOf(a+b+a)>-1:this.indexOf(b)>-1;},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");
},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());
});},merge:function(){var d=$type(arguments[0])==="array"?arguments[0]:arguments;var b=this;for(var e=0,c=d.length;
e<c;e++){b=b.replace(new RegExp("%"+e,"g"),d[e]);}return b;},pad:function(c,b){var a=this;c=c>1?c:2;b=b!==undefined?b:"0";
while(a.length<c){a=b+a;}return a;},stripScripts:function(b){var a="";var c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";
return"";});if(b&&a){$exec(a);}return c;},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");
},test:function(b,a){return this.match(typeof b==="string"?new RegExp(b,a):b);},toFloat:function(){return parseFloat(this);
},toInt:function(a){return parseInt(this,a||10);},trim:function(){return this.replace(/^\s*|\s*$/g,"");
}});var TkClass=function(b){var a=function(){for(var d in this){if($type(this[d])!="function"){this[d]=$unlink(this[d]);
}}this.constructor=a;var c=this.initialize?this.initialize.apply(this,arguments):this;if(this.options&&this.options.initialize){this.options.initialize.call(this);
}return c;};$extend(a,this);a.constructor=TkClass;a.prototype=b||{};return a;};TkClass.prototype={_type_:"class",extend:function(a){var b=new this(null);
for(var c in a){b[c]=(function(g,e){if($defined(g)&&g!=e){var f=$type(g);if(f==$type(e)){switch(f){case"function":var d=function(){this.parent=arguments.callee.parent;
return e.apply(this,arguments);};d.parent=g;return d;case"object":return $merge(e,g);}}}return e;})(b[c],a[c]);
}return new TkClass(b);},implement:function(){for(var b=0,a=arguments.length;b<a;b++){$extend(this.prototype,arguments[b]);
}}};window.$=function(a,b){if(typeof a==="string"){a=(a.charAt(0)=="#")?a.substr(1):a;a=document.getElementById(a);
}if(a&&a.nodeName){if(!b&&!a.extend&&!(/^object|embed$/i).test(a.tagName)){$uid(a);a.extend=document.extend;
a.extend(TkElement.Prototype);}return a;}return false;};var TkElement=new TkClass({initialize:function(c,a){var e=null;
if(typeof c==="string"){if(Tk.browser.msie&&a&&(a.name||a.type)){var b=a.name?' name="'+a.name+'"':"",d=a.type?' type="'+a.type+'"':"";
c="<"+c+b+d+">";delete a.name;delete a.type;}e=$(document.createElement(c));}else{e=$(c);}return(!e||!a)?e:e.set(a);
}});TkElement.PROPERTIES={accesskey:"accessKey",cellpadding:"cellPadding",cellspacing:"cellSpacing",checked:"checked","class":"className",className:"className",colspan:"colSpan",defer:"defer",disabled:"disabled","for":"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",multiple:"multiple",readonly:"readOnly",rowspan:"rowSpan",selected:"selected",tabindex:"tabIndex",value:"value"};
TkElement.PROPERTY_FLAGS={href:2,src:2};TkElement.Prototype={_type_:"element",addClass:function(){var d=$splat(arguments);
for(var c=0,a=d.length;c<a;c++){var b=d[c];if(!this.hasClass(b)){this.className+=(this.className?" ":"")+b;
}}return this;},appendText:function(a){this.appendChild(document.createTextNode(a));return this;},clone:function(f,e){f=f!==false;
var g=this.cloneNode(f);var b=function(o,k){if(!e){o.removeAttribute("id");}if(Tk.browser.msie){o.clearAttributes();
o.mergeAttributes(k);o.removeAttribute("uid");if(o.options){var j=o.options,m=k.options;for(var h=j.length;
h--;){j[h].selected=m[h].selected;}}}var l={input:"checked",option:"selected",textarea:"value"},n=l[k.tagName.toLowerCase()];
if(n&&k[n]){o[n]=k[n];}if(o._uid_!==undefined){o._uid_=$uid();}};if(f){var d=g.getElementsByTagName("*"),a=this.getElementsByTagName("*");
for(var c=d.length;c--;){b(d[c],a[c]);}}b(g,this);return $(g);},empty:function(){return this.setHtml("");
},getComputedStyle:function(b){if(this.currentStyle){return this.currentStyle[b.camelize()];}var a=document.getWindow().getComputedStyle(this,null);
return a?a.getPropertyValue(b.hyphenate()):null;},getDocument:function(){return this.ownerDocument;},getId:function(a){if(!this.id&&a){this.id="__"+$uid()+"__";
}return this.id;},getProperty:function(d){var b=TkElement.PROPERTIES[d];if(b){return this[b];}var a=TkElement.PROPERTY_FLAGS[d]||0;
if(a||!Tk.browser.msie){return this.getAttribute(d,a);}var c=this.attributes[d];return c?c.nodeValue:null;
},getProperties:function(){var e=$splat(arguments),d={};for(var c=0,a=e.length;c<a;c++){var b=e[c];d[b]=this.getProperty(b);
}return d;},getStyle:function(g,f){if(g=="opacity"&&!Tk.support.opacity){var e=(this.style.filter||"").match(/alpha\(opacity=(.*)\)/i);
if(e){var d=parseFloat(e[1]);if(!isNaN(d)){return d?d/100:0;}}return 1;}g=(g=="float")?(Tk.support.cssFloat?"cssFloat":"styleFloat"):g.camelize();
var d=this.style[g];if(!$check(d)){d=this.getComputedStyle(g);}if(typeof d=="string"&&d.indexOf("rgb")===0){return d.rgb2Hex();
}if(Tk.browser.opera||(Tk.browser.msie&&!$check(parseInt(d)))){if(g=="height"||g=="width"){var b=0,c=(g=="width")?["Left","Right"]:["Top","Bottom"];
c.each(function(h){b+=this.getStyle("border"+h+"Width",true)+this.getStyle("padding"+h,true);},this);
d=(this["offset"+g.capitalize()]-b)+"px";}else{if(/(border(.+)Width|margin|padding)/.test(g)){d="0px";
}}}if(f){var a=d.toInt();return isNaN(a)?d:a;}return d;},getStyles:function(){var e=$splat(arguments),c={};
for(var b=0,a=e.length;b<a;b++){var d=e[b];c[d]=this.getStyle(d);}return c;},getTag:function(){return this.tagName.toLowerCase();
},getText:function(){switch(this.getTag()){case"style":return this.styleSheet?this.styleSheet.cssText:this.innerHTML;
case"script":return $pick(this.text,this.innerHTML);default:return $pick(this.innerText,this.textContent);
}},getValue:function(){switch(this.getTag()){case"select":var a=[];Array.each(this.options,function(b){if(b.selected){a.push(b.value);
}});return this.multiple?a:(a.length?a[0]:false);case"input":if((/checkbox|radio/.test(this.type)&&!this.checked)&&!/hidden|text|password/.test(this.type)){break;
}case"textarea":return this.value;}return false;},getWindow:function(){return this.ownerDocument.getWindow();
},hasClass:function(a){return this.className.contains(a," ");},hide:function(){return this.setStyle("display","none");
},isDisplayed:function(){return this.getStyle("visibility")!=="hidden"&&this.getStyle("display")!=="none";
},removeClass:function(){var d=$splat(arguments);if(d.length&&d[0]!=""){var b=this.className;for(var c=0,a=d.length;
c<a;c++){b=b.replace(new RegExp("(^|\\s)"+d[c]+"(?:\\s|$)"),"$1");}this.className=b.clean();}else{this.className="";
}return this;},removeProperty:function(a){this.removeAttribute(a);return this;},removeProperties:function(){var c=$splat(arguments);
for(var b=0,a=c.length;b<a;b++){this.removeProperty(c[b]);}return this;},replaceClass:function(a,b){this.removeClass(a).addClass(b);
return this;},set:function(a){for(var b in a){var c=a[b];switch(b){case"events":this.addEvents(c);break;
case"html":this.setHtml(c);break;case"styles":this.setStyles(c);break;case"text":this.setText(c);break;
case"value":this.setValue(c);break;default:this.setProperty(b,c);}}return this;},setHtml:function(){if(window.TkEvent){TkEvent.purgeChildren(this);
}this.innerHTML=$array(arguments).join("");return this;},setOpacity:function(a){a=(a<0.00001?0:(a>1?1:a));
var b=this.style;if(a===0){if(b.visibility!="hidden"){b.visibility="hidden";}}else{if(b.visibility!="visible"){b.visibility="visible";
}}if(Tk.support.opacity){b.opacity=a;}else{if(!this.currentStyle||!this.currentStyle.hasLayout){b.zoom=1;
}b.filter=(a===1?"":"alpha(opacity="+Math.round(a*100)+")");}return this;},setProperty:function(c,b){if(b==undefined){return this.removeProperty(c);
}var a=TkElement.PROPERTIES[c];if(a){this[a]=b;}else{this.setAttribute(c,b);}return this;},setProperties:function(){for(var a in oProps){this.setProperty(a,oProps[a]);
}return this;},setStyle:function(b,a){if(arguments.length===1){this.style.cssText=b;return this;}if(/width|height/.test(b)&&parseFloat(a)<0){return this;
}if(b=="opacity"){return this.setOpacity(a);}b=(b=="float")?(Tk.support.cssFloat?"cssFloat":"styleFloat"):b.camelize();
if(typeof a=="number"&&!/zIndex|zoom/.test(b)){a+="px";}else{if($type(a)=="array"&&/color|backgroundColor|borderColor/.test(b)){a=a.rgb2Hex();
}}this.style[b]=a;return this;},setStyles:function(a){if(typeof a=="string"){this.style.cssText=a;return this;
}for(var b in a){this.setStyle(b,a[b]);}return this;},setText:function(a){switch(this.getTag()){case"script":if($defined(this.text)){this.setProperty("text",a);
}else{this.removeChild(this.firstChild);this.appendText(a);}break;case"style":if(this.styleSheet){this.styleSheet.cssText=a;
}else{this.removeChild(this.firstChild);this.appendText(a);}break;default:this[$defined(this.innerText)?"innerText":"textContent"]=a;
}return this;},setValue:function(b){if(this.getTag()=="select"){var a=$type(b)=="array"?b:[b];this.findElements("option").each(function(c){c.selected=a.contains(c.value)||a.contains(c.text);
});if(!a.length){this.selectedIndex=-1;}}else{if(/radio|checkbox/.test(this.type)){var a=$type(b)=="array"?b:[b];
this.checked=a.contains(this.value)||a.contains(this.name);}else{this.value=b;}}return this;},show:function(){return this.setStyle("display","block");
},toggle:function(){return this.setStyle("display",(this.isDisplayed()?"none":"block"));},toggleClasses:function(b,a){if(this.hasClass(b)){this.replaceClass(b,a);
}else{this.replaceClass(a,b);}}};var TkTextNodeWrapper=new TkClass({node:null,initialize:function(b,a){this.node=(a||document).createTextNode(b);
}});function $createShim(c,a,b,d){return new TkElement("iframe",{frameBorder:0,id:c||"",src:Tk.defaultIframeSrc,styles:$merge({background:"#fff",border:0,left:0,lineHeight:0,opacity:0,overflow:"hidden",position:"absolute",top:0,visibility:"visible",zIndex:-1},(a||{}))}).inject(b,d);
}$(document.head).extend({injectCssText:function(a){var b=document.createElement("style");b.media="screen";
b.type="text/css";if(b.styleSheet){b.styleSheet.cssText=a;}else{b.appendChild(document.createTextNode(a));
}this.appendChild(b);}});String.extend({escapeHtml:function(){var a=document.createElement("div");a.textContent=a.innerText=this;
return a.innerHTML.replace(/>/g,"&gt;");},unescapeHtml:function(){var a=document.createElement("div");
a.innerHTML=this;return a.textContent||a.innerText||"";}});(function(){function a(c,f,b,h,e){var d=c[b||f],g=[];
while(d){if(d.nodeType===1&&(!h||TkSelector.match(d,h))){g.push($(d));if(!e){break;}}d=d[f];}return e?g:(g.length?g[0]:null);
}$extend(TkElement.Prototype,{adopt:function(){var e=$splat(arguments);for(var d=0,b=e.length;d<b;d++){var c=$(e[d]);
if(c){c.inject(this);}}return this;},dispose:function(b){if(this.purgeEvents){this.purgeEvents(b);}return(this.parentNode)?this.parentNode.removeChild(this):this;
},getAllNext:function(b){return a(this,"nextSibling",null,b,true);},getAllPrevious:function(b){return a(this,"previousSibling",null,b,true);
},getChildren:function(b){return a(this,"nextSibling","firstChild",b,true);},getFirst:function(b){return a(this,"nextSibling","firstChild",b,false);
},getLast:function(b){return a(this,"previousSibling","lastChild",b,false);},getNext:function(b){return a(this,"nextSibling",null,b,false);
},getParent:function(b){return a(this,"parentNode",null,b,false);},getParents:function(b){return a(this,"parentNode",null,b,true);
},getPrevious:function(b){return a(this,"previousSibling",null,b,false);},hasChild:function(b){return $(b)?b.isChildOf(this):false;
},inject:function(b,d){b=$(b||document.body);if(!b){return null;}switch(d){case"after":var c=b.getNext();
if(c){b.parentNode.insertBefore(this,c);}else{b.parentNode.appendChild(this);}break;case"before":b.parentNode.insertBefore(this,b);
break;case"top":var e=b.firstChild;if(e){b.insertBefore(this,e);break;}default:b.appendChild(this);}return this;
},injectAfter:function(b){return this.inject(b,"after");},injectBefore:function(b){return this.inject(b,"before");
},injectBottom:function(b){return this.inject(b,"bottom");},injectTop:function(b){return this.inject(b,"top");
},isChildOf:function(c){if(!$(c)){return false;}for(var b=this.parentNode;b&&b!==c;b=b.parentNode){}return b===c;
},replaceWith:function(c,b){if(!$(c)){return null;}this.parentNode.replaceChild(c,this);if(this.purgeEvents){this.purgeEvents(b);
}return c;}});})();TkTextNodeWrapper.implement({_inject:TkElement.Prototype.inject,inject:function(a,b){this._inject.call(this.node,a,b);
},injectAfter:function(a){this._inject.call(this.node,a,"after");},injectBefore:function(a){this._inject.call(this.node,a,"before");
},injectBottom:function(a){this._inject.call(this.node,a,"bottom");},injectTop:function(a){this._inject.call(this.node,a,"top");
}});$extend([window,document,TkElement.Prototype],window.attachEvent?{addListener:function(b,a){this.attachEvent("on"+b,a);
return this;},removeListener:function(b,a){this.detachEvent("on"+b,a);return this;}}:{addListener:function(b,a){this.addEventListener(b,a,false);
return this;},removeListener:function(b,a){this.removeEventListener(b,a,false);return this;}});var TkEvent=new TkStatic({KEYS:{"8":"backspace","9":"tab","13":"enter","27":"esc","32":"space","37":"left","38":"up","39":"right","40":"down","46":"delete"},eventCache:{},add:function(c,e,d){if(c.nodeType==3||c.nodeType==8){return;
}if(c.setInterval&&c!=window){c=window;}if(!c||!e||!d){throw new Error("TkEvent.add - Missing parameter(s) detected");
}$uid(d);var b=this.eventCache[c._uid_];if(!b){b=this.eventCache[c._uid_]={element:c,events:{},handler:function(f){return TkEvent._callHandlers(c,f);
}};}var a=b.events[e];if(!a){a=b.events[e]={};c.addListener(e,b.handler);}a[d._uid_]=d;},_callHandlers:function(g,k){k=TkEvent._fix(k);
var b=TkEvent.eventCache[g._uid_],d=b&&b.events[k.type],m;if(d){if(k.type=="unload"){var a=[];for(var c in d){a.push(c);
}a=a.sort(function(l,i){return l-i;}).reverse();var h={};for(var f=0,e=a.length;f<e;f++){h[f]=d[a[f]];
}d=h;}for(var c in d){var j=d[c].apply(g,[k]);if(j!==undefined){m=j;if(j===false){k.stop();}}}}return m;
},fire:function(a,b){return this._callHandlers(a,{type:b,target:a,fake:true});},_fix:function(n){n=n||window.event;
if(n.extended){return n;}var b,a,m,i,l,e,f,j,h;j=n.type;f=n.target||n.srcElement;while(f&&f.nodeType===3){f=f.parentNode;
}if(!n.fake){if(/key/.test(j)){a=n.which||n.keyCode;m=this.KEYS[""+a];if(j=="keydown"){var c=a-111;if(c>0&&c<13){m="f"+c;
}}m=m||String.fromCharCode(n.code).toLowerCase();}else{if(/(click|mouse|menu)/.test(j)){var d=window,k=d.document;
k=(!k.compatMode||k.compatMode==="CSS1Compat")?k.html:k.body;b={x:n.pageX?n.pageX-d.pageXOffset:n.clientX,y:n.pageY?n.pageY-d.pageYOffset:n.clientY};
i={x:n.pageX||n.clientX+k.scrollLeft,y:n.pageY||n.clientY+k.scrollTop};if(/DOMMouseScroll|mousewheel/.test(j)){h=(n.wheelDelta)?n.wheelDelta/120:-(n.detail||0)/3;
}e=(n.which===3)||(n.button===2);l=null;if(/over|out/.test(j)){switch(j){case"mouseover":l=n.relatedTarget||n.fromElement;
break;case"mouseout":l=n.relatedTarget||n.toElement;break;}try{while(l&&l.nodeType===3){l=l.parentNode;
}}catch(g){l=null;}}}}}return{_type_:"event",extended:true,original:n,type:j,page:i,client:b,rightClick:e,wheel:h,relatedTarget:l,target:f,code:a,key:m,shift:n.shiftKey,control:n.ctrlKey,alt:n.altKey,meta:n.metaKey,preventDefault:function(){if(n.preventDefault){n.preventDefault();
}n.returnValue=false;return this;},stopPropagation:function(){if(n.stopPropagation){n.stopPropagation();
}n.cancelBubble=true;return this;},stop:function(){return this.stopPropagation().preventDefault();}};
},inspect:function(){var a=this.eventCache,b=0,c=0;for(var d in a){b++;c+=$length(a[d].events);}return""+c+" events attached to "+b+" DOM elements";
},purge:function(c,e,g){var b=c._uid_&&TkEvent.eventCache[c._uid_];if(b){var a;if(g){a=b.events[g];for(var f in a){TkEvent.remove(c,g,a[f]);
}}else{for(var d in b.events){a=b.events[d];for(var f in a){TkEvent.remove(c,d,a[f]);}}}}if(e){TkEvent.purgeChildren(c,g);
}},purgeChildren:function(b,e){var d=b.getElementsByTagName("*");for(var c=0,a=d.length;c<a;c++){this.purge(d[c],false,e);
}},remove:function(c,g,f){var b=c._uid_&&this.eventCache[c._uid_];if(b){if(!g||!f){return this.purge(c,false,g);
}var a=b.events[g];if(a){delete a[f._uid_];for(var e in a){break;}if(!e){c.removeListener(g,b.handler);
delete b.events[g];}for(var d in b.events){break;}if(!d){b.element=b.handler=null;delete this.eventCache[c._uid_];
}}}}});$extend([window,document,TkElement.Prototype],{addEvent:function(b,a){TkEvent.add(this,b,a);return this;
},addEvents:function(b){for(var a in b){this.addEvent(a,b[a]);}return this;},fireEvent:function(a){return TkEvent.fire(this,a);
},purgeEvents:function(a,b){TkEvent.purge(this,a,b);return this;},removeEvent:function(b,a){TkEvent.remove(this,b,a);
return this;},removeEvents:function(b){for(var a in b){this.removeEvent(a,b[a]);}return this;}});(function(){window._isReady_=false;
var d=false,c=null;function b(){if(d){return;}d=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);
a();},false);}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);
a();}});var e=false;try{e=window.frameElement==null;}catch(f){}if(document.documentElement.doScroll&&e){(function(){if(window._isReady_){return;
}try{document.documentElement.doScroll("left");}catch(g){setTimeout(arguments.callee,0);return;}a();})();
}}}window.addEvent("load",a);}function a(){if(window._isReady_){return;}window._isReady_=true;if(c){c.each(function(e){$tryOrNotify(e);
});c=null;}window.removeEvent("load",arguments.callee);}window.extend({ready:function(e){b();if(window._isReady_){$tryOrNotify(e);
}else{if(!c){c=[];}c.push(e);}}});})();window.addEvent("unload",function(){var b=document,a=window;b.purgeEvents(true);
a.onbeforeunload=null;a.purgeEvents();b.head=b.html=null;if(a.CollectGarbage){CollectGarbage();}});var TkFx=function(a){this.startState=0;
this.endState=0;this.subjects=[];this.time=0;this.timerDelegate=this._step.bind(this);this.options=$extend({duration:TkFx.Duration.Normal,interval:TkFx.Interval.Normal,onComplete:$doNothing,onStart:$doNothing,onStep:$doNothing,transition:function(b){return -(Math.cos(Math.PI*b)-1)/2;
}},a);};TkFx.Duration={Short:200,Normal:400,Long:800,XLong:1200};TkFx.Interval={XShort:1,Short:10,Normal:20,Long:40};
TkFx.prototype={addSubject:function(a){this.subjects.push(a);return this;},clearSubjects:function(){this.subjects=[];
return this;},jumpTo:function(a){this.endState=this.startState=a.limit(0,1);this._propagate();return this;
},play:function(){return this.playFromTo(0,1);},playFromTo:function(b,a){this.startState=b.limit(0,1);
this.endState=a.limit(0,1);this.time=$time();this.options.onStart.call(this);if(!this.intervalId){this.intervalId=this.timerDelegate.periodic(this.options.interval);
}return this;},playTo:function(a){return this.playFromTo(this.startState,a);},_propagate:function(){var d=this.options.transition(this.startState);
for(var c=0,a=this.subjects.length;c<a;c++){var b=this.subjects[c];if(b.setState){b.setState(d);}else{b(d);
}}return this;},removeSubject:function(a){this.subjects.remove(a);return this;},reverse:function(){if(this.endState!==this.startState){return this.playFromTo(this.endState,this.startState);
}else{return this.playFromTo(1,0);}},_step:function(){var c=$time(),d=c-this.time,b=this.startState-this.endState,a=(d/this.options.duration)*(b<0?1:-1);
this.time=c;if(Math.abs(a)<Math.abs(b)){this.startState+=a;}else{this.startState=this.endState;}try{this._propagate();
}finally{this.options.onStep.call(this);if(this.endState===this.startState){this.intervalId=$clearTimer(this.intervalId);
this.options.onComplete.call(this);}}},stop:function(){this.intervalId=$clearTimer(this.intervalId);return this;
},toggle:function(){return this.playTo(1-this.endState);}};TkFx.Css=function(k,d){this.subjects=[];k=$splat(k);
if(!k.length){return false;}if($type(d)==="array"){d=this._parseStyles(d,k[0]);}var e,h,a,b,c,g,f,j;for(var i in d){e=h=b=c=f=null;
j=d[i];a=""+j[0];g=""+j[1];if(a==g){continue;}e=TkFx.Css.Color.parseColor(a);if(e){b=TkFx.Css.Color.parseColor(g);
if(b&&e!=b){f=new TkFx.Css.Color(k,i,e,b);}}else{h=a.match(TkFx.Css.NUMERICAL_REGX);if(h){c=g.match(TkFx.Css.NUMERICAL_REGX);
if(c&&h[0]!=c[0]){f=new TkFx.Css.Numeric(k,i,h[0],c[0],h[1]||c[1]);}}else{h=a.match(TkFx.Css.DISCRETE_REGX);
if(h){c=g.match(TkFx.Css.DISCRETE_REGX);if(c&&h[0]!=c[0]){f=new TkFx.Css.Discrete(k,i,a,g);}}}}if(f){this.subjects.push(f);
}}};TkFx.Css.CSS_RULE_REGX=/^\s*([a-zA-Z\-]+)\s*:\s*(\S(.+\S)?)\s*$/;TkFx.Css.NUMERICAL_REGX=/^-?\d+(?:\.\d+)?(%|[a-zA-Z]{2})?$/;
TkFx.Css.DISCRETE_REGX=/url\(\s*(.*?)\s*\)|\w+/;TkFx.Css.CSS_PROPERTIES=["azimuth","background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","borderCollapse","borderColor","borderSpacing","borderStyle","borderTop","borderTopColor","borderRightColor","borderBottomColor","borderLedtColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderWidth","bottom","clear","clip","color","content","cursor","direction","display","elevation","emptyCells","cssFloat","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginTop","marginRight","marginBottom","marginLeft","maxHeight","maxWidth","minHeight","minWidth","orphans","outline","outlineColor","outlineStyle","outlineWidth","overflow","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","pause","position","right","size","tableLayout","textAlign","textDecoration","textIndent","textShadow","textTransform","top","verticalAlign","visibility","whiteSpace","width","wordSpacing","zIndex","opacity","outlineOffset","overflowX","overflowY"];
TkFx.Css.prototype={_parseStyles:function(f,e){var g,b,k,l,m={},h;if($type(f)==="array"&&f.length===2){if(f[0].contains(":")){for(var d=0;
d<2;d++){l=f[d].split(";");for(var a=0,c=l.length;a<c;a++){b=TkFx.Css.CSS_RULE_REGX.exec(l[a]);if(b){k=b[1];
h=b[2];if(!m[k]){m[k]=[];}m[k].push(h);}}}}else{g=e.className;for(var d=0;d<2;d++){e.className=f[d];for(var a=0,c=TkFx.Css.CSS_PROPERTIES.length;
a<c;a++){k=TkFx.Css.CSS_PROPERTIES[a];h=e.getStyle(k);if(h){if(!m[k]){m[k]=[];}m[k].push(h);}}}e.className=g;
}}return m;},setState:function(c){for(var b=0,a=this.subjects.length;b<a;b++){this.subjects[b].setState(c);
}}};TkFx.Css.Color=function(d,c,b,a){this.elements=$splat(d);if(!this.elements.length){return false;}this.property=c.camelize();
this.startValue=this._expandColor(b);this.endValue=this._expandColor(a);};TkFx.Css.Color.prototype={_expandColor:function(b){if(b=="#"){var a=this.elements[0];
while(a){b=a.getStyle(this.property);if((b&&b!="transparent")||a.getTag()=="body"){break;}a=$(a.parentNode);
}if(!b||b=="transparent"){return[255,255,255];}}var c=TkFx.Css.Color.parseColor(b);if(c){return[parseInt(c.slice(1,3),16),parseInt(c.slice(3,5),16),parseInt(c.slice(5,7),16)];
}},_getState:function(a,b){return Math.round(this.startValue[a]+((this.endValue[a]-this.startValue[a])*b));
},setState:function(d){var b="#"+this._getState(0,d).toHex()+this._getState(1,d).toHex()+this._getState(2,d).toHex();
for(var c=0,a=this.elements.length;c<a;c++){this.elements[c].setStyle(this.property,b);}}};TkFx.Css.Color.parseColor=function(b){if(b=="#"){return b;
}var a=$hexColor(b);return(!a||a==="transparent")?false:a;};TkFx.Css.Discrete=function(e,c,d,a,b){this.elements=$splat(e);
if(!this.elements.length){return false;}this.startValue=d;this.endValue=a;this.property=c.camelize();
this.threshold=b||0.5;};TkFx.Css.Discrete.prototype={setState:function(c){for(var b=0,a=this.elements.length;
b<a;b++){this.elements[b].setStyle(this.property,(c<=this.threshold?this.startValue:this.endValue));}}};
TkFx.Css.Numeric=function(e,b,d,a,c){this.elements=$splat(e);if(!this.elements.length){return false;}this.startValue=parseFloat(d);
this.endValue=parseFloat(a);this.property=b.camelize();this.units=c||"px";this.distance=this.endValue-this.startValue;
};TkFx.Css.Numeric.prototype={setState:function(c){var d=this.startValue+(this.distance*c);if(this.property!="opacity"){d=Math.round(d)+this.units;
}for(var b=0,a=this.elements.length;b<a;b++){this.elements[b].setStyle(this.property,d);}}};TkFx.Transition=function(a,b){b=$splat(b);
return $extend(a,{easeIn:function(c){return a(c,b);},easeOut:function(c){return 1-a(1-c,b);},easeInOut:function(c){return c<=0.5?a(2*c,b)/2:(2-a(2*(1-c),b))/2;
}});};TkFx.Transitions={extend:function(a){for(var b in a){TkFx.Transitions[b]=new TkFx.Transition(a[b]);
}},linear:function(a){return a;}};TkFx.Transitions.extend({Back:function(b,a){a=a[0]||1.618;return Math.pow(b,2)*((a+1)*b-a);
},Bounce:function(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=-Math.pow((11-6*d-11*f)/4,2)+c*c;
break;}}return e;},Circ:function(a){return 1-Math.sin(Math.acos(a));},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3);
},Expo:function(a){return Math.pow(2,8*(a-1));},Pow:function(b,a){return Math.pow(b,a[0]||6);},Sine:function(a){return 1-Math.sin((1-a)*Math.PI/2);
}});["Quad","Cubic","Quart","Quint"].each(function(a,b){TkFx.Transitions[a]=new TkFx.Transition(function(c){return Math.pow(c,[b+2]);
});});$extend(TkFx,{create:function(c,a,b){return new TkFx(b).addSubject(new TkFx.Css(c,a));},fadeColor:function(f,d,e,c,a){var b={};
b[d]=[e,c];return TkFx.create(f,b,a);},fadeIn:function(b,a){return TkFx.create(b,{opacity:[0,1]},a);},fadeOut:function(b,a){return TkFx.create(b,{opacity:[1,0]},a);
},play:function(c,a,b){return TkFx.create(c,a,b).play();}});