if(typeof(nitobi)=="undefined"){nitobi=function(){}}if(false){nitobi.lang=function(){}}if(typeof(nitobi.lang)=="undefined"){nitobi.lang={}}nitobi.lang.defineNs=function(_1){var _2=_1.split(".");var _3="";var _4="";for(var i=0;i<_2.length;i++){_3+=_4+_2[i];_4=".";if(eval("typeof("+_3+")")=="undefined"){eval(_3+"={}")}}};nitobi.lang.extend=function(b,a){function c(){}c.prototype=a.prototype;b.prototype=new c();b.prototype.constructor=b;b.baseConstructor=a;if(a.base){a.prototype.base=a.base}b.base=a.prototype};nitobi.lang.implement=function(b,a){for(var c in a.prototype){if(typeof(b.prototype[c])=="undefined"||b.prototype[c]==null){b.prototype[c]=a.prototype[c]}}};nitobi.lang.setJsProps=function(d,b){for(var c=0;c<b.length;c++){var a=b[c];d["set"+a.n]=this.jSET;d["get"+a.n]=this.jGET;d[a.n]=a.d}};nitobi.lang.setXmlProps=function(f,h){for(var a=0;a<h.length;a++){var d=h[a];var b,c;switch(d.t){case"i":b=this.xSET;c=this.xiGET;break;case"b":b=this.xbSET;c=this.xbGET;break;default:b=this.xSET;c=this.xGET}f["set"+d.n]=b;f["get"+d.n]=c;f.sModel+=d.n+'"'+d.d+'" '}};nitobi.lang.setEvents=function(c,b){for(var a=0;a<b.length;a++){var f=b[a];c["set"+f]=this.eSET;c["get"+f]=this.eGET;var d=f.substring(0,f.length-5);c["set"+d]=this.eSET;c["get"+d]=this.eGET;c["o"+f.substring(1)]=new nitobi.base.Event()}};nitobi.lang.isDefined=function(b){return(typeof(b)!="undefined")};nitobi.lang.getBool=function(b){if(null==b){return null}if(typeof(b)=="boolean"){return b}return b.toLowerCase()=="true"};nitobi.lang.type={XMLNODE:0,HTMLNODE:1,ARRAY:2,XMLDOC:3};nitobi.lang.typeOf=function(b){var a=typeof(b);if(a=="object"){if(b.blur&&b.innerHTML){return nitobi.lang.type.HTMLNODE}if(b.nodeName&&b.nodeName.toLowerCase()==="#document"){return nitobi.lang.type.XMLDOC}if(b.nodeName){return nitobi.lang.type.XMLNODE}if(b instanceof Array){return nitobi.lang.type.ARRAY}}return a};nitobi.lang.toBool=function(b,a){if(typeof(a)!="undefined"){if((typeof(b)=="undefined")||(b=="")||(b==null)){b=a}}b=b.toString()||"";b=b.toUpperCase();if((b=="Y")||(b=="1")||(b=="TRUE")){return true}else{return false}};nitobi.lang.boolToStr=function(a){if((typeof(a)=="boolean"&&a)||(typeof(a)=="string"&&(a.toLowerCase()=="true"||a=="1"))){return"1"}else{return"0"}return a};nitobi.lang.formatNumber=function(a,f,c,b){var d=nitobi.form.numberXslProc;d.addParameter("number",a,"");d.addParameter("mask",f,"");d.addParameter("group",c,"");d.addParameter("decimal",b,"");return nitobi.xml.transformToString(nitobi.xml.Empty,nitobi.form.numberXslProc)};nitobi.lang.close=function(c,b,a){if(null==a){return function(){return b.apply(c,arguments)}}else{return function(){return b.apply(c,a)}}};nitobi.lang.after=function(b,g,f,d){var c=b[g];var a=f[d];if(d instanceof Function){a=d}b[g]=function(){c.apply(b,arguments);a.apply(f,arguments)};b[g].orig=c};nitobi.lang.before=function(d,f,c,b){var a=d[f];var g=function(){};if(c!=null){g=c[b]}if(b instanceof Function){g=b}d[f]=function(){g.apply(c,arguments);a.apply(d,arguments)};d[f].orig=a};nitobi.lang.forEach=function(b,d){var a=b.length;for(var c=0;c<a;c++){d.call(this,b[c],c)}d=null};nitobi.lang.throwError=function(a,c){var b=a;if(c!=null){b+="\n - because "+nitobi.lang.getErrorDescription(c)}throw b};nitobi.lang.getErrorDescription=function(b){var a=(typeof(b.description)=="undefined")?b:b.description;return a};nitobi.lang.newObject=function(_3e,_3f,_40){var a=_3f;if(null==_40){_40=0}var e="new "+_3e+"(";var _43="";for(var i=_40;i<a.length;i++){e+=_43+"a["+i+"]";_43=","}e+=")";return eval(e)};nitobi.lang.getLastFunctionArgs=function(b,f){var c=new Array(b.length-f);for(var d=f;d<b.length;d++){c[d-f]=b[d]}return c};nitobi.lang.getFirstHashKey=function(b){for(var a in b){return a}};nitobi.lang.getFirstFunction=function(b){for(var a in b){if(b[a]!=null&&typeof(b[a])=="function"&&typeof(b[a].prototype)!="undefined"){return{name:a,value:b[a]}}}return null};nitobi.lang.copy=function(c){var b={};for(var a in c){b[a]=c[a]}return b};nitobi.lang.dispose=function(f,d){try{if(d!=null){var c=d.length;for(var b=0;b<c;b++){if(typeof(d[b].dispose)=="function"){d[b].dispose()}if(typeof(d[b])=="function"){d[b].call(f)}d[b]=null}}for(var a in f){if(f[a]!=null&&f[a].dispose instanceof Function){f[a].dispose()}f[a]=null}}catch(g){}};nitobi.lang.parseNumber=function(b){var a=parseInt(b);return(isNaN(a)?0:a)};nitobi.lang.numToAlpha=function(b){if(typeof(nitobi.lang.numAlphaCache[b])==="string"){return nitobi.lang.numAlphaCache[b]}var d=b%26;var c=Math.floor(b/26);var a=(c>0?String.fromCharCode(96+c):"")+String.fromCharCode(97+d);nitobi.lang.alphaNumCache[a]=b;nitobi.lang.numAlphaCache[b]=a;return a};nitobi.lang.alphaToNum=function(a){if(typeof(nitobi.lang.alphaNumCache[a])==="number"){return nitobi.lang.alphaNumCache[a]}var c=0;var b=0;for(var d=a.length-1;d>=0;d--){b+=(a.charCodeAt(d)-96)*Math.pow(26,c++)}b=b-1;nitobi.lang.alphaNumCache[a]=b;nitobi.lang.numAlphaCache[b]=a;return b};nitobi.lang.alphaNumCache={};nitobi.lang.numAlphaCache={};nitobi.lang.toArray=function(a,b){return Array.prototype.splice.call(a,b||0)};nitobi.lang.merge=function(h,g){var f={};for(var d=0;d<arguments.length;d++){var c=arguments[d];for(var b in arguments[d]){f[b]=c[b]}}return f};nitobi.lang.xor=function(){var a=false;for(var c=0;c<arguments.length;c++){if(arguments[c]&&!a){a=true}else{if(arguments[c]&&a){return false}}}return a};nitobi.lang.zeros="00000000000000000000000000000000000000000000000000000000000000000000";nitobi.lang.padZeros=function(a,b){b=b||2;a=a+"";return nitobi.lang.zeros.substr(0,Math.max(b-a.length,0))+a};nitobi.lang.noop=function(){};nitobi.lang.isStandards=function(){var b=(document.compatMode=="CSS1Compat");if(nitobi.browser.SAFARI||nitobi.browser.CHROME){var a=document.createElement("div");a.style.cssText="width:0px;width:1";b=(parseInt(a.style.width)!=1)}return b};nitobi.lang.defineNs("nitobi.lang");nitobi.lang.Math=function(){};nitobi.lang.Math.sinTable=Array();nitobi.lang.Math.cosTable=Array();nitobi.lang.Math.rotateCoords=function(d,c,j){var b=j*0.01745329277777778;if(nitobi.lang.Math.sinTable[b]==null){nitobi.lang.Math.sinTable[b]=Math.sin(b);nitobi.lang.Math.cosTable[b]=Math.cos(b)}var g=nitobi.lang.Math.cosTable[b];var f=nitobi.lang.Math.sinTable[b];var a=d*g-c*f;var h=c*g+d*f;return{x:a,y:h}};nitobi.lang.Math.returnAngle=function(d,c,b,a){return Math.atan2(a-c,b-d)/0.01745329277777778};nitobi.lang.Math.returnDistance=function(b,d,a,c){return Math.sqrt(((a-b)*(a-b))+((c-d)*(c-d)))};nitobi.lang.defineNs("nitobi");nitobi.Object=function(){this.disposal=new Array();this.modelNodes={}};nitobi.Object.prototype.setValues=function(b){for(var a in b){if(this[a]!=null){if(this[a].subscribe!=null){}else{this[a]=b[a]}}else{if(this[a] instanceof Function){this[a](b[a])}else{if(this["set"+a] instanceof Function){this["set"+a](b[a])}else{this[a]=b[a]}}}}};nitobi.Object.prototype.xGET=function(){var b=null,c="@"+arguments[0],d="";var a=this.modelNodes[c];if(a!=null){b=a}else{b=this.modelNodes[c]=this.modelNode.selectSingleNode(c)}if(b!=null){d=b.nodeValue}return d};nitobi.Object.prototype.xSET=function(){var c=null,b="@"+arguments[0];var a=this.modelNodes[b];if(a!=null){c=a}else{c=this.modelNodes[b]=this.modelNode.selectSingleNode(b)}if(c==null){this.modelNode.setAttribute(arguments[0],"")}if(arguments[1][0]!=null&&c!=null){if(typeof(arguments[1][0])=="boolean"){c.nodeValue=nitobi.lang.boolToStr(arguments[1][0])}else{c.nodeValue=arguments[1][0]}}};nitobi.Object.prototype.eSET=function(f,c){var b=c[0];var a=b;var g=f.substr(2);g=g.substr(0,g.length-5);if(typeof(b)=="string"){a=function(){return nitobi.event.evaluate(b,arguments[0])}}if(this[f]!=null){this.unsubscribe(g,this[f])}var d=this.subscribe(g,a);this.jSET(f,[d]);return d};nitobi.Object.prototype.eGET=function(){};nitobi.Object.prototype.jSET=function(a,b){this[a]=b[0]};nitobi.Object.prototype.jGET=function(a){return this[a]};nitobi.Object.prototype.xsGET=nitobi.Object.prototype.xGET;nitobi.Object.prototype.xsSET=nitobi.Object.prototype.xSET;nitobi.Object.prototype.xbGET=function(){return nitobi.lang.toBool(this.xGET.apply(this,arguments),false)};nitobi.Object.prototype.xiGET=function(){return parseInt(this.xGET.apply(this,arguments))};nitobi.Object.prototype.xiSET=nitobi.Object.prototype.xSET;nitobi.Object.prototype.xdGET=function(){};nitobi.Object.prototype.xnGET=function(){return parseFloat(this.xGET.apply(this,arguments))};nitobi.Object.prototype.xbSET=function(){this.xSET.call(this,arguments[0],[nitobi.lang.boolToStr(arguments[1][0])])};nitobi.Object.prototype.fire=function(a,b){return nitobi.event.notify(a+this.uid,b)};nitobi.Object.prototype.subscribe=function(c,d,b){if(this.subscribedEvents==null){this.subscribedEvents={}}if(typeof(b)=="undefined"){b=this}var a=nitobi.event.subscribe(c+this.uid,nitobi.lang.close(b,d));this.subscribedEvents[a]=c+this.uid;return a};nitobi.Object.prototype.subscribeOnce=function(a,g,d,c){var b=this;var h=function(){g.apply(d||this,c||arguments);b.unsubscribe(a,f)};var f=this.subscribe(a,h);return f};nitobi.Object.prototype.unsubscribe=function(a,b){return nitobi.event.unsubscribe(a+this.uid,b)};nitobi.Object.prototype.dispose=function(){if(this.disposing){return}this.disposing=true;var b=this.disposal.length;for(var a=0;a<b;a++){if(disposal[a] instanceof Function){disposal[a].call(context)}disposal[a]=null}for(var c in this){if(this[c].dispose instanceof Function){this[c].dispose.call(this[c])}this[c]=null}};if(false){nitobi.base=function(){}}nitobi.lang.defineNs("nitobi.base");nitobi.base.uid=1;nitobi.base.getUid=function(){return"ntb__"+(nitobi.base.uid++)};nitobi.lang.defineNs("nitobi.browser");if(false){nitobi.browser=function(){}}nitobi.browser.UNKNOWN=true;nitobi.browser.IE=false;nitobi.browser.IE6=false;nitobi.browser.IE7=false;nitobi.browser.IE8=false;nitobi.browser.MOZ=false;nitobi.browser.FF3=false;nitobi.browser.SAFARI=false;nitobi.browser.OPERA=false;nitobi.browser.AIR=false;nitobi.browser.CHROME=false;nitobi.browser.XHR_ENABLED;nitobi.browser.detect=function(){var f=[{string:navigator.vendor,subString:"Adobe",identity:"AIR"},{string:navigator.vendor,subString:"Google",identity:"Chrome"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"},{string:navigator.vendor,subString:"Camino",identity:"Camino"}];var d="Unknown";for(var c=0;c<f.length;c++){var b=f[c].string;var a=f[c].prop;if(b){if(b.indexOf(f[c].subString)!=-1){d=f[c].identity;break}}else{if(a){d=f[c].identity;break}}}nitobi.browser.IE=(d=="Explorer");nitobi.browser.IE6=(nitobi.browser.IE&&!window.XMLHttpRequest);nitobi.browser.IE7=(nitobi.browser.IE&&window.XMLHttpRequest);nitobi.browser.MOZ=(d=="Netscape"||d=="Firefox"||d=="Camino");nitobi.browser.FF3=(d=="Firefox"&&parseInt(navigator.userAgent.substr(navigator.userAgent.indexOf("Firefox/")+8,3))==3);nitobi.browser.SAFARI=(d=="Safari");nitobi.browser.OPERA=(d=="Opera");nitobi.browser.AIR=(d=="AIR");nitobi.browser.CHROME=(d=="Chrome");if(nitobi.browser.SAFARI){nitobi.browser.OPERA=true}if(nitobi.browser.AIR){nitobi.browser.SAFARI=true}nitobi.browser.XHR_ENABLED=nitobi.browser.OPERA||nitobi.browser.SAFARI||nitobi.browser.MOZ||nitobi.browser.IE||nitobi.browser.CHROME;nitobi.browser.UNKNOWN=!(nitobi.browser.IE||nitobi.browser.MOZ||nitobi.browser.SAFARI||nitobi.browser.CHROME)};nitobi.browser.detect();if(nitobi.browser.IE6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}nitobi.lang.defineNs("nitobi.browser");nitobi.browser.Cookies=function(){};nitobi.lang.extend(nitobi.browser.Cookies,nitobi.Object);nitobi.browser.Cookies.get=function(c){var a,b;if(document.cookie.length>0){a=document.cookie.indexOf(c+"=");if(a!=-1){a+=c.length+1;b=document.cookie.indexOf(";",a);if(b==-1){b=document.cookie.length}return unescape(document.cookie.substring(a,b))}}return null};nitobi.browser.Cookies.set=function(d,c,b){var a=new Date();a.setTime(a.getTime()+(b*24*3600*1000));document.cookie=d+"="+escape(c)+((b==null)?"":"; expires="+a.toGMTString())};nitobi.browser.Cookies.remove=function(a){if(nitobi.browser.Cookies.get(a)){document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"}};nitobi.lang.defineNs("nitobi.browser");nitobi.browser.History=function(){this.lastPage="";this.currentPage="";this.onChange=new nitobi.base.Event();this.iframeObject=nitobi.html.createElement("iframe",{name:"ntb_history",id:"ntb_history"},{display:"none"});document.body.appendChild(nitobi.xml.importNode(document,this.iframeObject,true));this.iframe=frames.ntb_history;this.monitor()};nitobi.browser.History.prototype.add=function(a){this.lastPage=this.currentPage=a.substr(a.indexOf("#")+1);this.iframe.location.href=a};nitobi.browser.History.prototype.monitor=function(){var a=this.iframe.location.href.split("#");this.currentPage=a[1];if(this.currentPage!=this.lastPage){this.onChange.notify(a[0].substring(a[0].lastIndexOf("/")+1),this.currentPage);this.lastPage=this.currentPage}window.setTimeout(nitobi.lang.close(this,this.monitor),1500)};nitobi.lang.defineNs("nitobi.xml");nitobi.xml=function(){};nitobi.xml.nsPrefix="ntb:";nitobi.xml.nsDecl='xmlns:ntb="http://www.nitobi.com"';if(nitobi.browser.IE){var inUse=false;nitobi.xml.XslTemplate=new ActiveXObject("MSXML2.XSLTemplate.3.0")}if(typeof XMLSerializer!="undefined"&&typeof DOMParser!="undefined"){nitobi.xml.Serializer=new XMLSerializer();nitobi.xml.DOMParser=new DOMParser()}nitobi.xml.getChildNodes=function(a){if(nitobi.browser.IE){return a.childNodes}else{return a.selectNodes("./*")}};nitobi.xml.indexOfChildNode=function(d,c){var b=nitobi.xml.getChildNodes(d);for(var a=0;a<b.length;a++){if(b[a]==c){return a}}return -1};nitobi.xml.createXmlDoc=function(a){if(a!=null){a=a.substring(a.indexOf("<?xml"))}if(a!=null&&a.documentElement!=null){return a}var b=null;if(nitobi.browser.IE){b=new ActiveXObject("Msxml2.DOMDocument.3.0");b.setProperty("SelectionNamespaces","xmlns:ntb='http://www.nitobi.com'")}else{if(document.implementation&&document.implementation.createDocument){b=document.implementation.createDocument("","",null)}}if(a!=null&&typeof a=="string"){b=nitobi.xml.loadXml(b,a)}return b};nitobi.xml.loadXml=function(f,b,a){f.async=false;if(nitobi.browser.IE){f.loadXML(b)}else{var d=nitobi.xml.DOMParser.parseFromString((b.xml!=null?b.xml:b),"text/xml");if(a){while(f.hasChildNodes()){f.removeChild(f.firstChild)}for(var c=0;c<d.childNodes.length;c++){f.appendChild(f.importNode(d.childNodes[c],true))}}else{f=d}d=null}return f};nitobi.xml.hasParseError=function(b){if(nitobi.browser.IE){return(b.parseError!=0)}else{if(b==null||b.documentElement==null){return true}var a=b.documentElement;if((a.tagName=="parserError")||(a.namespaceURI=="http://www.mozilla.org/newlayout/xml/parsererror.xml")){return true}return false}};nitobi.xml.getParseErrorReason=function(a){if(!nitobi.xml.hasParseError(a)){return""}if(nitobi.browser.IE){return(a.parseError.reason)}else{return(new XMLSerializer().serializeToString(a))}};nitobi.xml.createXslDoc=function(a){var b=null;if(nitobi.browser.IE){b=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0")}else{b=nitobi.xml.createXmlDoc()}b=nitobi.xml.loadXml(b,a||'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ntb="http://www.nitobi.com" />');return b};nitobi.xml.createXslProcessor=function(b){var c=null;var a=null;if(typeof(b)!="string"){b=nitobi.xml.serialize(b)}if(nitobi.browser.IE){c=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0");a=new ActiveXObject("MSXML2.XSLTemplate.3.0");c.async=false;c.loadXML(b);a.stylesheet=c;return a.createProcessor()}else{if(XSLTProcessor){c=nitobi.xml.createXmlDoc(b);a=new XSLTProcessor();a.importStylesheet(c);a.stylesheet=c;return a}}};nitobi.xml.parseHtml=function(h){if(typeof(h)=="string"){h=document.getElementById(h)}var g=nitobi.html.getOuterHtml(h);var f="";if(nitobi.browser.IE){var c=new RegExp("(\\s+.[^=]*)='(.*?)'","g");g=g.replace(c,function(j,l,k){return l+'="'+k.replace(/"/g,"&quot;")+'"'});f=(g.substring(g.indexOf("/>")+2).replace(/(\s+.[^\=]*)\=\s*([^\"^\s^\>]+)/g,'$1="$2" ')).replace(/\n/gi,"").replace(/(.*?:.*?\s)/i,"$1  ");var d=new RegExp('="([^"]*)(<)(.*?)"',"gi");var b=new RegExp('="([^"]*)(>)(.*?)"',"gi");while(true){f=f.replace(d,'="$1&lt;$3" ');f=f.replace(b,'="$1&gt;$3" ');var a=(d.test(f));if(!d.test(f)){break}}}else{f=g;f=f.replace(/\n/gi,"").replace(/\>\s*\</gi,"><").replace(/(.*?:.*?\s)/i,"$1  ");f=f.replace(/\&/g,"&amp;");f=f.replace(/\&amp;gt;/g,"&gt;").replace(/\&amp;lt;/g,"&lt;").replace(/\&amp;apos;/g,"&apos;").replace(/\&amp;quot;/g,"&quot;").replace(/\&amp;amp;/g,"&amp;").replace(/\&amp;eq;/g,"&eq;")}if(f.indexOf('xmlns:ntb="http://www.nitobi.com"')<1){f=f.replace(/\<(.*?)(\s|\>|\\)/,'<$1 xmlns:ntb="http://www.nitobi.com"$2')}f=f.replace(/\&nbsp\;/gi," ");return nitobi.xml.createXmlDoc(f)};nitobi.xml.transform=function(c,d,b){if(d.documentElement){d=nitobi.xml.createXslProcessor(d)}if(nitobi.browser.IE){d.input=c;d.transform();return d.output}else{if(XSLTProcessor){var f=d.transformToDocument(c);var a=f.documentlement;if(a&&a.nodeName.indexOf("ntb:")==0){a.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:ntb","http://www.nitobi.com")}return f}}};nitobi.xml.transformToString=function(a,b,g){var d=nitobi.xml.transform(a,b,"text");if(nitobi.browser.MOZ){if(g=="xml"){d=nitobi.xml.Serializer.serializeToString(d)}else{if(d.documentElement.childNodes[0]==null){nitobi.lang.throwError("The transformToString fn could not find any valid output")}if(d.documentElement.childNodes[0].data!=null){d=d.documentElement.childNodes[0].data}else{if(d.documentElement.childNodes[0].textContent!=null){d=d.documentElement.childNodes[0].textContent}else{nitobi.lang.throwError("The transformToString fn could not find any valid output")}}}}else{if(nitobi.browser.SAFARI||nitobi.browser.CHROME){if(g=="xml"){d=nitobi.xml.Serializer.serializeToString(d)}else{var c=d.documentElement;if(c.nodeName!="transformiix:result"){c=c.getElementsByTagName("pre")[0]}try{d=c.childNodes[0].data}catch(f){d=(c.data)}}}}return d};nitobi.xml.transformToXml=function(a,b){var c=nitobi.xml.transform(a,b,"xml");if(typeof c=="string"){c=nitobi.xml.createXmlDoc(c)}else{if(c.documentElement.nodeName=="transformiix:result"){c=nitobi.xml.createXmlDoc(c.documentElement.firstChild.data)}}return c};nitobi.xml.serialize=function(a){if(nitobi.browser.IE){return a.xml}else{return(new XMLSerializer()).serializeToString(a)}};nitobi.xml.createXmlHttp=function(){if(nitobi.browser.IE){var b=null;try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}}return b}else{return new XMLHttpRequest()}};nitobi.xml.createElement=function(d,b,c){c=c||"http://www.nitobi.com";var a=null;if(nitobi.browser.IE){a=d.createNode(1,nitobi.xml.nsPrefix+b,c)}else{if(d.createElementNS){a=d.createElementNS(c,nitobi.xml.nsPrefix+b)}}return a};function nitobiXmlDecodeXslt(a){return a.replace(/x:c-/g,"xsl:choose").replace(/x\:wh\-/g,"xsl:when").replace(/x\:o\-/g,"xsl:otherwise").replace(/x\:n\-/g,' name="').replace(/x\:s\-/g,' select="').replace(/x\:va\-/g,"xsl:variable").replace(/x\:v\-/g,"xsl:value-of").replace(/x\:ct\-/g,"xsl:call-template").replace(/x\:w\-/g,"xsl:with-param").replace(/x\:p\-/g,"xsl:param").replace(/x\:t\-/g,"xsl:template").replace(/x\:at\-/g,"xsl:apply-templates").replace(/x\:a\-/g,"xsl:attribute")}if(!nitobi.browser.IE){Document.prototype.loadXML=function(a){changeReadyState(this,1);var c=new DOMParser();var f=c.parseFromString(a,"text/xml");while(this.hasChildNodes()){this.removeChild(this.lastChild)}for(var b=0;b<f.childNodes.length;b++){this.appendChild(this.importNode(f.childNodes[b],true))}changeReadyState(this,4)};Document.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this)});Node.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this)});XPathResult.prototype.__defineGetter__("length",function(){return this.snapshotLength});if(XSLTProcessor){XSLTProcessor.prototype.addParameter=function(c,b,a){if(b==null){this.removeParameter(a,c)}else{this.setParameter(a,c,b)}}}XMLDocument.prototype.selectNodes=function(c,h){try{if(this.nsResolver==null){this.nsResolver=this.createNSResolver(this.documentElement)}var g=this.evaluate(c,(h?h:this),new MyNSResolver(),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var f=new Array(g.snapshotLength);f.expr=c;var a=0;for(i=0;i<g.snapshotLength;i++){var b=g.snapshotItem(i);if(b.nodeType!=3){f[a++]=b}}return f}catch(d){}};Document.prototype.selectNodes=XMLDocument.prototype.selectNodes;function MyNSResolver(){}MyNSResolver.prototype.lookupNamespaceURI=function(a){switch(a){case"xsl":return"http://www.w3.org/1999/XSL/Transform";break;case"ntb":return"http://www.nitobi.com";break;case"d":return"http://exslt.org/dates-and-times";break;case"n":return"http://www.nitobi.com/exslt/numbers";break;default:return null;break}};XMLDocument.prototype.selectSingleNode=function(f,d){var c=f.match(/\[\d+\]/ig);if(c!=null){var a=c[c.length-1];if(f.lastIndexOf(a)+a.length!=f.length){f+="[1]"}}var b=this.selectNodes(f,d||null);return((b!=null&&b.length>0)?b[0]:null)};Document.prototype.selectSingleNode=XMLDocument.prototype.selectSingleNode;Element.prototype.selectNodes=function(a){var b=this.ownerDocument;return b.selectNodes(a,this)};Element.prototype.selectSingleNode=function(b){var a=this.ownerDocument;return a.selectSingleNode(b,this)}}nitobi.xml.getLocalName=function(b){var a=b.indexOf(":");if(a==-1){return b}else{return b.substr(a+1)}};nitobi.xml.importNode=function(a,c,b){if(b==null){b=true}return(a.importNode?a.importNode(c,b):c)};nitobi.xml.encode=function(a){a+="";a=a.replace(/&/g,"&amp;");a=a.replace(/'/g,"&apos;");a=a.replace(/\"/g,"&quot;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");a=a.replace(/\n/g,"&#xa;");return a};nitobi.xml.constructValidXpathQuery=function(j,h){var g=j.match(/(\"|\')/g);if(g!=null){var f="concat(";var c="";var b;for(var d=0;d<j.length;d++){if(j.substr(d,1)=='"'){b="&apos;"}else{b="&quot;"}f+=c+b+nitobi.xml.encode(j.substr(d,1))+b;c=","}f+=c+"&apos;&apos;";f+=")";j=f}else{var a=(h?"'":"");j=a+nitobi.xml.encode(j)+a}return j};nitobi.xml.removeChildren=function(a){while(a.firstChild){a.removeChild(a.firstChild)}};nitobi.xml.Empty=nitobi.xml.createXmlDoc("<root></root>");nitobi.lang.defineNs("nitobi.html");nitobi.html.Url=function(){};nitobi.html.Url.setParameter=function(b,c,a){var d=new RegExp("(\\?|&)("+encodeURIComponent(c)+")=(.*?)(&|$)");if(b.match(d)){return b.replace(d,"$1$2="+encodeURIComponent(a)+"$4")}if(b.match(/\?/)){b=b+"&"}else{b=b+"?"}return b+encodeURIComponent(c)+"="+encodeURIComponent(a)};nitobi.html.Url.removeParameter=function(a,b){var c=new RegExp("(\\?|&)("+encodeURIComponent(b)+")=(.*?)(&|$)");return a.replace(c,function(l,k,j,h,g,d,f){if(((k)=="?")&&(g!="&")){return""}else{return k}})};nitobi.html.Url.normalize=function(b,c){if(c){if(c.indexOf("http://")==0||c.indexOf("https://")==0||c.indexOf("/")==0){return c}}var a=(b.match(/.*\//)||"")+"";if(c){return a+c}return a};nitobi.html.Url.randomize=function(a){return nitobi.html.Url.setParameter(a,"ntb-random",(new Date).getTime())};nitobi.lang.defineNs("nitobi.base");nitobi.base.Event=function(a){this.type=a;this.handlers={};this.guid=0;this.setEnabled(true)};nitobi.base.Event.prototype.subscribe=function(_11b,_11c,guid){if(_11b==null){return}var func=_11b;if(typeof(_11b)=="string"){var s=_11b;s=s.replace(/\#\&lt\;\#/g,"<").replace(/\#\&gt\;\#/g,">").replace(/\#\&amp;lt\;\#/g,"<").replace(/\#\&amp;gt\;\#/g,">").replace(/\/\*EQ\*\//g,"=").replace(/\#\Q\#/g,'"').replace(/\#\&amp\;\#/g,"&");s=s.replace(/eventArgs/g,"arguments[0]");_11b=nitobi.lang.close(_11c,function(){eval(s)})}if(typeof _11c=="object"&&_11b instanceof Function){func=nitobi.lang.close(_11c,_11b)}guid=guid||func.observer_guid||_11b.observer_guid||this.guid++;func.observer_guid=guid;_11b.observer_guid=guid;this.handlers[guid]=func;return guid};nitobi.base.Event.prototype.subscribeOnce=function(f,d){var a=null;var c=this;var b=function(){f.apply(d||null,arguments);c.unSubscribe(a)};a=this.subscribe(b);return a};nitobi.base.Event.prototype.unSubscribe=function(a){if(a instanceof Function){a=a.observer_guid}this.handlers[a]=null;delete this.handlers[a]};nitobi.base.Event.prototype.notify=function(c){if(this.enabled){if(arguments.length==0){arguments=new Array();arguments[0]=new nitobi.base.EventArgs(null,this);arguments[0].event=this;arguments[0].source=null}else{if(typeof(arguments[0].event)!="undefined"&&arguments[0].event==null){arguments[0].event=this}}var b=false;for(var d in this.handlers){var a=this.handlers[d];if(a instanceof Function){var f=(a.apply(this,arguments)==false);b=b||f}}return !b}return true};nitobi.base.Event.prototype.dispose=function(){for(var a in this.handlers){this.handlers[a]=null}this.handlers={}};nitobi.base.Event.prototype.setEnabled=function(a){this.enabled=a};nitobi.base.Event.prototype.isEnabled=function(){return this.enabled};nitobi.lang.defineNs("nitobi.html");nitobi.html.Css=function(){};nitobi.html.Css.onPrecached=new nitobi.base.Event();nitobi.html.Css.swapClass=function(c,b,a){if(c.className){var d=new RegExp("(\\s|^)"+b+"(\\s|$)");c.className=c.className.replace(d,"$1"+a+"$2")}};nitobi.html.Css.replaceOrAppend=function(a,c,b){if(nitobi.html.Css.hasClass(a,c)){nitobi.html.Css.swapClass(a,c,b)}else{nitobi.html.Css.addClass(a,b)}};nitobi.html.Css.hasClass=function(b,a){if(!a||a===""){return false}return(new RegExp("(\\s|^)"+a+"(\\s|$)")).test(b.className)};nitobi.html.Css.addClass=function(c,b,a){if(a==true||!nitobi.html.Css.hasClass(c,b)){c.className=c.className?c.className+" "+b:b}};nitobi.html.Css.removeClass=function(a,f,d){if(typeof f=="array"){for(var b=0;b<f.length;b++){this.removeClass(a,f[b],d)}}if(d==true||nitobi.html.Css.hasClass(a,f)){var c=new RegExp("(\\s|^)"+f+"(\\s|$)");a.className=a.className.replace(c,"$2")}};nitobi.html.Css.addRule=function(d,b,c){if(d.cssRules){var a=d.insertRule(b+"{"+(c||"")+"}",d.cssRules.length);return d.cssRules[a]}else{d.addRule(b,c||"nitobi:placeholder;");return d.rules[d.rules.length-1]}};nitobi.html.Css.getRules=function(b){var a=null;if(typeof(b)=="number"){a=document.styleSheets[b]}else{a=b}if(a==null){return null}try{if(a.cssRules){return a.cssRules}if(a.rules){return a.rules}}catch(c){}return null};nitobi.html.Css.getStyleSheetsByName=function(f){var a=new Array();var c=document.styleSheets;var d=new RegExp(f.replace(".",".")+"($|\\?)");for(var b=0;b<c.length;b++){a=nitobi.html.Css._getStyleSheetsByName(d,c[b],a)}return a};nitobi.html.Css._getStyleSheetsByName=function(d,g,a){if(d.test(g.href)){a=a.concat([g])}var f=nitobi.html.Css.getRules(g);if(g.href!=""&&g.imports){for(var b=0;b<g.imports.length;b++){a=nitobi.html.Css._getStyleSheetsByName(d,g.imports[b],a)}}else{for(var b=0;b<f.length;b++){var c=f[b].styleSheet;if(c){a=nitobi.html.Css._getStyleSheetsByName(d,c,a)}}}return a};nitobi.html.Css.imageCache={};nitobi.html.Css.imageCacheDidNotify=false;nitobi.html.Css.trackPrecache=function(b){nitobi.html.Css.precacheArray[b]=true;var c=false;for(var a in nitobi.html.Css.precacheArray){if(!nitobi.html.Css.precacheArray[a]){c=true}}if((!nitobi.html.Css.imageCacheDidNotify)&&(!c)){nitobi.html.Css.imageCacheDidNotify=true;nitobi.html.Css.isPrecaching=false;nitobi.html.Css.onPrecached.notify()}};nitobi.html.Css.precacheArray={};nitobi.html.Css.isPrecaching=false;nitobi.html.Css.precacheImages=function(h){nitobi.html.Css.isPrecaching=true;if(!h){var n=document.styleSheets;for(var j=0;j<n.length;j++){nitobi.html.Css.precacheImages(n[j])}return}var d=/.*?url\((.*?)\).*?/;var a=nitobi.html.Css.getRules(h);var b=nitobi.html.Css.getPath(h);for(var j=0;j<a.length;j++){var l=a[j];if(l.styleSheet){nitobi.html.Css.precacheImages(l.styleSheet)}else{var m=l.style;var g=m?m.backgroundImage:null;if(g){g=g.replace(d,"$1");g=nitobi.html.Url.normalize(b,g);if(!nitobi.html.Css.imageCache[g]){var f=new Image();f.src=g;nitobi.html.Css.precacheArray[g]=false;var c=nitobi.lang.close({},nitobi.html.Css.trackPrecache,[g]);f.onload=c;f.onerror=c;f.onabort=c;nitobi.html.Css.imageCache[g]=f;try{if(f.width>0){nitobi.html.Css.precacheArray[g]=true}}catch(k){}}}}}if(h.href!=""&&h.imports){for(var j=0;j<h.imports.length;j++){nitobi.html.Css.precacheImages(h.imports[j])}}};nitobi.html.Css.getPath=function(b){var a=b.href;a=nitobi.html.Url.normalize(a);if(b.parentStyleSheet&&a.indexOf("/")!=0&&a.indexOf("http://")!=0&&a.indexOf("https://")!=0){a=nitobi.html.Css.getPath(b.parentStyleSheet)+a}return a};nitobi.html.Css.getSheetUrl=nitobi.html.Css.getPath;nitobi.html.Css.findParentStylesheet=function(a){var b=nitobi.html.Css.getRule(a);if(b){return b.parentStyleSheet}return null};nitobi.html.Css.findInSheet=function(m,l,k){if(nitobi.browser.IE6&&typeof k=="undefined"){k=0}else{if(k>4){return null}}k++;var h=nitobi.html.Css.getRules(l);for(var d=0;d<h.length;d++){var f=h[d];var n=f.styleSheet;var c=f.selectorText;if(n){var b=nitobi.html.Css.findInSheet(m,n,k);if(b){return b}}else{if(c!=null&&c.toLowerCase().indexOf(m)>-1){if(nitobi.browser.IE){f={selectorText:c,style:f.style,readOnly:f.readOnly,parentStyleSheet:l}}return f}}}var j=l.imports;if(l.href!=""&&j){var g=j.length;for(var a=0;a<g;a++){var b=nitobi.html.Css.findInSheet(m,j[a],k);if(b){return b}}}return null};nitobi.html.Css.getClass=function(c,b){c=c.toLowerCase();if(c.indexOf(".")!==0){c="."+c}if(b){var a=nitobi.html.Css.getRule(c);if(a!=null){return a.style}}else{if(nitobi.html.Css.classCache[c]==null){var a=nitobi.html.Css.getRule(c);if(a!=null){nitobi.html.Css.classCache[c]=a.style}else{return null}}return nitobi.html.Css.classCache[c]}};nitobi.html.Css.classCache={};nitobi.html.Css.getStyleBySelector=function(b){var a=nitobi.html.Css.getRule(b);if(a!=null){return a.style}return null};nitobi.html.Css.getRule=function(f){f=f.toLowerCase();if(f.indexOf(".")!==0){f="."+f}var d=document.styleSheets;for(var b=0;b<d.length;b++){try{var a=nitobi.html.Css.findInSheet(f,d[b]);if(a){return a}}catch(c){}}return null};nitobi.html.Css.getClassStyle=function(c,b){var a=nitobi.html.Css.getClass(c);if(a!=null){return a[b]}else{return null}};nitobi.html.Css.setStyle=function(b,c,a){c=c.replace(/\-(\w)/g,function(d,f){return f.toUpperCase()});b.style[c]=a};nitobi.html.Css.getStyle=function(b,c){var a="";if(document.defaultView&&document.defaultView.getComputedStyle){c=c.replace(/([A-Z])/g,function(d){return"-"+d.toLowerCase()});strStyle=document.defaultView.getComputedStyle(b,null);a=strStyle.getPropertyValue(c)}else{if(b.currentStyle){c=c.replace(/\-(\w)/g,function(f,d){return d.toUpperCase()});a=b.currentStyle[c]}}return a};nitobi.html.Css.setOpacities=function(c,b){if(c.length){for(var a=0;a<c.length;a++){nitobi.html.Css.setOpacity(c[a],b)}}else{nitobi.html.Css.setOpacity(c,b)}};nitobi.html.Css.setOpacity=function(b,a){var c=b.style;if(a>100){a=100}if(a<0){a=0}if(c.filter!=null){var d=c.filter.match(/alpha\(opacity=[\d\.]*?\)/ig);if(d!=null&&d.length>0){c.filter=c.filter.replace(/alpha\(opacity=[\d\.]*?\)/ig,"alpha(opacity="+a+")")}else{c.filter+="alpha(opacity="+a+")"}}else{c.opacity=(a/100)}};nitobi.html.Css.getOpacity=function(b){if(b==null){nitobi.lang.throwError(nitobi.error.ArgExpected+" for nitobi.html.Css.getOpacity")}if(nitobi.browser.IE){if(b.style.filter==""){return 100}var a=b.style.filter;a.match(/opacity=([\d\.]*?)\)/ig);if(RegExp.$1==""){return 100}return parseInt(RegExp.$1)}else{return Math.abs(b.style.opacity?b.style.opacity*100:100)}};nitobi.html.Css.getCustomStyle=function(c,b){if(nitobi.browser.IE){return nitobi.html.getClassStyle(c,b)}else{var f=nitobi.html.Css.getRule(c);var d=new RegExp("(.*?)({)(.*?)(})","gi");var a=f.cssText.match(d);d=new RegExp("("+b+")(:)(.*?)(;)","gi");a=d.exec(RegExp.$3)}};nitobi.html.Css.createStyleSheet=function(a){var b;if(nitobi.browser.IE){b=document.createStyleSheet()}else{b=document.createElement("style");b.setAttribute("type","text/css");document.body.appendChild(b);b.appendChild(document.createTextNode(""))}if(a!=null){nitobi.html.Css.setStyleSheetValue(b,a)}return b};nitobi.html.Css.setStyleSheetValue=function(a,b){if(nitobi.browser.IE){a.cssText=b}else{a.replaceChild(document.createTextNode(b),a.firstChild)}return a};if(nitobi.browser.MOZ){HTMLStyleElement.prototype.__defineSetter__("cssText",function(a){this.innerHTML=a});HTMLStyleElement.prototype.__defineGetter__("cssText",function(){return this.innerHTML})}nitobi.lang.defineNs("nitobi.drawing");if(false){nitobi.drawing=function(){}}nitobi.drawing.Point=function(a,b){this.x=a;this.y=b};nitobi.drawing.Point.prototype.toString=function(){return"("+this.x+","+this.y+")"};nitobi.drawing.rgb=function(d,c,a){return"#"+((d*65536)+(c*256)+a).toString(16)};nitobi.drawing.align=function(r,p,o,t,k,h,j){t=t||0;k=k||0;h=h||0;j=j||0;var B=o;var m,b,c,n,g,f,l,C,v,d,z,w,A,u;if(p.getBoundingClientRect){m=p.getBoundingClientRect();b=r.getBoundingClientRect();c=m.top;n=m.bottom;g=m.left;f=m.right;l=Math.abs(n-c);C=Math.abs(f-g);v=b.top;d=b.bottom;z=b.left;w=b.right;A=Math.abs(d-v);u=Math.abs(w-z)}else{if(document.getBoxObjectFor){m=document.getBoxObjectFor(p);b=document.getBoxObjectFor(r);c=m.y;g=m.x;C=m.width;l=m.height;v=b.y;z=b.x;u=b.width;A=b.height}else{m=nitobi.html.getCoords(p);b=nitobi.html.getCoords(r);c=m.y;g=m.x;C=m.width;l=m.height;v=b.y;z=b.x;u=b.width;A=b.height}}var q=r.style;if(B&268435456){q.height=(l+t)+"px"}if(B&16777216){q.width=(C+k)+"px"}if(B&1048576){q.top=(nitobi.html.getStyleTop(r)+c-v+h)+"px"}if(B&65536){q.top=(nitobi.html.getStyleTop(r)+c-v+l-A+h)+"px"}if(B&4096){q.left=(nitobi.html.getStyleLeft(r)-z+g+j)+"px"}if(B&256){q.left=(nitobi.html.getStyleLeft(r)-z+g+C-u+j)+"px"}if(B&16){q.top=(nitobi.html.getStyleTop(r)+c-v+h+Math.floor((l-A)/2))+"px"}if(B&1){q.left=(nitobi.html.getStyleLeft(r)-z+g+j+Math.floor((C-u)/2))+"px"}};nitobi.drawing.align.SAMEHEIGHT=268435456;nitobi.drawing.align.SAMEWIDTH=16777216;nitobi.drawing.align.ALIGNTOP=1048576;nitobi.drawing.align.ALIGNBOTTOM=65536;nitobi.drawing.align.ALIGNLEFT=4096;nitobi.drawing.align.ALIGNRIGHT=256;nitobi.drawing.align.ALIGNMIDDLEVERT=16;nitobi.drawing.align.ALIGNMIDDLEHORIZ=1;nitobi.drawing.alignOuterBox=function(n,m,k,p,c,a,b,o){p=p||0;c=c||0;a=a||0;b=b||0;if(nitobi.browser.moz){td=document.getBoxObjectFor(m);sd=document.getBoxObjectFor(n);var l=parseInt(document.defaultView.getComputedStyle(m,"").getPropertyValue("border-left-width"));var j=parseInt(document.defaultView.getComputedStyle(m,"").getPropertyValue("border-top-width"));var h=parseInt(document.defaultView.getComputedStyle(n,"").getPropertyValue("border-top-width"));var g=parseInt(document.defaultView.getComputedStyle(n,"").getPropertyValue("border-bottom-width"));var f=parseInt(document.defaultView.getComputedStyle(n,"").getPropertyValue("border-left-width"));var d=parseInt(document.defaultView.getComputedStyle(n,"").getPropertyValue("border-right-width"));a=a+h-j;b=b+f-l}nitobi.drawing.align(n,m,k,p,c,a,b,o)};nitobi.lang.defineNs("nitobi.html");if(false){nitobi.html=function(){}}nitobi.html.createElement=function(g,f,d){var c=document.createElement(g);for(var a in f){if(a.toLowerCase().substring(0,5)=="class"){c.className=f[a]}else{c.setAttribute(a,f[a])}}for(var b in d){c.style[b]=d[b]}return c};nitobi.html.createTable=function(d,b){var a=nitobi.html.createElement("table",d,b);var g=document.createElement("tbody");var f=document.createElement("tr");var c=document.createElement("td");a.appendChild(g);g.appendChild(f);f.appendChild(c);return a};nitobi.html.setBgImage=function(b,c){var a=nitobi.html.Css.getStyle(b,"background-image");if(a!=""&&nitobi.browser.IE){a=a.replace(/(^url\(")(.*?)("\))/,"$2")}};nitobi.html.fitWidth=function(a,f){var b;var d=nitobi.html.Css;if(nitobi.browser.IE&&!nitobi.lang.isStandards()){var c=(parseInt(d.getStyle(a,"width"))-parseInt(d.getStyle(a,"paddingLeft"))-parseInt(d.getStyle(a,"paddingRight"))-parseInt(d.getStyle(a,"borderLeftWidth"))-parseInt(d.getStyle(a,"borderRightWidth")));if(c<0){c=0}b=c+"px"}else{if(nitobi.lang.isStandards()){if(nitobi.browser.IE){var c=(parseInt(d.getStyle(a,"width"))-(f.offsetWidth-parseInt(d.getStyle(f,"width"))))}else{var c=(parseInt(a.style.width)-(f.offsetWidth-parseInt(a.style.width)))}if(c<0){c=0}b=c+"px"}else{b=parseInt(a.style.width)+"px"}}f.style.width=b};nitobi.html.getDomNodeByPath=function(c,h){if(nitobi.browser.IE){}var f=c;var b=h.split("/");var a=b.length;for(var d=0;d<a;d++){if(f.childNodes[Number(b[d])]!=null){f=f.childNodes[Number(b[d])]}else{alert("Path expression failed."+h)}var g=""}return f};nitobi.html.indexOfChildNode=function(d,b){var a=d.childNodes;for(var c=0;c<a.length;c++){if(a[c]==b){return c}}return -1};nitobi.html.evalScriptBlocks=function(node){for(var i=0;i<node.childNodes.length;i++){var _1e2=node.childNodes[i];if(_1e2.nodeName.toLowerCase()=="script"){eval(_1e2.text)}else{nitobi.html.evalScriptBlocks(_1e2)}}};nitobi.html.position=function(a){var b=nitobi.html.getStyle($ntb(a),"position");if(b=="static"){a.style.position="relative"}};nitobi.html.setOpacity=function(c,b){var a=c.style;a.opacity=(b/100);a.MozOpacity=(b/100);a.KhtmlOpacity=(b/100);a.filter="alpha(opacity="+b+")"};nitobi.html.highlight=function(d,a,b){b=b||d.value.length;if(d.createTextRange){d.focus();var c=d.createTextRange();c.move("character",0-b);c.move("character",a);c.moveEnd("textedit",1);c.select()}else{if(d.setSelectionRange){d.focus();d.setSelectionRange(a,b)}}};nitobi.html.setCursor=function(c,a){if(c.createTextRange){c.focus();var b=c.createTextRange();b.move("character",0-c.value.length);b.move("character",a);b.select()}else{if(c.setSelectionRange){c.setSelectionRange(a,a)}}};nitobi.html.getCursor=function(b){if(b.createTextRange){b.focus();var a=document.selection.createRange().duplicate();a.moveEnd("textedit",1);return b.value.length-a.text.length}else{if(b.setSelectionRange){return b.selectionStart}}return -1};nitobi.html.encode=function(a){a+="";a=a.replace(/&/g,"&amp;");a=a.replace(/\"/g,"&quot;");a=a.replace(/'/g,"&apos;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");a=a.replace(/\n/g,"<br>");return a};nitobi.html.getElement=function(a){if(typeof(a)=="string"){return document.getElementById(a)}return a};if(typeof($)=="undefined"){$=nitobi.html.getElement}if(typeof($ntb)=="undefined"){$ntb=nitobi.html.getElement}if(typeof($F)=="undefined"){$F=function(b){var a=$ntb(b);if(a!=null){return a.value}return""}}nitobi.html.getTagName=function(a){if(nitobi.browser.IE&&a.scopeName!=""){return(a.scopeName+":"+a.nodeName).toLowerCase()}else{return a.nodeName.toLowerCase()}};nitobi.html.getStyleTop=function(a){var b=a.style.top;if(b==""){b=nitobi.html.Css.getStyle(a,"top")}return nitobi.lang.parseNumber(b)};nitobi.html.getStyleLeft=function(a){var b=a.style.left;if(b==""){b=nitobi.html.Css.getStyle(a,"left")}return nitobi.lang.parseNumber(b)};nitobi.html.getHeight=function(a){return a.offsetHeight};nitobi.html.getWidth=function(a){return a.offsetWidth};if(nitobi.browser.IE){nitobi.html.getBox=function(f){var g=nitobi.lang.parseNumber(nitobi.html.getStyle(document.body,"border-top-width"));var d=nitobi.lang.parseNumber(nitobi.html.getStyle(document.body,"border-left-width"));var b=nitobi.lang.parseNumber(document.body.scrollTop)-(g==0?2:g);var a=nitobi.lang.parseNumber(document.body.scrollLeft)-(d==0?2:d);var c=nitobi.html.getBoundingClientRect(f);return{top:c.top+b,left:c.left+a,bottom:c.bottom,right:c.right,height:c.bottom-c.top,width:c.right-c.left}}}else{if(nitobi.browser.MOZ){nitobi.html.getBox=function(j){var g=0;var f=0;var d=j.parentNode;while(d.nodeType==1&&d!=document.body){g+=nitobi.lang.parseNumber(d.scrollTop)-(nitobi.html.getStyle(d,"overflow")=="auto"?nitobi.lang.parseNumber(nitobi.html.getStyle(d,"border-top-width")):0);f+=nitobi.lang.parseNumber(d.scrollLeft)-(nitobi.html.getStyle(d,"overflow")=="auto"?nitobi.lang.parseNumber(nitobi.html.getStyle(d,"border-left-width")):0);d=d.parentNode}var b=j.ownerDocument.getBoxObjectFor(j);var p=nitobi.lang.parseNumber(nitobi.html.getStyle(j,"border-left-width"));var n=nitobi.lang.parseNumber(nitobi.html.getStyle(j,"border-right-width"));var l=nitobi.lang.parseNumber(nitobi.html.getStyle(j,"border-top-width"));var k=nitobi.lang.parseNumber(b.y)-g-l;var h=nitobi.lang.parseNumber(b.x)-f-p;var c=h+nitobi.lang.parseNumber(b.width);var a=k+b.height;var o=nitobi.lang.parseNumber(b.height);var m=nitobi.lang.parseNumber(b.width);return{top:k,left:h,bottom:a,right:c,height:o,width:m}};nitobi.html.getBox.cache={}}else{if(nitobi.browser.SAFARI||nitobi.browser.CHROME){nitobi.html.getBox=function(b){var a=nitobi.html.getCoords(b);return{top:a.y,left:a.x,bottom:a.y+a.height,right:a.x+a.width,height:a.height,width:a.width}}}}}nitobi.html.getBox2=nitobi.html.getBox;nitobi.html.getUniqueId=function(b){if(b.uniqueID){return b.uniqueID}else{var a=(new Date()).getTime();b.uniqueID=a;return a}};nitobi.html.getChildNodeById=function(a,c,b){return nitobi.html.getChildNodeByAttribute(a,"id",c,b)};nitobi.html.getChildNodeByAttribute=function(c,d,b,g){for(var a=0;a<c.childNodes.length;a++){if(c.nodeType!=3&&Boolean(c.childNodes[a].getAttribute)){if(c.childNodes[a].getAttribute(d)==b){return c.childNodes[a]}}}if(g){for(var a=0;a<c.childNodes.length;a++){var f=nitobi.html.getChildNodeByAttribute(c.childNodes[a],d,b,g);if(f!=null){return f}}}return null};nitobi.html.getParentNodeById=function(b,a){return nitobi.html.getParentNodeByAtt(b,"id",a)};nitobi.html.getParentNodeByAtt=function(c,a,b){while(c.parentNode!=null){if(c.parentNode.getAttribute(a)==b){return c.parentNode}c=c.parentNode}return null};if(nitobi.browser.IE){nitobi.html.getFirstChild=function(a){return a.firstChild}}else{nitobi.html.getFirstChild=function(b){var a=0;while(a<b.childNodes.length&&b.childNodes[a].nodeType==3){a++}return b.childNodes[a]}}nitobi.html.getScroll=function(){var b,a=0;if((nitobi.browser.OPERA==false)&&(document.documentElement.scrollTop>0)){b=document.documentElement.scrollTop;a=document.documentElement.scrollLeft}else{b=document.body.scrollTop;a=document.body.scrollLeft}if(((b==0)&&(document.documentElement.scrollTop>0))||((a==0)&&(document.documentElement.scrollLeft>0))){b=document.documentElement.scrollTop;a=document.documentElement.scrollLeft}return{left:a,top:b}};nitobi.html.getCoords=function(h){var b,g;try{var a=h;b=h.offsetWidth;g=h.offsetHeight;for(var d=0,c=0;h!=null;d+=h.offsetLeft,c+=h.offsetTop,h=h.offsetParent){}for(;a!=document.body;d-=a.scrollLeft,c-=a.scrollTop,a=a.parentNode){}}catch(f){}return{x:d,y:c,height:g,width:b}};nitobi.html.scrollBarWidth=0;nitobi.html.getScrollBarWidth=function(h){if(nitobi.html.scrollBarWidth){return nitobi.html.scrollBarWidth}try{if(null==h){var f="ntb-scrollbar-width";var g=document.getElementById(f);if(null==g){g=nitobi.html.createElement("div",{id:f},{width:"100px",height:"100px",overflow:"auto",position:"absolute",top:"-200px",left:"-5000px"});g.innerHTML="<div style='height:200px;'></div>";document.body.appendChild(g)}h=g}if(nitobi.browser.IE){nitobi.html.scrollBarWidth=Math.abs(h.offsetWidth-h.clientWidth-(h.clientLeft?h.clientLeft*2:0))}else{if(nitobi.browser.MOZ){var a=document.getBoxObjectFor(h);nitobi.html.scrollBarWidth=Math.abs((a.width-h.clientWidth))}else{if(nitobi.browser.SAFARI||nitobi.browser.CHROME){var a=nitobi.html.getBox(h);nitobi.html.scrollBarWidth=Math.abs((a.width-h.clientWidth))}}}}catch(c){}return nitobi.html.scrollBarWidth};nitobi.html.align=nitobi.drawing.align;nitobi.html.emptyElements={HR:true,BR:true,IMG:true,INPUT:true};nitobi.html.specialElements={TEXTAREA:true};nitobi.html.permHeight=0;nitobi.html.permWidth=0;nitobi.html.getBodyArea=function(){var h,g,f,c;var k,j;var n=false;if(nitobi.lang.isStandards()){n=true}var l=document.documentElement;var m=document.body;if(self.innerHeight){k=self.innerWidth;j=self.innerHeight}else{if(l&&l.clientHeight){k=l.clientWidth;j=l.clientHeight}else{if(m){k=m.clientWidth;j=m.clientHeight}}}f=k;c=j;if(self.pageYOffset){k=self.pageXOffset;j=self.pageYOffset}else{if(l&&l.scrollTop){k=l.scrollLeft;j=l.scrollTop}else{if(m){k=m.scrollLeft;j=m.scrollTop}}}h=k;g=j;var d=m.scrollHeight;var b=m.offsetHeight;if(d>b){k=m.scrollWidth;j=m.scrollHeight}else{k=m.offsetWidth;j=m.offsetHeight}nitobi.html.permHeight=j;nitobi.html.permWidth=k;if(nitobi.html.permHeight<c){nitobi.html.permHeight=c;if(nitobi.browser.IE&&n){f+=20}}if(f<nitobi.html.permWidth){f=nitobi.html.permWidth}if(nitobi.html.permHeight>c){f+=20}var a,o;a=l.scrollHeight;o=l.scrollWidth;return{scrollWidth:o,scrollHeight:a,scrollLeft:h,scrollTop:g,clientWidth:f,clientHeight:c,bodyWidth:nitobi.html.permWidth,bodyHeight:nitobi.html.PermHeight}};nitobi.html.getOuterHtml=function(d){if(nitobi.browser.IE){return d.outerHTML}else{var c="";switch(d.nodeType){case Node.ELEMENT_NODE:c+="<";c+=d.nodeName.toLowerCase();if(!nitobi.html.specialElements[d.nodeName]){for(var b=0;b<d.attributes.length;b++){if(d.attributes[b].nodeName.toLowerCase()!="_moz-userdefined"){c+=" "+d.attributes[b].nodeName.toLowerCase()+'="'+d.attributes[b].nodeValue+'"'}}c+=">";if(!nitobi.html.emptyElements[d.nodeName]){c+=d.innerHTML;c+="</"+d.nodeName.toLowerCase()+">"}}else{switch(d.nodeName){case"TEXTAREA":for(var b=0;b<d.attributes.length;b++){if(d.attributes[b].nodeName.toLowerCase()!="value"){c+=" "+d.attributes[b].nodeName.toUpperCase()+'="'+d.attributes[b].nodeValue+'"'}else{var f=d.attributes[b].nodeValue}}c+=">";c+=f;c+="</"+d.nodeName+">";break}}break;case Node.TEXT_NODE:c+=d.nodeValue;break;case Node.COMMENT_NODE:c+="<!--"+d.nodeValue+"-->";break}return c}};nitobi.html.insertAdjacentText=function(c,d,a){if(nitobi.browser.IE){return c.insertAdjacentText(d,a)}var b=document.createTextNode(a);nitobi.html.insertAdjacentElement(c,d,b)};nitobi.html.insertAdjacentHTML=function(d,c,b,a){if(nitobi.browser.IE){return d.insertAdjacentHTML(c,b,a)}var g;var f=d.ownerDocument.createRange();switch(String(c).toLowerCase()){case"beforebegin":f.setStartBefore(d);g=f.createContextualFragment(b);d.parentNode.insertBefore(g,d);break;case"afterbegin":f.selectNodeContents(d);f.collapse(true);g=f.createContextualFragment(b);d.insertBefore(g,d.firstChild);break;case"beforeend":if(a==true){d.innerHTML=d.innerHTML+b}else{f.selectNodeContents(d);f.collapse(false);g=f.createContextualFragment(b);d.appendChild(g)}break;case"afterend":f.setStartAfter(d);g=f.createContextualFragment(b);d.parentNode.insertBefore(g,d.nextSibling);break}};nitobi.html.insertAdjacentElement=function(a,c,b){if(nitobi.browser.IE){return a.insertAdjacentElement(c,b)}switch(c){case"beforeBegin":a.parentNode.insertBefore(b,a);break;case"afterBegin":a.insertBefore(b,a.firstChild);break;case"beforeEnd":a.appendChild(b);break;case"afterEnd":if(a.nextSibling){a.parentNode.insertBefore(b,a.nextSibling)}else{a.parentNode.appendChild(b)}break}};nitobi.html.getClientRects=function(c,b,a){if(nitobi.browser.IE){return c.getClientRects()}b=b||0;a=a||0;var d;if(nitobi.browser.SAFARI||nitobi.browser.CHROME){d=nitobi.html.getCoords(c);b=0;a=0}else{var d=document.getBoxObjectFor(c)}return new Array({top:(d.y-b),left:(d.x-a),bottom:(d.y+d.height-b),right:(d.x+d.width-a)})};nitobi.html.getBoundingClientRect=function(a,f,b){if(nitobi.browser.IE){return a.getBoundingClientRect()}f=f||0;b=b||0;var g;if(nitobi.browser.SAFARI||nitobi.browser.CHROME){g=nitobi.html.getCoords(a);f=0;b=0}else{g=document.getBoxObjectFor(a)}var d=g.y-f;var c=g.x-b;return{top:d,left:c,bottom:(d+g.height),right:(c+g.width)}};nitobi.html.Event=function(){this.srcElement=null;this.fromElement=null;this.toElement=null;this.eventSrc=null};nitobi.html.handlerId=0;nitobi.html.elementId=0;nitobi.html.elements=[];nitobi.html.unload=[];nitobi.html.unloadCalled=false;nitobi.html.attachEvents=function(a,f,d){var c=[];for(var b=0;b<f.length;b++){var g=f[b];c.push(nitobi.html.attachEvent(a,g.type,g.handler,d,g.capture||false))}return c};nitobi.html.attachEvent=function(f,g,d,c,b,a){if(g=="anyclick"){if(nitobi.browser.IE){nitobi.html.attachEvent(f,"dblclick",d,c,b,a)}g="click"}if(!(d instanceof Function)){nitobi.lang.throwError("Event handler needs to be a Function")}f=$ntb(f);if(g.toLowerCase()=="unload"&&a!=true){var k=d;if(c!=null){k=function(){d.call(c)}}return this.addUnload(k)}var j=this.handlerId++;var h=this.elementId++;if(typeof(d.ebaguid)!="undefined"){j=d.ebaguid}else{d.ebaguid=j}if(typeof(f.ebaguid)=="undefined"){f.ebaguid=h;nitobi.html.elements[h]=f}if(typeof(f.eba_events)=="undefined"){f.eba_events={}}if(f.eba_events[g]==null){f.eba_events[g]={};if(f.attachEvent){f["eba_event_"+g]=function(){nitobi.html.notify.call(f,window.event)};f.attachEvent("on"+g,f["eba_event_"+g]);if(b&&f.setCapture!=null){f.setCapture(true)}}else{if(f.addEventListener){f["eba_event_"+g]=function(){nitobi.html.notify.call(f,arguments[0])};f.addEventListener(g,f["eba_event_"+g],b)}}}f.eba_events[g][j]={handler:d,context:c};return j};nitobi.html.notify=function(c){if(!nitobi.browser.IE){c.srcElement=c.target;c.fromElement=c.relatedTarget;c.toElement=c.relatedTarget}var a=this;c.eventSrc=a;nitobi.html.Event=c;for(var d in a.eba_events[c.type]){var b=a.eba_events[c.type][d];if(typeof(b.context)=="object"){b.handler.call(b.context,c,a)}else{b.handler.call(a,c,a)}}};nitobi.html.detachEvents=function(c,b){for(var a=0;a<b.length;a++){var d=b[a];nitobi.html.detachEvent(c,d.type,d.handler)}};nitobi.html.detachEvent=function(f,d,c){f=$ntb(f);var b=c;if(c instanceof Function){b=c.ebaguid}if(d=="unload"){this.unload.splice(ebaguid,1)}if(f!=null&&f.eba_events!=null&&f.eba_events[d]!=null&&f.eba_events[d][b]!=null){var a=f.eba_events[d];a[b]=null;delete a[b];if(nitobi.collections.isHashEmpty(a)){this.m_detach(f,d,f["eba_event_"+d]);f["eba_event_"+d]=null;f.eba_events[d]=null;a=null;if(f.nodeType==1){f.removeAttribute("eba_event_"+d)}}}return true};nitobi.html.m_detach=function(a,c,d){if(d!=null&&d instanceof Function){if(a.detachEvent){a.detachEvent("on"+c,d)}else{if(a.removeEventListener){a.removeEventListener(c,d,false)}}a["on"+c]=null;if(c=="unload"){for(var b=0;b<this.unload.length;b++){this.unload[b].call(this);this.unload[b]=null}}}};nitobi.html.detachAllEvents=function(a){for(var b=0;b<nitobi.html.elements.length;b++){if(typeof(nitobi.html.elements[b])!="undefined"){for(var d in nitobi.html.elements[b].eba_events){nitobi.html.m_detach(nitobi.html.elements[b],d,nitobi.html.elements[b]["eba_event_"+d]);if(typeof(nitobi.html.elements[b])!="undefined"&&nitobi.html.elements[b].eba_events[d]!=null){for(var c in nitobi.html.elements[b].eba_events[d]){nitobi.html.elements[b].eba_events[d][c]=null}}nitobi.html.elements[b]["eba_event_"+d]=null}}}nitobi.html.elements=null};nitobi.html.addUnload=function(a){this.unload.push(a);return this.unload.length-1};nitobi.html.cancelEvent=function(a){nitobi.html.stopPropagation(a);nitobi.html.preventDefault(a)};nitobi.html.stopPropagation=function(a){if(a==null){return}if(nitobi.browser.IE){a.cancelBubble=true}else{a.stopPropagation()}};nitobi.html.preventDefault=function(a,b){if(a==null){return}if(nitobi.browser.IE){a.returnValue=false}else{a.preventDefault()}if(b!=null){e.keyCode=b}};nitobi.html.getEventCoords=function(a){var b={x:a.clientX,y:a.clientY};if(nitobi.browser.IE){b.x+=document.documentElement.scrollLeft+document.body.scrollLeft;b.y+=document.documentElement.scrollTop+document.body.scrollTop}else{b.x+=window.scrollX;b.y+=window.scrollY}return b};nitobi.html.getEvent=function(a){if(nitobi.browser.IE){return window.event}else{a.srcElement=a.target;a.fromElement=a.relatedTarget;a.toElement=a.relatedTarget;return a}};nitobi.html.createEvent=function(c,b,a,f){if(nitobi.browser.IE){a.target.fireEvent("on"+b)}else{var d=document.createEvent(c);d.initKeyEvent(b,true,true,document.defaultView,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,f.keyCode,f.charCode);a.target.dispatchEvent(d)}};nitobi.html.unloadEventId=nitobi.html.attachEvent(window,"unload",nitobi.html.detachAllEvents,nitobi.html,false,true);nitobi.lang.defineNs("nitobi.event");nitobi.event=function(){};nitobi.event.keys={};nitobi.event.guid=0;nitobi.event.subscribe=function(c,a){ntbAssert(c.indexOf("undefined")==-1,"Something used nitobi.event with an invalid key. The key was "+c);nitobi.event.publish(c);var b=this.guid++;this.keys[c].add(a,b);return b};nitobi.event.unsubscribe=function(b,a){ntbAssert(b.indexOf("undefined")==-1,"Something used nitobi.event with an invalid key. The key was "+b);if(this.keys[b]==null){return true}if(this.keys[b].remove(a)){this.keys[b]=null;delete this.keys[b]}};nitobi.event.evaluate=function(func,_290){var _291=true;if(typeof func=="string"){func=func.replace(/eventArgs/gi,"arguments[1]");var _292=eval(func);_291=(typeof(_292)=="undefined"?true:_292)}return _291};nitobi.event.publish=function(a){ntbAssert(a.indexOf("undefined")==-1,"Something used nitobi.event with an invalid key. The key was "+a);if(this.keys[a]==null){this.keys[a]=new nitobi.event.Key()}};nitobi.event.notify=function(b,a){ntbAssert(b.indexOf("undefined")==-1,"Something used nitobi.event with an invalid key. The key was "+b);if(this.keys[b]!=null){return this.keys[b].notify(a)}else{return true}};nitobi.event.dispose=function(){for(var a in this.keys){if(typeof(this.keys[a])=="function"){this.keys[a].dispose()}}this.keys=null};nitobi.event.Key=function(){this.handlers={}};nitobi.event.Key.prototype.add=function(a,b){ntbAssert(a instanceof Function,"EventKey.add requires a JavaScript function pointer as a parameter.","",EBA_THROW);this.handlers[b]=a};nitobi.event.Key.prototype.remove=function(a){this.handlers[a]=null;delete this.handlers[a];var b=true;for(var c in this.handlers){b=false;break}return b};nitobi.event.Key.prototype.notify=function(b){var a=false;for(var c in this.handlers){var f=this.handlers[c];if(f instanceof Function){var d=(f.apply(this,arguments)==false);a=a||d}else{}}return !a};nitobi.event.Key.prototype.dispose=function(){for(var a in this.handlers){this.handlers[a]=null}};nitobi.event.Args=function(a){this.source=a};nitobi.event.Args.prototype.callback=function(){};nitobi.html.cancelBubble=nitobi.html.cancelEvent;nitobi.html.getCssRules=nitobi.html.Css.getRules;nitobi.html.findParentStylesheet=nitobi.html.Css.findParentStylesheet;nitobi.html.getClass=nitobi.html.Css.getClass;nitobi.html.getStyle=nitobi.html.Css.getStyle;nitobi.html.addClass=nitobi.html.Css.addClass;nitobi.html.removeClass=nitobi.html.Css.removeClass;nitobi.html.getClassStyle=nitobi.html.Css.getClassStyle;nitobi.html.normalizeUrl=nitobi.html.Url.normalize;nitobi.html.setUrlParameter=nitobi.html.Url.setParameter;nitobi.lang.defineNs("nitobi.base.XmlNamespace");nitobi.base.XmlNamespace.prefix="ntb";nitobi.base.XmlNamespace.uri="http://www.nitobi.com";nitobi.lang.defineNs("nitobi.collections");if(false){nitobi.collections=function(){}}nitobi.collections.IEnumerable=function(){this.list=new Array();this.length=0};nitobi.collections.IEnumerable.prototype.add=function(a){this.list[this.getLength()]=a;this.length++};nitobi.collections.IEnumerable.prototype.insert=function(b,a){this.list.splice(b,0,a);this.length++};nitobi.collections.IEnumerable.createNewArray=function(f,d){var c;d=d||0;if(f.count){c=f.count}if(f.length){c=f.length}var a=new Array(c-d);for(var b=d;b<c;b++){a[b-d]=f[b]}return a};nitobi.collections.IEnumerable.prototype.get=function(a){if(a<0||a>=this.getLength()){nitobi.lang.throwError(nitobi.error.OutOfBounds)}return this.list[a]};nitobi.collections.IEnumerable.prototype.set=function(b,a){if(b<0||b>=this.getLength()){nitobi.lang.throwError(nitobi.error.OutOfBounds)}this.list[b]=a};nitobi.collections.IEnumerable.prototype.indexOf=function(b){for(var a=0;a<this.getLength();a++){if(this.list[a]===b){return a}}return -1};nitobi.collections.IEnumerable.prototype.remove=function(a){var b;if(typeof(a)!="number"){b=this.indexOf(a)}else{b=a}if(-1==b||b<0||b>=this.getLength()){nitobi.lang.throwError(nitobi.error.OutOfBounds)}this.list[b]=null;this.list.splice(b,1);this.length--};nitobi.collections.IEnumerable.prototype.getLength=function(){return this.length};nitobi.collections.IEnumerable.prototype.each=function(c){var a=this.length;var d=this.list;for(var b=0;b<a;b++){c(d[b])}};nitobi.lang.defineNs("nitobi.base");nitobi.base.ISerializable=function(c,d,a,b){nitobi.Object.call(this);if(typeof(this.ISerializableInitialized)=="undefined"){this.ISerializableInitialized=true}else{return}this.xmlNode=null;this.setXmlNode(c);if(c!=null){this.profile=nitobi.base.Registry.getInstance().getCompleteProfile({idField:null,tagName:c.nodeName})}else{this.profile=nitobi.base.Registry.getInstance().getProfileByInstance(this)}this.onDeserialize=new nitobi.base.Event();this.onSetParentObject=new nitobi.base.Event();this.factory=nitobi.base.Factory.getInstance();this.objectHash={};this.onCreateObject=new nitobi.base.Event();if(c!=null){this.deserializeFromXmlNode(this.getXmlNode())}else{if(this.factory!=null&&this.profile.tagName!=null){this.createByProfile(this.profile,this.getXmlNode())}else{if(a!=null&&c!=null){this.createByXml(a)}}}this.disposal.push(this.xmlNode)};nitobi.lang.extend(nitobi.base.ISerializable,nitobi.Object);nitobi.base.ISerializable.guidMap={};nitobi.base.ISerializable.prototype.ISerializableImplemented=true;nitobi.base.ISerializable.prototype.getProfile=function(){return this.profile};nitobi.base.ISerializable.prototype.createByProfile=function(d,c){if(c==null){var a="<"+d.tagName+" xmlns:"+nitobi.base.XmlNamespace.prefix+'="'+nitobi.base.XmlNamespace.uri+'" />';var b=nitobi.xml.createXmlDoc(a);this.setXmlNode(b.firstChild);this.deserializeFromXmlNode(this.xmlNode)}else{this.deserializeFromXmlNode(c);this.setXmlNode(c)}};nitobi.base.ISerializable.prototype.createByXml=function(a){this.deserializeFromXml(a)};nitobi.base.ISerializable.prototype.getParentObject=function(){return this.parentObj};nitobi.base.ISerializable.prototype.setParentObject=function(a){this.parentObj=a;this.onSetParentObject.notify()};nitobi.base.ISerializable.prototype.addChildObject=function(b){this.addToCache(b);b.setParentObject(this);var a=b.getXmlNode();if(!this.areGuidsGenerated(a)){a=this.generateGuids(a);b.setXmlNode(a)}b.setXmlNode(this.xmlNode.appendChild(nitobi.xml.importNode(this.xmlNode.ownerDocument,a,true)))};nitobi.base.ISerializable.prototype.insertBeforeChildObject=function(c,b){b=b?b.getXmlNode():null;this.addToCache(c);c.setParentObject(this);var a=c.getXmlNode();if(!this.areGuidsGenerated(a)){a=this.generateGuids(a);c.setXmlNode(a)}a=nitobi.xml.importNode(this.xmlNode.ownerDocument,a,true);this.xmlNode.insertBefore(a,b)};nitobi.base.ISerializable.prototype.createElement=function(a){var b;if(this.xmlNode==null||this.xmlNode.ownerDocument==null){b=nitobi.xml.createXmlDoc()}else{b=this.xmlNode.ownerDocument}if(nitobi.browser.IE){return b.createNode(1,a,nitobi.base.XmlNamespace.uri)}else{if(b.createElementNS){return b.createElementNS(nitobi.base.XmlNamespace.uri,a)}else{nitobi.lang.throwError("Unable to create a new xml node on this browser.")}}};nitobi.base.ISerializable.prototype.deleteChildObject=function(b){this.removeFromCache(b);var a=this.getElement(b);if(a!=null){a.parentNode.removeChild(a)}};nitobi.base.ISerializable.prototype.addToCache=function(a){this.objectHash[a.getId()]=a};nitobi.base.ISerializable.prototype.removeFromCache=function(a){this.objectHash[a]=null};nitobi.base.ISerializable.prototype.inCache=function(a){return(this.objectHash[a]!=null)};nitobi.base.ISerializable.prototype.flushCache=function(){this.objectHash={}};nitobi.base.ISerializable.prototype.areGuidsGenerated=function(b){if(b==null||b.ownerDocument==null){return false}if(nitobi.browser.IE){var a=b.ownerDocument.documentElement;if(a==null){return false}else{var c=a.getAttribute("id");if(c==null||c==""){return false}else{return(nitobi.base.ISerializable.guidMap[c]!=null)}}}else{return(b.ownerDocument.generatedGuids==true)}};nitobi.base.ISerializable.prototype.setGuidsGenerated=function(b,c){if(b==null||b.ownerDocument==null){return}if(nitobi.browser.IE){var a=b.ownerDocument.documentElement;if(a!=null){var d=a.getAttribute("id");if(d!=null&&d!=""){nitobi.base.ISerializable.guidMap[d]=true}}}else{b.ownerDocument.generatedGuids=true}};nitobi.base.ISerializable.prototype.generateGuids=function(a){nitobi.base.uniqueIdGeneratorProc.addParameter("guid",nitobi.component.getUniqueId(),"");var b=nitobi.xml.transformToXml(a,nitobi.base.uniqueIdGeneratorProc);this.saveDocument=b;this.setGuidsGenerated(b.documentElement,true);return b.documentElement};nitobi.base.ISerializable.prototype.deserializeFromXmlNode=function(a){if(!this.areGuidsGenerated(a)){a=this.generateGuids(a)}this.setXmlNode(a);this.flushCache();if(this.profile==null){this.profile=nitobi.base.Registry.getInstance().getCompleteProfile({idField:null,tagName:a.nodeName})}this.onDeserialize.notify()};nitobi.base.ISerializable.prototype.deserializeFromXml=function(a){var c=nitobi.xml.createXmlDoc(a);var b=this.generateGuids(c.firstChild);this.setXmlNode(b);this.onDeserialize.notify()};nitobi.base.ISerializable.prototype.getChildObject=function(c){var b=null;b=this.objectHash[c];if(b==null){var a=this.getElement(c);if(a==null){return null}else{b=this.factory.createByNode(a);this.onCreateObject.notify(b);this.addToCache(b)}b.setParentObject(this)}return b};nitobi.base.ISerializable.prototype.getChildObjectById=function(a){return this.getChildObject(a)};nitobi.base.ISerializable.prototype.getElement=function(c){try{var b=this.xmlNode.selectSingleNode("*[@id='"+c+"']");return b}catch(a){nitobi.lang.throwError(nitobi.error.Unexpected,a)}};nitobi.base.ISerializable.prototype.getFactory=function(){return this.factory};nitobi.base.ISerializable.prototype.setFactory=function(a){this.factory=factory};nitobi.base.ISerializable.prototype.getXmlNode=function(){return this.xmlNode};nitobi.base.ISerializable.prototype.setXmlNode=function(a){if(nitobi.lang.typeOf(a)==nitobi.lang.type.XMLDOC&&a!=null){this.ownerDocument=a;a=nitobi.html.getFirstChild(a)}else{if(a!=null){this.ownerDocument=a.ownerDocument}}if(a!=null&&nitobi.browser.MOZ&&a.ownerDocument==null){nitobi.lang.throwError(nitobi.error.OrphanXmlNode+" ISerializable.setXmlNode")}this.xmlNode=a};nitobi.base.ISerializable.prototype.serializeToXml=function(){return nitobi.xml.serialize(this.xmlNode)};nitobi.base.ISerializable.prototype.getAttribute=function(a,c){if(this[a]!=null){return this[a]}var b=this.xmlNode.getAttribute(a);return b===null?c:b};nitobi.base.ISerializable.prototype.setAttribute=function(a,b){this[a]=b;this.xmlNode.setAttribute(a.toLowerCase(),b!=null?b.toString():"")};nitobi.base.ISerializable.prototype.setIntAttribute=function(b,a){var c=parseInt(a);if(a!=null&&(typeof(c)!="number"||isNaN(c))){nitobi.lang.throwError(b+" is not an integer and therefore cannot be set. It's value was "+a)}this.setAttribute(b,a)};nitobi.base.ISerializable.prototype.getIntAttribute=function(c,d){var a=this.getAttribute(c,d);if(a==null||a==""){return 0}var b=parseInt(a);if(isNaN(b)){nitobi.lang.throwError("ISerializable attempting to get "+c+" which was supposed to be an int but was actually NaN")}return b};nitobi.base.ISerializable.prototype.setBoolAttribute=function(b,a){a=nitobi.lang.getBool(a);if(a!=null&&typeof(a)!="boolean"){nitobi.lang.throwError(b+" is not an boolean and therefore cannot be set. It's value was "+a)}this.setAttribute(b,(a?"true":"false"))};nitobi.base.ISerializable.prototype.getBoolAttribute=function(d,b){var a=this.getAttribute(d,b);if(typeof(a)=="string"&&a==""){return null}var c=nitobi.lang.getBool(a);if(c==null){nitobi.lang.throwError("ISerializable attempting to get "+d+" which was supposed to be a bool but was actually "+a)}return c};nitobi.base.ISerializable.prototype.setDateAttribute=function(a,b){this.setAttribute(a,b)};nitobi.base.ISerializable.prototype.getDateAttribute=function(a,c){if(this[a]){return this[a]}var b=this.getAttribute(a,c);return b?new Date(b):null};nitobi.base.ISerializable.prototype.getId=function(){return this.getAttribute("id")};nitobi.base.ISerializable.prototype.getChildObjectId=function(b,a){var f=(typeof(b.className)=="string"?b.tagName:b.getXmlNode().nodeName);var c=f;if(a){c+="[@instancename='"+a+"']"}var d=this.getXmlNode().selectSingleNode(c);if(null==d){return null}else{return d.getAttribute("id")}};nitobi.base.ISerializable.prototype.setObject=function(b,a){if(b.ISerializableImplemented!=true){nitobi.lang.throwError(nitobi.error.ExpectedInterfaceNotFound+" ISerializable")}var c=this.getChildObjectId(b,a);if(null!=c){this.deleteChildObject(c)}if(a){b.setAttribute("instancename",a)}this.addChildObject(b)};nitobi.base.ISerializable.prototype.getObject=function(b,a){var c=this.getChildObjectId(b,a);if(null==c){return c}return this.getChildObject(c)};nitobi.base.ISerializable.prototype.getObjectById=function(a){return this.getChildObject(a)};nitobi.base.ISerializable.prototype.isDescendantExists=function(c){var b=this.getXmlNode();var a=b.selectSingleNode("//*[@id='"+c+"']");return(a!=null)};nitobi.base.ISerializable.prototype.getPathToLeaf=function(j){var h=this.getXmlNode();var b=h.selectSingleNode("//*[@id='"+j+"']");if(nitobi.browser.IE){b.ownerDocument.setProperty("SelectionLanguage","XPath")}var g=b.selectNodes("./ancestor-or-self::*");var d=this.getId();var c=0;for(var f=0;f<g.length;f++){if(g[f].getAttribute("id")==d){c=f+1;break}}var a=nitobi.collections.IEnumerable.createNewArray(g,c);return a.reverse()};nitobi.base.ISerializable.prototype.isDescendantInstantiated=function(j){var c=this.getXmlNode();var h=c.selectSingleNode("//*[@id='"+j+"']");if(nitobi.browser.IE){h.ownerDocument.setProperty("SelectionLanguage","XPath")}var g=h.selectNodes("ancestor::*");var f=false;var d=this;for(var a=0;a<g.length;a++){if(f){var b=g[a].getAttribute("id");instantiated=d.inCache(b);if(!instantiated){return false}d=this.getObjectById(b)}if(g[a].getAttribute("id")==this.getId()){f=true}}return d.inCache(j)};nitobi.lang.defineNs("nitobi.base");if(!nitobi.base.Registry){nitobi.base.Registry=function(){this.classMap={};this.tagMap={}};if(!nitobi.base.Registry.instance){nitobi.base.Registry.instance=null}nitobi.base.Registry.getInstance=function(){if(nitobi.base.Registry.instance==null){nitobi.base.Registry.instance=new nitobi.base.Registry()}return nitobi.base.Registry.instance};nitobi.base.Registry.prototype.getProfileByClass=function(a){return this.classMap[a]};nitobi.base.Registry.prototype.getProfileByInstance=function(f){var c=nitobi.lang.getFirstFunction(f);var j=c.value.prototype;var h=null;var g=0;for(var d in this.classMap){var b=this.classMap[d].classObject;var a=0;while(b&&f instanceof b){b=b.baseConstructor;a++}if(a>g){g=a;h=d}}if(h){return this.getProfileByClass(h)}else{return null}};nitobi.base.Registry.prototype.getProfileByTag=function(a){return this.tagMap[a]};nitobi.base.Registry.prototype.getCompleteProfile=function(a){if(nitobi.lang.isDefined(a.className)&&a.className!=null){return this.classMap[a.className]}if(nitobi.lang.isDefined(a.tagName)&&a.tagName!=null){return this.tagMap[a.tagName]}nitobi.lang.throwError("A complete class profile could not be found. Insufficient information was provided.")};nitobi.base.Registry.prototype.register=function(a){if(!nitobi.lang.isDefined(a.tagName)||null==a.tagName){nitobi.lang.throwError("Illegal to register a class without a tagName.")}if(!nitobi.lang.isDefined(a.className)||null==a.className){nitobi.lang.throwError("Illegal to register a class without a className.")}this.tagMap[a.tagName]=a;this.classMap[a.className]=a}}nitobi.lang.defineNs("nitobi.base");nitobi.base.Factory=function(){this.registry=nitobi.base.Registry.getInstance()};nitobi.lang.extend(nitobi.base.Factory,nitobi.Object);nitobi.base.Factory.instance=null;nitobi.base.Factory.prototype.createByClass=function(b){try{return nitobi.lang.newObject(b,arguments,1)}catch(a){nitobi.lang.throwError("The Factory (createByClass) could not create the class "+b+".",a)}};nitobi.base.Factory.prototype.createByNode=function(g){try{if(null==g){nitobi.lang.throwError(nitobi.error.ArgExpected)}if(nitobi.lang.typeOf(g)==nitobi.lang.type.XMLDOC){g=nitobi.xml.getChildNodes(g)[0]}var f=this.registry.getProfileByTag(g.nodeName).className;var c=g.ownerDocument;var b=Array.prototype.slice.call(arguments,0);var d=nitobi.lang.newObject(f,b,0);return d}catch(a){nitobi.lang.throwError("The Factory (createByNode) could not create the class "+f+".",a)}};nitobi.base.Factory.prototype.createByProfile=function(a){try{return nitobi.lang.newObject(a.className,arguments,1)}catch(b){nitobi.lang.throwError("The Factory (createByProfile) could not create the class "+a.className+".",b)}};nitobi.base.Factory.prototype.createByTag=function(c){var b=this.registry.getProfileByTag(c).className;var a=Array.prototype.slice.call(arguments,0);return nitobi.lang.newObject(b,a,1)};nitobi.base.Factory.getInstance=function(){if(nitobi.base.Factory.instance==null){nitobi.base.Factory.instance=new nitobi.base.Factory()}return nitobi.base.Factory.instance};nitobi.lang.defineNs("nitobi.base");nitobi.base.Profile=function(_32d,_32e,_32f,_330,_331){this.className=_32d;this.classObject=eval(_32d);this.schema=_32e;this.singleton=_32f;this.tagName=_330;this.idField=_331||"id"};nitobi.lang.defineNs("nitobi.base");nitobi.base.Declaration=function(){nitobi.base.Declaration.baseConstructor.call(this);this.xmlDoc=null};nitobi.lang.extend(nitobi.base.Declaration,nitobi.Object);nitobi.base.Declaration.prototype.loadHtml=function(a){try{a=$ntb(a);this.xmlDoc=nitobi.xml.parseHtml(a);return this.xmlDoc}catch(b){nitobi.lang.throwError(nitobi.error.DeclarationParseError,b)}};nitobi.base.Declaration.prototype.getXmlDoc=function(){return this.xmlDoc};nitobi.base.Declaration.prototype.serializeToXml=function(){return nitobi.xml.serialize(this.xmlDoc)};nitobi.lang.defineNs("nitobi.base");nitobi.base.DateMath={DAY:"d",WEEK:"w",MONTH:"m",YEAR:"y",ONE_DAY_MS:86400000};nitobi.base.DateMath._add=function(a,b,c){if(b==this.DAY){a.setDate(a.getDate()+c)}else{if(b==this.WEEK){a.setDate(a.getDate()+7*c)}else{if(b==this.MONTH){a.setMonth(a.getMonth()+c)}else{if(b==this.YEAR){a.setFullYear(a.getFullYear()+c)}}}}return a};nitobi.base.DateMath.add=function(a,b,c){return this._add(a,b,c)};nitobi.base.DateMath.subtract=function(a,b,c){return this._add(a,b,-1*c)};nitobi.base.DateMath.after=function(a,b){return(a-b)>0};nitobi.base.DateMath.between=function(b,c,a){return(b-c)>=0&&(a-b)>=0};nitobi.base.DateMath.before=function(a,b){return(a-b)<0};nitobi.base.DateMath.clone=function(a){var b=new Date(a.toString());return b};nitobi.base.DateMath.isLeapYear=function(a){var f=a.getFullYear();var d=String(f/4).indexOf(".")==-1;var c=String(f/100).indexOf(".")==-1;var b=String(f/400).indexOf(".")==-1;return(b)?true:(d&&!c)?true:false};nitobi.base.DateMath.getMonthDays=function(a){return[31,(this.isLeapYear(a))?29:28,31,30,31,30,31,31,30,31,30,31][a.getMonth()]};nitobi.base.DateMath.getMonthEnd=function(a){return new Date(a.getFullYear(),a.getMonth(),this.getMonthDays(a))};nitobi.base.DateMath.getMonthStart=function(a){return new Date(a.getFullYear(),a.getMonth(),1)};nitobi.base.DateMath.isToday=function(b){var c=this.resetTime(new Date());var a=this.add(this.clone(c),this.DAY,1);return this.between(b,c,a)};nitobi.base.DateMath.isSameDay=function(a,b){a=this.resetTime(this.clone(a));b=this.resetTime(this.clone(b));return a.valueOf()==b.valueOf()};nitobi.base.DateMath.parse=function(a){};nitobi.base.DateMath.getWeekNumber=function(a){var b=this.getJanuary1st(a);return Math.ceil(this.getNumberOfDays(b,a)/7)};nitobi.base.DateMath.getNumberOfDays=function(c,b){var a=this.resetTime(this.clone(b)).getTime()-this.resetTime(this.clone(c)).getTime();return Math.round(a/this.ONE_DAY_MS)+1};nitobi.base.DateMath.getJanuary1st=function(a){return new Date(a.getFullYear(),0,1)};nitobi.base.DateMath.resetTime=function(a){if(nitobi.base.DateMath.invalid(a)){return a}a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a};nitobi.base.DateMath.parseIso8601=function(a){return new Date(a.replace(/^(....).(..).(..)(.*)$/,"$1/$2/$3$4"))};nitobi.base.DateMath.toIso8601=function(b){if(nitobi.base.DateMath.invalid(b)){return""}var a=nitobi.lang.padZeros;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())};nitobi.base.DateMath.invalid=function(a){return(!a)||(a.toString()=="Invalid Date")};nitobi.lang.defineNs("nitobi.base");nitobi.base.EventArgs=function(b,a){this.source=b;this.event=a||nitobi.html.Event};nitobi.base.EventArgs.prototype.getSource=function(){return this.source};nitobi.base.EventArgs.prototype.getEvent=function(){return this.event};nitobi.lang.defineNs("nitobi.collections");nitobi.collections.IList=function(){nitobi.base.ISerializable.call(this);nitobi.collections.IEnumerable.call(this)};nitobi.lang.implement(nitobi.collections.IList,nitobi.base.ISerializable);nitobi.lang.implement(nitobi.collections.IList,nitobi.collections.IEnumerable);nitobi.collections.IList.prototype.IListImplemented=true;nitobi.collections.IList.prototype.add=function(a){nitobi.collections.IEnumerable.prototype.add.call(this,a);if(a.ISerializableImplemented==true&&a.profile!=null){this.addChildObject(a)}};nitobi.collections.IList.prototype.insert=function(c,b){var a=this.get(c);nitobi.collections.IEnumerable.prototype.insert.call(this,c,b);if(b.ISerializableImplemented==true&&b.profile!=null){this.insertBeforeChildObject(b,a)}};nitobi.collections.IList.prototype.addToCache=function(b,a){nitobi.base.ISerializable.prototype.addToCache.call(this,b);this.list[a]=b};nitobi.collections.IList.prototype.removeFromCache=function(a){nitobi.base.ISerializable.prototype.removeFromCache.call(this,this.list[a].getId())};nitobi.collections.IList.prototype.flushCache=function(){nitobi.base.ISerializable.prototype.flushCache.call(this);this.list=new Array()};nitobi.collections.IList.prototype.get=function(b){if(typeof(b)=="object"){return b}if(b<0||b>=this.getLength()){nitobi.lang.throwError(nitobi.error.OutOfBounds)}var c=null;if(this.list[b]!=null){c=this.list[b]}if(c==null){var a=nitobi.xml.getChildNodes(this.xmlNode)[b];if(a==null){return null}else{c=this.factory.createByNode(a);this.onCreateObject.notify(c);nitobi.collections.IList.prototype.addToCache.call(this,c,b)}c.setParentObject(this)}return c};nitobi.collections.IList.prototype.getById=function(c){var b=this.xmlNode.selectSingleNode("*[@id='"+c+"']");var a=nitobi.xml.indexOfChildNode(b.parentNode,b);return this.get(a)};nitobi.collections.IList.prototype.set=function(c,b){if(c<0||c>=this.getLength()){nitobi.lang.throwError(nitobi.error.OutOfBounds)}try{if(b.ISerializableImplemented==true){var f=this.get(c);if(f.getXmlNode()!=b.getXmlNode()){var a=this.xmlNode.insertBefore(b.getXmlNode(),f.getXmlNode());this.xmlNode.removeChild(f.getXmlNode());f.setXmlNode(a)}}b.setParentObject(this);nitobi.collections.IList.prototype.addToCache.call(this,b,c)}catch(d){nitobi.lang.throwError(nitobi.error.Unexpected,d)}};nitobi.collections.IList.prototype.remove=function(a){var b;if(typeof(a)!="number"){b=this.indexOf(a)}else{b=a}var c=this.get(b);nitobi.collections.IEnumerable.prototype.remove.call(this,a);this.xmlNode.removeChild(c.getXmlNode())};nitobi.collections.IList.prototype.getLength=function(){return nitobi.xml.getChildNodes(this.xmlNode).length};nitobi.lang.defineNs("nitobi.collections");nitobi.collections.List=function(a){nitobi.collections.List.baseConstructor.call(this);nitobi.collections.IList.call(this)};nitobi.lang.extend(nitobi.collections.List,nitobi.Object);nitobi.lang.implement(nitobi.collections.List,nitobi.collections.IList);nitobi.base.Registry.getInstance().register(new nitobi.base.Profile("nitobi.collections.List",null,false,"ntb:list"));nitobi.lang.defineNs("nitobi.collections");nitobi.collections.isHashEmpty=function(c){var b=true;for(var a in c){if(c[a]!=null&&c[a]!=""){b=false;break}}return b};nitobi.collections.hashLength=function(c){var a=0;for(var b in c){a++}return a};nitobi.collections.serialize=function(f){var c="";for(var d in f){var a=f[d];var b=typeof(a);if(b=="string"||b=="number"){c+="'"+d+"':'"+a+"',"}}c=c.substring(0,c.length-1);return"{"+c+"}"};nitobi.lang.defineNs("nitobi.ui");if(false){nitobi.ui=function(){}}nitobi.ui.setWaitScreen=function(a){if(a){var d=nitobi.html.getBodyArea();var b=nitobi.html.createElement("div",{id:"NTB_waitDiv"},{verticalAlign:"middle",color:"#000000",font:"12px Trebuchet MS, Georgia, Verdana",textAlign:"center",background:"#ffffff",border:"1px solid #000000",padding:"0px",position:"absolute",top:(d.clientHeight/2)+d.scrollTop-30+"px",left:(d.clientWidth/2)+d.scrollLeft-100+"px",width:"200px",height:"60px"});b.innerHTML="<table height=60 width=200><tr><td valign=center height=60 align=center>Please wait..</td></tr></table>";document.getElementsByTagName("body").item(0).appendChild(b)}else{var b=$ntb("NTB_waitDiv");try{document.getElementsByTagName("body").item(0).removeChild(b)}catch(c){}}};nitobi.lang.defineNs("nitobi.ui");nitobi.ui.IStyleable=function(a){this.htmlNode=a||null;this.onBeforeSetStyle=new nitobi.base.Event();this.onSetStyle=new nitobi.base.Event()};nitobi.ui.IStyleable.prototype.getHtmlNode=function(){return this.htmlNode};nitobi.ui.IStyleable.prototype.setHtmlNode=function(a){this.htmlNode=a};nitobi.ui.IStyleable.prototype.setStyle=function(a,b){if(this.onBeforeSetStyle.notify(new nitobi.ui.StyleEventArgs(this,this.onBeforeSetStyle,a,b))&&this.getHtmlNode()!=null){nitobi.html.Css.setStyle(this.getHtmlNode(),a,b);this.onSetStyle.notify(new nitobi.ui.StyleEventArgs(this,this.onSetStyle,a,b))}};nitobi.ui.IStyleable.prototype.getStyle=function(a){return nitobi.html.Css.getStyle(this.getHtmlNode(),a)};nitobi.lang.defineNs("nitobi.ui");nitobi.ui.StyleEventArgs=function(b,a,d,c){nitobi.ui.ElementEventArgs.baseConstructor.apply(this,arguments);this.property=d||null;this.value=c||null};nitobi.lang.extend(nitobi.ui.StyleEventArgs,nitobi.base.EventArgs);nitobi.lang.defineNs("nitobi.ui");nitobi.ui.IScrollable=function(a){this.scrollableElement=a};nitobi.ui.IScrollable.prototype.setScrollableElement=function(a){this.scrollableElement=a};nitobi.ui.IScrollable.prototype.getScrollableElement=function(){return this.scrollableElement};nitobi.ui.IScrollable.prototype.getScrollLeft=function(){return this.scrollableElement.scrollLeft};nitobi.ui.IScrollable.prototype.setScrollLeft=function(a){this.scrollableElement.scrollLeft=a};nitobi.ui.IScrollable.prototype.scrollLeft=function(a){a=a||25;this.scrollableElement.scrollLeft-=a};nitobi.ui.IScrollable.prototype.scrollRight=function(a){a=a||25;this.scrollableElement.scrollLeft+=a};nitobi.ui.IScrollable.prototype.isOverflowed=function(a){a=a||this.scrollableElement.childNodes[0];return !(parseInt(nitobi.html.getBox(this.scrollableElement).width)>=parseInt(nitobi.html.getBox(a).width))};nitobi.lang.defineNs("nitobi.ui");if(false){nitobi.ui=function(){}}nitobi.ui.startDragOperation=function(d,c,b,a,h,g){var f=new nitobi.ui.DragDrop(d,b,a);f.onDragStop.subscribe(g,h);f.startDrag(c)};nitobi.ui.DragDrop=function(b,a,c){this.allowVertDrag=(a!=null?a:true);this.allowHorizDrag=(c!=null?c:true);if(nitobi.browser.IE){this.surface=document.getElementById("ebadragdropsurface_");if(this.surface==null){this.surface=nitobi.html.createElement("div",{id:"ebadragdropsurface_"},{filter:"alpha(opacity=1)",backgroundColor:"white",position:"absolute",display:"none",top:"0px",left:"0px",width:"100px",height:"100px",zIndex:"899"});document.body.appendChild(this.surface)}}if(b.nodeType==3){alert("Text node not supported. Use parent element")}this.element=b;this.zIndex=this.element.style.zIndex;this.element.style.zIndex=900;this.onMouseMove=new nitobi.base.Event();this.onDragStart=new nitobi.base.Event();this.onDragStop=new nitobi.base.Event();this.events=[{type:"mouseup",handler:this.handleMouseUp,capture:true},{type:"mousemove",handler:this.handleMouseMove,capture:true}]};nitobi.ui.DragDrop.prototype.startDrag=function(b){this.elementOriginTop=parseInt(this.element.style.top,10);this.elementOriginLeft=parseInt(this.element.style.left,10);if(isNaN(this.elementOriginLeft)){this.elementOriginLeft=0}if(isNaN(this.elementOriginTop)){this.elementOriginTop=0}var a=nitobi.html.getEventCoords(b);x=a.x;y=a.y;this.originX=x;this.originY=y;nitobi.html.attachEvents(document,this.events,this);nitobi.html.cancelEvent(b);this.onDragStart.notify()};nitobi.ui.DragDrop.prototype.handleMouseMove=function(f){var a,g;var d=nitobi.html.getEventCoords(f);a=d.x;g=d.y;if(nitobi.browser.IE){this.surface.style.display="block";if(document.compat=="CSS1Compat"){var c=nitobi.html.getBodyArea();var b=0;if(document.compatMode=="CSS1Compat"){b=25}this.surface.style.width=(c.clientWidth-b)+"px";this.surface.style.height=(c.clientHeight)+"px"}else{this.surface.style.width=document.body.clientWidth;this.surface.style.height=document.body.clientHeight}}if(this.allowHorizDrag){this.element.style.left=(this.elementOriginLeft+a-this.originX)+"px"}if(this.allowVertDrag){this.element.style.top=(this.elementOriginTop+g-this.originY)+"px"}this.x=a;this.y=g;this.onMouseMove.notify(this);nitobi.html.cancelEvent(f)};nitobi.ui.DragDrop.prototype.handleMouseUp=function(a){this.onDragStop.notify({event:a,x:this.x,y:this.y});nitobi.html.detachEvents(document,this.events);if(nitobi.browser.IE){this.surface.style.display="none"}this.element.style.zIndex=this.zIndex;this.element.object=null;this.element=null};if(typeof(nitobi.ajax)=="undefined"){nitobi.ajax=function(){}}nitobi.ajax.createXmlHttp=function(){if(nitobi.browser.IE){var b=null;try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}}return b}else{if(nitobi.browser.XHR_ENABLED){return new XMLHttpRequest()}}};nitobi.lang.defineNs("nitobi.ajax");nitobi.ajax.HttpRequest=function(){this.handler="";this.async=true;this.responseType=null;this.httpObj=nitobi.ajax.createXmlHttp();this.onPostComplete=new nitobi.base.Event();this.onGetComplete=new nitobi.base.Event();this.onRequestComplete=new nitobi.base.Event();this.onError=new nitobi.base.Event();this.timeout=0;this.timeoutId=null;this.params=null;this.data="";this.completeCallback=null;this.status="complete";this.preventCache=true;this.username="";this.password="";this.requestMethod="get";this.requestHeaders={}};nitobi.lang.extend(nitobi.ajax.HttpRequest,nitobi.Object);nitobi.ajax.HttpRequestPool_MAXCONNECTIONS=64;nitobi.ajax.HttpRequest.prototype.handleResponse=function(){var b=null;var a=null;if((this.httpObj.responseXML!=null&&this.httpObj.responseXML.documentElement!=null)&&this.responseType!="text"){b=this.httpObj.responseXML}else{if(this.responseType=="xml"){b=nitobi.xml.createXmlDoc(this.httpObj.responseText)}else{b=this.httpObj.responseText}}if(this.httpObj.status!=200){this.onError.notify({source:this,status:this.httpObj.status,message:"An error occured retrieving the data from the server. Expected response type was '"+this.responseType+"'."})}return b};nitobi.ajax.HttpRequest.prototype.post=function(b,a){this.data=b;return this._send("POST",a,b,this.postComplete)};nitobi.ajax.HttpRequest.prototype.get=function(a){return this._send("GET",a,null,this.getComplete)};nitobi.ajax.HttpRequest.prototype.postComplete=function(){if(this.httpObj.readyState==4){this.status="complete";var a={response:this.handleResponse(),params:this.params};this.responseXml=this.responseText=a.response;this.onPostComplete.notify(a);this.onRequestComplete.notify(a);if(this.completeCallback){this.completeCallback.call(this,a)}}};nitobi.ajax.HttpRequest.prototype.postXml=function(b){this.setTimeout();if(("undefined"==typeof(b.documentElement))||(null==b.documentElement)||("undefined"==typeof(b.documentElement.childNodes))||(1>b.documentElement.childNodes.length)){ebaErrorReport("updategram is empty. No request sent. xmlData["+b+"]\nxmlData.xml["+b.xml+"]");return}if(null==b.xml){var a=new XMLSerializer();b.xml=a.serializeToString(b)}return this.post(b.xml)};nitobi.ajax.HttpRequest.prototype._send=function(f,a,c,d){this.handler=a||this.handler;this.setTimeout();this.status="pending";this.httpObj.open(f,(this.preventCache?this.cacheBust(this.handler):this.handler),this.async,this.username,this.password);if(this.async){this.httpObj.onreadystatechange=nitobi.lang.close(this,d)}for(var b in this.requestHeaders){this.httpObj.setRequestHeader(b,this.requestHeaders[b])}if(this.responseType=="xml"){this.httpObj.setRequestHeader("Content-Type","text/xml")}else{if(f.toLowerCase()=="post"){this.httpObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}}this.httpObj.send(c);if(!this.async){return this.handleResponse()}return this.httpObj};nitobi.ajax.HttpRequest.prototype.open=function(f,b,d,c,a){this.requestMethod=f;this.async=d;this.username=c;this.password=a;this.handler=b};nitobi.ajax.HttpRequest.prototype.send=function(b){var a=null;switch(this.requestMethod.toUpperCase()){case"POST":a=this.post(b);break;default:a=this.get();break}this.responseXml=this.responseText=a};nitobi.ajax.HttpRequest.prototype.setTimeout=function(){if(this.timeout>0){this.timeoutId=window.setTimeout(nitobi.lang.close(this,this.abort),this.timeout)}};nitobi.ajax.HttpRequest.prototype.getComplete=function(){if(this.httpObj.readyState==4){this.status="complete";var a={response:this.handleResponse(),params:this.params,status:this.httpObj.status,statusText:this.httpObj.statusText};this.responseXml=this.responseText=a.response;this.onGetComplete.notify(a);this.onRequestComplete.notify(a);if(this.completeCallback){this.completeCallback.call(this,a)}}};nitobi.ajax.HttpRequest.prototype.setRequestHeader=function(a,b){this.requestHeaders[a]=b};nitobi.ajax.HttpRequest.prototype.isError=function(a){return(a>=400&&a<600)};nitobi.ajax.HttpRequest.prototype.abort=function(){this.httpObj.onreadystatechange=function(){};this.httpObj.abort()};nitobi.ajax.HttpRequest.prototype.clear=function(){this.handler="";this.async=true;this.onPostComplete.dispose();this.onGetComplete.dispose();this.params=null};nitobi.ajax.HttpRequest.prototype.cacheBust=function(c){var a=c.split("?");var b="nitobi_cachebust="+(new Date().getTime());if(a.length==1){c+="?"+b}else{c+="&"+b}return c};nitobi.ajax.HttpRequestPool=function(a){this.inUse=new Array();this.free=new Array();this.max=a||nitobi.ajax.HttpRequestPool_MAXCONNECTIONS;this.locked=false;this.context=null};nitobi.ajax.HttpRequestPool.prototype.reserve=function(){this.locked=true;var b;if(this.free.length){b=this.free.pop();b.clear();this.inUse.push(b)}else{if(this.inUse.length<this.max){try{b=new nitobi.ajax.HttpRequest()}catch(a){b=null}this.inUse.push(b)}else{throw"No request objects available"}}this.locked=false;return b};nitobi.ajax.HttpRequestPool.prototype.release=function(c){var b=false;this.locked=true;if(null!=c){for(var a=0;a<this.inUse.length;a++){if(c==this.inUse[a]){this.free.push(this.inUse[a]);this.inUse.splice(a,1);b=true;break}}}this.locked=false;return null};nitobi.ajax.HttpRequestPool.prototype.dispose=function(){for(var b=0;b<this.inUse.length;b++){this.inUse[b].dispose()}this.inUse=null;for(var a=0;a<this.free.length;a++){this.free[b].dispose()}this.free=null};nitobi.ajax.HttpRequestPool.instance=null;nitobi.ajax.HttpRequestPool.getInstance=function(){if(nitobi.ajax.HttpRequestPool.instance==null){nitobi.ajax.HttpRequestPool.instance=new nitobi.ajax.HttpRequestPool()}return nitobi.ajax.HttpRequestPool.instance};nitobi.lang.defineNs("nitobi.data");nitobi.data.UrlConnector=function(b,a){this.url=b||null;this.transformer=a||null;this.async=true};nitobi.data.UrlConnector.prototype.get=function(c,b){this.request=nitobi.data.UrlConnector.requestPool.reserve();var a=this.url;for(var d in c){a=nitobi.html.Url.setParameter(a,d,c[d])}this.request.handler=a;this.request.async=this.async;this.request.responseType="xml";this.request.params={dataReadyCallback:b};this.request.completeCallback=nitobi.lang.close(this,this.getComplete);this.request.get()};nitobi.data.UrlConnector.prototype.getComplete=function(d){if(d.params.dataReadyCallback){var b=d.response;var c=d.params.dataReadyCallback;var a=b;if(this.transformer){if(typeof(this.transformer)==="function"){a=this.transformer.call(null,b)}else{a=nitobi.xml.transform(b,this.transformer,"xml")}}if(c){c.call(null,{result:a,response:d.response})}}nitobi.data.UrlConnector.requestPool.release(this.request)};nitobi.data.UrlConnector.requestPool=new nitobi.ajax.HttpRequestPool();function ntbAssert(b,a,d,c){}nitobi.lang.defineNs("console");nitobi.lang.defineNs("nitobi.debug");if(typeof(console.log)=="undefined"){console.log=function(b){nitobi.debug.addDebugTools();var a=$ntb("nitobi.log");a.value=b+"\n"+a.value};console.evalCode=function(){var _3d8=(eval($ntb("nitobi.consoleEntry").value))}}nitobi.debug.addDebugTools=function(){var a="nitobi_debug_panel";var c=document.getElementById(a);var b="<table width=100%><tr><td width=50%><textarea style='width:100%' cols=125 rows=25 id='nitobi.log'></textarea></td><td width=50%><textarea style='width:100%' cols=125 rows=25 id='nitobi.consoleEntry'></textarea><br/><button onclick='console.evalCode()'>Eval</button></td></tr></table>";if(c==null){var c=document.createElement("div");c.setAttribute("id",a);c.innerHTML=b;document.body.appendChild(c)}else{if(c.innerHTML==""){c.innerHTML=b}}};nitobi.debug.assert=function(){};EBA_EM_ATTRIBUTE_ERROR=1;EBA_XHR_RESPONSE_ERROR=2;EBA_DEBUG="debug";EBA_WARN="warn";EBA_ERROR="error";EBA_THROW="throw";EBA_DEBUG_MODE=false;EBA_ON_ERROR="";EBA_LAST_ERROR="";_ebaDebug=false;NTB_EM_ATTRIBUTE_ERROR=1;NTB_XHR_RESPONSE_ERROR=2;NTB_DEBUG="debug";NTB_WARN="warn";NTB_ERROR="error";NTB_THROW="throw";NTB_DEBUG_MODE=false;NTB_ON_ERROR="";NTB_LAST_ERROR="";_ebaDebug=false;function _ntbAssert(b,a){ntbAssert(b,a,"",DEBUG)}function ebaSetOnErrorEvent(a){nitobi.debug.setOnErrorEvent.apply(this,arguments)}nitobi.debug.setOnErrorEvent=function(a){NTB_ON_ERROR=a};function ebaReportError(c,b,a){nitobi.debug.errorReport("dude stop calling this method it is now called nitobi.debug.errorReport","");nitobi.debug.errorReport(c,b,a)}function ebaErrorReport(c,b,a){nitobi.debug.errorReport.apply(this,arguments)}nitobi.debug.errorReport=function(_3e6,_3e7,_3e8){_3e8=(_3e8)?_3e8:NTB_DEBUG;if(NTB_DEBUG==_3e8&&!NTB_DEBUG_MODE){return}var _3e9=_3e6+"\nerror code    ["+_3e7+"]\nerror Severity["+_3e8+"]";LastError=_3e9;if(eval(NTB_ON_ERROR||"true")){switch(_3e7){case NTB_EM_ATTRIBUTE_ERROR:confirm(_3e6);break;case NTB_XHR_RESPONSE_ERROR:confirm(_3e6);break;default:window.status=_3e6;break}}if(NTB_THROW==_3e8){throw (_3e9)}};if(false){nitobi.error=function(){}}nitobi.lang.defineNs("nitobi.error");nitobi.error.onError=new nitobi.base.Event();if(nitobi){if(nitobi.testframework){if(nitobi.testframework.initEventError){nitobi.testframework.initEventError()}}}nitobi.error.ErrorEventArgs=function(a,c,b){nitobi.error.ErrorEventArgs.baseConstructor.call(this,a);this.description=c;this.type=b};nitobi.lang.extend(nitobi.error.ErrorEventArgs,nitobi.base.EventArgs);nitobi.error.isError=function(a,b){return(a.indexOf(b)>-1)};nitobi.error.OutOfBounds="Array index out of bounds.";nitobi.error.Unexpected="An unexpected error occurred.";nitobi.error.ArgExpected="The argument is null and not optional.";nitobi.error.BadArgType="The argument is not of the correct type.";nitobi.error.BadArg="The argument is not a valid value.";nitobi.error.XmlParseError="The XML did not parse correctly.";nitobi.error.DeclarationParseError="The HTML declaration could not be parsed.";nitobi.error.ExpectedInterfaceNotFound="The object does not support the properties or methods of the expected interface. Its class must implement the required interface.";nitobi.error.NoHtmlNode="No HTML node found with id.";nitobi.error.OrphanXmlNode="The XML node has no owner document.";nitobi.error.HttpRequestError="The HTML page could not be loaded.";nitobi.lang.defineNs("nitobi.html");nitobi.html.IRenderer=function(a){this.setTemplate(a);this.parameters={}};nitobi.html.IRenderer.prototype.renderAfter=function(c,b){c=$ntb(c);var a=c.parentNode;c=c.nextSibling;return this._renderBefore(a,c,b)};nitobi.html.IRenderer.prototype.renderBefore=function(a,b){a=$ntb(a);return this._renderBefore(a.parentNode,a,b)};nitobi.html.IRenderer.prototype._renderBefore=function(c,a,g){var f=this.renderToString(g);var h=document.createElement("div");h.innerHTML=f;var b=new Array();if(h.childNodes){var d=0;while(h.childNodes.length){b[d++]=h.firstChild;c.insertBefore(h.firstChild,a)}}else{}return b};nitobi.html.IRenderer.prototype.renderIn=function(a,c){a=$ntb(a);var b=this.renderToString(c);a.innerHTML=b;return a.childNodes};nitobi.html.IRenderer.prototype.renderToString=function(a){};nitobi.html.IRenderer.prototype.setTemplate=function(a){this.template=a};nitobi.html.IRenderer.prototype.getTemplate=function(){return this.template};nitobi.html.IRenderer.prototype.setParameters=function(a){for(var b in a){this.parameters[b]=a[b]}};nitobi.html.IRenderer.prototype.getParameters=function(){return this.parameters};nitobi.lang.defineNs("nitobi.html");nitobi.html.XslRenderer=function(a){nitobi.html.IRenderer.call(this,a)};nitobi.lang.implement(nitobi.html.XslRenderer,nitobi.html.IRenderer);nitobi.html.XslRenderer.prototype.setTemplate=function(a){if(typeof(a)==="string"){a=nitobi.xml.createXslProcessor(a)}this.template=a};nitobi.html.XslRenderer.prototype.renderToString=function(b){if(typeof(b)==="string"){b=nitobi.xml.createXmlDoc(b)}if(nitobi.lang.typeOf(b)===nitobi.lang.type.XMLNODE){b=nitobi.xml.createXmlDoc(nitobi.xml.serialize(b))}var f=this.getTemplate();var d=this.getParameters();for(var c in d){f.addParameter(c,d[c],"")}var a=nitobi.xml.transformToString(b,f,"xml");for(var c in d){f.addParameter(c,"","")}return a};nitobi.lang.defineNs("nitobi.ui");NTB_CSS_HIDE="nitobi-hide";nitobi.ui.Element=function(g){nitobi.ui.Element.baseConstructor.call(this);nitobi.ui.IStyleable.call(this);if(g!=null){if(nitobi.lang.typeOf(g)==nitobi.lang.type.XMLNODE){nitobi.base.ISerializable.call(this,g)}else{if($ntb(g)!=null){var a=new nitobi.base.Declaration();var f=a.loadHtml($ntb(g));var d=$ntb(g);var c=d.parentNode;var b=c.ownerDocument.createElement("ntb:component");c.insertBefore(b,d);c.removeChild(d);this.setContainer(b);nitobi.base.ISerializable.call(this,f)}else{nitobi.base.ISerializable.call(this);this.setId(g)}}}else{nitobi.base.ISerializable.call(this)}this.eventMap={};this.onCreated=new nitobi.base.Event("created");this.eventMap.created=this.onCreated;this.onBeforeRender=new nitobi.base.Event("beforerender");this.eventMap.beforerender=this.onBeforeRender;this.onRender=new nitobi.base.Event("render");this.eventMap.render=this.onRender;this.onBeforeSetVisible=new nitobi.base.Event("beforesetvisible");this.eventMap.beforesetvisible=this.onBeforeSetVisible;this.onSetVisible=new nitobi.base.Event("setvisible");this.eventMap.setvisible=this.onSetVisible;this.onBeforePropagate=new nitobi.base.Event("beforepropagate");this.onEventNotify=new nitobi.base.Event("eventnotify");this.onBeforeEventNotify=new nitobi.base.Event("beforeeventnotify");this.onBeforePropagateToChild=new nitobi.base.Event("beforepropogatetochild");this.subscribeDeclarationEvents();this.setEnabled(true);this.renderer=new nitobi.html.XslRenderer()};nitobi.lang.extend(nitobi.ui.Element,nitobi.Object);nitobi.lang.implement(nitobi.ui.Element,nitobi.base.ISerializable);nitobi.lang.implement(nitobi.ui.Element,nitobi.ui.IStyleable);nitobi.ui.Element.htmlNodeCache={};nitobi.ui.Element.prototype.setHtmlNode=function(b){var a=$ntb(b);this.htmlNode=a};nitobi.ui.Element.prototype.getRootId=function(){var a=this.getParentObject();if(a==null){return this.getId()}else{return a.getRootId()}};nitobi.ui.Element.prototype.getId=function(){return this.getAttribute("id")};nitobi.ui.Element.parseId=function(b){var a=b.split(".");if(a.length<=2){return{localName:a[1],id:a[0]}}return{localName:a.pop(),id:a.join(".")}};nitobi.ui.Element.prototype.setId=function(a){this.setAttribute("id",a)};nitobi.ui.Element.prototype.notify=function(h,f,c,q){try{h=nitobi.html.getEvent(h);if(q!==false){nitobi.html.cancelEvent(h)}var l=nitobi.ui.Element.parseId(f).id;if(!this.isDescendantExists(l)){return false}var k=!(l==this.getId());var j=new nitobi.ui.ElementEventArgs(this,null,f);var g=new nitobi.ui.EventNotificationEventArgs(this,null,f,h);k=k&&this.onBeforePropagate.notify(g);var d=true;if(k){if(c==null){c=this.getPathToLeaf(l)}var b=this.onBeforeEventNotify.notify(g);var a=(b?this.onEventNotify.notify(g):true);var p=c.pop().getAttribute("id");var o=this.getObjectById(p);var d=this.onBeforePropagateToChild.notify(g);if(o.notify&&d&&a){d=o.notify(h,f,c,q)}}else{d=this.onEventNotify.notify(g)}var n=this.eventMap[h.type];if(n!=null&&d){n.notify(this.getEventArgs(h,f))}return d}catch(m){nitobi.lang.throwError(nitobi.error.Unexpected+" Element.notify encountered a problem.",m)}};nitobi.ui.Element.prototype.getEventArgs=function(c,b){var a=new nitobi.ui.ElementEventArgs(this,null,b);return a};nitobi.ui.Element.prototype.subscribeDeclarationEvents=function(){for(var a in this.eventMap){var b=this.getAttribute("on"+a);if(b!=null&&b!=""){this.eventMap[a].subscribe(b,this,a)}}};nitobi.ui.Element.prototype.getHtmlNode=function(a){var c=this.getId();c=(a!=null?c+"."+a:c);var b=nitobi.ui.Element.htmlNodeCache[a];if(b==null){b=$ntb(c);nitobi.ui.Element.htmlNodeCache[c]=b}return b};nitobi.ui.Element.prototype.flushHtmlNodeCache=function(){nitobi.ui.Element.htmlNodeCache={}};nitobi.ui.Element.prototype.hide=function(c,b,a){this.setVisible(false,c,b,a)};nitobi.ui.Element.prototype.show=function(c,a,b){this.setVisible(true,c,a,b)};nitobi.ui.Element.prototype.isVisible=function(){var a=this.getHtmlNode();return a&&!nitobi.html.Css.hasClass(a,NTB_CSS_HIDE)};nitobi.ui.Element.prototype.setVisible=function(g,f,d,c){var b=this.getHtmlNode();if(b&&this.isVisible()!=g&&this.onBeforeSetVisible.notify({source:this,event:this.onBeforeSetVisible,args:arguments})!==false){if(this.effect){this.effect.end()}if(g){if(f){var a=new f(b,c);a.callback=nitobi.lang.close(this,this.handleSetVisible,[d]);this.effect=a;a.onFinish.subscribeOnce(nitobi.lang.close(this,function(){this.effect=null}));a.start()}else{nitobi.html.Css.removeClass(b,NTB_CSS_HIDE);this.handleSetVisible(d)}}else{if(f){var a=new f(b,c);a.callback=nitobi.lang.close(this,this.handleSetVisible,[d]);this.effect=a;a.onFinish.subscribeOnce(nitobi.lang.close(this,function(){this.effect=null}));a.start()}else{nitobi.html.Css.addClass(this.getHtmlNode(),NTB_CSS_HIDE);this.handleSetVisible(d)}}}};nitobi.ui.Element.prototype.handleSetVisible=function(a){if(a){a()}this.onSetVisible.notify(new nitobi.ui.ElementEventArgs(this,this.onSetVisible))};nitobi.ui.Element.prototype.setEnabled=function(a){this.enabled=a};nitobi.ui.Element.prototype.isEnabled=function(){return this.enabled};nitobi.ui.Element.prototype.render=function(b,a){this.flushHtmlNodeCache();a=a||this.getState();b=$ntb(b)||this.getContainer();if(b==null){var b=document.createElement("span");document.body.appendChild(b);this.setContainer(b)}this.htmlNode=this.renderer.renderIn(b,a)[0];this.htmlNode.jsObject=this};nitobi.ui.Element.prototype.getContainer=function(){return this.container};nitobi.ui.Element.prototype.setContainer=function(a){this.container=$ntb(a)};nitobi.ui.Element.prototype.getState=function(){return this.getXmlNode()};nitobi.lang.defineNs("nitobi.ui");nitobi.ui.ElementEventArgs=function(c,a,b){nitobi.ui.ElementEventArgs.baseConstructor.apply(this,arguments);this.targetId=b||null};nitobi.lang.extend(nitobi.ui.ElementEventArgs,nitobi.base.EventArgs);nitobi.lang.defineNs("nitobi.ui");nitobi.ui.EventNotificationEventArgs=function(b,a,d,c){nitobi.ui.EventNotificationEventArgs.baseConstructor.apply(this,arguments);this.htmlEvent=c||null};nitobi.lang.extend(nitobi.ui.EventNotificationEventArgs,nitobi.ui.ElementEventArgs);nitobi.lang.defineNs("nitobi.ui");nitobi.ui.Container=function(a){nitobi.ui.Container.baseConstructor.call(this,a);nitobi.collections.IList.call(this)};nitobi.lang.extend(nitobi.ui.Container,nitobi.ui.Element);nitobi.lang.implement(nitobi.ui.Container,nitobi.collections.IList);nitobi.base.Registry.getInstance().register(new nitobi.base.Profile("nitobi.ui.Container",null,false,"ntb:container"));nitobi.lang.defineNs("nitobi.ui");NTB_CSS_SMALL="ntb-effects-small";NTB_CSS_HIDE="nitobi-hide";if(false){nitobi.ui.Effects=function(){}}nitobi.ui.Effects={};nitobi.ui.Effects.setVisible=function(g,d,b,a,h){a=(h?nitobi.lang.close(h,a):a)||nitobi.lang.noop;g=$ntb(g);if(typeof b=="string"){b=nitobi.effects.families[b]}if(!b){b=nitobi.effects.families.none}if(d){var f=b.show}else{var f=b.hide}if(f){var c=new f(g);c.callback=a;c.start()}else{if(d){nitobi.html.Css.removeClass(g,NTB_CSS_HIDE)}else{nitobi.html.Css.addClass(g,NTB_CSS_HIDE)}a()}};nitobi.ui.Effects.shrink=function(d,c,a,b){var f=nitobi.html.getClientRects(c)[0];d.deltaHeight_Doctype=0-parseInt("0"+nitobi.html.getStyle(c,"border-top-width"))-parseInt("0"+nitobi.html.getStyle(c,"border-bottom-width"))-parseInt("0"+nitobi.html.getStyle(c,"padding-top"))-parseInt("0"+nitobi.html.getStyle(c,"padding-bottom"));d.deltaWidth_Doctype=0-parseInt("0"+nitobi.html.getStyle(c,"border-left-width"))-parseInt("0"+nitobi.html.getStyle(c,"border-right-width"))-parseInt("0"+nitobi.html.getStyle(c,"padding-left"))-parseInt("0"+nitobi.html.getStyle(c,"padding-right"));d.oldHeight=Math.abs(f.top-f.bottom)+d.deltaHeight_Doctype;d.oldWidth=Math.abs(f.right-f.left)+d.deltaWidth_Doctype;if(!(typeof(d.width)=="undefined")){d.deltaWidth=Math.floor(Math.ceil(d.width-d.oldWidth)/(a/nitobi.ui.Effects.ANIMATION_INTERVAL))}else{d.width=d.oldWidth;d.deltaWidth=0}if(!(typeof(d.height)=="undefined")){d.deltaHeight=Math.floor(Math.ceil(d.height-d.oldHeight)/(a/nitobi.ui.Effects.ANIMATION_INTERVAL))}else{d.height=d.oldHeight;d.deltaHeight=0}nitobi.ui.Effects.resize(d,c,a,b)};nitobi.ui.Effects.resize=function(l,k,h,f){var d=nitobi.html.getClientRects(k)[0];var c=Math.abs(d.top-d.bottom);var b=Math.max(c+l.deltaHeight+l.deltaHeight_Doctype,0);if(Math.abs(c-l.height)<Math.abs(l.deltaHeight)){b=l.height;l.deltaHeight=0}var a=Math.abs(d.right-d.left);var j=Math.max(a+l.deltaWidth+l.deltaWidth_Doctype,0);j=(j>=0)?j:0;if(Math.abs(a-l.width)<Math.abs(l.deltaWidth)){j=l.width;l.deltaWidth=0}h-=nitobi.ui.Effects.ANIMATION_INTERVAL;if(h>0){window.setTimeout(nitobi.lang.closeLater(this,nitobi.ui.Effects.resize,[l,k,h,f]),nitobi.ui.Effects.ANIMATION_INTERVAL)}var g=function(){k.height=b+"px";k.style.height=b+"px";k.width=j+"px";k.style.width=j+"px";if(h<=0){if(f){window.setTimeout(f,0)}}};nitobi.ui.Effects.executeNextPulse.push(g)};nitobi.ui.Effects.executeNextPulse=new Array();nitobi.ui.Effects.pulse=function(){var a;while(a=nitobi.ui.Effects.executeNextPulse.pop()){a.call()}};nitobi.ui.Effects.PULSE_INTERVAL=20;nitobi.ui.Effects.ANIMATION_INTERVAL=40;window.setInterval(nitobi.ui.Effects.pulse,nitobi.ui.Effects.PULSE_INTERVAL);window.setTimeout(nitobi.ui.Effects.pulse,nitobi.ui.Effects.PULSE_INTERVAL);nitobi.ui.Effects.fadeIntervalId={};nitobi.ui.Effects.fadeIntervalTime=10;nitobi.ui.Effects.cube=function(a){return a*a*a};nitobi.ui.Effects.cubeRoot=function(b){var a=0;var d=parseFloat(b);if(d<0){d=-d;a=1}var f=Math.sqrt(d);var c=1;while(c<101){var f=f*d;var f=Math.sqrt(Math.sqrt(f));c++}return f};nitobi.ui.Effects.linear=function(a){return a};nitobi.ui.Effects.fade=function(l,k,c,h,f){f=f||nitobi.ui.Effects.linear;var d=(new Date()).getTime()+c;var a=nitobi.component.getUniqueId();var m=(new Date()).getTime();var b=l;if(l.length){b=l[0]}var j=nitobi.html.Css.getOpacity(b);var g=(k-j<0?-1:0);nitobi.ui.Effects.fadeIntervalId[a]=window.setInterval(function(){nitobi.ui.Effects.stepFade(l,k,m,d,a,h,f,g)},nitobi.ui.Effects.fadeIntervalTime)};nitobi.ui.Effects.stepFade=function(j,h,g,f,c,d,b,a){var l=(new Date()).getTime();var n=f-g;var k=((l-g)/(f-g));if(k<=0||k>=1){nitobi.html.Css.setOpacities(j,h);window.clearInterval(nitobi.ui.Effects.fadeIntervalId[c]);d();return}else{k=Math.abs(k+a)}var m=b(k);nitobi.html.Css.setOpacities(j,m*100)};nitobi.lang.defineNs("nitobi.component");if(false){nitobi.component=function(){}}nitobi.loadComponent=function(b){var d=b;b=$ntb(b);if(b==null){nitobi.lang.throwError("nitobi.loadComponent could not load the component because it could not be found on the page. The component may not have a declaration, node, or it may have a duplicated id. Id: "+d)}if(b.jsObject!=null){return b.jsObject}var a;var c=nitobi.html.getTagName(b);if(c=="ntb:grid"){a=nitobi.initGrid(b.id)}else{if(c==="ntb:combo"){a=nitobi.initCombo(b.id)}else{if(c=="ntb:treegrid"){a=nitobi.initTreeGrid(b.id)}else{if(b.jsObject==null){a=nitobi.base.Factory.getInstance().createByTag(c,b.id,nitobi.component.renderComponent);if(a.render&&!a.onLoadCallback){a.render()}}else{a=b.jsObject}}}}return a};nitobi.component.renderComponent=function(a){a.source.render()};nitobi.getComponent=function(b){var a=$ntb(b);if(a==null){return null}return a.jsObject};nitobi.component.uniqueId=0;nitobi.component.getUniqueId=function(){return"ntbcmp_"+(nitobi.component.uniqueId++)};nitobi.getComponents=function(d,c){if(c==null){c=[]}if(nitobi.component.isNitobiElement(d)){c.push(d);return}var b=d.childNodes;for(var a=0;a<b.length;a++){nitobi.getComponents(b[a],c)}return c};nitobi.component.isNitobiElement=function(b){var a=nitobi.html.getTagName(b);if(a.substr(0,3)=="ntb"){return true}else{return false}};nitobi.component.loadComponentsFromNode=function(b){var a=new Array();nitobi.getComponents(b,a);for(var c=0;c<a.length;c++){nitobi.loadComponent(a[c].getAttribute("id"))}};nitobi.lang.defineNs("nitobi.effects");if(false){nitobi.effects=function(){}}nitobi.effects.Effect=function(b,a){this.element=$ntb(b);this.transition=a.transition||nitobi.effects.Transition.sinoidal;this.duration=a.duration||1;this.fps=a.fps||50;this.from=typeof(a.from)==="number"?a.from:0;this.to=typeof(a.from)==="number"?a.to:1;this.delay=a.delay||0;this.callback=typeof(a.callback)==="function"?a.callback:nitobi.lang.noop;this.queue=a.queue||nitobi.effects.EffectQueue.globalQueue;this.onBeforeFinish=new nitobi.base.Event();this.onFinish=new nitobi.base.Event();this.onBeforeStart=new nitobi.base.Event()};nitobi.effects.Effect.prototype.start=function(){var a=new Date().getTime();this.startOn=a+this.delay*1000;this.finishOn=this.startOn+this.duration*1000;this.deltaTime=this.duration*1000;this.totalFrames=this.duration*this.fps;this.frame=0;this.delta=this.from-this.to;this.queue.add(this)};nitobi.effects.Effect.prototype.render=function(a){if(!this.running){this.onBeforeStart.notify(new nitobi.base.EventArgs(this,this.onBeforeStart));this.setup();this.running=true}this.update(this.transition(a*this.delta+this.from))};nitobi.effects.Effect.prototype.step=function(b){if(this.startOn<=b){if(b>=this.finishOn){this.end();return}var c=(b-this.startOn)/(this.deltaTime);var a=Math.floor(c*this.totalFrames);if(this.frame<a){this.render(c);this.frame=a}}};nitobi.effects.Effect.prototype.setup=function(){};nitobi.effects.Effect.prototype.update=function(a){};nitobi.effects.Effect.prototype.finish=function(){};nitobi.effects.Effect.prototype.end=function(){this.onBeforeFinish.notify(new nitobi.base.EventArgs(this,this.onBeforeFinish));this.cancel();this.render(1);this.running=false;this.finish();this.callback();this.onFinish.notify(new nitobi.base.EventArgs(this,this.onAfterFinish))};nitobi.effects.Effect.prototype.cancel=function(){this.queue.remove(this)};nitobi.effects.factory=function(d,c,b){var a=nitobi.lang.toArray(arguments,2);return function(g){var h=function(){d.apply(this,[g,c].concat(a))};nitobi.lang.extend(h,d);return new h()}};nitobi.effects.families={none:{show:null,hide:null}};nitobi.lang.defineNs("nitobi.effects");if(false){nitobi.effects.Transition=function(){}}nitobi.effects.Transition={};nitobi.effects.Transition.sinoidal=function(a){return(-Math.cos(a*Math.PI)/2)+0.5};nitobi.effects.Transition.linear=function(a){return a};nitobi.effects.Transition.reverse=function(a){return 1-a};nitobi.lang.defineNs("nitobi.effects");nitobi.effects.Scale=function(c,b,a){nitobi.effects.Scale.baseConstructor.call(this,c,b);this.scaleX=typeof(b.scaleX)=="boolean"?b.scaleX:true;this.scaleY=typeof(b.scaleY)=="boolean"?b.scaleY:true;this.scaleFrom=typeof(b.scaleFrom)=="number"?b.scaleFrom:100;this.scaleTo=a};nitobi.lang.extend(nitobi.effects.Scale,nitobi.effects.Effect);nitobi.effects.Scale.prototype.setup=function(){var b=this.element.style;var a=nitobi.html.Css;this.originalStyle={top:b.top,left:b.left,width:b.width,height:b.height,overflow:a.getStyle(this.element,"overflow")};this.factor=(this.scaleTo-this.scaleFrom)/100;this.dims=[this.element.scrollWidth,this.element.scrollHeight];b.width=this.dims[0]+"px";b.height=this.dims[1]+"px";a.setStyle(this.element,"overflow","hidden")};nitobi.effects.Scale.prototype.finish=function(){for(var a in this.originalStyle){this.element.style[a]=this.originalStyle[a]}};nitobi.effects.Scale.prototype.update=function(b){var a=(this.scaleFrom/100)+(this.factor*b);this.setDimensions(Math.floor(a*this.dims[0])||1,Math.floor(a*this.dims[1])||1)};nitobi.effects.Scale.prototype.setDimensions=function(a,b){if(this.scaleX){this.element.style.width=a+"px"}if(this.scaleY){this.element.style.height=b+"px"}};nitobi.lang.defineNs("nitobi.effects");nitobi.effects.EffectQueue=function(){nitobi.effects.EffectQueue.baseConstructor.call(this);nitobi.collections.IEnumerable.call(this);this.intervalId=0};nitobi.lang.extend(nitobi.effects.EffectQueue,nitobi.Object);nitobi.lang.implement(nitobi.effects.EffectQueue,nitobi.collections.IEnumerable);nitobi.effects.EffectQueue.prototype.add=function(a){nitobi.collections.IEnumerable.prototype.add.call(this,a);if(!this.intervalId){this.intervalId=window.setInterval(nitobi.lang.close(this,this.step),15)}};nitobi.effects.EffectQueue.prototype.step=function(){var a=new Date().getTime();this.each(function(b){b.step(a)})};nitobi.effects.EffectQueue.globalQueue=new nitobi.effects.EffectQueue();nitobi.lang.defineNs("nitobi.effects");nitobi.effects.BlindUp=function(a,b){b=nitobi.lang.merge({scaleX:false,duration:Math.min(0.2*(a.scrollHeight/100),0.5)},b||{});nitobi.effects.BlindUp.baseConstructor.call(this,a,b,0)};nitobi.lang.extend(nitobi.effects.BlindUp,nitobi.effects.Scale);nitobi.effects.BlindUp.prototype.setup=function(){nitobi.effects.BlindUp.base.setup.call(this)};nitobi.effects.BlindUp.prototype.finish=function(){nitobi.html.Css.addClass(this.element,NTB_CSS_HIDE);nitobi.effects.BlindUp.base.finish.call(this);this.element.style.height=""};nitobi.effects.BlindDown=function(b,a){nitobi.html.Css.swapClass(b,NTB_CSS_HIDE,NTB_CSS_SMALL);a=nitobi.lang.merge({scaleX:false,scaleFrom:0,duration:Math.min(0.2*(b.scrollHeight/100),0.5)},a||{});nitobi.effects.BlindDown.baseConstructor.call(this,b,a,100)};nitobi.lang.extend(nitobi.effects.BlindDown,nitobi.effects.Scale);nitobi.effects.BlindDown.prototype.setup=function(){nitobi.effects.BlindDown.base.setup.call(this);this.element.style.height="1px";nitobi.html.Css.removeClass(this.element,NTB_CSS_SMALL)};nitobi.effects.BlindDown.prototype.finish=function(){nitobi.effects.BlindDown.base.finish.call(this);this.element.style.height=""};nitobi.effects.families.blind={show:nitobi.effects.BlindDown,hide:nitobi.effects.BlindUp};nitobi.lang.defineNs("nitobi.effects");nitobi.effects.ShadeUp=function(b,a){a=nitobi.lang.merge({scaleX:false,duration:Math.min(0.2*(b.scrollHeight/100),0.3)},a||{});nitobi.effects.ShadeUp.baseConstructor.call(this,b,a,0)};nitobi.lang.extend(nitobi.effects.ShadeUp,nitobi.effects.Scale);nitobi.effects.ShadeUp.prototype.setup=function(){nitobi.effects.ShadeUp.base.setup.call(this);var a=nitobi.html.getFirstChild(this.element);this.originalStyle.position=this.element.style.position;nitobi.html.position(this.element);if(a){var b=a.style;this.fnodeStyle={position:b.position,bottom:b.bottom,left:b.left};this.fnode=a;b.position="absolute";b.bottom="0px";b.left="0px";b.top=""}};nitobi.effects.ShadeUp.prototype.finish=function(){nitobi.effects.ShadeUp.base.finish.call(this);nitobi.html.Css.addClass(this.element,NTB_CSS_HIDE);this.element.style.height="";this.element.style.position=this.originalStyle.position;this.element.style.overflow=this.originalStyle.overflow;for(var a in this.fnodeStyle){this.fnode.style[a]=this.fnodeStyle[a]}};nitobi.effects.ShadeDown=function(b,a){nitobi.html.Css.swapClass(b,NTB_CSS_HIDE,NTB_CSS_SMALL);a=nitobi.lang.merge({scaleX:false,scaleFrom:0,duration:Math.min(0.2*(b.scrollHeight/100),0.3)},a||{});nitobi.effects.ShadeDown.baseConstructor.call(this,b,a,100)};nitobi.lang.extend(nitobi.effects.ShadeDown,nitobi.effects.Scale);nitobi.effects.ShadeDown.prototype.setup=function(){nitobi.effects.ShadeDown.base.setup.call(this);this.element.style.height="1px";nitobi.html.Css.removeClass(this.element,NTB_CSS_SMALL);var b=nitobi.html.getFirstChild(this.element);this.originalStyle.position=this.element.style.position;nitobi.html.position(this.element);if(b){var a=b.style;this.fnodeStyle={position:a.position,bottom:a.bottom,left:a.left,right:a.right,top:a.top};this.fnode=b;a.position="absolute";a.top="";a.right="";a.bottom="0px";a.left="0px"}};nitobi.effects.ShadeDown.prototype.finish=function(){nitobi.effects.ShadeDown.base.finish.call(this);this.element.style.height="";this.element.style.position=this.originalStyle.position;this.element.style.overflow=this.originalStyle.overflow;for(var a in this.fnodeStyle){this.fnode.style[a]=this.fnodeStyle[a]}this.fnode.style.top="0px";this.fnode.style.left="0px";this.fnode.style.bottom="";this.fnode.style.right="";return;this.fnode.style.position=""};nitobi.effects.families.shade={show:nitobi.effects.ShadeDown,hide:nitobi.effects.ShadeUp};nitobi.lang.defineNs("nitobi.lang");nitobi.lang.StringBuilder=function(a){if(a){if(typeof(a)==="string"){this.strings=[a]}else{this.strings=a}}else{this.strings=new Array()}};nitobi.lang.StringBuilder.prototype.append=function(a){if(a){this.strings.push(a)}return this};nitobi.lang.StringBuilder.prototype.clear=function(){this.strings.length=0};nitobi.lang.StringBuilder.prototype.toString=function(){return this.strings.join("")};var temp_ntb_uniqueIdGeneratorProc='<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ntb="http://www.nitobi.com"> <xsl:output method="xml" /> <x:p-x:n-guid"x:s-0"/><x:t- match="/"> <x:at-/></x:t-><x:t- match="node()|@*"> <xsl:copy> <xsl:if test="not(@id)"> <x:a-x:n-id" ><x:v-x:s-generate-id(.)"/><x:v-x:s-position()"/><x:v-x:s-$guid"/></x:a-> </xsl:if> <x:at-x:s-./* | text() | @*"> </x:at-> </xsl:copy></x:t-> <x:t- match="text()"> <x:v-x:s-."/></x:t-></xsl:stylesheet>';nitobi.lang.defineNs("nitobi.base");nitobi.base.uniqueIdGeneratorProc=nitobi.xml.createXslProcessor(nitobiXmlDecodeXslt(temp_ntb_uniqueIdGeneratorProc));