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(_6,_7){
function inheritance(){
}
inheritance.prototype=_7.prototype;
_6.prototype=new inheritance();
_6.prototype.constructor=_6;
_6.baseConstructor=_7;
if(_7.base){
_7.prototype.base=_7.base;
}
_6.base=_7.prototype;
};
nitobi.lang.implement=function(_8,_9){
if(typeof (_9)=="undefined"||_9==null){
var _a="nitobi.lang.implement argument interface_ is null or undefined.  The most likely cause of this is that a js file has not been included, or has been included in the wrong order.";
nitobi.lang.throwError(_a);
}
for(var _b in _9.prototype){
if(typeof (_8.prototype[_b])=="undefined"||_8.prototype[_b]==null){
_8.prototype[_b]=_9.prototype[_b];
}
}
};
nitobi.lang.isDefined=function(a){
return (typeof (a)!="undefined");
};
nitobi.lang.getBool=function(a){
if(null==a){
return null;
}
if(typeof (a)=="boolean"){
return a;
}
return a.toLowerCase()=="true";
};
nitobi.lang.type={XMLNODE:0,HTMLNODE:1,ARRAY:2,XMLDOC:3};
nitobi.lang.typeOf=function(_e){
var t=typeof (_e);
if(t=="object"){
if(_e.blur){
return nitobi.lang.type.HTMLNODE;
}
if(_e.nodeName&&_e.nodeName.toLowerCase()==="#document"){
return nitobi.lang.type.XMLDOC;
}
if(_e.nodeName){
return nitobi.lang.type.XMLNODE;
}
if(_e instanceof Array){
return nitobi.lang.type.ARRAY;
}
}
return t;
};
nitobi.lang.toBool=function(_10,_11){
if(typeof (_11)!="undefined"){
if((typeof (_10)=="undefined")||(_10=="")||(_10==null)){
_10=_11;
}
}
_10=_10.toString()||"";
_10=_10.toUpperCase();
if((_10=="Y")||(_10=="1")||(_10=="TRUE")){
return true;
}else{
return false;
}
};
nitobi.lang.boolToStr=function(_12){
if(typeof (_12)=="boolean"){
if(_12){
return "1";
}else{
return "0";
}
}else{
return _12;
}
};
nitobi.lang.close=function(_13,_14,_15){
if(null==_15){
return function(){
return _14.apply(_13,arguments);
};
}else{
return function(){
return _14.apply(_13,_15);
};
}
};
nitobi.lang.after=function(_16,_17,_18,_19){
var _1a=_16[_17];
var _1b=_18[_19];
if(_19 instanceof Function){
_1b=_19;
}
_16[_17]=function(){
_1a.apply(_16,arguments);
_1b.apply(_18,arguments);
};
_16[_17].orig=_1a;
};
nitobi.lang.before=function(_1c,_1d,_1e,_1f){
var _20=_1c[_1d];
var _21=function(){
};
if(_1e!=null){
_21=_1e[_1f];
}
if(_1f instanceof Function){
_21=_1f;
}
_1c[_1d]=function(){
_21.apply(_1e,arguments);
_20.apply(_1c,arguments);
};
_1c[_1d].orig=_20;
};
nitobi.lang.forEach=function(arr,_23){
var len=arr.length;
for(var i=0;i<len;i++){
_23.call(this,arr[i],i);
}
_23=null;
};
nitobi.lang.throwError=function(_26,_27){
var msg=_26;
if(_27!=null){
msg+="\n - because "+nitobi.lang.getErrorDescription(_27);
}
throw msg;
};
nitobi.lang.getErrorDescription=function(_29){
var _2a=(typeof (_29.description)=="undefined")?_29:_29.description;
return _2a;
};
nitobi.lang.newObject=function(_2b,_2c,_2d){
var a=_2c;
if(null==_2d){
_2d=0;
}
var e="new "+_2b+"(";
var _30="";
for(var i=_2d;i<a.length;i++){
e+=_30+"a["+i+"]";
_30=",";
}
e+=")";
return eval(e);
};
nitobi.lang.getLastFunctionArgs=function(_32,_33){
var a=new Array(_32.length-_33);
for(var i=_33;i<_32.length;i++){
a[i-_33]=_32[i];
}
return a;
};
nitobi.lang.getFirstHashKey=function(_36){
for(var x in _36){
return x;
}
};
nitobi.lang.getFirstFunction=function(obj){
for(var x in obj){
if(obj[x]!=null&&typeof (obj[x])=="function"&&typeof (obj[x].prototype)!="undefined"){
return {name:x,value:obj[x]};
}
}
return null;
};
nitobi.lang.copy=function(obj){
var _3b={};
for(var _3c in obj){
_3b[_3c]=obj[_3c];
}
return _3b;
};
nitobi.lang.dispose=function(_3d,_3e){
try{
if(_3e!=null){
var _3f=_3e.length;
for(var i=0;i<_3f;i++){
if(typeof (_3e[i].dispose)=="function"){
_3e[i].dispose();
}
if(typeof (_3e[i])=="function"){
_3e[i].call(_3d);
}
_3e[i]=null;
}
}
for(var _41 in _3d){
if(_3d[_41].dispose instanceof Function){
_3d[_41].dispose();
}
_3d[_41]=null;
}
}
catch(e){
}
};
nitobi.lang.parseNumber=function(val){
var num=parseInt(val);
return (isNaN(num)?0:num);
};
nitobi.lang.numToAlpha=function(num){
if(typeof (nitobi.lang.numAlphaCache[num])==="string"){
return nitobi.lang.numAlphaCache[num];
}
var ck1=num%26;
var ck2=Math.floor(num/26);
var _47=(ck2>0?String.fromCharCode(96+ck2):"")+String.fromCharCode(97+ck1);
nitobi.lang.alphaNumCache[_47]=num;
nitobi.lang.numAlphaCache[num]=_47;
return _47;
};
nitobi.lang.alphaToNum=function(_48){
if(typeof (nitobi.lang.alphaNumCache[_48])==="number"){
return nitobi.lang.alphaNumCache[_48];
}
var j=0;
var num=0;
for(var i=_48.length-1;i>=0;i--){
num+=(_48.charCodeAt(i)-96)*Math.pow(26,j++);
}
num=num-1;
nitobi.lang.alphaNumCache[_48]=num;
nitobi.lang.numAlphaCache[num]=_48;
return num;
};
nitobi.lang.alphaNumCache={};
nitobi.lang.numAlphaCache={};
nitobi.lang.toArray=function(obj,_4d){
return Array.prototype.splice.call(obj,_4d||0);
};
nitobi.lang.merge=function(_4e,_4f){
var r={};
for(var i=0;i<arguments.length;i++){
var a=arguments[i];
for(var x in arguments[i]){
r[x]=a[x];
}
}
return r;
};
nitobi.lang.xor=function(){
var b=false;
for(var j=0;j<arguments.length;j++){
if(arguments[j]&&!b){
b=true;
}else{
if(arguments[j]&&b){
return false;
}
}
}
return b;
};
nitobi.lang.zeros="00000000000000000000000000000000000000000000000000000000000000000000";
nitobi.lang.padZeros=function(num,_57){
_57=_57||2;
num=num+"";
return nitobi.lang.zeros.substr(0,Math.max(_57-num.length,0))+num;
};
nitobi.lang.noop=function(){
};
nitobi.lang.defineNs("nitobi.lang");
nitobi.lang.Math=function(){
};
nitobi.lang.Math.sinTable=Array();
nitobi.lang.Math.cosTable=Array();
nitobi.lang.Math.rotateCoords=function(_58,_59,_5a){
var _5b=_5a*0.01745329277777778;
if(nitobi.lang.Math.sinTable[_5b]==null){
nitobi.lang.Math.sinTable[_5b]=Math.sin(_5b);
nitobi.lang.Math.cosTable[_5b]=Math.cos(_5b);
}
var cR=nitobi.lang.Math.cosTable[_5b];
var sR=nitobi.lang.Math.sinTable[_5b];
var x=_58*cR-_59*sR;
var y=_59*cR+_58*sR;
return {x:x,y:y};
};
nitobi.lang.Math.returnAngle=function(_60,_61,_62,_63){
return Math.atan2(_63-_61,_62-_60)/0.01745329277777778;
};
nitobi.lang.Math.returnDistance=function(x1,y1,x2,y2){
return Math.sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1)));
};
nitobi.lang.defineNs("nitobi.toolkit");
nitobi.toolkit.build="6342";
nitobi.toolkit.version="1.0.6342";
nitobi.lang.defineNs("nitobi");
nitobi.Object=function(){
this.disposal=new Array();
};
nitobi.Object.prototype.setValues=function(_68){
for(var _69 in _68){
if(this[_69]!=null){
if(this[_69].subscribe!=null){
}else{
this[_69]=_68[_69];
}
}else{
if(this[_69] instanceof Function){
this[_69](_68[_69]);
}else{
if(this["set"+_69] instanceof Function){
this["set"+_69](_68[_69]);
}else{
this[_69]=_68[_69];
}
}
}
}
};
nitobi.Object.prototype.dispose=function(){
if(this.disposing){
return;
}
this.disposing=true;
var _6a=this.disposal.length;
for(var i=0;i<_6a;i++){
if(disposal[i] instanceof Function){
disposal[i].call(context);
}
disposal[i]=null;
}
for(var _6c in this){
if(this[_6c].dispose instanceof Function){
this[_6c].dispose.call(this[_6c]);
}
this[_6c]=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.MOZ=false;
nitobi.browser.SAFARI=false;
nitobi.browser.OPERA=false;
nitobi.browser.XHR_ENABLED;
nitobi.browser.detect=function(){
var _6d=[{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 _6e="Unknown";
for(var i=0;i<_6d.length;i++){
var _70=_6d[i].string;
var _71=_6d[i].prop;
if(_70){
if(_70.indexOf(_6d[i].subString)!=-1){
_6e=_6d[i].identity;
break;
}
}else{
if(_71){
_6e=_6d[i].identity;
break;
}
}
}
nitobi.browser.IE=(_6e=="Explorer");
nitobi.browser.IE6=(nitobi.browser.IE&&!window.XMLHttpRequest);
nitobi.browser.IE7=(nitobi.browser.IE&&window.XMLHttpRequest);
nitobi.browser.MOZ=(_6e=="Netscape"||_6e=="Firefox"||_6e=="Camino");
nitobi.browser.SAFARI=(_6e=="Safari");
nitobi.browser.OPERA=(_6e=="Opera");
nitobi.browser.XHR_ENABLED=nitobi.browser.OPERA||nitobi.browser.SAFARI||nitobi.browser.MOZ||nitobi.browser.IE;
nitobi.browser.UNKNOWN=!(nitobi.browser.IE||nitobi.browser.MOZ||nitobi.browser.SAFARI);
};
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(id){
var _73,end;
if(document.cookie.length>0){
_73=document.cookie.indexOf(id+"=");
if(_73!=-1){
_73+=id.length+1;
end=document.cookie.indexOf(";",_73);
if(end==-1){
end=document.cookie.length;
}
return unescape(document.cookie.substring(_73,end));
}
}
return null;
};
nitobi.browser.Cookies.set=function(id,_76,_77){
var _78=new Date();
_78.setTime(_78.getTime()+(_77*24*3600*1000));
document.cookie=id+"="+escape(_76)+((_77==null)?"":"; expires="+_78.toGMTString());
};
nitobi.browser.Cookies.remove=function(id){
if(nitobi.browser.Cookies.get(id)){
document.cookie=id+"="+"; 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(this.iframeObject);
this.iframe=frames["ntb_history"];
this.monitor();
};
nitobi.browser.History.prototype.add=function(_7a){
this.lastPage=this.currentPage=_7a.substr(_7a.indexOf("#")+1);
this.iframe.location.href=_7a;
};
nitobi.browser.History.prototype.monitor=function(){
var _7b=this.iframe.location.href.split("#");
this.currentPage=_7b[1];
if(this.currentPage!=this.lastPage){
this.onChange.notify(_7b[0].substring(_7b[0].lastIndexOf("/")+1),this.currentPage);
this.lastPage=this.currentPage;
}
window.setTimeout(nitobi.lang.close(this,this.monitor),100);
};
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(nitobi.browser.MOZ){
nitobi.xml.Serializer=new XMLSerializer();
nitobi.xml.DOMParser=new DOMParser();
}
if(!nitobi.browser.IE&&!nitobi.browser.MOZ){
}
nitobi.xml.getChildNodes=function(_7c){
if(nitobi.browser.IE){
return _7c.childNodes;
}else{
return _7c.selectNodes("./*");
}
};
nitobi.xml.indexOfChildNode=function(_7d,_7e){
var _7f=nitobi.xml.getChildNodes(_7d);
for(var i=0;i<_7f.length;i++){
if(_7f[i]==_7e){
return i;
}
}
return -1;
};
nitobi.xml.createXmlDoc=function(xml){
if(xml!=null){
xml=xml.substring(xml.indexOf("<?xml"));
}
if(xml!=null&&xml.documentElement!=null){
return xml;
}
var doc=null;
if(nitobi.browser.IE){
doc=new ActiveXObject("Msxml2.DOMDocument.3.0");
doc.setProperty("SelectionNamespaces","xmlns:ntb='http://www.nitobi.com'");
}else{
if(nitobi.browser.MOZ){
doc=document.implementation.createDocument("","",null);
}
}
if(xml!=null&&typeof xml=="string"){
doc=nitobi.xml.loadXml(doc,xml);
}
return doc;
};
nitobi.xml.loadXml=function(doc,xml,_85){
doc.async=false;
if(nitobi.browser.IE){
doc.loadXML(xml);
}else{
var _86=nitobi.xml.DOMParser.parseFromString(xml,"text/xml");
if(_85){
while(doc.hasChildNodes()){
doc.removeChild(doc.firstChild);
}
for(var i=0;i<_86.childNodes.length;i++){
doc.appendChild(doc.importNode(_86.childNodes[i],true));
}
}else{
doc=_86;
}
_86=null;
}
return doc;
};
nitobi.xml.hasParseError=function(_88){
if(nitobi.browser.IE){
return (_88.parseError!=0);
}else{
if(_88==null||_88.documentElement==null){
return true;
}
var _89=_88.documentElement;
if((_89.tagName=="parserError")||(_89.namespaceURI=="http://www.mozilla.org/newlayout/xml/parsererror.xml")){
return true;
}
return false;
}
};
nitobi.xml.getParseErrorReason=function(_8a){
if(!nitobi.xml.hasParseError(_8a)){
return "";
}
if(nitobi.browser.IE){
return (_8a.parseError.reason);
}else{
return (new XMLSerializer().serializeToString(_8a));
}
};
nitobi.xml.createXslDoc=function(xsl){
var doc=null;
if(nitobi.browser.IE){
doc=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0");
}else{
if(nitobi.browser.MOZ){
doc=nitobi.xml.createXmlDoc();
}
}
doc=nitobi.xml.loadXml(doc,xsl||"<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:ntb=\"http://www.nitobi.com\" />");
return doc;
};
nitobi.xml.createXslProcessor=function(xsl){
var _8e=null;
var xt=null;
if(typeof (xsl)!="string"){
xsl=nitobi.xml.serialize(xsl);
}
if(nitobi.browser.IE){
_8e=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0");
xt=new ActiveXObject("MSXML2.XSLTemplate.3.0");
_8e.async=false;
_8e.loadXML(xsl);
xt.stylesheet=_8e;
return xt.createProcessor();
}else{
_8e=nitobi.xml.createXmlDoc(xsl);
xt=new XSLTProcessor();
xt.importStylesheet(_8e);
xt.stylesheet=_8e;
return xt;
}
};
nitobi.xml.parseHtml=function(_90){
if(typeof (_90)=="string"){
_90=document.getElementById(_90);
}
var _91=nitobi.html.getOuterHtml(_90);
var _92="";
if(nitobi.browser.IE){
var _93=new RegExp("(\\s+.[^=]*)='(.*?)'","g");
_91=_91.replace(_93,function(m,_1,_2){
return _1+"=\""+_2.replace(/"/g,"&quot;")+"\"";
});
_92=(_91.substring(_91.indexOf("/>")+2).replace(/(\s+.[^\=]*)\=\s*([^\"^\s^\>]+)/g,"$1=\"$2\" ")).replace(/\n/gi,"").replace(/(.*?:.*?\s)/i,"$1  ");
var _97=new RegExp("=\"([^\"]*)(<)(.*?)\"","gi");
var _98=new RegExp("=\"([^\"]*)(>)(.*?)\"","gi");
while(true){
_92=_92.replace(_97,"=\"$1&lt;$3\" ");
_92=_92.replace(_98,"=\"$1&gt;$3\" ");
var x=(_97.test(_92));
if(!_97.test(_92)){
break;
}
}
}else{
if(nitobi.browser.MOZ){
_92=_91.replace(/(\s+.[^\=]*)\=\s*([^\"^\s^\>]+)/g,"$1=\"$2\" ").replace(/\n/gi,"").replace(/\>\s*\</gi,"><").replace(/(.*?:.*?\s)/i,"$1  ");
_92=_92.replace(/\&/g,"&amp;");
_92=_92.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(_92.indexOf("xmlns:ntb=\"http://www.nitobi.com\"")<1){
_92=_92.replace(/\<(.*?)(\s|\>|\\)/,"<$1 xmlns:ntb=\"http://www.nitobi.com\"$2");
}
_92=_92.replace(/\&nbsp\;/gi," ");
return nitobi.xml.createXmlDoc(_92);
};
nitobi.xml.transform=function(xml,xsl,_9c){
if(xsl.documentElement){
xsl=nitobi.xml.createXslProcessor(xsl);
}
if(nitobi.browser.IE){
xsl.input=xml;
xsl.transform();
return xsl.output;
}else{
var doc=xsl.transformToDocument(xml);
var _9e=doc.documentElement;
if(_9e&&_9e.nodeName.indexOf("ntb:")==0){
_9e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:ntb","http://www.nitobi.com");
}
return doc;
}
};
nitobi.xml.transformToString=function(xml,xsl,_a1){
var _a2=nitobi.xml.transform(xml,xsl,"text");
if(nitobi.browser.MOZ){
if(_a1=="xml"){
_a2=nitobi.xml.Serializer.serializeToString(_a2);
}else{
if(_a2.documentElement.childNodes[0]==null){
nitobi.lang.throwError("The transformToString fn could not find any valid output");
}
if(_a2.documentElement.childNodes[0].data!=null){
_a2=_a2.documentElement.childNodes[0].data;
}else{
if(_a2.documentElement.childNodes[0].textContent!=null){
_a2=_a2.documentElement.childNodes[0].textContent;
}else{
nitobi.lang.throwError("The transformToString fn could not find any valid output");
}
}
}
}
return _a2;
};
nitobi.xml.transformToXml=function(xml,xsl){
var _a5=nitobi.xml.transform(xml,xsl,"xml");
if(nitobi.browser.IE){
_a5=nitobi.xml.createXmlDoc(_a5);
}else{
if(nitobi.browser.MOZ){
if(_a5.documentElement.nodeName=="transformiix:result"){
_a5=nitobi.xml.createXmlDoc(_a5.documentElement.firstChild.data);
}
}
}
return _a5;
};
nitobi.xml.serialize=function(xml){
if(nitobi.browser.IE){
return xml.xml;
}else{
return (new XMLSerializer()).serializeToString(xml);
}
};
nitobi.xml.createXmlHttp=function(){
if(nitobi.browser.IE){
var _a7=null;
try{
_a7=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_a7=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(ee){
}
}
return _a7;
}else{
if(nitobi.browser.MOZ){
return new XMLHttpRequest();
}
}
};
nitobi.xml.createElement=function(_a8,_a9,ns){
ns=ns||"http://www.nitobi.com";
var _ab=null;
if(nitobi.browser.IE){
_ab=_a8.createNode(1,nitobi.xml.nsPrefix+_a9,ns);
}else{
if(_a8.createElementNS){
_ab=_a8.createElementNS(ns,nitobi.xml.nsPrefix+_a9);
}
}
return _ab;
};
function nitobiXmlDecodeXslt(xsl){
return xsl.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.MOZ){
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;
});
XSLTProcessor.prototype.addParameter=function(_ad,_ae,_af){
if(_ae==null){
this.removeParameter(_af,_ad);
}else{
this.setParameter(_af,_ad,_ae);
}
};
XMLDocument.prototype.selectNodes=function(_b0,_b1){
try{
if(this.nsResolver==null){
this.nsResolver=this.createNSResolver(this.documentElement);
}
var _b2=this.evaluate(_b0,(_b1?_b1:this),this.nsResolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
var _b3=new Array(_b2.snapshotLength);
_b3.expr=_b0;
var j=0;
for(i=0;i<_b2.snapshotLength;i++){
var _b5=_b2.snapshotItem(i);
if(_b5.nodeType!=3){
_b3[j++]=_b5;
}
}
return _b3;
}
catch(e){
}
};
XMLDocument.prototype.selectSingleNode=function(_b6,_b7){
var _b8=_b6.match(/\[\d+\]/ig);
if(_b8!=null){
var x=_b8[_b8.length-1];
if(_b6.lastIndexOf(x)+x.length!=_b6.length){
_b6+="[1]";
}
}
var _ba=this.selectNodes(_b6,_b7||null);
return ((_ba!=null&&_ba.length>0)?_ba[0]:null);
};
Element.prototype.selectNodes=function(_bb){
var doc=this.ownerDocument;
return doc.selectNodes(_bb,this);
};
Element.prototype.selectSingleNode=function(_bd){
var doc=this.ownerDocument;
return doc.selectSingleNode(_bd,this);
};
}
nitobi.xml.getLocalName=function(_bf){
var _c0=_bf.indexOf(":");
if(_c0==-1){
return _bf;
}else{
return _bf.substr(_c0+1);
}
};
nitobi.xml.encode=function(str){
str+="";
str=str.replace(/&/g,"&amp;");
str=str.replace(/'/g,"&apos;");
str=str.replace(/\"/g,"&quot;");
str=str.replace(/</g,"&lt;");
str=str.replace(/>/g,"&gt;");
str=str.replace(/\n/g,"&#xa;");
return str;
};
nitobi.xml.constructValidXpathQuery=function(_c2,_c3){
var _c4=_c2.match(/(\"|\')/g);
if(_c4!=null){
var _c5="concat(";
var _c6="";
var _c7;
for(var i=0;i<_c2.length;i++){
if(_c2.substr(i,1)=="\""){
_c7="&apos;";
}else{
_c7="&quot;";
}
_c5+=_c6+_c7+nitobi.xml.encode(_c2.substr(i,1))+_c7;
_c6=",";
}
_c5+=_c6+"&apos;&apos;";
_c5+=")";
_c2=_c5;
}else{
var _c9=(_c3?"\"":"");
_c2=_c9+nitobi.xml.encode(_c2)+_c9;
}
return _c2;
};
nitobi.xml.removeChildren=function(_ca){
var _cb=nitobi.xml.getChildNodes(_ca);
for(var i=0,len=_cb.length;i<len;i++){
_ca.removeChild(_cb[i]);
}
};
nitobi.lang.defineNs("nitobi.html");
nitobi.html.Url=function(){
};
nitobi.html.Url.setParameter=function(url,key,_d0){
var reg=new RegExp("(\\?|&)("+encodeURIComponent(key)+")=(.*?)(&|$)");
if(url.match(reg)){
return url.replace(reg,"$1$2="+encodeURIComponent(_d0)+"$4");
}
if(url.match(/\?/)){
url=url+"&";
}else{
url=url+"?";
}
return url+encodeURIComponent(key)+"="+encodeURIComponent(_d0);
};
nitobi.html.Url.removeParameter=function(url,key){
var reg=new RegExp("(\\?|&)("+encodeURIComponent(key)+")=(.*?)(&|$)");
return url.replace(reg,function(str,p1,p2,p3,p4,_da,s){
if(((p1)=="?")&&(p4!="&")){
return "";
}else{
return p1;
}
});
};
nitobi.html.Url.normalize=function(url,_dd){
if(_dd){
if(_dd.indexOf("http://")==0||_dd.indexOf("https://")==0||_dd.indexOf("/")==0){
return _dd;
}
}
var _de=(url.match(/.*\//)||"")+"";
if(_dd){
return _de+_dd;
}
return _de;
};
nitobi.html.Url.randomize=function(url){
return nitobi.html.Url.setParameter(url,"ntb-random",(new Date).getTime());
};
nitobi.lang.defineNs("nitobi.base");
nitobi.base.Event=function(_e0){
this.type=_e0;
this.handlers={};
this.guid=0;
this.setEnabled(true);
};
nitobi.base.Event.prototype.subscribe=function(_e1,_e2,_e3){
if(_e1==null){
return;
}
var _e4=_e1;
if(typeof (_e1)=="string"){
var s=_e1;
s=s.replace(/eventArgs/g,"arguments[0]");
_e1=nitobi.lang.close(_e2,function(){
eval(s);
});
}
if(typeof _e2=="object"&&_e1 instanceof Function){
_e4=nitobi.lang.close(_e2,_e1);
}
_e3=_e3||_e4.observer_guid||_e1.observer_guid||this.guid++;
_e4.observer_guid=_e3;
_e1.observer_guid=_e3;
this.handlers[_e3]=_e4;
return _e3;
};
nitobi.base.Event.prototype.subscribeOnce=function(_e6,_e7){
var _e8=null;
var _e9=this;
var _ea=function(){
_e6.apply(_e7||null,arguments);
_e9.unSubscribe(_e8);
};
_e8=this.subscribe(_ea);
return _e8;
};
nitobi.base.Event.prototype.unSubscribe=function(_eb){
if(_eb instanceof Function){
_eb=_eb.observer_guid;
}
this.handlers[_eb]=null;
delete this.handlers[_eb];
};
nitobi.base.Event.prototype.notify=function(_ec){
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 _ed=false;
for(var _ee in this.handlers){
var _ef=this.handlers[_ee];
if(_ef instanceof Function){
var rv=(_ef.apply(this,arguments)==false);
_ed=_ed||rv;
}
}
return !_ed;
}
return true;
};
nitobi.base.Event.prototype.dispose=function(){
for(var _f1 in this.handlers){
this.handlers[_f1]=null;
}
this.handlers={};
};
nitobi.base.Event.prototype.setEnabled=function(_f2){
this.enabled=_f2;
};
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(_f3,_f4,_f5){
if(_f3.className){
var reg=new RegExp("(\\s|^)"+_f4+"(\\s|$)");
_f3.className=_f3.className.replace(reg,"$1"+_f5+"$2");
}
};
nitobi.html.Css.replaceOrAppend=function(_f7,_f8,_f9){
if(nitobi.html.Css.hasClass(_f7,_f8)){
nitobi.html.Css.swapClass(_f7,_f8,_f9);
}else{
nitobi.html.Css.addClass(_f7,_f9);
}
};
nitobi.html.Css.hasClass=function(_fa,_fb){
if(!_fb||_fb===""){
return false;
}
return (new RegExp("(\\s|^)"+_fb+"(\\s|$)")).test(_fa.className);
};
nitobi.html.Css.addClass=function(_fc,_fd){
if(!nitobi.html.Css.hasClass(_fc,_fd)){
_fc.className=_fc.className?_fc.className+" "+_fd:_fd;
}
};
nitobi.html.Css.removeClass=function(_fe,_ff){
if(nitobi.html.Css.hasClass(_fe,_ff)){
var reg=new RegExp("(\\s|^)"+_ff+"(\\s|$)");
_fe.className=_fe.className.replace(reg,"$2");
}
};
nitobi.html.Css.getRules=function(_101){
var _102=null;
if(typeof (_101)=="number"){
_102=document.styleSheets[_101];
}else{
_102=_101;
}
if(_102==null){
return null;
}
try{
if(_102.cssRules){
return _102.cssRules;
}
if(_102.rules){
return _102.rules;
}
}
catch(e){
}
return null;
};
nitobi.html.Css.getStyleSheetsByName=function(_103){
var arr=new Array();
var ss=document.styleSheets;
var _106=new RegExp(_103.replace(".",".")+"($|\\?)");
for(var i=0;i<ss.length;i++){
arr=nitobi.html.Css._getStyleSheetsByName(_106,ss[i],arr);
}
return arr;
};
nitobi.html.Css._getStyleSheetsByName=function(_108,_109,arr){
if(_108.test(_109.href)){
arr=arr.concat([_109]);
}
var _10b=nitobi.html.Css.getRules(_109);
if(_109.href!=""&&_109.imports){
for(var i=0;i<_109.imports.length;i++){
arr=nitobi.html.Css._getStyleSheetsByName(_108,_109.imports[i],arr);
}
}else{
for(var i=0;i<_10b.length;i++){
var s=_10b[i].styleSheet;
if(s){
arr=nitobi.html.Css._getStyleSheetsByName(_108,s,arr);
}
}
}
return arr;
};
nitobi.html.Css.imageCache={};
nitobi.html.Css.imageCacheDidNotify=false;
nitobi.html.Css.trackPrecache=function(_10e){
nitobi.html.Css.precacheArray[_10e]=true;
var _10f=false;
for(var i in nitobi.html.Css.precacheArray){
if(!nitobi.html.Css.precacheArray[i]){
_10f=true;
}
}
if((!nitobi.html.Css.imageCacheDidNotify)&&(!_10f)){
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(_111){
nitobi.html.Css.isPrecaching=true;
if(!_111){
var ss=document.styleSheets;
for(var i=0;i<ss.length;i++){
nitobi.html.Css.precacheImages(ss[i]);
}
return;
}
var _114=/.*?url\((.*?)\).*?/;
var _115=nitobi.html.Css.getRules(_111);
var url=nitobi.html.Css.getPath(_111);
for(var i=0;i<_115.length;i++){
var rule=_115[i];
if(rule.styleSheet){
nitobi.html.Css.precacheImages(rule.styleSheet);
}else{
var s=rule.style;
var _119=s?s.backgroundImage:null;
if(_119){
_119=_119.replace(_114,"$1");
_119=nitobi.html.Url.normalize(url,_119);
if(!nitobi.html.Css.imageCache[_119]){
var _11a=new Image();
_11a.src=_119;
nitobi.html.Css.precacheArray[_119]=false;
var _11b=nitobi.lang.close({},nitobi.html.Css.trackPrecache,[_119]);
_11a.onload=_11b;
_11a.onerror=_11b;
_11a.onabort=_11b;
nitobi.html.Css.imageCache[_119]=_11a;
try{
if(_11a.width>0){
nitobi.html.Css.precacheArray[_119]=true;
}
}
catch(e){
}
}
}
}
}
if(_111.href!=""&&_111.imports){
for(var i=0;i<_111.imports.length;i++){
nitobi.html.Css.precacheImages(_111.imports[i]);
}
}
};
nitobi.html.Css.getPath=function(_11c){
var href=_11c.href;
href=nitobi.html.Url.normalize(href);
if(_11c.parentStyleSheet&&href.indexOf("/")!=0&&href.indexOf("http://")!=0&&href.indexOf("https://")!=0){
href=nitobi.html.Css.getPath(_11c.parentStyleSheet)+href;
}
return href;
};
nitobi.html.Css.getSheetUrl=nitobi.html.Css.getPath;
nitobi.html.Css.findParentStylesheet=function(_11e){
var rule=nitobi.html.Css.getRule(_11e);
if(rule){
return rule.parentStyleSheet;
}
return null;
};
nitobi.html.Css.findInSheet=function(_120,_121,_122){
if(nitobi.browser.IE6&&typeof _122=="undefined"){
_122=0;
}else{
if(_122>4){
return null;
}
}
_122++;
var _123=nitobi.html.Css.getRules(_121);
for(var rule=0;rule<_123.length;rule++){
var _125=_123[rule];
if(_125.styleSheet){
var _126=nitobi.html.Css.findInSheet(_120,_125.styleSheet,_122);
if(_126){
return _126;
}
}else{
if(_125.selectorText!=null&&_125.selectorText.toLowerCase().indexOf(_120)>-1){
if(nitobi.browser.IE){
_125={selectorText:_125.selectorText,style:_125.style,readOnly:_125.readOnly,parentStyleSheet:_121};
}
return _125;
}
}
}
if(_121.href!=""&&_121.imports){
for(var i=0;i<_121.imports.length;i++){
var _126=nitobi.html.Css.findInSheet(_120,_121.imports[i],_122);
if(_126){
return _126;
}
}
}
return null;
};
nitobi.html.Css.getClass=function(_128){
_128=_128.toLowerCase();
if(_128.indexOf(".")!==0){
_128="."+_128;
}
if(nitobi.html.Css.classCache[_128]==null){
var rule=nitobi.html.Css.getRule(_128);
if(rule!=null){
nitobi.html.Css.classCache[_128]=rule.style;
}else{
return null;
}
}
return nitobi.html.Css.classCache[_128];
};
nitobi.html.Css.classCache={};
nitobi.html.Css.getStyleBySelector=function(_12a){
var rule=nitobi.html.Css.getRule(_12a);
if(rule!=null){
return rule.style;
}
return null;
};
nitobi.html.Css.getRule=function(_12c){
_12c=_12c.toLowerCase();
if(_12c.indexOf(".")!==0){
_12c="."+_12c;
}
var _12d=document.styleSheets;
for(var ss=0;ss<_12d.length;ss++){
try{
var _12f=nitobi.html.Css.findInSheet(_12c,_12d[ss]);
if(_12f){
return _12f;
}
}
catch(err){
}
}
return null;
};
nitobi.html.Css.getClassStyle=function(_130,_131){
var _132=nitobi.html.Css.getClass(_130);
if(_132!=null){
return _132[_131];
}else{
return null;
}
};
nitobi.html.Css.setStyle=function(el,rule,_135){
rule=rule.replace(/\-(\w)/g,function(_136,p1){
return p1.toUpperCase();
});
el.style[rule]=_135;
};
nitobi.html.Css.getStyle=function(oElm,_139){
var _13a="";
if(document.defaultView&&document.defaultView.getComputedStyle){
_139=_139.replace(/([A-Z])/g,function($1){
return "-"+$1.toLowerCase();
});
_13a=document.defaultView.getComputedStyle(oElm,"").getPropertyValue(_139);
}else{
if(oElm.currentStyle){
_139=_139.replace(/\-(\w)/g,function(_13c,p1){
return p1.toUpperCase();
});
_13a=oElm.currentStyle[_139];
}
}
return _13a;
};
nitobi.html.Css.setOpacities=function(_13e,_13f){
if(_13e.length){
for(var i=0;i<_13e.length;i++){
nitobi.html.Css.setOpacity(_13e[i],_13f);
}
}else{
nitobi.html.Css.setOpacity(_13e,_13f);
}
};
nitobi.html.Css.setOpacity=function(_141,_142){
var s=_141.style;
if(_142>100){
_142=100;
}
if(_142<0){
_142=0;
}
if(s.filter!=null){
var _144=s.filter.match(/alpha\(opacity=[\d\.]*?\)/ig);
if(_144!=null&&_144.length>0){
s.filter=s.filter.replace(/alpha\(opacity=[\d\.]*?\)/ig,"alpha(opacity="+_142+")");
}else{
s.filter+="alpha(opacity="+_142+")";
}
}else{
s.opacity=(_142/100);
}
};
nitobi.html.Css.getOpacity=function(_145){
if(_145==null){
nitobi.lang.throwError(nitobi.error.ArgExpected+" for nitobi.html.Css.getOpacity");
}
if(nitobi.browser.IE){
if(_145.style.filter==""){
return 100;
}
var s=_145.style.filter;
s.match(/opacity=([\d\.]*?)\)/ig);
if(RegExp.$1==""){
return 100;
}
return parseInt(RegExp.$1);
}else{
return Math.abs(_145.style.opacity?_145.style.opacity*100:100);
}
};
nitobi.html.Css.getCustomStyle=function(_147,_148){
if(nitobi.browser.IE){
return nitobi.html.getClassStyle(_147,_148);
}else{
var rule=nitobi.html.Css.getRule(_147);
var re=new RegExp("(.*?)({)(.*?)(})","gi");
var _14b=rule.cssText.match(re);
re=new RegExp("("+_148+")(:)(.*?)(;)","gi");
_14b=re.exec(RegExp.$3);
}
};
if(nitobi.browser.MOZ){
Document.prototype.createStyleSheet=function(){
var _14c=this.createElement("style");
this.documentElement.childNodes[0].appendChild(_14c);
return _14c;
};
HTMLStyleElement.prototype.__defineSetter__("cssText",function(_14d){
this.innerHTML=_14d;
});
HTMLStyleElement.prototype.__defineGetter__("cssText",function(){
return this.innerHTML;
});
}
nitobi.lang.defineNs("nitobi.drawing");
nitobi.drawing.Point=function(x,y){
this.x=x;
this.y=y;
};
nitobi.drawing.Point.prototype.toString=function(){
return "("+this.x+","+this.y+")";
};
nitobi.drawing.rgb=function(r,g,b){
return "#"+((r*65536)+(g*256)+b).toString(16);
};
nitobi.drawing.align=function(_153,_154,_155,oh,ow,oy,ox){
oh=oh||0;
ow=ow||0;
oy=oy||0;
ox=ox||0;
var a=_155;
var td,sd,tt,tb,tl,tr,th,tw,st,sb,sl,sr,sh,sw;
if(nitobi.browser.IE){
td=_154.getBoundingClientRect();
sd=_153.getBoundingClientRect();
tt=td.top;
tb=td.bottom;
tl=td.left;
tr=td.right;
th=Math.abs(tb-tt);
tw=Math.abs(tr-tl);
st=sd.top;
sb=sd.bottom;
sl=sd.left;
sr=sd.right;
sh=Math.abs(sb-st);
sw=Math.abs(sr-sl);
}else{
if(nitobi.browser.MOZ){
td=document.getBoxObjectFor(_154);
sd=document.getBoxObjectFor(_153);
tt=td.y;
tl=td.x;
tw=td.width;
th=td.height;
st=sd.y;
sl=sd.x;
sw=sd.width;
sh=sd.height;
}else{
td=nitobi.html.getCoords(_154);
sd=nitobi.html.getCoords(_153);
tt=td.y;
tl=td.x;
tw=td.width;
th=td.height;
st=sd.y;
sl=sd.x;
sw=sd.width;
sh=sd.height;
}
}
var s=_153.style;
if(a&268435456){
s.height=(th+oh)+"px";
}
if(a&16777216){
s.width=(tw+ow)+"px";
}
if(a&1048576){
s.top=(nitobi.html.getStyleTop(_153)+tt-st+oy)+"px";
}
if(a&65536){
s.top=(nitobi.html.getStyleTop(_153)+tt-st+th-sh+oy)+"px";
}
if(a&4096){
s.left=(nitobi.html.getStyleLeft(_153)-sl+tl+ox)+"px";
}
if(a&256){
s.left=(nitobi.html.getStyleLeft(_153)-sl+tl+tw-sw+ox)+"px";
}
if(a&16){
s.top=(nitobi.html.getStyleTop(_153)+tt-st+oy+Math.floor((th-sh)/2))+"px";
}
if(a&1){
s.left=(nitobi.html.getStyleLeft(_153)-sl+tl+ox+Math.floor((tw-sw)/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(_16a,_16b,_16c,oh,ow,oy,ox,show){
oh=oh||0;
ow=ow||0;
oy=oy||0;
ox=ox||0;
if(nitobi.browser.moz){
td=document.getBoxObjectFor(_16b);
sd=document.getBoxObjectFor(_16a);
var _172=parseInt(document.defaultView.getComputedStyle(_16b,"").getPropertyValue("border-left-width"));
var _173=parseInt(document.defaultView.getComputedStyle(_16b,"").getPropertyValue("border-top-width"));
var _174=parseInt(document.defaultView.getComputedStyle(_16a,"").getPropertyValue("border-top-width"));
var _175=parseInt(document.defaultView.getComputedStyle(_16a,"").getPropertyValue("border-bottom-width"));
var _176=parseInt(document.defaultView.getComputedStyle(_16a,"").getPropertyValue("border-left-width"));
var _177=parseInt(document.defaultView.getComputedStyle(_16a,"").getPropertyValue("border-right-width"));
oy=oy+_174-_173;
ox=ox+_176-_172;
}
nitobi.drawing.align(_16a,_16b,_16c,oh,ow,oy,ox,show);
};
nitobi.lang.defineNs("nitobi.html");
if(false){
nitobi.html=function(){
};
}
nitobi.html.createElement=function(_178,_179,_17a){
var elem=document.createElement(_178);
for(var attr in _179){
if(attr.toLowerCase().substring(0,5)=="class"){
elem.className=_179[attr];
}else{
elem.setAttribute(attr,_179[attr]);
}
}
for(var _17d in _17a){
elem.style[_17d]=_17a[_17d];
}
return elem;
};
nitobi.html.createTable=function(_17e,_17f){
var _180=nitobi.html.createElement("table",_17e,_17f);
var _181=document.createElement("tbody");
var _182=document.createElement("tr");
var _183=document.createElement("td");
_180.appendChild(_181);
_181.appendChild(_182);
_182.appendChild(_183);
return _180;
};
nitobi.html.setBgImage=function(elem,src){
var s=nitobi.html.Css.getStyle(elem,"background-image");
if(s!=""&&nitobi.browser.IE){
s=s.replace(/(^url\(")(.*?)("\))/,"$2");
}
};
nitobi.html.getDomNodeByPath=function(Node,Path){
if(nitobi.browser.IE){
}
var _189=Node;
var _18a=Path.split("/");
var len=_18a.length;
for(var i=0;i<len;i++){
if(_189.childNodes[Number(_18a[i])]!=null){
_189=_189.childNodes[Number(_18a[i])];
}else{
alert("Path expression failed."+Path);
}
var s="";
}
return _189;
};
nitobi.html.indexOfChildNode=function(_18e,_18f){
var _190=_18e.childNodes;
for(var i=0;i<_190.length;i++){
if(_190[i]==_18f){
return i;
}
}
return -1;
};
nitobi.html.evalScriptBlocks=function(node){
for(var i=0;i<node.childNodes.length;i++){
var _194=node.childNodes[i];
if(_194.nodeName.toLowerCase()=="script"){
eval(_194.text);
}else{
nitobi.html.evalScriptBlocks(_194);
}
}
};
nitobi.html.position=function(node){
var pos=nitobi.html.getStyle($(node),"position");
if(pos=="static"){
node.style.position="relative";
}
};
nitobi.html.setOpacity=function(_197,_198){
var _199=_197.style;
_199.opacity=(_198/100);
_199.MozOpacity=(_198/100);
_199.KhtmlOpacity=(_198/100);
_199.filter="alpha(opacity="+_198+")";
};
nitobi.html.highlight=function(o,x){
if(o.createTextRange){
o.focus();
var r=document.selection.createRange().duplicate();
r.move("character",0-o.value.length);
r.move("character",x);
r.moveEnd("textedit",1);
r.select();
}else{
if(o.setSelectionRange){
o.setSelectionRange(x,o.value.length);
}
}
};
nitobi.html.setCursor=function(o,x){
if(o.createTextRange){
o.focus();
var r=document.selection.createRange().duplicate();
r.move("character",0-o.value.length);
r.move("character",x);
r.select();
}else{
if(o.setSelectionRange){
o.setSelectionRange(x,x);
}
}
};
nitobi.html.encode=function(str){
str+="";
str=str.replace(/&/g,"&amp;");
str=str.replace(/\"/g,"&quot;");
str=str.replace(/</g,"&lt;");
str=str.replace(/>/g,"&gt;");
str=str.replace(/\n/g,"<br>");
return str;
};
nitobi.html.getElement=function(_1a1){
if(typeof (_1a1)=="string"){
return document.getElementById(_1a1);
}
return _1a1;
};
if(typeof ($)=="undefined"){
$=nitobi.html.getElement;
}
if(typeof ($F)=="undefined"){
$F=function(id){
var _1a3=$(id);
if(_1a3!=null){
return _1a3.value;
}
return "";
};
}
nitobi.html.getTagName=function(elem){
if(nitobi.browser.IE&&elem.scopeName!=""){
return (elem.scopeName+":"+elem.nodeName).toLowerCase();
}else{
return elem.nodeName.toLowerCase();
}
};
nitobi.html.getStyleTop=function(elem){
return nitobi.lang.parseNumber(elem.style.top);
};
nitobi.html.getStyleLeft=function(elem){
return nitobi.lang.parseNumber(elem.style.left);
};
nitobi.html.getHeight=function(elem){
return elem.offsetHeight;
};
nitobi.html.getWidth=function(elem){
return elem.offsetWidth;
};
if(nitobi.browser.IE){
nitobi.html.getBox=function(elem){
var _1aa=nitobi.lang.parseNumber(nitobi.html.getStyle(document.body,"border-top-width"));
var _1ab=nitobi.lang.parseNumber(nitobi.html.getStyle(document.body,"border-left-width"));
var _1ac=nitobi.lang.parseNumber(document.body.scrollTop)-(_1aa==0?2:_1aa);
var _1ad=nitobi.lang.parseNumber(document.body.scrollLeft)-(_1ab==0?2:_1ab);
var rect=elem.getBoundingClientRect();
return {top:rect.top+_1ac,left:rect.left+_1ad,bottom:rect.bottom,right:rect.right,height:rect.bottom-rect.top,width:rect.right-rect.left};
};
}else{
nitobi.html.getBox=function(elem){
var _1b0=0;
var _1b1=0;
var _1b2=elem.parentNode;
while(_1b2.nodeType==1&&_1b2!=document.body){
_1b0+=nitobi.lang.parseNumber(_1b2.scrollTop)-(nitobi.html.getStyle(_1b2,"overflow")=="auto"?nitobi.lang.parseNumber(nitobi.html.getStyle(_1b2,"border-top-width")):0);
_1b1+=nitobi.lang.parseNumber(_1b2.scrollLeft)-(nitobi.html.getStyle(_1b2,"overflow")=="auto"?nitobi.lang.parseNumber(nitobi.html.getStyle(_1b2,"border-left-width")):0);
_1b2=_1b2.parentNode;
}
var _1b3=elem.ownerDocument.getBoxObjectFor(elem);
var _1b4=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-left-width"));
var _1b5=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-right-width"));
var _1b6=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-top-width"));
var top=nitobi.lang.parseNumber(_1b3.y)-_1b0-_1b6;
var left=nitobi.lang.parseNumber(_1b3.x)-_1b1-_1b4;
var _1b9=left+nitobi.lang.parseNumber(_1b3.width);
var _1ba=top+_1b3.height;
var _1bb=nitobi.lang.parseNumber(_1b3.height);
var _1bc=nitobi.lang.parseNumber(_1b3.width);
return {top:top,left:left,bottom:_1ba,right:_1b9,height:_1bb,width:_1bc};
};
nitobi.html.getBox.cache={};
}
nitobi.html.getBox2=nitobi.html.getBox;
nitobi.html.getUniqueId=function(elem){
if(elem.uniqueID){
return elem.uniqueID;
}else{
var t=(new Date()).getTime();
elem.uniqueID=t;
return t;
}
};
nitobi.html.getChildNodeById=function(elem,_1c0,_1c1){
return nitobi.html.getChildNodeByAttribute(elem,"id",_1c0,_1c1);
};
nitobi.html.getChildNodeByAttribute=function(elem,_1c3,_1c4,_1c5){
for(var i=0;i<elem.childNodes.length;i++){
if(elem.nodeType!=3&&Boolean(elem.childNodes[i].getAttribute)){
if(elem.childNodes[i].getAttribute(_1c3)==_1c4){
return elem.childNodes[i];
}
}
}
if(_1c5){
for(var i=0;i<elem.childNodes.length;i++){
var _1c7=nitobi.html.getChildNodeByAttribute(elem.childNodes[i],_1c3,_1c4,_1c5);
if(_1c7!=null){
return _1c7;
}
}
}
return null;
};
nitobi.html.getParentNodeById=function(elem,_1c9){
return nitobi.html.getParentNodeByAtt(elem,"id",_1c9);
};
nitobi.html.getParentNodeByAtt=function(elem,att,_1cc){
while(elem.parentNode!=null){
if(elem.parentNode.getAttribute(att)==_1cc){
return elem.parentNode;
}
elem=elem.parentNode;
}
return null;
};
if(nitobi.browser.IE){
nitobi.html.getFirstChild=function(node){
return node.firstChild;
};
}else{
if(nitobi.browser.MOZ){
nitobi.html.getFirstChild=function(node){
var i=0;
while(i<node.childNodes.length&&node.childNodes[i].nodeType==3){
i++;
}
return node.childNodes[i];
};
}
}
nitobi.html.getScroll=function(){
var _1d0,_1d1=0;
if((nitobi.browser.OPERA==false)&&(document.documentElement.scrollTop>0)){
_1d0=document.documentElement.scrollTop;
_1d1=document.documentElement.scrollLeft;
}else{
_1d0=document.body.scrollTop;
_1d1=document.body.scrollLeft;
}
if(((_1d0==0)&&(document.documentElement.scrollTop>0))||((_1d1==0)&&(document.documentElement.scrollLeft>0))){
_1d0=document.documentElement.scrollTop;
_1d1=document.documentElement.scrollLeft;
}
return {"left":_1d1,"top":_1d0};
};
nitobi.html.getCoords=function(_1d2){
var ew,eh;
try{
var _1d5=_1d2;
ew=_1d2.offsetWidth;
eh=_1d2.offsetHeight;
for(var lx=0,ly=0;_1d2!=null;lx+=_1d2.offsetLeft,ly+=_1d2.offsetTop,_1d2=_1d2.offsetParent){
}
for(;_1d5!=document.body;lx-=_1d5.scrollLeft,ly-=_1d5.scrollTop,_1d5=_1d5.parentNode){
}
}
catch(e){
}
return {"x":lx,"y":ly,"height":eh,"width":ew};
};
nitobi.html.scrollBarWidth=0;
nitobi.html.getScrollBarWidth=function(_1d8){
if(nitobi.html.scrollBarWidth){
return nitobi.html.scrollBarWidth;
}
try{
if(null==_1d8){
var d=document.getElementById("eba.sb.div");
if(null==d){
d=document.createElement("div");
d.id="eba.sb.div";
d.style.width="100px";
d.style.height="100px";
d.style.overflow="auto";
d.innerHTML="<div style='height:200px;'></div>";
d.style.backgroundColor="black";
d.style.position="absolute";
d.style.top="-200px";
document.body.appendChild(d);
}
_1d8=d;
}
if(nitobi.browser.IE){
nitobi.html.scrollBarWidth=Math.abs(_1d8.offsetWidth-_1d8.clientWidth-(_1d8.clientLeft?_1d8.clientLeft*2:0));
}else{
var b=document.getBoxObjectFor(_1d8);
nitobi.html.scrollBarWidth=Math.abs((b.width-_1d8.clientWidth));
}
}
catch(err){
}
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 _1db,_1dc,_1dd,_1de;
var x,y;
var _1e1=navigator.userAgent.toLowerCase();
var _1e2=false;
var _1e3=false;
var _1e4=false;
var ie=false;
var _1e6=false;
if(_1e1.indexOf("opera")>=0){
_1e2=true;
}
if(_1e1.indexOf("firefox")>=0){
_1e3=true;
}
if(_1e1.indexOf("msie")>=0){
ie=true;
}
if(_1e1.indexOf("safari")>=0){
_1e4=true;
}
if(document.compatMode=="CSS1Compat"){
_1e6=true;
}
var de=document.documentElement;
var db=document.body;
if(self.innerHeight){
x=self.innerWidth;
y=self.innerHeight;
}else{
if(de&&de.clientHeight){
x=de.clientWidth;
y=de.clientHeight;
}else{
if(db){
x=db.clientWidth;
y=db.clientHeight;
}
}
}
_1dd=x;
_1de=y;
if(self.pageYOffset){
x=self.pageXOffset;
y=self.pageYOffset;
}else{
if(de&&de.scrollTop){
x=de.scrollLeft;
y=de.scrollTop;
}else{
if(db){
x=db.scrollLeft;
y=db.scrollTop;
}
}
}
_1db=x;
_1dc=y;
var _1e9=db.scrollHeight;
var _1ea=db.offsetHeight;
if(_1e9>_1ea){
x=db.scrollWidth;
y=db.scrollHeight;
}else{
x=db.offsetWidth;
y=db.offsetHeight;
}
nitobi.html.permHeight=y;
nitobi.html.permWidth=x;
if(nitobi.html.permHeight<_1de){
nitobi.html.permHeight=_1de;
if(ie&&_1e6){
_1dd+=20;
}
}
if(_1dd<nitobi.html.permWidth){
_1dd=nitobi.html.permWidth;
}
if(nitobi.html.permHeight>_1de){
_1dd+=20;
}
var _1eb,_1ec;
_1eb=de.scrollHeight;
_1ec=de.scrollWidth;
return {scrollWidth:_1ec,scrollHeight:_1eb,scrollLeft:_1db,scrollTop:_1dc,clientWidth:_1dd,clientHeight:_1de,bodyWidth:nitobi.html.permWidth,bodyHeight:nitobi.html.rrPermHeight};
};
nitobi.html.getOuterHtml=function(node){
if(nitobi.browser.IE){
return node.outerHTML;
}else{
var html="";
switch(node.nodeType){
case Node.ELEMENT_NODE:
html+="<";
html+=node.nodeName.toLowerCase();
if(!nitobi.html.specialElements[node.nodeName]){
for(var a=0;a<node.attributes.length;a++){
if(node.attributes[a].nodeName.toLowerCase()!="_moz-userdefined"){
html+=" "+node.attributes[a].nodeName.toLowerCase()+"=\""+node.attributes[a].nodeValue+"\"";
}
}
html+=">";
if(!nitobi.html.emptyElements[node.nodeName]){
html+=node.innerHTML;
html+="</"+node.nodeName.toLowerCase()+">";
}
}else{
switch(node.nodeName){
case "TEXTAREA":
for(var a=0;a<node.attributes.length;a++){
if(node.attributes[a].nodeName.toLowerCase()!="value"){
html+=" "+node.attributes[a].nodeName.toUpperCase()+"=\""+node.attributes[a].nodeValue+"\"";
}else{
var _1f0=node.attributes[a].nodeValue;
}
}
html+=">";
html+=_1f0;
html+="</"+node.nodeName+">";
break;
}
}
break;
case Node.TEXT_NODE:
html+=node.nodeValue;
break;
case Node.COMMENT_NODE:
html+="<!"+"--"+node.nodeValue+"--"+">";
break;
}
return html;
}
};
try{
Node.prototype.swapNode=function(node){
var _1f2=this.nextSibling;
var _1f3=this.parentNode;
node.parentNode.replaceChild(this,node);
_1f3.insertBefore(node,_1f2);
};
HTMLElement.prototype.getBoundingClientRect=function(_1f4,_1f5){
_1f4=_1f4||0;
_1f5=_1f5||0;
var td=document.getBoxObjectFor(this);
var top=td.y-_1f4;
var left=td.x-_1f5;
return {top:top,left:left,bottom:(top+td.height),right:(left+td.width)};
};
HTMLElement.prototype.getClientRects=function(_1f9,_1fa){
_1f9=_1f9||0;
_1fa=_1fa||0;
var td=document.getBoxObjectFor(this);
return new Array({top:(td.y-_1f9),left:(td.x-_1fa),bottom:(td.y+td.height-_1f9),right:(td.x+td.width-_1fa)});
};
HTMLElement.prototype.insertAdjacentElement=function(pos,node){
switch(pos){
case "beforeBegin":
this.parentNode.insertBefore(node,this);
break;
case "afterBegin":
this.insertBefore(node,this.firstChild);
break;
case "beforeEnd":
this.appendChild(node);
break;
case "afterEnd":
if(this.nextSibling){
this.parentNode.insertBefore(node,this.nextSibling);
}else{
this.parentNode.appendChild(node);
}
break;
}
};
HTMLElement.prototype.insertAdjacentHTML=function(_1fe,_1ff,_200){
var df;
var r=this.ownerDocument.createRange();
switch(String(_1fe).toLowerCase()){
case "beforebegin":
r.setStartBefore(this);
df=r.createContextualFragment(_1ff);
this.parentNode.insertBefore(df,this);
break;
case "afterbegin":
r.selectNodeContents(this);
r.collapse(true);
df=r.createContextualFragment(_1ff);
this.insertBefore(df,this.firstChild);
break;
case "beforeend":
if(_200==true){
this.innerHTML=this.innerHTML+_1ff;
}else{
r.selectNodeContents(this);
r.collapse(false);
df=r.createContextualFragment(_1ff);
this.appendChild(df);
}
break;
case "afterend":
r.setStartAfter(this);
df=r.createContextualFragment(_1ff);
this.parentNode.insertBefore(df,this.nextSibling);
break;
}
};
HTMLElement.prototype.insertAdjacentText=function(pos,s){
var node=document.createTextNode(s);
this.insertAdjacentElement(pos,node);
};
}
catch(e){
}
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(_206,_207,_208){
var _209=[];
for(var i=0;i<_207.length;i++){
var e=_207[i];
_209.push(nitobi.html.attachEvent(_206,e.type,e.handler,_208,e.capture||false));
}
return _209;
};
nitobi.html.attachEvent=function(_20c,type,_20e,_20f,_210,_211){
if(type=="anyclick"){
if(nitobi.browser.IE){
nitobi.html.attachEvent(_20c,"dblclick",_20e,_20f,_210,_211);
}
type="click";
}
if(!(_20e instanceof Function)){
nitobi.lang.throwError("Event handler needs to be a Function");
}
_20c=$(_20c);
if(type.toLowerCase()=="unload"&&_211!=true){
var _212=_20e;
if(_20f!=null){
_212=function(){
_20e.call(_20f);
};
}
return this.addUnload(_212);
}
var _213=this.handlerId++;
var _214=this.elementId++;
if(typeof (_20e.ebaguid)!="undefined"){
_213=_20e.ebaguid;
}else{
_20e.ebaguid=_213;
}
if(typeof (_20c.ebaguid)=="undefined"){
_20c.ebaguid=_214;
nitobi.html.elements[_214]=_20c;
}
if(typeof (_20c.eba_events)=="undefined"){
_20c.eba_events={};
}
if(_20c.eba_events[type]==null){
_20c.eba_events[type]={};
if(_20c.attachEvent){
_20c["eba_event_"+type]=function(){
nitobi.html.notify.call(_20c,window.event);
};
_20c.attachEvent("on"+type,_20c["eba_event_"+type]);
if(_210&&_20c.setCapture!=null){
_20c.setCapture(true);
}
}else{
if(_20c.addEventListener){
_20c["eba_event_"+type]=function(){
nitobi.html.notify.call(_20c,arguments[0]);
};
_20c.addEventListener(type,_20c["eba_event_"+type],_210);
}
}
}
_20c.eba_events[type][_213]={handler:_20e,context:_20f};
return _213;
};
nitobi.html.notify=function(e){
if(!nitobi.browser.IE){
e.srcElement=e.target;
e.fromElement=e.relatedTarget;
e.toElement=e.relatedTarget;
}
var _216=this;
e.eventSrc=_216;
nitobi.html.Event=e;
for(var _217 in _216.eba_events[e.type]){
var _218=_216.eba_events[e.type][_217];
if(typeof (_218.context)=="object"){
_218.handler.call(_218.context,e,_216);
}else{
_218.handler.call(_216,e,_216);
}
}
};
nitobi.html.detachEvents=function(_219,_21a){
for(var i=0;i<_21a.length;i++){
var e=_21a[i];
nitobi.html.detachEvent(_219,e.type,e.handler);
}
};
nitobi.html.detachEvent=function(_21d,type,_21f){
_21d=$(_21d);
var _220=_21f;
if(_21f instanceof Function){
_220=_21f.ebaguid;
}
if(type=="unload"){
this.unload.splice(ebaguid,1);
}
if(_21d.eba_events!=null&&_21d.eba_events[type]!=null&&_21d.eba_events[type][_220]!=null){
var _221=_21d.eba_events[type];
_221[_220]=null;
delete _221[_220];
if(nitobi.collections.isHashEmpty(_221)){
this.m_detach(_21d,type,_21d["eba_event_"+type]);
_21d["eba_event_"+type]=null;
_21d.eba_events[type]=null;
_221=null;
if(_21d.nodeType==1){
_21d.removeAttribute("eba_event_"+type);
}
}
}
return true;
};
nitobi.html.m_detach=function(_222,type,_224){
if(_224!=null&&_224 instanceof Function){
if(_222.detachEvent){
_222.detachEvent("on"+type,_224);
}else{
if(_222.removeEventListener){
_222.removeEventListener(type,_224,false);
}
}
_222["on"+type]=null;
if(type=="unload"){
for(var i=0;i<this.unload.length;i++){
this.unload[i].call(this);
this.unload[i]=null;
}
}
}
};
nitobi.html.detachAllEvents=function(){
for(var i=0;i<nitobi.html.elements.length;i++){
if(typeof (nitobi.html.elements[i])!="undefined"){
for(var _227 in nitobi.html.elements[i].eba_events){
nitobi.html.m_detach(nitobi.html.elements[i],_227,nitobi.html.elements[i]["eba_event_"+_227]);
if(typeof (nitobi.html.elements[i])!="undefined"&&nitobi.html.elements[i].eba_events[_227]!=null){
for(var j=0;j<nitobi.html.elements[i].eba_events[_227].length;j++){
nitobi.html.elements[i].eba_events[_227][j]=null;
}
}
nitobi.html.elements[i]["eba_event_"+_227]=null;
}
}
}
nitobi.html.elements=null;
};
nitobi.html.addUnload=function(_229){
this.unload.push(_229);
return this.unload.length-1;
};
nitobi.html.cancelEvent=function(evt,v){
nitobi.html.stopPropagation(evt);
nitobi.html.preventDefault(evt);
};
nitobi.html.stopPropagation=function(evt){
if(evt==null){
return;
}
if(nitobi.browser.MOZ){
evt.stopPropagation();
}else{
if(nitobi.browser.IE){
evt.cancelBubble=true;
}
}
};
nitobi.html.preventDefault=function(evt,v){
if(evt==null){
return;
}
if(nitobi.browser.MOZ){
evt.preventDefault();
}else{
if(nitobi.browser.IE){
evt.returnValue=false;
}
}
if(v!=null){
e.keyCode=v;
}
};
nitobi.html.getEventCoords=function(evt){
var _230={"x":evt.clientX,"y":evt.clientY};
if(nitobi.browser.IE){
_230.x+=document.documentElement.scrollLeft+document.body.scrollLeft;
_230.y+=document.documentElement.scrollTop+document.body.scrollTop;
}else{
_230.x+=window.scrollX;
_230.y+=window.scrollY;
}
return _230;
};
nitobi.html.getEvent=function(_231){
if(nitobi.browser.IE){
return window.event;
}else{
_231.srcElement=_231.target;
_231.fromElement=_231.relatedTarget;
_231.toElement=_231.relatedTarget;
return _231;
}
};
nitobi.html.createEvent=function(_232,_233,_234,_235){
if(nitobi.browser.IE){
_234.target.fireEvent("on"+_233);
}else{
var _236=document.createEvent(_232);
_236.initKeyEvent(_233,true,true,document.defaultView,_234.ctrlKey,_234.altKey,_234.shiftKey,_234.metaKey,_235.keyCode,_235.charCode);
_234.target.dispatchEvent(_236);
}
};
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(key,_238){
nitobi.event.publish(key);
var guid=this.guid++;
this.keys[key].add(_238,guid);
return guid;
};
nitobi.event.unsubscribe=function(key,guid){
if(this.keys[key]==null){
return true;
}
if(this.keys[key].remove(guid)){
this.keys[key]=null;
delete this.keys[key];
}
};
nitobi.event.evaluate=function(func,_23d){
var _23e=true;
if(typeof func=="string"){
func=func.replace(/eventArgs/gi,"arguments[1]");
var _23f=eval(func);
_23e=(typeof (_23f)=="undefined"?true:_23f);
}
return _23e;
};
nitobi.event.publish=function(key){
if(this.keys[key]==null){
this.keys[key]=new nitobi.event.Key();
}
};
nitobi.event.notify=function(key,_242){
if(this.keys[key]!=null){
return this.keys[key].notify(_242);
}else{
return true;
}
};
nitobi.event.dispose=function(){
for(var key in this.keys){
if(typeof (this.keys[key])=="function"){
this.keys[key].dispose();
}
}
this.keys=null;
};
nitobi.event.Key=function(){
this.handlers={};
};
nitobi.event.Key.prototype.add=function(_244,guid){
this.handlers[guid]=_244;
};
nitobi.event.Key.prototype.remove=function(guid){
this.handlers[guid]=null;
delete this.handlers[guid];
var i=true;
for(var item in this.handlers){
i=false;
break;
}
return i;
};
nitobi.event.Key.prototype.notify=function(_249){
var fail=false;
for(var item in this.handlers){
var _24c=this.handlers[item];
if(_24c instanceof Function){
var rv=(_24c.apply(this,arguments)==false);
fail=fail||rv;
}else{
}
}
return !fail;
};
nitobi.event.Key.prototype.dispose=function(){
for(var _24e in this.handlers){
this.handlers[_24e]=null;
}
};
nitobi.event.Args=function(src){
this.source=src;
};
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(obj){
this.list[this.getLength()]=obj;
this.length++;
};
nitobi.collections.IEnumerable.prototype.insert=function(_251,obj){
this.list.splice(_251,0,obj);
this.length++;
};
nitobi.collections.IEnumerable.createNewArray=function(obj,_254){
var _255;
_254=_254||0;
if(obj.count){
_255=obj.count;
}
if(obj.length){
_255=obj.length;
}
var x=new Array(_255-_254);
for(var i=_254;i<_255;i++){
x[i-_254]=obj[i];
}
return x;
};
nitobi.collections.IEnumerable.prototype.get=function(_258){
if(_258<0||_258>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
return this.list[_258];
};
nitobi.collections.IEnumerable.prototype.set=function(_259,_25a){
if(_259<0||_259>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
this.list[_259]=_25a;
};
nitobi.collections.IEnumerable.prototype.indexOf=function(obj){
for(var i=0;i<this.getLength();i++){
if(this.list[i]===obj){
return i;
}
}
return -1;
};
nitobi.collections.IEnumerable.prototype.remove=function(_25d){
var i;
if(typeof (_25d)!="number"){
i=this.indexOf(_25d);
}else{
i=_25d;
}
if(-1==i||i<0||i>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
this.list[i]=null;
this.list.splice(i,1);
this.length--;
};
nitobi.collections.IEnumerable.prototype.getLength=function(){
return this.length;
};
nitobi.collections.IEnumerable.prototype.each=function(func){
var l=this.length;
var list=this.list;
for(var i=0;i<l;i++){
func(list[i]);
}
};
nitobi.lang.defineNs("nitobi.base");
nitobi.base.ISerializable=function(_263,id,xml,_266){
nitobi.Object.call(this);
if(typeof (this.ISerializableInitialized)=="undefined"){
this.ISerializableInitialized=true;
}else{
return;
}
this.xmlNode=null;
this.setXmlNode(_263);
if(_263!=null){
this.profile=nitobi.base.Registry.getInstance().getCompleteProfile({idField:null,tagName:_263.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(_263!=null){
this.deserializeFromXmlNode(this.getXmlNode());
}else{
if(this.factory!=null&&this.profile.tagName!=null){
this.createByProfile(this.profile,this.getXmlNode());
}else{
if(xml!=null&&_263!=null){
this.createByXml(xml);
}
}
}
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(_267,_268){
if(_268==null){
var xml="<"+_267.tagName+" xmlns:"+nitobi.base.XmlNamespace.prefix+"=\""+nitobi.base.XmlNamespace.uri+"\" />";
var _26a=nitobi.xml.createXmlDoc(xml);
this.setXmlNode(_26a.firstChild);
this.deserializeFromXmlNode(this.xmlNode);
}else{
this.deserializeFromXmlNode(_268);
this.setXmlNode(_268);
}
};
nitobi.base.ISerializable.prototype.createByXml=function(xml){
this.deserializeFromXml(xml);
};
nitobi.base.ISerializable.prototype.getParentObject=function(){
return this.parentObj;
};
nitobi.base.ISerializable.prototype.setParentObject=function(_26c){
this.parentObj=_26c;
this.onSetParentObject.notify();
};
nitobi.base.ISerializable.prototype.addChildObject=function(_26d){
this.addToCache(_26d);
_26d.setParentObject(this);
var _26e=_26d.getXmlNode();
if(!this.areGuidsGenerated(_26e)){
_26e=this.generateGuids(_26e);
_26d.setXmlNode(_26e);
}
this.xmlNode.appendChild(_26e);
};
nitobi.base.ISerializable.prototype.insertBeforeChildObject=function(obj,_270){
_270=_270?_270.getXmlNode():null;
this.addToCache(obj);
obj.setParentObject(this);
var _271=obj.getXmlNode();
if(!this.areGuidsGenerated(_271)){
_271=this.generateGuids(_271);
obj.setXmlNode(_271);
}
this.xmlNode.insertBefore(_271,_270);
};
nitobi.base.ISerializable.prototype.createElement=function(name){
var _273;
if(this.xmlNode==null||this.xmlNode.ownerDocument==null){
_273=nitobi.xml.createXmlDoc();
}else{
_273=this.xmlNode.ownerDocument;
}
if(nitobi.browser.IE){
return _273.createNode(1,name,nitobi.base.XmlNamespace.uri);
}else{
if(_273.createElementNS){
return _273.createElementNS(nitobi.base.XmlNamespace.uri,name);
}else{
nitobi.lang.throwError("Unable to create a new xml node on this browser.");
}
}
};
nitobi.base.ISerializable.prototype.deleteChildObject=function(id){
this.removeFromCache(id);
var e=this.getElement(id);
if(e!=null){
e.parentNode.removeChild(e);
}
};
nitobi.base.ISerializable.prototype.addToCache=function(obj){
this.objectHash[obj.getId()]=obj;
};
nitobi.base.ISerializable.prototype.removeFromCache=function(id){
this.objectHash[id]=null;
};
nitobi.base.ISerializable.prototype.inCache=function(id){
return (this.objectHash[id]!=null);
};
nitobi.base.ISerializable.prototype.flushCache=function(){
this.objectHash={};
};
nitobi.base.ISerializable.prototype.areGuidsGenerated=function(_279){
if(_279==null||_279.ownerDocument==null){
return false;
}
if(nitobi.browser.IE){
var node=_279.ownerDocument.documentElement;
if(node==null){
return false;
}else{
var id=node.getAttribute("id");
if(id==null||id==""){
return false;
}else{
return (nitobi.base.ISerializable.guidMap[id]!=null);
}
}
}else{
return (_279.ownerDocument.generatedGuids==true);
}
};
nitobi.base.ISerializable.prototype.setGuidsGenerated=function(_27c,_27d){
if(_27c==null||_27c.ownerDocument==null){
return;
}
if(nitobi.browser.IE){
var node=_27c.ownerDocument.documentElement;
if(node!=null){
var id=node.getAttribute("id");
if(id!=null&&id!=""){
nitobi.base.ISerializable.guidMap[id]=true;
}
}
}else{
_27c.ownerDocument.generatedGuids=true;
}
};
nitobi.base.ISerializable.prototype.generateGuids=function(_280){
nitobi.base.uniqueIdGeneratorProc.addParameter("guid",nitobi.component.getUniqueId(),"");
var doc=nitobi.xml.transformToXml(_280,nitobi.base.uniqueIdGeneratorProc);
this.saveDocument=doc;
this.setGuidsGenerated(doc.documentElement,true);
return doc.documentElement;
};
nitobi.base.ISerializable.prototype.deserializeFromXmlNode=function(_282){
if(!this.areGuidsGenerated(_282)){
_282=this.generateGuids(_282);
}
this.setXmlNode(_282);
this.flushCache();
if(this.profile==null){
this.profile=nitobi.base.Registry.getInstance().getCompleteProfile({idField:null,tagName:_282.nodeName});
}
this.onDeserialize.notify();
};
nitobi.base.ISerializable.prototype.deserializeFromXml=function(xml){
var doc=nitobi.xml.createXmlDoc(xml);
var node=this.generateGuids(doc.firstChild);
this.setXmlNode(node);
this.onDeserialize.notify();
};
nitobi.base.ISerializable.prototype.getChildObject=function(id){
var obj=null;
obj=this.objectHash[id];
if(obj==null){
var _288=this.getElement(id);
if(_288==null){
return null;
}else{
obj=this.factory.createByNode(_288);
this.onCreateObject.notify(obj);
this.addToCache(obj);
}
obj.setParentObject(this);
}
return obj;
};
nitobi.base.ISerializable.prototype.getChildObjectById=function(id){
return this.getChildObject(id);
};
nitobi.base.ISerializable.prototype.getElement=function(id){
try{
var node=this.xmlNode.selectSingleNode("*[@id='"+id+"']");
return node;
}
catch(err){
nitobi.lang.throwError(nitobi.error.Unexpected,err);
}
};
nitobi.base.ISerializable.prototype.getFactory=function(){
return this.factory;
};
nitobi.base.ISerializable.prototype.setFactory=function(_28c){
this.factory=factory;
};
nitobi.base.ISerializable.prototype.getXmlNode=function(){
return this.xmlNode;
};
nitobi.base.ISerializable.prototype.setXmlNode=function(_28d){
if(nitobi.lang.typeOf(_28d)==nitobi.lang.type.XMLDOC&&_28d!=null){
this.ownerDocument=_28d;
_28d=nitobi.html.getFirstChild(_28d);
}else{
if(_28d!=null){
this.ownerDocument=_28d.ownerDocument;
}
}
if(_28d!=null&&nitobi.browser.MOZ&&_28d.ownerDocument==null){
nitobi.lang.throwError(nitobi.error.OrphanXmlNode+" ISerializable.setXmlNode");
}
this.xmlNode=_28d;
};
nitobi.base.ISerializable.prototype.serializeToXml=function(){
return nitobi.xml.serialize(this.xmlNode);
};
nitobi.base.ISerializable.prototype.getAttribute=function(name,_28f){
if(this[name]!=null){
return this[name];
}
var _290=this.xmlNode.getAttribute(name);
return _290===null?_28f:_290;
};
nitobi.base.ISerializable.prototype.setAttribute=function(name,_292){
this[name]=_292;
this.xmlNode.setAttribute(name.toLowerCase(),_292!=null?_292.toString():"");
};
nitobi.base.ISerializable.prototype.setIntAttribute=function(name,_294){
var n=parseInt(_294);
if(_294!=null&&(typeof (n)!="number"||isNaN(n))){
nitobi.lang.throwError(name+" is not an integer and therefore cannot be set. It's value was "+_294);
}
this.setAttribute(name,_294);
};
nitobi.base.ISerializable.prototype.getIntAttribute=function(name,_297){
var x=this.getAttribute(name,_297);
if(x==null||x==""){
return 0;
}
var tx=parseInt(x);
if(isNaN(tx)){
nitobi.lang.throwError("ISerializable attempting to get "+name+" which was supposed to be an int but was actually NaN");
}
return tx;
};
nitobi.base.ISerializable.prototype.setBoolAttribute=function(name,_29b){
_29b=nitobi.lang.getBool(_29b);
if(_29b!=null&&typeof (_29b)!="boolean"){
nitobi.lang.throwError(name+" is not an boolean and therefore cannot be set. It's value was "+_29b);
}
this.setAttribute(name,(_29b?"true":"false"));
};
nitobi.base.ISerializable.prototype.getBoolAttribute=function(name,_29d){
var x=this.getAttribute(name,_29d);
if(typeof (x)=="string"&&x==""){
return null;
}
var tx=nitobi.lang.getBool(x);
if(tx==null){
nitobi.lang.throwError("ISerializable attempting to get "+name+" which was supposed to be a bool but was actually "+x);
}
return tx;
};
nitobi.base.ISerializable.prototype.setDateAttribute=function(name,_2a1){
this.setAttribute(name,_2a1);
};
nitobi.base.ISerializable.prototype.getDateAttribute=function(name,_2a3){
if(this[name]){
return this[name];
}
var _2a4=this.getAttribute(name,_2a3);
return _2a4?new Date(_2a4):null;
};
nitobi.base.ISerializable.prototype.getId=function(){
return this.getAttribute("id");
};
nitobi.base.ISerializable.prototype.getChildObjectId=function(_2a5,_2a6){
var _2a7=(typeof (_2a5.className)=="string"?_2a5.tagName:_2a5.getXmlNode().nodeName);
var _2a8=_2a7;
if(_2a6){
_2a8+="[@instancename='"+_2a6+"']";
}
var node=this.getXmlNode().selectSingleNode(_2a8);
if(null==node){
return null;
}else{
return node.getAttribute("id");
}
};
nitobi.base.ISerializable.prototype.setObject=function(_2aa,_2ab){
if(_2aa.ISerializableImplemented!=true){
nitobi.lang.throwError(nitobi.error.ExpectedInterfaceNotFound+" ISerializable");
}
var id=this.getChildObjectId(_2aa,_2ab);
if(null!=id){
this.deleteChildObject(id);
}
if(_2ab){
_2aa.setAttribute("instancename",_2ab);
}
this.addChildObject(_2aa);
};
nitobi.base.ISerializable.prototype.getObject=function(_2ad,_2ae){
var id=this.getChildObjectId(_2ad,_2ae);
if(null==id){
return id;
}
return this.getChildObject(id);
};
nitobi.base.ISerializable.prototype.getObjectById=function(id){
return this.getChildObject(id);
};
nitobi.base.ISerializable.prototype.isDescendantExists=function(id){
var node=this.getXmlNode();
var _2b3=node.selectSingleNode("//*[@id='"+id+"']");
return (_2b3!=null);
};
nitobi.base.ISerializable.prototype.getPathToLeaf=function(id){
var node=this.getXmlNode();
var _2b6=node.selectSingleNode("//*[@id='"+id+"']");
if(nitobi.browser.IE){
_2b6.ownerDocument.setProperty("SelectionLanguage","XPath");
}
var _2b7=_2b6.selectNodes("./ancestor-or-self::*");
var _2b8=this.getId();
var _2b9=0;
for(var i=0;i<_2b7.length;i++){
if(_2b7[i].getAttribute("id")==_2b8){
_2b9=i+1;
break;
}
}
var arr=nitobi.collections.IEnumerable.createNewArray(_2b7,_2b9);
return arr.reverse();
};
nitobi.base.ISerializable.prototype.isDescendantInstantiated=function(id){
var node=this.getXmlNode();
var _2be=node.selectSingleNode("//*[@id='"+id+"']");
if(nitobi.browser.IE){
_2be.ownerDocument.setProperty("SelectionLanguage","XPath");
}
var _2bf=_2be.selectNodes("ancestor::*");
var _2c0=false;
var obj=this;
for(var i=0;i<_2bf.length;i++){
if(_2c0){
var _2c3=_2bf[i].getAttribute("id");
instantiated=obj.inCache(_2c3);
if(!instantiated){
return false;
}
obj=this.getObjectById(_2c3);
}
if(_2bf[i].getAttribute("id")==this.getId()){
_2c0=true;
}
}
return obj.inCache(id);
};
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(_2c4){
return this.classMap[_2c4];
};
nitobi.base.Registry.prototype.getProfileByInstance=function(_2c5){
var _2c6=nitobi.lang.getFirstFunction(_2c5);
var p=_2c6.value.prototype;
var _2c8=null;
var _2c9=0;
for(var _2ca in this.classMap){
var _2cb=this.classMap[_2ca].classObject;
var _2cc=0;
while(_2cb&&_2c5 instanceof _2cb){
_2cb=_2cb.baseConstructor;
_2cc++;
}
if(_2cc>_2c9){
_2c9=_2cc;
_2c8=_2ca;
}
}
if(_2c8){
return this.getProfileByClass(_2c8);
}else{
return null;
}
};
nitobi.base.Registry.prototype.getProfileByTag=function(_2cd){
return this.tagMap[_2cd];
};
nitobi.base.Registry.prototype.getCompleteProfile=function(_2ce){
if(nitobi.lang.isDefined(_2ce.className)&&_2ce.className!=null){
return this.classMap[_2ce.className];
}
if(nitobi.lang.isDefined(_2ce.tagName)&&_2ce.tagName!=null){
return this.tagMap[_2ce.tagName];
}
nitobi.lang.throwError("A complete class profile could not be found. Insufficient information was provided.");
};
nitobi.base.Registry.prototype.register=function(_2cf){
if(!nitobi.lang.isDefined(_2cf.tagName)||null==_2cf.tagName){
nitobi.lang.throwError("Illegal to register a class without a tagName.");
}
if(!nitobi.lang.isDefined(_2cf.className)||null==_2cf.className){
nitobi.lang.throwError("Illegal to register a class without a className.");
}
this.tagMap[_2cf.tagName]=_2cf;
this.classMap[_2cf.className]=_2cf;
};
}
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(_2d0){
try{
return nitobi.lang.newObject(_2d0,arguments,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByClass) could not create the class "+_2d0+".",err);
}
};
nitobi.base.Factory.prototype.createByNode=function(_2d1){
try{
if(null==_2d1){
nitobi.lang.throwError(nitobi.error.ArgExpected);
}
if(nitobi.lang.typeOf(_2d1)==nitobi.lang.type.XMLDOC){
_2d1=nitobi.xml.getChildNodes(_2d1)[0];
}
var _2d2=this.registry.getProfileByTag(_2d1.nodeName).className;
var _2d3=_2d1.ownerDocument;
var _2d4=Array.prototype.slice.call(arguments,0);
var obj=nitobi.lang.newObject(_2d2,_2d4,0);
return obj;
}
catch(err){
nitobi.lang.throwError("The Factory (createByNode) could not create the class "+_2d2+".",err);
}
};
nitobi.base.Factory.prototype.createByProfile=function(_2d6){
try{
return nitobi.lang.newObject(_2d6.className,arguments,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByProfile) could not create the class "+_2d6.className+".",err);
}
};
nitobi.base.Factory.prototype.createByTag=function(_2d7){
try{
var _2d8=this.registry.getProfileByTag(_2d7).className;
var _2d9=Array.prototype.slice.call(arguments,0);
return nitobi.lang.newObject(_2d8,_2d9,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByTag) could not create the class "+_2d8+".",err);
}
};
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(_2da,_2db,_2dc,_2dd,_2de){
this.className=_2da;
this.classObject=eval(_2da);
this.schema=_2db;
this.singleton=_2dc;
this.tagName=_2dd;
this.idField=_2de||"id";
};
nitobi.lang.defineNs("nitobi.base");
if(false){
nitobi.base=function(){
};
}
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(_2df){
try{
_2df=$(_2df);
this.xmlDoc=nitobi.xml.parseHtml(_2df);
return this.xmlDoc;
}
catch(err){
nitobi.lang.throwError(nitobi.error.DeclarationParseError,err);
}
};
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(date,unit,_2e2){
if(unit==this.DAY){
date.setDate(date.getDate()+_2e2);
}else{
if(unit==this.WEEK){
date.setDate(date.getDate()+7*_2e2);
}else{
if(unit==this.MONTH){
date.setMonth(date.getMonth()+_2e2);
}else{
if(unit==this.YEAR){
date.setFullYear(date.getFullYear()+_2e2);
}
}
}
}
return date;
};
nitobi.base.DateMath.add=function(date,unit,_2e5){
return this._add(date,unit,_2e5);
};
nitobi.base.DateMath.subtract=function(date,unit,_2e8){
return this._add(date,unit,-1*_2e8);
};
nitobi.base.DateMath.after=function(date,_2ea){
return (date-_2ea)>0;
};
nitobi.base.DateMath.between=function(date,_2ec,end){
return (date-_2ec)>=0&&(end-date)>0;
};
nitobi.base.DateMath.before=function(date,_2ef){
return (date-_2ef)<0;
};
nitobi.base.DateMath.clone=function(date){
var n=new Date(date.toString());
return n;
};
nitobi.base.DateMath.isLeapYear=function(date){
var y=date.getFullYear();
var _1=String(y/4).indexOf(".")==-1;
var _2=String(y/100).indexOf(".")==-1;
var _3=String(y/400).indexOf(".")==-1;
return (_3)?true:(_1&&!_2)?true:false;
};
nitobi.base.DateMath.getMonthDays=function(date){
return [31,(this.isLeapYear(date))?29:28,31,30,31,30,31,31,30,31,30,31][date.getMonth()];
};
nitobi.base.DateMath.getMonthEnd=function(date){
return new Date(date.getFullYear(),date.getMonth(),this.getMonthDays(date));
};
nitobi.base.DateMath.getMonthStart=function(date){
return new Date(date.getFullYear(),date.getMonth(),1);
};
nitobi.base.DateMath.isToday=function(date){
var _2fb=this.resetTime(new Date());
var end=this.add(this.clone(_2fb),this.DAY,1);
return this.between(date,_2fb,end);
};
nitobi.base.DateMath.parse=function(str){
};
nitobi.base.DateMath.getWeekNumber=function(date){
var _2ff=this.getJanuary1st(date);
return Math.ceil(this.getNumberOfDays(_2ff,date)/7);
};
nitobi.base.DateMath.getNumberOfDays=function(_300,end){
var _302=this.resetTime(this.clone(end)).getTime()-this.resetTime(this.clone(_300)).getTime();
return Math.round(_302/this.ONE_DAY_MS)+1;
};
nitobi.base.DateMath.getJanuary1st=function(date){
return new Date(date.getFullYear(),0,1);
};
nitobi.base.DateMath.resetTime=function(date){
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);
return date;
};
nitobi.base.DateMath.parseIso8601=function(date){
return new Date(date.replace(/^(....).(..).(..).(.*)$/,"$1/$2/$3 $4"));
};
nitobi.base.DateMath.toIso8601=function(date){
if(nitobi.base.DateMath.invalid(date)){
return "";
}
var pz=nitobi.lang.padZeros;
return date.getFullYear()+"-"+pz(date.getMonth()+1)+"-"+pz(date.getDate())+" "+pz(date.getHours())+":"+pz(date.getMinutes())+":"+pz(date.getSeconds());
};
nitobi.base.DateMath.invalid=function(date){
return (!date)||(date.toString()=="Invalid Date");
};
nitobi.lang.defineNs("nitobi.base");
nitobi.base.EventArgs=function(_309,_30a){
this.source=_309;
this.event=_30a||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(obj){
nitobi.collections.IEnumerable.prototype.add.call(this,obj);
if(obj.ISerializableImplemented==true&&obj.profile!=null){
this.addChildObject(obj);
}
};
nitobi.collections.IList.prototype.insert=function(_30c,obj){
var _30e=this.get(_30c);
nitobi.collections.IEnumerable.prototype.insert.call(this,_30c,obj);
if(obj.ISerializableImplemented==true&&obj.profile!=null){
this.insertBeforeChildObject(obj,_30e);
}
};
nitobi.collections.IList.prototype.addToCache=function(obj,_310){
nitobi.base.ISerializable.prototype.addToCache.call(this,obj);
this.list[_310]=obj;
};
nitobi.collections.IList.prototype.removeFromCache=function(_311){
nitobi.base.ISerializable.prototype.removeFromCache.call(this,this.list[_311].getId());
};
nitobi.collections.IList.prototype.flushCache=function(){
nitobi.base.ISerializable.prototype.flushCache.call(this);
this.list=new Array();
};
nitobi.collections.IList.prototype.get=function(_312){
if(typeof (_312)=="object"){
return _312;
}
if(_312<0||_312>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
var obj=null;
if(this.list[_312]!=null){
obj=this.list[_312];
}
if(obj==null){
var _314=nitobi.xml.getChildNodes(this.xmlNode)[_312];
if(_314==null){
return null;
}else{
obj=this.factory.createByNode(_314);
this.onCreateObject.notify(obj);
nitobi.collections.IList.prototype.addToCache.call(this,obj,_312);
}
obj.setParentObject(this);
}
return obj;
};
nitobi.collections.IList.prototype.getById=function(id){
var node=this.xmlNode.selectSingleNode("*[@id='"+id+"']");
var _317=nitobi.xml.indexOfChildNode(node.parentNode,node);
return this.get(_317);
};
nitobi.collections.IList.prototype.set=function(_318,_319){
if(_318<0||_318>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
try{
if(_319.ISerializableImplemented==true){
var obj=this.get(_318);
if(obj.getXmlNode()!=_319.getXmlNode()){
var _31b=this.xmlNode.insertBefore(_319.getXmlNode(),obj.getXmlNode());
this.xmlNode.removeChild(obj.getXmlNode());
obj.setXmlNode(_31b);
}
}
_319.setParentObject(this);
nitobi.collections.IList.prototype.addToCache.call(this,_319,_318);
}
catch(err){
nitobi.lang.throwError(nitobi.error.Unexpected,err);
}
};
nitobi.collections.IList.prototype.remove=function(_31c){
var i;
if(typeof (_31c)!="number"){
i=this.indexOf(_31c);
}else{
i=_31c;
}
var obj=this.get(i);
nitobi.collections.IEnumerable.prototype.remove.call(this,_31c);
this.xmlNode.removeChild(obj.getXmlNode());
};
nitobi.collections.IList.prototype.getLength=function(){
return nitobi.xml.getChildNodes(this.xmlNode).length;
};
nitobi.lang.defineNs("nitobi.collections");
nitobi.collections.List=function(_31f){
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(hash){
var _321=true;
for(var item in hash){
if(hash[item]!=null&&hash[item]!=""){
_321=false;
break;
}
}
return _321;
};
nitobi.collections.hashLength=function(hash){
var _324=0;
for(var item in hash){
_324++;
}
return _324;
};
nitobi.collections.serialize=function(hash){
var s="";
for(var item in hash){
var _329=hash[item];
var type=typeof (_329);
if(type=="string"||type=="number"){
s+="'"+item+"':'"+_329+"',";
}
}
s=s.substring(0,s.length-1);
return "{"+s+"}";
};
nitobi.lang.defineNs("nitobi.ui");
if(false){
nitobi.ui=function(){
};
}
nitobi.ui.setWaitScreen=function(_32b){
if(_32b){
var sc=nitobi.html.getBodyArea();
var me=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":(sc.clientHeight/2)+sc.scrollTop-30+"px","left":(sc.clientWidth/2)+sc.scrollLeft-100+"px","width":"200px","height":"60px"});
me.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(me);
}else{
var me=$("NTB_waitDiv");
try{
document.getElementsByTagName("body").item(0).removeChild(me);
}
catch(e){
}
}
};
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.IStyleable=function(_32e){
this.htmlNode=_32e||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(node){
this.htmlNode=node;
};
nitobi.ui.IStyleable.prototype.setStyle=function(name,_331){
if(this.onBeforeSetStyle.notify(new nitobi.ui.StyleEventArgs(this,this.onBeforeSetStyle,name,_331))&&this.getHtmlNode()!=null){
nitobi.html.Css.setStyle(this.getHtmlNode(),name,_331);
this.onSetStyle.notify(new nitobi.ui.StyleEventArgs(this,this.onSetStyle,name,_331));
}
};
nitobi.ui.IStyleable.prototype.getStyle=function(name){
return nitobi.html.Css.getStyle(this.getHtmlNode(),name);
};
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.StyleEventArgs=function(_333,_334,_335,_336){
nitobi.ui.ElementEventArgs.baseConstructor.apply(this,arguments);
this.property=_335||null;
this.value=_336||null;
};
nitobi.lang.extend(nitobi.ui.StyleEventArgs,nitobi.base.EventArgs);
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.IScrollable=function(_337){
this.scrollableElement=_337;
};
nitobi.ui.IScrollable.prototype.setScrollableElement=function(el){
this.scrollableElement=el;
};
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(left){
this.scrollableElement.scrollLeft=left;
};
nitobi.ui.IScrollable.prototype.scrollLeft=function(_33a){
_33a=_33a||25;
this.scrollableElement.scrollLeft-=_33a;
};
nitobi.ui.IScrollable.prototype.scrollRight=function(_33b){
_33b=_33b||25;
this.scrollableElement.scrollLeft+=_33b;
};
nitobi.ui.IScrollable.prototype.isOverflowed=function(_33c){
_33c=_33c||this.scrollableElement.childNodes[0];
return !(parseInt(nitobi.html.getBox(this.scrollableElement).width)>=parseInt(nitobi.html.getBox(_33c).width));
};
nitobi.lang.defineNs("nitobi.ui");
if(false){
nitobi.ui=function(){
};
}
nitobi.ui.startDragOperation=function(_33d,_33e,_33f,_340,_341,_342){
var ddo=new nitobi.ui.DragDrop(_33d,_33f,_340);
ddo.onDragStop.subscribe(_342,_341);
ddo.startDrag(_33e);
};
nitobi.ui.DragDrop=function(_344,_345,_346){
this.allowVertDrag=(_345!=null?_345:true);
this.allowHorizDrag=(_346!=null?_346: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(_344.nodeType==3){
alert("Text node not supported. Use parent element");
}
this.element=_344;
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(_347){
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 _348=nitobi.html.getEventCoords(_347);
x=_348.x;
y=_348.y;
this.originX=x;
this.originY=y;
nitobi.html.attachEvents(document,this.events,this);
nitobi.html.cancelEvent(_347);
this.onDragStart.notify();
};
nitobi.ui.DragDrop.prototype.handleMouseMove=function(_349){
var x,y;
var _34c=nitobi.html.getEventCoords(_349);
x=_34c.x;
y=_34c.y;
if(nitobi.browser.IE){
this.surface.style.display="block";
if(document.compat=="CSS1Compat"){
var _34d=nitobi.html.getBodyArea();
var _34e=0;
if(document.compatMode=="CSS1Compat"){
_34e=25;
}
this.surface.style.width=(_34d.clientWidth-_34e)+"px";
this.surface.style.height=(_34d.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+x-this.originX)+"px";
}
if(this.allowVertDrag){
this.element.style.top=(this.elementOriginTop+y-this.originY)+"px";
}
this.x=x;
this.y=y;
this.onMouseMove.notify(this);
nitobi.html.cancelEvent(_349);
};
nitobi.ui.DragDrop.prototype.handleMouseUp=function(_34f){
this.onDragStop.notify({"event":_34f,"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 _350=null;
try{
_350=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_350=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(ee){
}
}
return _350;
}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.onError=new nitobi.base.Event();
this.timeout=0;
this.timeoutId=null;
this.params=null;
this.data="";
this.completeCallback=null;
this.errorCallback=null;
this.status="complete";
this.preventCache=true;
};
nitobi.lang.extend(nitobi.ajax.HttpRequest,nitobi.Object);
nitobi.ajax.HttpRequestPool_MAXCONNECTIONS=64;
nitobi.ajax.HttpRequest.prototype.handleResponse=function(){
var _351=null;
var _352=null;
if((this.httpObj.responseXML!=null&&this.httpObj.responseXML.documentElement!=null)&&this.responseType!="text"){
_351=this.httpObj.responseXML;
}else{
if(this.responseType=="xml"){
_351=nitobi.xml.createXmlDoc(this.httpObj.responseText);
}else{
_351=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 _351;
};
nitobi.ajax.HttpRequest.prototype.post=function(data,url){
this.handler=url||this.handler;
this.data=data;
this.status="pending";
this.httpObj.open("POST",this.handler,this.async,"","");
if(this.async){
this.httpObj.onreadystatechange=nitobi.lang.close(this,this.postComplete);
}
if(this.responseType=="xml"){
this.httpObj.setRequestHeader("Content-Type","text/xml");
}else{
this.httpObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
this.httpObj.send(data);
if(!this.async){
return this.handleResponse();
}
};
nitobi.ajax.HttpRequest.prototype.postComplete=function(){
if(this.httpObj.readyState==4){
this.status="complete";
var _355={"response":this.handleResponse(),"params":this.params};
this.onPostComplete.notify(_355);
if(this.completeCallback){
this.completeCallback.call(this,_355);
}
}
};
nitobi.ajax.HttpRequest.prototype.postXml=function(_356){
this.setTimeout();
if(("undefined"==typeof (_356.documentElement))||(null==_356.documentElement)||("undefined"==typeof (_356.documentElement.childNodes))||(1>_356.documentElement.childNodes.length)){
ebaErrorReport("updategram is empty. No request sent. xmlData["+_356+"]\nxmlData.xml["+_356.xml+"]");
return;
}
if(null==_356.xml){
var _357=new XMLSerializer();
_356.xml=_357.serializeToString(_356);
}
var sync=this.post(_356.xml);
if(!this.async){
return sync;
}
};
nitobi.ajax.HttpRequest.prototype.get=function(url){
this.handler=url||this.handler;
this.setTimeout();
this.status="pending";
try{
this.httpObj.open("GET",(this.preventCache?this.cacheBust(this.handler):this.handler),this.async);
}
catch(e){
throw (e);
return;
}
if(this.async){
this.httpObj.onreadystatechange=nitobi.lang.close(this,this.getComplete);
}
if(this.responseType=="xml"){
this.httpObj.setRequestHeader("Content-Type","text/xml");
}
this.httpObj.send(null);
if(!this.async){
return this.handleResponse();
}
};
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 _35a={"response":this.handleResponse(),"params":this.params,"status":this.httpObj.status,"statusText":this.httpObj.statusText};
this.onGetComplete.notify(_35a);
if(this.completeCallback){
this.completeCallback.call(this,_35a);
}
}
};
nitobi.ajax.HttpRequest.isError=function(code){
return (code>=400&&code<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(url){
var _35d=url.split("?");
var _35e="nitobi_cachebust="+(new Date().getTime());
if(_35d.length==1){
url+="?"+_35e;
}else{
url+="&"+_35e;
}
return url;
};
nitobi.ajax.HttpRequestPool=function(_35f){
this.inUse=new Array();
this.free=new Array();
this.max=_35f||nitobi.ajax.HttpRequestPool_MAXCONNECTIONS;
this.locked=false;
this.context=null;
};
nitobi.ajax.HttpRequestPool.prototype.reserve=function(){
this.locked=true;
var _360;
if(this.free.length){
_360=this.free.pop();
_360.clear();
this.inUse.push(_360);
}else{
if(this.inUse.length<this.max){
try{
_360=new nitobi.ajax.HttpRequest();
}
catch(e){
_360=null;
}
this.inUse.push(_360);
}else{
throw "No request objects available";
}
}
this.locked=false;
return _360;
};
nitobi.ajax.HttpRequestPool.prototype.release=function(_361){
var _362=false;
this.locked=true;
if(null!=_361){
for(var i=0;i<this.inUse.length;i++){
if(_361==this.inUse[i]){
this.free.push(this.inUse[i]);
this.inUse.splice(i,1);
_362=true;
break;
}
}
}
this.locked=false;
return null;
};
nitobi.ajax.HttpRequestPool.prototype.dispose=function(){
for(var i=0;i<this.inUse.length;i++){
this.inUse[i].dispose();
}
this.inUse=null;
for(var j=0;j<this.free.length;j++){
this.free[i].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(url,_367){
this.url=url||null;
this.transformer=_367||null;
this.async=true;
};
nitobi.data.UrlConnector.prototype.get=function(_368,_369){
var _36a=nitobi.data.UrlConnector.requestPool.reserve();
var _36b=this.url;
for(var p in _368){
_36b=nitobi.html.Url.setParameter(_36b,p,_368[p]);
}
_36a.handler=_36b;
_36a.async=this.async;
_36a.responseType="xml";
_36a.params={dataReadyCallback:_369};
_36a.completeCallback=nitobi.lang.close(this,this.getComplete);
_36a.get();
};
nitobi.data.UrlConnector.prototype.getComplete=function(_36d){
if(_36d.params.dataReadyCallback){
var _36e=_36d.response;
var _36f=_36d.params.dataReadyCallback;
var _370=_36e;
if(this.transformer){
if(typeof (this.transformer)==="function"){
_370=this.transformer.call(null,_36e);
}else{
_370=nitobi.xml.transform(_36e,this.transformer,"xml");
}
}
if(_36f){
_36f.call(null,{result:_370,response:_36d.response});
}
}
};
nitobi.data.UrlConnector.requestPool=new nitobi.ajax.HttpRequestPool();
function ntbAssert(_371,_372,_373,_374){
}
nitobi.lang.defineNs("console");
nitobi.lang.defineNs("nitobi.debug");
if(typeof (console.log)=="undefined"){
console.log=function(s){
nitobi.debug.addDebugTools();
var t=$("nitobi.log");
t.value=s+"\n"+t.value;
};
console.evalCode=function(){
var _377=(eval($("nitobi.consoleEntry").value));
};
}
nitobi.debug.addDebugTools=function(){
var sId="nitobi_debug_panel";
var div=document.getElementById(sId);
var html="<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(div==null){
var div=document.createElement("div");
div.setAttribute("id",sId);
div.innerHTML=html;
document.body.appendChild(div);
}else{
if(div.innerHTML==""){
div.innerHTML=html;
}
}
};
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(_37b,_37c){
}
function ebaSetOnErrorEvent(_37d){
nitobi.debug.setOnErrorEvent.apply(this,arguments);
}
nitobi.debug.setOnErrorEvent=function(_37e){
NTB_ON_ERROR=_37e;
};
function ebaReportError(_37f,_380,_381){
nitobi.debug.errorReport("dude stop calling this method it is now called nitobi.debug.errorReport","");
nitobi.debug.errorReport(_37f,_380,_381);
}
function ebaErrorReport(_382,_383,_384){
nitobi.debug.errorReport.apply(this,arguments);
}
nitobi.debug.errorReport=function(_385,_386,_387){
_387=(_387)?_387:NTB_DEBUG;
if(NTB_DEBUG==_387&&!NTB_DEBUG_MODE){
return;
}
var _388=_385+"\nerror code    ["+_386+"]\nerror Severity["+_387+"]";
LastError=_388;
if(eval(NTB_ON_ERROR||"true")){
switch(_386){
case NTB_EM_ATTRIBUTE_ERROR:
confirm(_385);
break;
case NTB_XHR_RESPONSE_ERROR:
confirm(_385);
break;
default:
window.status=_385;
break;
}
}
if(NTB_THROW==_387){
throw (_388);
}
};
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(_389,_38a,type){
nitobi.error.ErrorEventArgs.baseConstructor.call(this,_389);
this.description=_38a;
this.type=type;
};
nitobi.lang.extend(nitobi.error.ErrorEventArgs,nitobi.base.EventArgs);
nitobi.error.isError=function(err,_38d){
return (err.indexOf(_38d)>-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(_38e){
this.setTemplate(_38e);
this.parameters={};
};
nitobi.html.IRenderer.prototype.renderAfter=function(_38f,data){
_38f=$(_38f);
var _391=_38f.parentNode;
_38f=_38f.nextSibling;
return this._renderBefore(_391,_38f,data);
};
nitobi.html.IRenderer.prototype.renderBefore=function(_392,data){
_392=$(_392);
return this._renderBefore(_392.parentNode,_392,data);
};
nitobi.html.IRenderer.prototype._renderBefore=function(_394,_395,data){
var s=this.renderToString(data);
var _398=document.createElement("div");
_398.innerHTML=s;
var _399=new Array();
if(_398.childNodes){
var i=0;
while(_398.childNodes.length){
_399[i++]=_398.firstChild;
_394.insertBefore(_398.firstChild,_395);
}
}else{
}
return _399;
};
nitobi.html.IRenderer.prototype.renderIn=function(_39b,data){
_39b=$(_39b);
var s=this.renderToString(data);
_39b.innerHTML=s;
return _39b.childNodes;
};
nitobi.html.IRenderer.prototype.renderToString=function(data){
};
nitobi.html.IRenderer.prototype.setTemplate=function(_39f){
this.template=_39f;
};
nitobi.html.IRenderer.prototype.getTemplate=function(){
return this.template;
};
nitobi.html.IRenderer.prototype.setParameters=function(_3a0){
for(var p in _3a0){
this.parameters[p]=_3a0[p];
}
};
nitobi.html.IRenderer.prototype.getParameters=function(){
return this.parameters;
};
nitobi.lang.defineNs("nitobi.html");
nitobi.html.XslRenderer=function(_3a2){
nitobi.html.IRenderer.call(this,_3a2);
};
nitobi.lang.implement(nitobi.html.XslRenderer,nitobi.html.IRenderer);
nitobi.html.XslRenderer.prototype.setTemplate=function(_3a3){
if(typeof (_3a3)==="string"){
_3a3=nitobi.xml.createXslProcessor(_3a3);
}
this.template=_3a3;
};
nitobi.html.XslRenderer.prototype.renderToString=function(data){
if(typeof (data)==="string"){
data=nitobi.xml.createXmlDoc(data);
}
if(nitobi.lang.typeOf(data)===nitobi.lang.type.XMLNODE){
data=nitobi.xml.createXmlDoc(nitobi.xml.serialize(data));
}
var _3a5=this.getTemplate();
var _3a6=this.getParameters();
for(var p in _3a6){
_3a5.addParameter(p,_3a6[p],"");
}
var s=nitobi.xml.transformToString(data,_3a5,"xml");
for(var p in _3a6){
_3a5.addParameter(p,"","");
}
return s;
};
nitobi.lang.defineNs("nitobi.ui");
NTB_CSS_HIDE="nitobi-hide";
nitobi.ui.Element=function(id){
nitobi.ui.Element.baseConstructor.call(this);
nitobi.ui.IStyleable.call(this);
if(id!=null){
if(nitobi.lang.typeOf(id)==nitobi.lang.type.XMLNODE){
nitobi.base.ISerializable.call(this,id);
}else{
if($(id)!=null){
var decl=new nitobi.base.Declaration();
var _3ab=decl.loadHtml($(id));
var _3ac=$(id);
var _3ad=_3ac.parentNode;
var _3ae=_3ad.ownerDocument.createElement("ntb:component");
_3ad.insertBefore(_3ae,_3ac);
_3ad.removeChild(_3ac);
this.setContainer(_3ae);
nitobi.base.ISerializable.call(this,_3ab);
}else{
nitobi.base.ISerializable.call(this);
this.setId(id);
}
}
}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(_3af){
var node=$(_3af);
this.htmlNode=node;
};
nitobi.ui.Element.prototype.getRootId=function(){
var _3b1=this.getParentObject();
if(_3b1==null){
return this.getId();
}else{
return _3b1.getRootId();
}
};
nitobi.ui.Element.prototype.getId=function(){
return this.getAttribute("id");
};
nitobi.ui.Element.parseId=function(id){
var ids=id.split(".");
return {localName:ids[1],id:ids[0]};
};
nitobi.ui.Element.prototype.setId=function(id){
this.setAttribute("id",id);
};
nitobi.ui.Element.prototype.notify=function(_3b5,id,_3b7,_3b8){
try{
_3b5=nitobi.html.getEvent(_3b5);
if(_3b8!==false){
nitobi.html.cancelEvent(_3b5);
}
var _3b9=nitobi.ui.Element.parseId(id).id;
if(!this.isDescendantExists(_3b9)){
return false;
}
var _3ba=!(_3b9==this.getId());
var _3bb=new nitobi.ui.ElementEventArgs(this,null,id);
var _3bc=new nitobi.ui.EventNotificationEventArgs(this,null,id,_3b5);
_3ba=_3ba&&this.onBeforePropagate.notify(_3bc);
var _3bd=true;
if(_3ba){
if(_3b7==null){
_3b7=this.getPathToLeaf(_3b9);
}
var _3be=this.onBeforeEventNotify.notify(_3bc);
var _3bf=(_3be?this.onEventNotify.notify(_3bc):true);
var _3c0=_3b7.pop().getAttribute("id");
var _3c1=this.getObjectById(_3c0);
var _3bd=this.onBeforePropagateToChild.notify(_3bc);
if(_3c1.notify&&_3bd&&_3bf){
_3bd=_3c1.notify(_3b5,id,_3b7,_3b8);
}
}else{
_3bd=this.onEventNotify.notify(_3bc);
}
var _3c2=this.eventMap[_3b5.type];
if(_3c2!=null&&_3bd){
_3c2.notify(this.getEventArgs(_3b5,id));
}
return _3bd;
}
catch(err){
nitobi.lang.throwError(nitobi.error.Unexpected+" Element.notify encountered a problem.",err);
}
};
nitobi.ui.Element.prototype.getEventArgs=function(_3c3,_3c4){
var _3c5=new nitobi.ui.ElementEventArgs(this,null,_3c4);
return _3c5;
};
nitobi.ui.Element.prototype.subscribeDeclarationEvents=function(){
for(var name in this.eventMap){
var ev=this.getAttribute("on"+name);
if(ev!=null&&ev!=""){
this.eventMap[name].subscribe(ev,this,name);
}
}
};
nitobi.ui.Element.prototype.getHtmlNode=function(name){
var id=this.getId();
id=(name!=null?id+"."+name:id);
var node=nitobi.ui.Element.htmlNodeCache[name];
if(node==null){
node=$(id);
nitobi.ui.Element.htmlNodeCache[id]=node;
}
return node;
};
nitobi.ui.Element.prototype.flushHtmlNodeCache=function(){
nitobi.ui.Element.htmlNodeCache={};
};
nitobi.ui.Element.prototype.hide=function(_3cb,_3cc){
this.setVisible(false,_3cb,_3cc);
};
nitobi.ui.Element.prototype.show=function(_3cd,_3ce){
this.setVisible(true,_3cd,_3ce);
};
nitobi.ui.Element.prototype.isVisible=function(){
var node=this.getHtmlNode();
return node&&!nitobi.html.Css.hasClass(node,NTB_CSS_HIDE);
};
nitobi.ui.Element.prototype.setVisible=function(_3d0,_3d1,_3d2){
var _3d3=this.getHtmlNode();
if(_3d3&&this.isVisible()!=_3d0&&this.onBeforeSetVisible.notify({source:this,event:this.onBeforeSetVisible,args:arguments})!==false){
if(this.effect){
this.effect.end();
}
if(_3d0){
if(_3d1){
var _3d4=new _3d1(_3d3);
_3d4.callback=nitobi.lang.close(this,this.handleSetVisible,[_3d2]);
this.effect=_3d4;
_3d4.onFinish.subscribeOnce(nitobi.lang.close(this,function(){
this.effect=null;
}));
_3d4.start();
}else{
nitobi.html.Css.removeClass(_3d3,NTB_CSS_HIDE);
this.handleSetVisible(_3d2);
}
}else{
if(_3d1){
var _3d4=new _3d1(_3d3);
_3d4.callback=nitobi.lang.close(this,this.handleSetVisible,[_3d2]);
this.effect=_3d4;
_3d4.onFinish.subscribeOnce(nitobi.lang.close(this,function(){
this.effect=null;
}));
_3d4.start();
}else{
nitobi.html.Css.addClass(this.getHtmlNode(),NTB_CSS_HIDE);
this.handleSetVisible(_3d2);
}
}
}
};
nitobi.ui.Element.prototype.handleSetVisible=function(_3d5){
if(_3d5){
_3d5();
}
this.onSetVisible.notify(new nitobi.ui.ElementEventArgs(this,this.onSetVisible));
};
nitobi.ui.Element.prototype.setEnabled=function(_3d6){
this.enabled=_3d6;
};
nitobi.ui.Element.prototype.isEnabled=function(){
return this.enabled;
};
nitobi.ui.Element.prototype.render=function(_3d7,_3d8){
this.flushHtmlNodeCache();
_3d8=_3d8||this.getState();
_3d7=$(_3d7)||this.getContainer();
if(_3d7==null){
var _3d7=document.createElement("span");
document.body.appendChild(_3d7);
this.setContainer(_3d7);
}
this.htmlNode=this.renderer.renderIn(_3d7,_3d8)[0];
this.htmlNode.jsObject=this;
};
nitobi.ui.Element.prototype.getContainer=function(){
return this.container;
};
nitobi.ui.Element.prototype.setContainer=function(_3d9){
this.container=$(_3d9);
};
nitobi.ui.Element.prototype.getState=function(){
return this.getXmlNode();
};
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.ElementEventArgs=function(_3da,_3db,_3dc){
nitobi.ui.ElementEventArgs.baseConstructor.apply(this,arguments);
this.targetId=_3dc||null;
};
nitobi.lang.extend(nitobi.ui.ElementEventArgs,nitobi.base.EventArgs);
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.EventNotificationEventArgs=function(_3dd,_3de,_3df,_3e0){
nitobi.ui.EventNotificationEventArgs.baseConstructor.apply(this,arguments);
this.htmlEvent=_3e0||null;
};
nitobi.lang.extend(nitobi.ui.EventNotificationEventArgs,nitobi.ui.ElementEventArgs);
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.Container=function(id){
nitobi.ui.Container.baseConstructor.call(this,id);
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(_3e2,_3e3,_3e4,_3e5,_3e6){
_3e5=(_3e6?nitobi.lang.close(_3e6,_3e5):_3e5)||nitobi.lang.noop;
_3e2=$(_3e2);
if(typeof _3e4=="string"){
_3e4=nitobi.effects.families[_3e4];
}
if(!_3e4){
_3e4=nitobi.effects.families["none"];
}
if(_3e3){
var _3e7=_3e4.show;
}else{
var _3e7=_3e4.hide;
}
if(_3e7){
var _3e8=new _3e7(_3e2);
_3e8.callback=_3e5;
_3e8.start();
}else{
if(_3e3){
nitobi.html.Css.removeClass(_3e2,NTB_CSS_HIDE);
}else{
nitobi.html.Css.addClass(_3e2,NTB_CSS_HIDE);
}
_3e5();
}
};
nitobi.ui.Effects.shrink=function(_3e9,_3ea,_3eb,_3ec){
var rect=_3ea.getClientRects()[0];
_3e9.deltaHeight_Doctype=0-parseInt("0"+nitobi.html.getStyle(_3ea,"border-top-width"))-parseInt("0"+nitobi.html.getStyle(_3ea,"border-bottom-width"))-parseInt("0"+nitobi.html.getStyle(_3ea,"padding-top"))-parseInt("0"+nitobi.html.getStyle(_3ea,"padding-bottom"));
_3e9.deltaWidth_Doctype=0-parseInt("0"+nitobi.html.getStyle(_3ea,"border-left-width"))-parseInt("0"+nitobi.html.getStyle(_3ea,"border-right-width"))-parseInt("0"+nitobi.html.getStyle(_3ea,"padding-left"))-parseInt("0"+nitobi.html.getStyle(_3ea,"padding-right"));
_3e9.oldHeight=Math.abs(rect.top-rect.bottom)+_3e9.deltaHeight_Doctype;
_3e9.oldWidth=Math.abs(rect.right-rect.left)+_3e9.deltaWidth_Doctype;
if(!(typeof (_3e9.width)=="undefined")){
_3e9.deltaWidth=Math.floor(Math.ceil(_3e9.width-_3e9.oldWidth)/(_3eb/nitobi.ui.Effects.ANIMATION_INTERVAL));
}else{
_3e9.width=_3e9.oldWidth;
_3e9.deltaWidth=0;
}
if(!(typeof (_3e9.height)=="undefined")){
_3e9.deltaHeight=Math.floor(Math.ceil(_3e9.height-_3e9.oldHeight)/(_3eb/nitobi.ui.Effects.ANIMATION_INTERVAL));
}else{
_3e9.height=_3e9.oldHeight;
_3e9.deltaHeight=0;
}
nitobi.ui.Effects.resize(_3e9,_3ea,_3eb,_3ec);
};
nitobi.ui.Effects.resize=function(_3ee,_3ef,_3f0,_3f1){
var rect=_3ef.getClientRects()[0];
var _3f3=Math.abs(rect.top-rect.bottom);
var _3f4=Math.max(_3f3+_3ee.deltaHeight+_3ee.deltaHeight_Doctype,0);
if(Math.abs(_3f3-_3ee.height)<Math.abs(_3ee.deltaHeight)){
_3f4=_3ee.height;
_3ee.deltaHeight=0;
}
var _3f5=Math.abs(rect.right-rect.left);
var _3f6=Math.max(_3f5+_3ee.deltaWidth+_3ee.deltaWidth_Doctype,0);
_3f6=(_3f6>=0)?_3f6:0;
if(Math.abs(_3f5-_3ee.width)<Math.abs(_3ee.deltaWidth)){
_3f6=_3ee.width;
_3ee.deltaWidth=0;
}
_3f0-=nitobi.ui.Effects.ANIMATION_INTERVAL;
if(_3f0>0){
window.setTimeout(nitobi.lang.closeLater(this,nitobi.ui.Effects.resize,[_3ee,_3ef,_3f0,_3f1]),nitobi.ui.Effects.ANIMATION_INTERVAL);
}
var _3f7=function(){
_3ef.height=_3f4+"px";
_3ef.style.height=_3f4+"px";
_3ef.width=_3f6+"px";
_3ef.style.width=_3f6+"px";
if(_3f0<=0){
if(_3f1){
window.setTimeout(_3f1,0);
}
}
};
nitobi.ui.Effects.executeNextPulse.push(_3f7);
};
nitobi.ui.Effects.executeNextPulse=new Array();
nitobi.ui.Effects.pulse=function(){
var p;
while(p=nitobi.ui.Effects.executeNextPulse.pop()){
p.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(_3f9){
return _3f9*_3f9*_3f9;
};
nitobi.ui.Effects.cubeRoot=function(_3fa){
var T=0;
var N=parseFloat(_3fa);
if(N<0){
N=-N;
T=1;
}
var M=Math.sqrt(N);
var ctr=1;
while(ctr<101){
var M=M*N;
var M=Math.sqrt(Math.sqrt(M));
ctr++;
}
return M;
};
nitobi.ui.Effects.linear=function(_3ff){
return _3ff;
};
nitobi.ui.Effects.fade=function(_400,_401,time,_403,_404){
_404=_404||nitobi.ui.Effects.linear;
var _405=(new Date()).getTime()+time;
var id=nitobi.component.getUniqueId();
var _407=(new Date()).getTime();
var el=_400;
if(_400.length){
el=_400[0];
}
var _409=nitobi.html.Css.getOpacity(el);
var _40a=(_401-_409<0?-1:0);
nitobi.ui.Effects.fadeIntervalId[id]=window.setInterval(function(){
nitobi.ui.Effects.stepFade(_400,_401,_407,_405,id,_403,_404,_40a);
},nitobi.ui.Effects.fadeIntervalTime);
};
nitobi.ui.Effects.stepFade=function(_40b,_40c,_40d,_40e,id,_410,_411,_412){
var ct=(new Date()).getTime();
var _414=_40e-_40d;
var nct=((ct-_40d)/(_40e-_40d));
if(nct<=0||nct>=1){
nitobi.html.Css.setOpacities(_40b,_40c);
window.clearInterval(nitobi.ui.Effects.fadeIntervalId[id]);
_410();
return;
}else{
nct=Math.abs(nct+_412);
}
var no=_411(nct);
nitobi.html.Css.setOpacities(_40b,no*100);
};
nitobi.lang.defineNs("nitobi.component");
if(false){
nitobi.component=function(){
};
}
nitobi.loadComponent=function(el){
var id=el;
el=$(el);
if(el==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: "+id);
}
if(el.jsObject!=null){
return el.jsObject;
}
var _419;
var _41a=nitobi.html.getTagName(el);
if(_41a=="ntb:grid"){
_419=nitobi.initGrid(el.id);
}else{
if(_41a==="ntb:combo"){
_419=nitobi.initCombo(el.id);
}else{
if(el.jsObject==null){
_419=nitobi.base.Factory.getInstance().createByTag(_41a,el.id,nitobi.component.renderComponent);
if(_419.render&&!_419.onLoadCallback){
_419.render();
}
}else{
_419=el.jsObject;
}
}
}
return _419;
};
nitobi.component.renderComponent=function(_41b){
_41b.source.render();
};
nitobi.getComponent=function(id){
var el=$(id);
if(el==null){
return null;
}
return el.jsObject;
};
nitobi.component.uniqueId=0;
nitobi.component.getUniqueId=function(){
return "ntbcmp_"+(nitobi.component.uniqueId++);
};
nitobi.component.findNitobiComponents=function(_41e,_41f){
if(nitobi.component.isNitobiElement(_41e)){
_41f.push(_41e);
return;
}
var _420=_41e.childNodes;
for(var i=0;i<_420.length;i++){
nitobi.component.findNitobiComponents(_420[i],_41f);
}
return;
};
nitobi.component.isNitobiElement=function(_422){
var _423=nitobi.html.getTagName(_422);
if(_423.substr(0,3)=="ntb"){
return true;
}else{
return false;
}
};
nitobi.component.loadComponentsFromNode=function(_424){
var _425=new Array();
nitobi.component.findNitobiComponents(_424,_425);
for(var i=0;i<_425.length;i++){
nitobi.loadComponent(_425[i].getAttribute("id"));
}
};
nitobi.lang.defineNs("nitobi.effects");
if(false){
nitobi.effects=function(){
};
}
nitobi.effects.Effect=function(_427,_428){
this.element=$(_427);
this.transition=_428.transition||nitobi.effects.Transition.sinoidal;
this.duration=_428.duration||1;
this.fps=_428.fps||50;
this.from=typeof (_428.from)==="number"?_428.from:0;
this.to=typeof (_428.from)==="number"?_428.to:1;
this.delay=_428.delay||0;
this.callback=typeof (_428.callback)==="function"?_428.callback:nitobi.lang.noop;
this.queue=_428.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 now=new Date().getTime();
this.startOn=now+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(pos){
if(!this.running){
this.onBeforeStart.notify(new nitobi.base.EventArgs(this,this.onBeforeStart));
this.setup();
this.running=true;
}
this.update(this.transition(pos*this.delta+this.from));
};
nitobi.effects.Effect.prototype.step=function(now){
if(this.startOn<=now){
if(now>=this.finishOn){
this.end();
return;
}
var pos=(now-this.startOn)/(this.deltaTime);
var _42d=Math.floor(pos*this.totalFrames);
if(this.frame<_42d){
this.render(pos);
this.frame=_42d;
}
}
};
nitobi.effects.Effect.prototype.setup=function(){
};
nitobi.effects.Effect.prototype.update=function(pos){
};
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(_42f,_430,etc){
var args=nitobi.lang.toArray(arguments,2);
return function(_433){
var f=function(){
_42f.apply(this,[_433,_430].concat(args));
};
nitobi.lang.extend(f,_42f);
return new f();
};
};
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(x){
return (-Math.cos(x*Math.PI)/2)+0.5;
};
nitobi.effects.Transition.linear=function(x){
return x;
};
nitobi.effects.Transition.reverse=function(x){
return 1-x;
};
nitobi.lang.defineNs("nitobi.effects");
nitobi.effects.Scale=function(_438,_439,_43a){
nitobi.effects.Scale.baseConstructor.call(this,_438,_439);
this.scaleX=typeof (_439.scaleX)=="boolean"?_439.scaleX:true;
this.scaleY=typeof (_439.scaleY)=="boolean"?_439.scaleY:true;
this.scaleFrom=typeof (_439.scaleFrom)=="number"?_439.scaleFrom:100;
this.scaleTo=_43a;
};
nitobi.lang.extend(nitobi.effects.Scale,nitobi.effects.Effect);
nitobi.effects.Scale.prototype.setup=function(){
var _43b=this.element.style;
this.originalStyle={"top":_43b.top,"left":_43b.left,"width":_43b.width,"height":_43b.height,"overflow":_43b.overflow};
this.factor=(this.scaleTo-this.scaleFrom)/100;
this.dims=[this.element.scrollWidth,this.element.scrollHeight];
_43b.width=this.dims[0]+"px";
_43b.height=this.dims[1]+"px";
_43b.overflow="hidden";
};
nitobi.effects.Scale.prototype.finish=function(){
for(var s in this.originalStyle){
this.element.style[s]=this.originalStyle[s];
}
};
nitobi.effects.Scale.prototype.update=function(pos){
var _43e=(this.scaleFrom/100)+(this.factor*pos);
this.setDimensions(Math.floor(_43e*this.dims[0])||1,Math.floor(_43e*this.dims[1])||1);
};
nitobi.effects.Scale.prototype.setDimensions=function(x,y){
if(this.scaleX){
this.element.style.width=x+"px";
}
if(this.scaleY){
this.element.style.height=y+"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(_441){
nitobi.collections.IEnumerable.prototype.add.call(this,_441);
if(!this.intervalId){
this.intervalId=window.setInterval(nitobi.lang.close(this,this.step),15);
}
};
nitobi.effects.EffectQueue.prototype.step=function(){
var now=new Date().getTime();
this.each(function(e){
e.step(now);
});
};
nitobi.effects.EffectQueue.globalQueue=new nitobi.effects.EffectQueue();
nitobi.lang.defineNs("nitobi.effects");
nitobi.effects.BlindUp=function(_444,_445){
_445=nitobi.lang.merge({scaleX:false,duration:Math.min(0.2*(_444.scrollHeight/100),0.5)},_445||{});
nitobi.effects.BlindUp.baseConstructor.call(this,_444,_445,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(_446,_447){
nitobi.html.Css.swapClass(_446,NTB_CSS_HIDE,NTB_CSS_SMALL);
_447=nitobi.lang.merge({scaleX:false,scaleFrom:0,duration:Math.min(0.2*(_446.scrollHeight/100),0.5)},_447||{});
nitobi.effects.BlindDown.baseConstructor.call(this,_446,_447,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(_448,_449){
_449=nitobi.lang.merge({scaleX:false,duration:Math.min(0.2*(_448.scrollHeight/100),0.3)},_449||{});
nitobi.effects.ShadeUp.baseConstructor.call(this,_448,_449,0);
};
nitobi.lang.extend(nitobi.effects.ShadeUp,nitobi.effects.Scale);
nitobi.effects.ShadeUp.prototype.setup=function(){
nitobi.effects.ShadeUp.base.setup.call(this);
var _44a=nitobi.html.getFirstChild(this.element);
this.originalStyle.position=this.element.style.position;
nitobi.html.position(this.element);
if(_44a){
var _44b=_44a.style;
this.fnodeStyle={position:_44b.position,bottom:_44b.bottom,left:_44b.left};
this.fnode=_44a;
_44b.position="absolute";
_44b.bottom="0px";
_44b.left="0px";
}
};
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 x in this.fnodeStyle){
this.fnode.style[x]=this.fnodeStyle[x];
}
};
nitobi.effects.ShadeDown=function(_44d,_44e){
nitobi.html.Css.swapClass(_44d,NTB_CSS_HIDE,NTB_CSS_SMALL);
_44e=nitobi.lang.merge({scaleX:false,scaleFrom:0,duration:Math.min(0.2*(_44d.scrollHeight/100),0.3)},_44e||{});
nitobi.effects.ShadeDown.baseConstructor.call(this,_44d,_44e,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 _44f=nitobi.html.getFirstChild(this.element);
this.originalStyle.position=this.element.style.position;
nitobi.html.position(this.element);
if(_44f){
var _450=_44f.style;
this.fnodeStyle={position:_450.position,bottom:_450.bottom,left:_450.left,right:_450.right,top:_450.top};
this.fnode=_44f;
_450.position="absolute";
_450.top="";
_450.right="";
_450.bottom="0px";
_450.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 x in this.fnodeStyle){
this.fnode.style[x]=this.fnodeStyle[x];
}
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(_452){
if(_452){
if(typeof (_452)==="string"){
this.strings=[_452];
}else{
this.strings=_452;
}
}else{
this.strings=new Array();
}
};
nitobi.lang.StringBuilder.prototype.append=function(_453){
if(_453){
this.strings.push(_453);
}
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));


