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=_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.dispose=function(_3a,_3b){
try{
if(_3b!=null){
var _3c=_3b.length;
for(var i=0;i<_3c;i++){
if(typeof (_3b[i].dispose)=="function"){
_3b[i].dispose();
}
if(typeof (_3b[i])=="function"){
_3b[i].call(_3a);
}
_3b[i]=null;
}
}
for(var _3e in _3a){
if(_3a[_3e].dispose instanceof Function){
_3a[_3e].dispose();
}
_3a[_3e]=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 _44=(ck2>0?String.fromCharCode(96+ck2):"")+String.fromCharCode(97+ck1);
nitobi.lang.alphaNumCache[_44]=num;
nitobi.lang.numAlphaCache[num]=_44;
return _44;
};
nitobi.lang.alphaToNum=function(_45){
if(typeof (nitobi.lang.alphaNumCache[_45])==="number"){
return nitobi.lang.alphaNumCache[_45];
}
var j=0;
var num=0;
for(var i=_45.length-1;i>=0;i--){
num+=(_45.charCodeAt(i)-96)*Math.pow(26,j++);
}
num=num-1;
nitobi.lang.alphaNumCache[_45]=num;
nitobi.lang.numAlphaCache[num]=_45;
return num;
};
nitobi.lang.alphaNumCache={};
nitobi.lang.numAlphaCache={};
nitobi.lang.toArray=function(obj,_4a){
return Array.prototype.splice.call(obj,_4a||0);
};
nitobi.lang.merge=function(_4b,_4c){
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,_54){
_54=_54||2;
num=num+"";
return nitobi.lang.zeros.substr(0,Math.max(_54-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(_55,_56,_57){
var _58=_57*0.01745329277777778;
if(nitobi.lang.Math.sinTable[_58]==null){
nitobi.lang.Math.sinTable[_58]=Math.sin(_58);
nitobi.lang.Math.cosTable[_58]=Math.cos(_58);
}
var cR=nitobi.lang.Math.cosTable[_58];
var sR=nitobi.lang.Math.sinTable[_58];
var x=_55*cR-_56*sR;
var y=_56*cR+_55*sR;
return {x:x,y:y};
};
nitobi.lang.Math.returnAngle=function(_5d,_5e,_5f,_60){
return Math.atan2(_60-_5e,_5f-_5d)/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="6087";
nitobi.toolkit.version="1.0.6087";
nitobi.lang.defineNs("nitobi");
nitobi.Object=function(){
this.disposal=new Array();
};
nitobi.Object.prototype.setValues=function(_65){
for(var _66 in _65){
if(this[_66]!=null){
if(this[_66].subscribe!=null){
}else{
this[_66]=_65[_66];
}
}else{
if(this[_66] instanceof Function){
this[_66](_65[_66]);
}else{
if(this["set"+_66] instanceof Function){
this["set"+_66](_65[_66]);
}else{
this[_66]=_65[_66];
}
}
}
}
};
nitobi.Object.prototype.dispose=function(){
if(this.disposing){
return;
}
this.disposing=true;
var _67=this.disposal.length;
for(var i=0;i<_67;i++){
if(disposal[i] instanceof Function){
disposal[i].call(context);
}
disposal[i]=null;
}
for(var _69 in this){
if(this[_69].dispose instanceof Function){
this[_69].dispose.call(this[_69]);
}
this[_69]=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 _6a=[{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"}];
var _6b="Unknown";
for(var i=0;i<_6a.length;i++){
var _6d=_6a[i].string;
var _6e=_6a[i].prop;
if(_6d){
if(_6d.indexOf(_6a[i].subString)!=-1){
_6b=_6a[i].identity;
break;
}
}else{
if(_6e){
_6b=_6a[i].identity;
break;
}
}
}
nitobi.browser.IE=(_6b=="Explorer");
nitobi.browser.IE6=(nitobi.browser.IE&&!window.XMLHttpRequest);
nitobi.browser.IE7=(nitobi.browser.IE&&window.XMLHttpRequest);
nitobi.browser.MOZ=(_6b=="Netscape"||_6b=="Firefox");
nitobi.browser.SAFARI=(_6b=="Safari");
nitobi.browser.OPERA=(_6b=="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 _70,end;
if(document.cookie.length>0){
_70=document.cookie.indexOf(id+"=");
if(_70!=-1){
_70+=id.length+1;
end=document.cookie.indexOf(";",_70);
if(end==-1){
end=document.cookie.length;
}
return unescape(document.cookie.substring(_70,end));
}
}
return null;
};
nitobi.browser.Cookies.set=function(id,_73,_74){
var _75=new Date();
_75.setTime(_75.getTime()+(_74*24*3600*1000));
document.cookie=id+"="+escape(_73)+((_74==null)?"":"; expires="+_75.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(_77){
this.lastPage=this.currentPage=_77.substr(_77.indexOf("#")+1);
this.iframe.location.href=_77;
};
nitobi.browser.History.prototype.monitor=function(){
var _78=this.iframe.location.href.split("#");
this.currentPage=_78[1];
if(this.currentPage!=this.lastPage){
this.onChange.notify(_78[0].substring(_78[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(_79){
if(nitobi.browser.IE){
return _79.childNodes;
}else{
return _79.selectNodes("./*");
}
};
nitobi.xml.indexOfChildNode=function(_7a,_7b){
var _7c=nitobi.xml.getChildNodes(_7a);
for(var i=0;i<_7c.length;i++){
if(_7c[i]==_7b){
return i;
}
}
return -1;
};
nitobi.xml.createXmlDoc=function(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,_82){
doc.async=false;
if(nitobi.browser.IE){
doc.loadXML(xml);
}else{
var _83=nitobi.xml.DOMParser.parseFromString(xml,"text/xml");
if(_82){
while(doc.hasChildNodes()){
doc.removeChild(doc.firstChild);
}
for(var i=0;i<_83.childNodes.length;i++){
doc.appendChild(doc.importNode(_83.childNodes[i],true));
}
}else{
doc=_83;
}
_83=null;
}
return doc;
};
nitobi.xml.hasParseError=function(_85){
if(nitobi.browser.IE){
return (_85.parseError!=0);
}else{
if(_85==null||_85.documentElement==null){
return true;
}
var _86=_85.documentElement;
if((_86.tagName=="parserError")||(_86.namespaceURI=="http://www.mozilla.org/newlayout/xml/parsererror.xml")){
return true;
}
return false;
}
};
nitobi.xml.getParseErrorReason=function(_87){
if(!nitobi.xml.hasParseError(_87)){
return "";
}
if(nitobi.browser.IE){
return (_87.parseError.reason);
}else{
return (new XMLSerializer().serializeToString(_87));
}
};
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 _8b=null;
var xt=null;
if(typeof (xsl)!="string"){
xsl=nitobi.xml.serialize(xsl);
}
if(nitobi.browser.IE){
_8b=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0");
xt=new ActiveXObject("MSXML2.XSLTemplate.3.0");
_8b.async=false;
_8b.loadXML(xsl);
xt.stylesheet=_8b;
return xt.createProcessor();
}else{
_8b=nitobi.xml.createXmlDoc(xsl);
xt=new XSLTProcessor();
xt.importStylesheet(_8b);
xt.stylesheet=_8b;
return xt;
}
};
nitobi.xml.parseHtml=function(_8d){
if(typeof (_8d)=="string"){
_8d=document.getElementById(_8d);
}
var _8e=nitobi.html.getOuterHtml(_8d);
var _8f="";
if(nitobi.browser.IE){
var _90=new RegExp("(\\s+.[^=]*)='(.*?)'","g");
_8e=_8e.replace(_90,function(m,_1,_2){
return _1+"=\""+_2.replace(/"/g,"&quot;")+"\"";
});
_8f=(_8e.substring(_8e.indexOf("/>")+2).replace(/(\s+.[^\=]*)\=\s*([^\"^\s^\>]+)/g,"$1=\"$2\" ")).replace(/\n/gi,"").replace(/(.*?:.*?\s)/i,"$1  ");
var _94=new RegExp("=\"([^\"]*)(<)(.*?)\"","gi");
var _95=new RegExp("=\"([^\"]*)(>)(.*?)\"","gi");
while(true){
_8f=_8f.replace(_94,"=\"$1&lt;$3\" ");
_8f=_8f.replace(_95,"=\"$1&gt;$3\" ");
var x=(_94.test(_8f));
if(!_94.test(_8f)){
break;
}
}
}else{
if(nitobi.browser.MOZ){
_8f=_8e.replace(/(\s+.[^\=]*)\=\s*([^\"^\s^\>]+)/g,"$1=\"$2\" ").replace(/\n/gi,"").replace(/\>\s*\</gi,"><").replace(/(.*?:.*?\s)/i,"$1  ");
_8f=_8f.replace(/\&/g,"&amp;");
_8f=_8f.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(_8f.indexOf("xmlns:ntb=\"http://www.nitobi.com\"")<1){
_8f=_8f.replace(/\<(.*?)(\s|\>|\\)/,"<$1 xmlns:ntb=\"http://www.nitobi.com\"$2");
}
_8f=_8f.replace(/\&nbsp\;/gi," ");
return nitobi.xml.createXmlDoc(_8f);
};
nitobi.xml.transform=function(xml,xsl,_99){
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 _9b=doc.documentElement;
if(_9b&&_9b.nodeName.indexOf("ntb:")==0){
_9b.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:ntb","http://www.nitobi.com");
}
return doc;
}
};
nitobi.xml.transformToString=function(xml,xsl,_9e){
var _9f=nitobi.xml.transform(xml,xsl,"text");
if(nitobi.browser.MOZ){
if(_9e=="xml"){
_9f=nitobi.xml.Serializer.serializeToString(_9f);
}else{
if(_9f.documentElement.childNodes[0]==null){
nitobi.lang.throwError("The transformToString fn could not find any valid output");
}
if(_9f.documentElement.childNodes[0].data!=null){
_9f=_9f.documentElement.childNodes[0].data;
}else{
if(_9f.documentElement.childNodes[0].textContent!=null){
_9f=_9f.documentElement.childNodes[0].textContent;
}else{
nitobi.lang.throwError("The transformToString fn could not find any valid output");
}
}
}
}
return _9f;
};
nitobi.xml.transformToXml=function(xml,xsl){
var _a2=nitobi.xml.transform(xml,xsl,"xml");
if(nitobi.browser.IE){
_a2=nitobi.xml.createXmlDoc(_a2);
}else{
if(nitobi.browser.MOZ){
if(_a2.documentElement.nodeName=="transformiix:result"){
_a2=nitobi.xml.createXmlDoc(_a2.documentElement.firstChild.data);
}
}
}
return _a2;
};
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 _a4=null;
try{
_a4=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_a4=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(ee){
}
}
return _a4;
}else{
if(nitobi.browser.MOZ){
return new XMLHttpRequest();
}
}
};
nitobi.xml.createElement=function(_a5,_a6,ns){
ns=ns||"http://www.nitobi.com";
var _a8=null;
if(nitobi.browser.IE){
_a8=_a5.createNode(1,nitobi.xml.nsPrefix+_a6,ns);
}else{
if(_a5.createElementNS){
_a8=_a5.createElementNS(ns,nitobi.xml.nsPrefix+_a6);
}
}
return _a8;
};
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(_aa,_ab,_ac){
if(_ab==null){
this.removeParameter(_ac,_aa);
}else{
this.setParameter(_ac,_aa,_ab);
}
};
XMLDocument.prototype.selectNodes=function(_ad,_ae){
try{
if(this.nsResolver==null){
this.nsResolver=this.createNSResolver(this.documentElement);
}
var _af=this.evaluate(_ad,(_ae?_ae:this),this.nsResolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
var _b0=new Array(_af.snapshotLength);
_b0.expr=_ad;
var j=0;
for(i=0;i<_af.snapshotLength;i++){
var _b2=_af.snapshotItem(i);
if(_b2.nodeType!=3){
_b0[j++]=_b2;
}
}
return _b0;
}
catch(e){
}
};
XMLDocument.prototype.selectSingleNode=function(_b3,_b4){
var _b5=_b3.match(/\[\d+\]/ig);
if(_b5!=null){
var x=_b5[_b5.length-1];
if(_b3.lastIndexOf(x)+x.length!=_b3.length){
_b3+="[1]";
}
}
var _b7=this.selectNodes(_b3,_b4||null);
return ((_b7!=null&&_b7.length>0)?_b7[0]:null);
};
Element.prototype.selectNodes=function(_b8){
var doc=this.ownerDocument;
return doc.selectNodes(_b8,this);
};
Element.prototype.selectSingleNode=function(_ba){
var doc=this.ownerDocument;
return doc.selectSingleNode(_ba,this);
};
}
nitobi.xml.getLocalName=function(_bc){
var _bd=_bc.indexOf(":");
if(_bd==-1){
return _bc;
}else{
return _bc.substr(_bd+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(_bf,_c0){
var _c1=_bf.match(/(\"|\')/g);
if(_c1!=null){
var _c2="concat(";
var _c3="";
var _c4;
for(var i=0;i<_bf.length;i++){
if(_bf.substr(i,1)=="\""){
_c4="&apos;";
}else{
_c4="&quot;";
}
_c2+=_c3+_c4+nitobi.xml.encode(_bf.substr(i,1))+_c4;
_c3=",";
}
_c2+=_c3+"&apos;&apos;";
_c2+=")";
_bf=_c2;
}else{
var _c6=(_c0?"\"":"");
_bf=_c6+nitobi.xml.encode(_bf)+_c6;
}
return _bf;
};
nitobi.lang.defineNs("nitobi.html");
nitobi.html.Url=function(){
};
nitobi.html.Url.setParameter=function(url,key,_c9){
var reg=new RegExp("(\\?|&)("+encodeURIComponent(key)+")=(.*?)(&|$)");
if(url.match(reg)){
return url.replace(reg,"$1$2="+encodeURIComponent(_c9)+"$4");
}
if(url.match(/\?/)){
url=url+"&";
}else{
url=url+"?";
}
return url+encodeURIComponent(key)+"="+encodeURIComponent(_c9);
};
nitobi.html.Url.removeParameter=function(url,key){
var reg=new RegExp("(\\?|&)("+encodeURIComponent(key)+")=(.*?)(&|$)");
return url.replace(reg,function(str,p1,p2,p3,p4,_d3,s){
if(((p1)=="?")&&(p4!="&")){
return "";
}else{
return p1;
}
});
};
nitobi.html.Url.normalize=function(url,_d6){
if(_d6){
if(_d6.indexOf("http://")==0||_d6.indexOf("https://")==0||_d6.indexOf("/")==0){
return _d6;
}
}
var _d7=(url.match(/.*\//)||"")+"";
if(_d6){
return _d7+_d6;
}
return _d7;
};
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(_d9){
this.type=_d9;
this.handlers={};
this.guid=0;
this.setEnabled(true);
};
nitobi.base.Event.prototype.subscribe=function(_da,_db,_dc){
if(_da==null){
return;
}
var _dd=_da;
if(typeof (_da)=="string"){
var s=_da;
s=s.replace(/eventArgs/g,"arguments[0]");
_da=nitobi.lang.close(_db,function(){
eval(s);
});
}
if(typeof _db=="object"&&_da instanceof Function){
_dd=nitobi.lang.close(_db,_da);
}
_dc=_dc||_dd.observer_guid||_da.observer_guid||this.guid++;
_dd.observer_guid=_dc;
_da.observer_guid=_dc;
this.handlers[_dc]=_dd;
return _dc;
};
nitobi.base.Event.prototype.subscribeOnce=function(_df,_e0){
var _e1=null;
var _e2=this;
var _e3=function(){
_df.apply(_e0||null,arguments);
_e2.unSubscribe(_e1);
};
_e1=this.subscribe(_e3);
return _e1;
};
nitobi.base.Event.prototype.unSubscribe=function(_e4){
if(_e4 instanceof Function){
_e4=_e4.observer_guid;
}
this.handlers[_e4]=null;
delete this.handlers[_e4];
};
nitobi.base.Event.prototype.notify=function(_e5){
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 _e6=false;
for(var _e7 in this.handlers){
var _e8=this.handlers[_e7];
if(_e8 instanceof Function){
var rv=(_e8.apply(this,arguments)==false);
_e6=_e6||rv;
}
}
return !_e6;
}
return true;
};
nitobi.base.Event.prototype.dispose=function(){
for(var _ea in this.handlers){
this.handlers[_ea]=null;
}
this.handlers={};
};
nitobi.base.Event.prototype.setEnabled=function(_eb){
this.enabled=_eb;
};
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(_ec,_ed,_ee){
if(_ec.className){
var reg=new RegExp("(\\s|^)"+_ed+"(\\s|$)");
_ec.className=_ec.className.replace(reg,"$1"+_ee+"$2");
}
};
nitobi.html.Css.replaceOrAppend=function(_f0,_f1,_f2){
if(nitobi.html.Css.hasClass(_f0,_f1)){
nitobi.html.Css.swapClass(_f0,_f1,_f2);
}else{
nitobi.html.Css.addClass(_f0,_f2);
}
};
nitobi.html.Css.hasClass=function(_f3,_f4){
if(!_f4||_f4===""){
return false;
}
return (new RegExp("(\\s|^)"+_f4+"(\\s|$)")).test(_f3.className);
};
nitobi.html.Css.addClass=function(_f5,_f6){
if(!nitobi.html.Css.hasClass(_f5,_f6)){
_f5.className=_f5.className?_f5.className+" "+_f6:_f6;
}
};
nitobi.html.Css.removeClass=function(_f7,_f8){
if(nitobi.html.Css.hasClass(_f7,_f8)){
var reg=new RegExp("(\\s|^)"+_f8+"(\\s|$)");
_f7.className=_f7.className.replace(reg,"$2");
}
};
nitobi.html.Css.getRules=function(_fa){
var _fb=null;
if(typeof (_fa)=="number"){
_fb=document.styleSheets[_fa];
}else{
_fb=_fa;
}
if(_fb==null){
return null;
}
try{
if(_fb.cssRules){
return _fb.cssRules;
}
if(_fb.rules){
return _fb.rules;
}
}
catch(e){
}
return null;
};
nitobi.html.Css.getStyleSheetsByName=function(_fc){
var arr=new Array();
var ss=document.styleSheets;
var _ff=new RegExp(_fc.replace(".",".")+"($|\\?)");
for(var i=0;i<ss.length;i++){
arr=nitobi.html.Css._getStyleSheetsByName(_ff,ss[i],arr);
}
return arr;
};
nitobi.html.Css._getStyleSheetsByName=function(_101,_102,arr){
if(_101.test(_102.href)){
arr=arr.concat([_102]);
}
var _104=nitobi.html.Css.getRules(_102);
if(_102.href!=""&&_102.imports){
for(var i=0;i<_102.imports.length;i++){
arr=nitobi.html.Css._getStyleSheetsByName(_101,_102.imports[i],arr);
}
}else{
for(var i=0;i<_104.length;i++){
var s=_104[i].styleSheet;
if(s){
arr=nitobi.html.Css._getStyleSheetsByName(_101,s,arr);
}
}
}
return arr;
};
nitobi.html.Css.imageCache={};
nitobi.html.Css.imageCacheDidNotify=false;
nitobi.html.Css.trackPrecache=function(_107){
nitobi.html.Css.precacheArray[_107]=true;
var _108=false;
for(var i in nitobi.html.Css.precacheArray){
if(!nitobi.html.Css.precacheArray[i]){
_108=true;
}
}
if((!nitobi.html.Css.imageCacheDidNotify)&&(!_108)){
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(_10a){
nitobi.html.Css.isPrecaching=true;
if(!_10a){
var ss=document.styleSheets;
for(var i=0;i<ss.length;i++){
nitobi.html.Css.precacheImages(ss[i]);
}
return;
}
var _10d=/.*?url\((.*?)\).*?/;
var _10e=nitobi.html.Css.getRules(_10a);
var url=nitobi.html.Css.getPath(_10a);
for(var i=0;i<_10e.length;i++){
var rule=_10e[i];
if(rule.styleSheet){
nitobi.html.Css.precacheImages(rule.styleSheet);
}else{
var s=rule.style;
var _112=s?s.backgroundImage:null;
if(_112){
_112=_112.replace(_10d,"$1");
_112=nitobi.html.Url.normalize(url,_112);
if(!nitobi.html.Css.imageCache[_112]){
var _113=new Image();
_113.src=_112;
nitobi.html.Css.precacheArray[_112]=false;
var _114=nitobi.lang.close({},nitobi.html.Css.trackPrecache,[_112]);
_113.onload=_114;
_113.onerror=_114;
_113.onabort=_114;
nitobi.html.Css.imageCache[_112]=_113;
try{
if(_113.width>0){
nitobi.html.Css.precacheArray[_112]=true;
}
}
catch(e){
}
}
}
}
}
if(_10a.href!=""&&_10a.imports){
for(var i=0;i<_10a.imports.length;i++){
nitobi.html.Css.precacheImages(_10a.imports[i]);
}
}
};
nitobi.html.Css.getPath=function(_115){
var href=_115.href;
href=nitobi.html.Url.normalize(href);
if(_115.parentStyleSheet&&href.indexOf("/")!=0&&href.indexOf("http://")!=0&&href.indexOf("https://")!=0){
href=nitobi.html.Css.getPath(_115.parentStyleSheet)+href;
}
return href;
};
nitobi.html.Css.getSheetUrl=nitobi.html.Css.getPath;
nitobi.html.Css.findParentStylesheet=function(_117){
var rule=nitobi.html.Css.getRule(_117);
if(rule){
return rule.parentStyleSheet;
}
return null;
};
nitobi.html.Css.findInSheet=function(_119,_11a,_11b){
if(nitobi.browser.IE6&&typeof _11b=="undefined"){
_11b=0;
}else{
if(_11b>4){
return null;
}
}
_11b++;
var _11c=nitobi.html.Css.getRules(_11a);
for(var rule=0;rule<_11c.length;rule++){
var _11e=_11c[rule];
if(_11e.styleSheet){
var _11f=nitobi.html.Css.findInSheet(_119,_11e.styleSheet,_11b);
if(_11f){
return _11f;
}
}else{
if(_11e.selectorText!=null&&_11e.selectorText.toLowerCase().indexOf(_119)>-1){
if(nitobi.browser.IE){
_11e={selectorText:_11e.selectorText,style:_11e.style,readOnly:_11e.readOnly,parentStyleSheet:_11a};
}
return _11e;
}
}
}
if(_11a.href!=""&&_11a.imports){
for(var i=0;i<_11a.imports.length;i++){
var _11f=nitobi.html.Css.findInSheet(_119,_11a.imports[i],_11b);
if(_11f){
return _11f;
}
}
}
return null;
};
nitobi.html.Css.getClass=function(_121){
_121=_121.toLowerCase();
if(_121.indexOf(".")!==0){
_121="."+_121;
}
var rule=nitobi.html.Css.getRule(_121);
if(rule!=null){
return rule.style;
}
return null;
};
nitobi.html.Css.getStyleBySelector=function(_123){
var rule=nitobi.html.Css.getRule(_123);
if(rule!=null){
return rule.style;
}
return null;
};
nitobi.html.Css.getRule=function(_125){
_125=_125.toLowerCase();
if(_125.indexOf(".")!==0){
_125="."+_125;
}
var _126=document.styleSheets;
for(var ss=0;ss<_126.length;ss++){
try{
var _128=nitobi.html.Css.findInSheet(_125,_126[ss]);
if(_128){
return _128;
}
}
catch(err){
}
}
return null;
};
nitobi.html.Css.getClassStyle=function(_129,_12a){
var _12b=nitobi.html.Css.getClass(_129);
if(_12b!=null){
return _12b[_12a];
}else{
return null;
}
};
nitobi.html.Css.setStyle=function(el,rule,_12e){
rule=rule.replace(/\-(\w)/g,function(_12f,p1){
return p1.toUpperCase();
});
el.style[rule]=_12e;
};
nitobi.html.Css.getStyle=function(oElm,_132){
var _133="";
if(document.defaultView&&document.defaultView.getComputedStyle){
_132=_132.replace(/([A-Z])/g,function($1){
return "-"+$1.toLowerCase();
});
_133=document.defaultView.getComputedStyle(oElm,"").getPropertyValue(_132);
}else{
if(oElm.currentStyle){
_132=_132.replace(/\-(\w)/g,function(_135,p1){
return p1.toUpperCase();
});
_133=oElm.currentStyle[_132];
}
}
return _133;
};
nitobi.html.Css.setOpacities=function(_137,_138){
if(_137.length){
for(var i=0;i<_137.length;i++){
nitobi.html.Css.setOpacity(_137[i],_138);
}
}else{
nitobi.html.Css.setOpacity(_137,_138);
}
};
nitobi.html.Css.setOpacity=function(_13a,_13b){
var s=_13a.style;
if(_13b>100){
_13b=100;
}
if(_13b<0){
_13b=0;
}
if(s.filter!=null){
var _13d=s.filter.match(/alpha\(opacity=[\d\.]*?\)/ig);
if(_13d!=null&&_13d.length>0){
s.filter=s.filter.replace(/alpha\(opacity=[\d\.]*?\)/ig,"alpha(opacity="+_13b+")");
}else{
s.filter+="alpha(opacity="+_13b+")";
}
}else{
s.opacity=(_13b/100);
}
};
nitobi.html.Css.getOpacity=function(_13e){
if(_13e==null){
nitobi.lang.throwError(nitobi.error.ArgExpected+" for nitobi.html.Css.getOpacity");
}
if(nitobi.browser.IE){
if(_13e.style.filter==""){
return 100;
}
var s=_13e.style.filter;
s.match(/opacity=([\d\.]*?)\)/ig);
if(RegExp.$1==""){
return 100;
}
return parseInt(RegExp.$1);
}else{
return Math.abs(_13e.style.opacity?_13e.style.opacity*100:100);
}
};
nitobi.html.Css.getCustomStyle=function(_140,_141){
if(nitobi.browser.IE){
return nitobi.html.getClassStyle(_140,_141);
}else{
var rule=nitobi.html.Css.getRule(_140);
var re=new RegExp("(.*?)({)(.*?)(})","gi");
var _144=rule.cssText.match(re);
re=new RegExp("("+_141+")(:)(.*?)(;)","gi");
_144=re.exec(RegExp.$3);
}
};
if(nitobi.browser.MOZ){
Document.prototype.createStyleSheet=function(){
var _145=this.createElement("style");
this.documentElement.childNodes[0].appendChild(_145);
return _145;
};
HTMLStyleElement.prototype.__defineSetter__("cssText",function(_146){
this.innerHTML=_146;
});
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(_14c,_14d,_14e,oh,ow,oy,ox){
oh=oh||0;
ow=ow||0;
oy=oy||0;
ox=ox||0;
var a=_14e;
var td,sd,tt,tb,tl,tr,th,tw,st,sb,sl,sr,sh,sw;
if(nitobi.browser.IE){
td=_14d.getBoundingClientRect();
sd=_14c.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(_14d);
sd=document.getBoxObjectFor(_14c);
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(_14d);
sd=nitobi.html.getCoords(_14c);
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=_14c.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(_14c)+tt-st+oy)+"px";
}
if(a&65536){
s.top=(nitobi.html.getStyleTop(_14c)+tt-st+th-sh+oy)+"px";
}
if(a&4096){
s.left=(nitobi.html.getStyleLeft(_14c)-sl+tl+ox)+"px";
}
if(a&256){
s.left=(nitobi.html.getStyleLeft(_14c)-sl+tl+tw-sw+ox)+"px";
}
if(a&16){
s.top=(nitobi.html.getStyleTop(_14c)+tt-st+oy+Math.floor((th-sh)/2))+"px";
}
if(a&1){
s.left=(nitobi.html.getStyleLeft(_14c)-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(_163,_164,_165,oh,ow,oy,ox,show){
oh=oh||0;
ow=ow||0;
oy=oy||0;
ox=ox||0;
if(nitobi.browser.moz){
td=document.getBoxObjectFor(_164);
sd=document.getBoxObjectFor(_163);
var _16b=parseInt(document.defaultView.getComputedStyle(_164,"").getPropertyValue("border-left-width"));
var _16c=parseInt(document.defaultView.getComputedStyle(_164,"").getPropertyValue("border-top-width"));
var _16d=parseInt(document.defaultView.getComputedStyle(_163,"").getPropertyValue("border-top-width"));
var _16e=parseInt(document.defaultView.getComputedStyle(_163,"").getPropertyValue("border-bottom-width"));
var _16f=parseInt(document.defaultView.getComputedStyle(_163,"").getPropertyValue("border-left-width"));
var _170=parseInt(document.defaultView.getComputedStyle(_163,"").getPropertyValue("border-right-width"));
oy=oy+_16d-_16c;
ox=ox+_16f-_16b;
}
nitobi.drawing.align(_163,_164,_165,oh,ow,oy,ox,show);
};
nitobi.lang.defineNs("nitobi.html");
if(false){
nitobi.html=function(){
};
}
nitobi.html.createElement=function(_171,_172,_173){
var elem=document.createElement(_171);
for(var attr in _172){
elem.setAttribute(attr,_172[attr]);
}
for(var _176 in _173){
elem.style[_176]=_173[_176];
}
return elem;
};
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 _17c=Node;
var _17d=Path.split("/");
var len=_17d.length;
for(var i=0;i<len;i++){
if(_17c.childNodes[Number(_17d[i])]!=null){
_17c=_17c.childNodes[Number(_17d[i])];
}else{
alert("Path expression failed."+Path);
}
var s="";
}
return _17c;
};
nitobi.html.indexOfChildNode=function(_181,_182){
var _183=_181.childNodes;
for(var i=0;i<_183.length;i++){
if(_183[i]==_182){
return i;
}
}
return -1;
};
nitobi.html.evalScriptBlocks=function(node){
for(var i=0;i<node.childNodes.length;i++){
var _187=node.childNodes[i];
if(_187.nodeName.toLowerCase()=="script"){
eval(_187.text);
}else{
nitobi.html.evalScriptBlocks(_187);
}
}
};
nitobi.html.position=function(node){
var pos=nitobi.html.getStyle($(node),"position");
if(pos=="static"){
node.style.position="relative";
}
};
nitobi.html.setOpacity=function(_18a,_18b){
var _18c=_18a.style;
_18c.opacity=(_18b/100);
_18c.MozOpacity=(_18b/100);
_18c.KhtmlOpacity=(_18b/100);
_18c.filter="alpha(opacity="+_18b+")";
};
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(_194){
if(typeof (_194)=="string"){
return document.getElementById(_194);
}
return _194;
};
if(typeof ($)=="undefined"){
$=nitobi.html.getElement;
}
if(typeof ($F)=="undefined"){
$F=function(id){
var _196=$(id);
if(_196!=null){
return _196.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 _19d=nitobi.lang.parseNumber(nitobi.html.getStyle(document.body,"border-top-width"));
var _19e=nitobi.lang.parseNumber(nitobi.html.getStyle(document.body,"border-left-width"));
var _19f=nitobi.lang.parseNumber(document.body.scrollTop)-(_19d==0?2:_19d);
var _1a0=nitobi.lang.parseNumber(document.body.scrollLeft)-(_19e==0?2:_19e);
var rect=elem.getBoundingClientRect();
return {top:rect.top+_19f,left:rect.left+_1a0,bottom:rect.bottom,right:rect.right,height:rect.bottom-rect.top,width:rect.right-rect.left};
};
}else{
nitobi.html.getBox=function(elem){
var _1a3=0;
var _1a4=0;
var _1a5=elem.parentNode;
while(_1a5.nodeType==1&&_1a5!=document.body){
_1a3+=nitobi.lang.parseNumber(_1a5.scrollTop)-(nitobi.html.getStyle(_1a5,"overflow")=="auto"?nitobi.lang.parseNumber(nitobi.html.getStyle(_1a5,"border-top-width")):0);
_1a4+=nitobi.lang.parseNumber(_1a5.scrollLeft)-(nitobi.html.getStyle(_1a5,"overflow")=="auto"?nitobi.lang.parseNumber(nitobi.html.getStyle(_1a5,"border-left-width")):0);
_1a5=_1a5.parentNode;
}
var _1a6=elem.ownerDocument.getBoxObjectFor(elem);
var _1a7=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-left-width"));
var _1a8=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-right-width"));
var _1a9=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-top-width"));
var top=nitobi.lang.parseNumber(_1a6.y)-_1a3-_1a9;
var left=nitobi.lang.parseNumber(_1a6.x)-_1a4-_1a7;
var _1ac=left+nitobi.lang.parseNumber(_1a6.width);
var _1ad=top+_1a6.height;
var _1ae=nitobi.lang.parseNumber(_1a6.height);
var _1af=nitobi.lang.parseNumber(_1a6.width);
return {top:top,left:left,bottom:_1ad,right:_1ac,height:_1ae,width:_1af};
};
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,_1b3,_1b4){
return nitobi.html.getChildNodeByAttribute(elem,"id",_1b3,_1b4);
};
nitobi.html.getChildNodeByAttribute=function(elem,_1b6,_1b7,_1b8){
for(var i=0;i<elem.childNodes.length;i++){
if(elem.nodeType!=3&&Boolean(elem.childNodes[i].getAttribute)){
if(elem.childNodes[i].getAttribute(_1b6)==_1b7){
return elem.childNodes[i];
}
}
}
if(_1b8){
for(var i=0;i<elem.childNodes.length;i++){
var _1ba=nitobi.html.getChildNodeByAttribute(elem.childNodes[i],_1b6,_1b7,_1b8);
if(_1ba!=null){
return _1ba;
}
}
}
return null;
};
nitobi.html.getParentNodeById=function(elem,_1bc){
return nitobi.html.getParentNodeByAtt(elem,"id",_1bc);
};
nitobi.html.getParentNodeByAtt=function(elem,att,_1bf){
while(elem.parentNode!=null){
if(elem.parentNode.getAttribute(att)==_1bf){
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 _1c3,_1c4=0;
if((nitobi.browser.OPERA==false)&&(document.documentElement.scrollTop>0)){
_1c3=document.documentElement.scrollTop;
_1c4=document.documentElement.scrollLeft;
}else{
_1c3=document.body.scrollTop;
_1c4=document.body.scrollLeft;
}
if(((_1c3==0)&&(document.documentElement.scrollTop>0))||((_1c4==0)&&(document.documentElement.scrollLeft>0))){
_1c3=document.documentElement.scrollTop;
_1c4=document.documentElement.scrollLeft;
}
return {"left":_1c4,"top":_1c3};
};
nitobi.html.getCoords=function(_1c5){
var ew,eh;
try{
var _1c8=_1c5;
ew=_1c5.offsetWidth;
eh=_1c5.offsetHeight;
for(var lx=0,ly=0;_1c5!=null;lx+=_1c5.offsetLeft,ly+=_1c5.offsetTop,_1c5=_1c5.offsetParent){
}
for(;_1c8!=document.body;lx-=_1c8.scrollLeft,ly-=_1c8.scrollTop,_1c8=_1c8.parentNode){
}
}
catch(e){
}
return {"x":lx,"y":ly,"height":eh,"width":ew};
};
nitobi.html.scrollBarWidth=0;
nitobi.html.getScrollBarWidth=function(_1cb){
if(nitobi.html.scrollBarWidth){
return nitobi.html.scrollBarWidth;
}
try{
if(null==_1cb){
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);
}
_1cb=d;
}
if(nitobi.browser.IE){
nitobi.html.scrollBarWidth=Math.abs(_1cb.offsetWidth-_1cb.clientWidth-(_1cb.clientLeft?_1cb.clientLeft*2:0));
}else{
var b=document.getBoxObjectFor(_1cb);
nitobi.html.scrollBarWidth=Math.abs((b.width-_1cb.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 _1ce,_1cf,_1d0,_1d1;
var x,y;
var _1d4=navigator.userAgent.toLowerCase();
var _1d5=false;
var _1d6=false;
var _1d7=false;
var ie=false;
var _1d9=false;
if(_1d4.indexOf("opera")>=0){
_1d5=true;
}
if(_1d4.indexOf("firefox")>=0){
_1d6=true;
}
if(_1d4.indexOf("msie")>=0){
ie=true;
}
if(_1d4.indexOf("safari")>=0){
_1d7=true;
}
if(document.compatMode=="CSS1Compat"){
_1d9=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;
}
}
}
_1d0=x;
_1d1=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;
}
}
}
_1ce=x;
_1cf=y;
var _1dc=db.scrollHeight;
var _1dd=db.offsetHeight;
if(_1dc>_1dd){
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<_1d1){
nitobi.html.permHeight=_1d1;
if(ie&&_1d9){
_1d0+=20;
}
}
if(_1d0<nitobi.html.permWidth){
_1d0=nitobi.html.permWidth;
}
if(nitobi.html.permHeight>_1d1){
_1d0+=20;
}
var _1de,_1df;
_1de=de.scrollHeight;
_1df=de.scrollWidth;
return {scrollWidth:_1df,scrollHeight:_1de,scrollLeft:_1ce,scrollTop:_1cf,clientWidth:_1d0,clientHeight:_1d1,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 _1e3=node.attributes[a].nodeValue;
}
}
html+=">";
html+=_1e3;
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 _1e5=this.nextSibling;
var _1e6=this.parentNode;
node.parentNode.replaceChild(this,node);
_1e6.insertBefore(node,_1e5);
};
HTMLElement.prototype.getBoundingClientRect=function(_1e7,_1e8){
_1e7=_1e7||0;
_1e8=_1e8||0;
var td=document.getBoxObjectFor(this);
var top=td.y-_1e7;
var left=td.x-_1e8;
return {top:top,left:left,bottom:(top+td.height),right:(left+td.width)};
};
HTMLElement.prototype.getClientRects=function(_1ec,_1ed){
_1ec=_1ec||0;
_1ed=_1ed||0;
var td=document.getBoxObjectFor(this);
return new Array({top:(td.y-_1ec),left:(td.x-_1ed),bottom:(td.y+td.height-_1ec),right:(td.x+td.width-_1ed)});
};
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(_1f1,_1f2,_1f3){
var df;
var r=this.ownerDocument.createRange();
switch(String(_1f1).toLowerCase()){
case "beforebegin":
r.setStartBefore(this);
df=r.createContextualFragment(_1f2);
this.parentNode.insertBefore(df,this);
break;
case "afterbegin":
r.selectNodeContents(this);
r.collapse(true);
df=r.createContextualFragment(_1f2);
this.insertBefore(df,this.firstChild);
break;
case "beforeend":
if(_1f3==true){
this.innerHTML=this.innerHTML+_1f2;
}else{
r.selectNodeContents(this);
r.collapse(false);
df=r.createContextualFragment(_1f2);
this.appendChild(df);
}
break;
case "afterend":
r.setStartAfter(this);
df=r.createContextualFragment(_1f2);
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(_1f9,_1fa,_1fb){
var _1fc=[];
for(var i=0;i<_1fa.length;i++){
var e=_1fa[i];
_1fc.push(nitobi.html.attachEvent(_1f9,e.type,e.handler,_1fb,e.capture||false));
}
return _1fc;
};
nitobi.html.attachEvent=function(_1ff,type,_201,_202,_203,_204){
if(type=="anyclick"){
if(nitobi.browser.IE){
nitobi.html.attachEvent(_1ff,"dblclick",_201,_202,_203,_204);
}
type="click";
}
if(!(_201 instanceof Function)){
nitobi.lang.throwError("Event handler needs to be a Function");
}
_1ff=$(_1ff);
if(type.toLowerCase()=="unload"&&_204!=true){
var _205=_201;
if(_202!=null){
_205=function(){
_201.call(_202);
};
}
return this.addUnload(_205);
}
var _206=this.handlerId++;
var _207=this.elementId++;
if(typeof (_201.ebaguid)!="undefined"){
_206=_201.ebaguid;
}else{
_201.ebaguid=_206;
}
if(typeof (_1ff.ebaguid)=="undefined"){
_1ff.ebaguid=_207;
nitobi.html.elements[_207]=_1ff;
}
if(typeof (_1ff.eba_events)=="undefined"){
_1ff.eba_events={};
}
if(_1ff.eba_events[type]==null){
_1ff.eba_events[type]={};
if(_1ff.attachEvent){
_1ff["eba_event_"+type]=function(){
nitobi.html.notify.call(_1ff,window.event);
};
_1ff.attachEvent("on"+type,_1ff["eba_event_"+type]);
if(_203&&_1ff.setCapture!=null){
_1ff.setCapture(true);
}
}else{
if(_1ff.addEventListener){
_1ff["eba_event_"+type]=function(){
nitobi.html.notify.call(_1ff,arguments[0]);
};
_1ff.addEventListener(type,_1ff["eba_event_"+type],_203);
}
}
}
_1ff.eba_events[type][_206]={handler:_201,context:_202};
return _206;
};
nitobi.html.notify=function(e){
if(!nitobi.browser.IE){
e.srcElement=e.target;
e.fromElement=e.relatedTarget;
e.toElement=e.relatedTarget;
}
var _209=this;
e.eventSrc=_209;
nitobi.html.Event=e;
for(var _20a in _209.eba_events[e.type]){
var _20b=_209.eba_events[e.type][_20a];
if(typeof (_20b.context)=="object"){
_20b.handler.call(_20b.context,e,_209);
}else{
_20b.handler.call(_209,e,_209);
}
}
};
nitobi.html.detachEvents=function(_20c,_20d){
for(var i=0;i<_20d.length;i++){
var e=_20d[i];
nitobi.html.detachEvent(_20c,e.type,e.handler);
}
};
nitobi.html.detachEvent=function(_210,type,_212){
_210=$(_210);
var _213=_212;
if(_212 instanceof Function){
_213=_212.ebaguid;
}
if(type=="unload"){
this.unload.splice(ebaguid,1);
}
if(_210.eba_events!=null&&_210.eba_events[type]!=null&&_210.eba_events[type][_213]!=null){
var _214=_210.eba_events[type];
_214[_213]=null;
delete _214[_213];
if(nitobi.collections.isHashEmpty(_214)){
this.m_detach(_210,type,_210["eba_event_"+type]);
_210["eba_event_"+type]=null;
_210.eba_events[type]=null;
_214=null;
if(_210.nodeType==1){
_210.removeAttribute("eba_event_"+type);
}
}
}
return true;
};
nitobi.html.m_detach=function(_215,type,_217){
if(_217!=null&&_217 instanceof Function){
if(_215.detachEvent){
_215.detachEvent("on"+type,_217);
}else{
if(_215.removeEventListener){
_215.removeEventListener(type,_217,false);
}
}
_215["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 _21a in nitobi.html.elements[i].eba_events){
nitobi.html.m_detach(nitobi.html.elements[i],_21a,nitobi.html.elements[i]["eba_event_"+_21a]);
if(typeof (nitobi.html.elements[i])!="undefined"&&nitobi.html.elements[i].eba_events[_21a]!=null){
for(var j=0;j<nitobi.html.elements[i].eba_events[_21a].length;j++){
nitobi.html.elements[i].eba_events[_21a][j]=null;
}
}
nitobi.html.elements[i]["eba_event_"+_21a]=null;
}
}
}
nitobi.html.elements=null;
};
nitobi.html.addUnload=function(_21c){
this.unload.push(_21c);
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 _223={"x":evt.clientX,"y":evt.clientY};
if(nitobi.browser.IE){
_223.x+=document.documentElement.scrollLeft+document.body.scrollLeft;
_223.y+=document.documentElement.scrollTop+document.body.scrollTop;
}else{
_223.x+=window.scrollX;
_223.y+=window.scrollY;
}
return _223;
};
nitobi.html.getEvent=function(_224){
if(nitobi.browser.IE){
return window.event;
}else{
_224.srcElement=_224.target;
_224.fromElement=_224.relatedTarget;
_224.toElement=_224.relatedTarget;
return _224;
}
};
nitobi.html.createEvent=function(_225,_226,_227,_228){
if(nitobi.browser.IE){
_227.target.fireEvent("on"+_226);
}else{
var _229=document.createEvent(_225);
_229.initKeyEvent(_226,true,true,document.defaultView,_227.ctrlKey,_227.altKey,_227.shiftKey,_227.metaKey,_228.keyCode,_228.charCode);
_227.target.dispatchEvent(_229);
}
};
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,_22b){
nitobi.event.publish(key);
var guid=this.guid++;
this.keys[key].add(_22b,guid);
return guid;
};
nitobi.event.unsubscribe=function(key,guid){
if(this.keys[key]==null){
return true;
}
this.keys[key].remove(guid);
};
nitobi.event.evaluate=function(func,_230){
var _231=true;
if(typeof func=="string"){
func=func.replace(/eventArgs/gi,"arguments[1]");
var _232=eval(func);
_231=(typeof (_232)=="undefined"?true:_232);
}
return _231;
};
nitobi.event.publish=function(key){
if(this.keys[key]==null){
this.keys[key]=new nitobi.event.Key();
}
};
nitobi.event.notify=function(key,_235){
if(this.keys[key]!=null){
return this.keys[key].notify(_235);
}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(_237,guid){
this.handlers[guid]=_237;
};
nitobi.event.Key.prototype.remove=function(guid){
this.handlers[guid]=null;
delete this.handlers[guid];
};
nitobi.event.Key.prototype.notify=function(_23a){
var fail=false;
for(var item in this.handlers){
var _23d=this.handlers[item];
if(_23d instanceof Function){
var rv=(_23d.apply(this,arguments)==false);
fail=fail||rv;
}else{
}
}
return !fail;
};
nitobi.event.Key.prototype.dispose=function(){
for(var _23f in this.handlers){
this.handlers[_23f]=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(_242,obj){
this.list.splice(_242,0,obj);
this.length++;
};
nitobi.collections.IEnumerable.createNewArray=function(obj,_245){
var _246;
_245=_245||0;
if(obj.count){
_246=obj.count;
}
if(obj.length){
_246=obj.length;
}
var x=new Array(_246-_245);
for(var i=_245;i<_246;i++){
x[i-_245]=obj[i];
}
return x;
};
nitobi.collections.IEnumerable.prototype.get=function(_249){
if(_249<0||_249>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
return this.list[_249];
};
nitobi.collections.IEnumerable.prototype.set=function(_24a,_24b){
if(_24a<0||_24a>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
this.list[_24a]=_24b;
};
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(_24e){
var i;
if(typeof (_24e)!="number"){
i=this.indexOf(_24e);
}else{
i=_24e;
}
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(_254,id,xml,_257){
nitobi.Object.call(this);
if(typeof (this.ISerializableInitialized)=="undefined"){
this.ISerializableInitialized=true;
}else{
return;
}
this.xmlNode=null;
this.setXmlNode(_254);
if(_254!=null){
this.profile=nitobi.base.Registry.getInstance().getCompleteProfile({idField:null,tagName:_254.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(_254!=null){
this.deserializeFromXmlNode(this.getXmlNode());
}else{
if(this.factory!=null&&this.profile.tagName!=null){
this.createByProfile(this.profile,this.getXmlNode());
}else{
if(xml!=null&&_254!=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(_258,_259){
if(_259==null){
var xml="<"+_258.tagName+" xmlns:"+nitobi.base.XmlNamespace.prefix+"=\""+nitobi.base.XmlNamespace.uri+"\" />";
var _25b=nitobi.xml.createXmlDoc(xml);
this.setXmlNode(_25b.firstChild);
this.deserializeFromXmlNode(this.xmlNode);
}else{
this.deserializeFromXmlNode(_259);
this.setXmlNode(_259);
}
};
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(_25d){
this.parentObj=_25d;
this.onSetParentObject.notify();
};
nitobi.base.ISerializable.prototype.addChildObject=function(_25e){
this.addToCache(_25e);
_25e.setParentObject(this);
var _25f=_25e.getXmlNode();
if(!this.areGuidsGenerated(_25f)){
_25f=this.generateGuids(_25f);
_25e.setXmlNode(_25f);
}
this.xmlNode.appendChild(_25f);
};
nitobi.base.ISerializable.prototype.insertBeforeChildObject=function(obj,_261){
_261=_261?_261.getXmlNode():null;
this.addToCache(obj);
obj.setParentObject(this);
var _262=obj.getXmlNode();
if(!this.areGuidsGenerated(_262)){
_262=this.generateGuids(_262);
obj.setXmlNode(_262);
}
this.xmlNode.insertBefore(_262,_261);
};
nitobi.base.ISerializable.prototype.createElement=function(name){
var _264;
if(this.xmlNode==null||this.xmlNode.ownerDocument==null){
_264=nitobi.xml.createXmlDoc();
}else{
_264=this.xmlNode.ownerDocument;
}
if(nitobi.browser.IE){
return _264.createNode(1,name,nitobi.base.XmlNamespace.uri);
}else{
if(_264.createElementNS){
return _264.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(_26a){
if(_26a==null||_26a.ownerDocument==null){
return false;
}
if(nitobi.browser.IE){
var node=_26a.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 (_26a.ownerDocument.generatedGuids==true);
}
};
nitobi.base.ISerializable.prototype.setGuidsGenerated=function(_26d,_26e){
if(_26d==null||_26d.ownerDocument==null){
return;
}
if(nitobi.browser.IE){
var node=_26d.ownerDocument.documentElement;
if(node!=null){
var id=node.getAttribute("id");
if(id!=null&&id!=""){
nitobi.base.ISerializable.guidMap[id]=true;
}
}
}else{
_26d.ownerDocument.generatedGuids=true;
}
};
nitobi.base.ISerializable.prototype.generateGuids=function(_271){
nitobi.base.uniqueIdGeneratorProc.addParameter("guid",nitobi.component.getUniqueId(),"");
var doc=nitobi.xml.transformToXml(_271,nitobi.base.uniqueIdGeneratorProc);
this.saveDocument=doc;
this.setGuidsGenerated(doc.documentElement,true);
return doc.documentElement;
};
nitobi.base.ISerializable.prototype.deserializeFromXmlNode=function(_273){
if(!this.areGuidsGenerated(_273)){
_273=this.generateGuids(_273);
}
this.setXmlNode(_273);
this.flushCache();
if(this.profile==null){
this.profile=nitobi.base.Registry.getInstance().getCompleteProfile({idField:null,tagName:_273.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 _279=this.getElement(id);
if(_279==null){
return null;
}else{
obj=this.factory.createByNode(_279);
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(_27d){
this.factory=factory;
};
nitobi.base.ISerializable.prototype.getXmlNode=function(){
return this.xmlNode;
};
nitobi.base.ISerializable.prototype.setXmlNode=function(_27e){
if(nitobi.lang.typeOf(_27e)==nitobi.lang.type.XMLDOC&&_27e!=null){
this.ownerDocument=_27e;
_27e=nitobi.html.getFirstChild(_27e);
}else{
if(_27e!=null){
this.ownerDocument=_27e.ownerDocument;
}
}
if(_27e!=null&&nitobi.browser.MOZ&&_27e.ownerDocument==null){
nitobi.lang.throwError(nitobi.error.OrphanXmlNode+" ISerializable.setXmlNode");
}
this.xmlNode=_27e;
};
nitobi.base.ISerializable.prototype.serializeToXml=function(){
return nitobi.xml.serialize(this.xmlNode);
};
nitobi.base.ISerializable.prototype.getAttribute=function(name,_280){
if(this[name]!=null){
return this[name];
}
var _281=this.xmlNode.getAttribute(name);
return _281===null?_280:_281;
};
nitobi.base.ISerializable.prototype.setAttribute=function(name,_283){
this[name]=_283;
this.xmlNode.setAttribute(name.toLowerCase(),_283!=null?_283.toString():"");
};
nitobi.base.ISerializable.prototype.setIntAttribute=function(name,_285){
var n=parseInt(_285);
if(_285!=null&&(typeof (n)!="number"||isNaN(n))){
nitobi.lang.throwError(name+" is not an integer and therefore cannot be set. It's value was "+_285);
}
this.setAttribute(name,_285);
};
nitobi.base.ISerializable.prototype.getIntAttribute=function(name,_288){
var x=this.getAttribute(name,_288);
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,_28c){
_28c=nitobi.lang.getBool(_28c);
if(_28c!=null&&typeof (_28c)!="boolean"){
nitobi.lang.throwError(name+" is not an boolean and therefore cannot be set. It's value was "+_28c);
}
this.setAttribute(name,(_28c?"true":"false"));
};
nitobi.base.ISerializable.prototype.getBoolAttribute=function(name,_28e){
var x=this.getAttribute(name,_28e);
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,_292){
this.setAttribute(name,_292);
};
nitobi.base.ISerializable.prototype.getDateAttribute=function(name,_294){
if(this[name]){
return this[name];
}
var _295=this.getAttribute(name,_294);
return _295?new Date(_295):null;
};
nitobi.base.ISerializable.prototype.getId=function(){
return this.getAttribute("id");
};
nitobi.base.ISerializable.prototype.getChildObjectId=function(_296,_297){
var _298=(typeof (_296.className)=="string"?_296.tagName:_296.getXmlNode().nodeName);
var _299=_298;
if(_297){
_299+="[@instancename='"+_297+"']";
}
var node=this.getXmlNode().selectSingleNode(_299);
if(null==node){
return null;
}else{
return node.getAttribute("id");
}
};
nitobi.base.ISerializable.prototype.setObject=function(_29b,_29c){
if(_29b.ISerializableImplemented!=true){
nitobi.lang.throwError(nitobi.error.ExpectedInterfaceNotFound+" ISerializable");
}
var id=this.getChildObjectId(_29b,_29c);
if(null!=id){
this.deleteChildObject(id);
}
if(_29c){
_29b.setAttribute("instancename",_29c);
}
this.addChildObject(_29b);
};
nitobi.base.ISerializable.prototype.getObject=function(_29e,_29f){
var id=this.getChildObjectId(_29e,_29f);
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 _2a4=node.selectSingleNode("//*[@id='"+id+"']");
return (_2a4!=null);
};
nitobi.base.ISerializable.prototype.getPathToLeaf=function(id){
var node=this.getXmlNode();
var _2a7=node.selectSingleNode("//*[@id='"+id+"']");
if(nitobi.browser.IE){
_2a7.ownerDocument.setProperty("SelectionLanguage","XPath");
}
var _2a8=_2a7.selectNodes("./ancestor-or-self::*");
var _2a9=this.getId();
var _2aa=0;
for(var i=0;i<_2a8.length;i++){
if(_2a8[i].getAttribute("id")==_2a9){
_2aa=i+1;
break;
}
}
var arr=nitobi.collections.IEnumerable.createNewArray(_2a8,_2aa);
return arr.reverse();
};
nitobi.base.ISerializable.prototype.isDescendantInstantiated=function(id){
var node=this.getXmlNode();
var _2af=node.selectSingleNode("//*[@id='"+id+"']");
if(nitobi.browser.IE){
_2af.ownerDocument.setProperty("SelectionLanguage","XPath");
}
var _2b0=_2af.selectNodes("ancestor::*");
var _2b1=false;
var obj=this;
for(var i=0;i<_2b0.length;i++){
if(_2b1){
var _2b4=_2b0[i].getAttribute("id");
instantiated=obj.inCache(_2b4);
if(!instantiated){
return false;
}
obj=this.getObjectById(_2b4);
}
if(_2b0[i].getAttribute("id")==this.getId()){
_2b1=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(_2b5){
return this.classMap[_2b5];
};
nitobi.base.Registry.prototype.getProfileByInstance=function(_2b6){
var _2b7=nitobi.lang.getFirstFunction(_2b6);
var p=_2b7.value.prototype;
var _2b9=null;
var _2ba=0;
for(var _2bb in this.classMap){
var _2bc=this.classMap[_2bb].classObject;
var _2bd=0;
while(_2bc&&_2b6 instanceof _2bc){
_2bc=_2bc.baseConstructor;
_2bd++;
}
if(_2bd>_2ba){
_2ba=_2bd;
_2b9=_2bb;
}
}
if(_2b9){
return this.getProfileByClass(_2b9);
}else{
return null;
}
};
nitobi.base.Registry.prototype.getProfileByTag=function(_2be){
return this.tagMap[_2be];
};
nitobi.base.Registry.prototype.getCompleteProfile=function(_2bf){
if(nitobi.lang.isDefined(_2bf.className)&&_2bf.className!=null){
return this.classMap[_2bf.className];
}
if(nitobi.lang.isDefined(_2bf.tagName)&&_2bf.tagName!=null){
return this.tagMap[_2bf.tagName];
}
nitobi.lang.throwError("A complete class profile could not be found. Insufficient information was provided.");
};
nitobi.base.Registry.prototype.register=function(_2c0){
if(!nitobi.lang.isDefined(_2c0.tagName)||null==_2c0.tagName){
nitobi.lang.throwError("Illegal to register a class without a tagName.");
}
if(!nitobi.lang.isDefined(_2c0.className)||null==_2c0.className){
nitobi.lang.throwError("Illegal to register a class without a className.");
}
this.tagMap[_2c0.tagName]=_2c0;
this.classMap[_2c0.className]=_2c0;
};
}
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(_2c1){
try{
return nitobi.lang.newObject(_2c1,arguments,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByClass) could not create the class "+_2c1+".",err);
}
};
nitobi.base.Factory.prototype.createByNode=function(_2c2){
try{
if(null==_2c2){
nitobi.lang.throwError(nitobi.error.ArgExpected);
}
if(nitobi.lang.typeOf(_2c2)==nitobi.lang.type.XMLDOC){
_2c2=nitobi.xml.getChildNodes(_2c2)[0];
}
var _2c3=this.registry.getProfileByTag(_2c2.nodeName).className;
var _2c4=_2c2.ownerDocument;
var _2c5=Array.prototype.slice.call(arguments,0);
var obj=nitobi.lang.newObject(_2c3,_2c5,0);
return obj;
}
catch(err){
nitobi.lang.throwError("The Factory (createByNode) could not create the class "+_2c3+".",err);
}
};
nitobi.base.Factory.prototype.createByProfile=function(_2c7){
try{
return nitobi.lang.newObject(_2c7.className,arguments,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByProfile) could not create the class "+_2c7.className+".",err);
}
};
nitobi.base.Factory.prototype.createByTag=function(_2c8){
try{
var _2c9=this.registry.getProfileByTag(_2c8).className;
var _2ca=Array.prototype.slice.call(arguments,0);
return nitobi.lang.newObject(_2c9,_2ca,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByTag) could not create the class "+_2c9+".",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(_2cb,_2cc,_2cd,_2ce,_2cf){
this.className=_2cb;
this.classObject=eval(_2cb);
this.schema=_2cc;
this.singleton=_2cd;
this.tagName=_2ce;
this.idField=_2cf||"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(_2d0){
try{
_2d0=$(_2d0);
this.xmlDoc=nitobi.xml.parseHtml(_2d0);
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,_2d3){
if(unit==this.DAY){
date.setDate(date.getDate()+_2d3);
}else{
if(unit==this.WEEK){
date.setDate(date.getDate()+7*_2d3);
}else{
if(unit==this.MONTH){
date.setMonth(date.getMonth()+_2d3);
}else{
if(unit==this.YEAR){
date.setFullYear(date.getFullYear()+_2d3);
}
}
}
}
return date;
};
nitobi.base.DateMath.add=function(date,unit,_2d6){
return this._add(date,unit,_2d6);
};
nitobi.base.DateMath.subtract=function(date,unit,_2d9){
return this._add(date,unit,-1*_2d9);
};
nitobi.base.DateMath.after=function(date,_2db){
return (date-_2db)>0;
};
nitobi.base.DateMath.between=function(date,_2dd,end){
return (date-_2dd)>=0&&(end-date)>0;
};
nitobi.base.DateMath.before=function(date,_2e0){
return (date-_2e0)<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 _2ec=this.resetTime(new Date());
var end=this.add(this.clone(_2ec),this.DAY,1);
return this.between(date,_2ec,end);
};
nitobi.base.DateMath.parse=function(str){
};
nitobi.base.DateMath.getWeekNumber=function(date){
var _2f0=this.getJanuary1st(date);
return Math.ceil(this.getNumberOfDays(_2f0,date)/7);
};
nitobi.base.DateMath.getNumberOfDays=function(_2f1,end){
var _2f3=this.resetTime(this.clone(end)).getTime()-this.resetTime(this.clone(_2f1)).getTime();
return Math.round(_2f3/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(_2fa,_2fb){
this.source=_2fa;
this.event=_2fb||null;
};
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(_2fd,obj){
var _2ff=this.get(_2fd);
nitobi.collections.IEnumerable.prototype.insert.call(this,_2fd,obj);
if(obj.ISerializableImplemented==true&&obj.profile!=null){
this.insertBeforeChildObject(obj,_2ff);
}
};
nitobi.collections.IList.prototype.addToCache=function(obj,_301){
nitobi.base.ISerializable.prototype.addToCache.call(this,obj);
this.list[_301]=obj;
};
nitobi.collections.IList.prototype.removeFromCache=function(_302){
nitobi.base.ISerializable.prototype.removeFromCache.call(this,this.list[_302].getId());
};
nitobi.collections.IList.prototype.flushCache=function(){
nitobi.base.ISerializable.prototype.flushCache.call(this);
this.list=new Array();
};
nitobi.collections.IList.prototype.get=function(_303){
if(typeof (_303)=="object"){
return _303;
}
if(_303<0||_303>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
var obj=null;
if(this.list[_303]!=null){
obj=this.list[_303];
}
if(obj==null){
var _305=nitobi.xml.getChildNodes(this.xmlNode)[_303];
if(_305==null){
return null;
}else{
obj=this.factory.createByNode(_305);
this.onCreateObject.notify(obj);
nitobi.collections.IList.prototype.addToCache.call(this,obj,_303);
}
obj.setParentObject(this);
}
return obj;
};
nitobi.collections.IList.prototype.getById=function(id){
var node=this.xmlNode.selectSingleNode("*[@id='"+id+"']");
var _308=nitobi.xml.indexOfChildNode(node.parentNode,node);
return this.get(_308);
};
nitobi.collections.IList.prototype.set=function(_309,_30a){
if(_309<0||_309>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
try{
if(_30a.ISerializableImplemented==true){
var obj=this.get(_309);
if(obj.getXmlNode()!=_30a.getXmlNode()){
var _30c=this.xmlNode.insertBefore(_30a.getXmlNode(),obj.getXmlNode());
this.xmlNode.removeChild(obj.getXmlNode());
obj.setXmlNode(_30c);
}
}
_30a.setParentObject(this);
nitobi.collections.IList.prototype.addToCache.call(this,_30a,_309);
}
catch(err){
nitobi.lang.throwError(nitobi.error.Unexpected,err);
}
};
nitobi.collections.IList.prototype.remove=function(_30d){
var i;
if(typeof (_30d)!="number"){
i=this.indexOf(_30d);
}else{
i=_30d;
}
var obj=this.get(i);
nitobi.collections.IEnumerable.prototype.remove.call(this,_30d);
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(_310){
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 _312=true;
for(var item in hash){
if(hash[item]!=null&&hash[item]!=""){
_312=false;
break;
}
}
return _312;
};
nitobi.collections.hashLength=function(hash){
var _315=0;
for(var item in hash){
_315++;
}
return _315;
};
nitobi.collections.serialize=function(hash){
var s="";
for(var item in hash){
var _31a=hash[item];
var type=typeof (_31a);
if(type=="string"||type=="number"){
s+="'"+item+"':'"+_31a+"',";
}
}
s=s.substring(0,s.length-1);
return "{"+s+"}";
};
nitobi.lang.defineNs("nitobi.ui");
if(false){
nitobi.ui=function(){
};
}
nitobi.ui.setWaitScreen=function(_31c){
if(_31c){
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(_31f){
this.htmlNode=_31f||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,_322){
if(this.onBeforeSetStyle.notify(new nitobi.ui.StyleEventArgs(this,this.onBeforeSetStyle,name,_322))&&this.getHtmlNode()!=null){
nitobi.html.Css.setStyle(this.getHtmlNode(),name,_322);
this.onSetStyle.notify(new nitobi.ui.StyleEventArgs(this,this.onSetStyle,name,_322));
}
};
nitobi.ui.IStyleable.prototype.getStyle=function(name){
return nitobi.html.Css.getStyle(this.getHtmlNode(),name);
};
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.StyleEventArgs=function(_324,_325,_326,_327){
nitobi.ui.ElementEventArgs.baseConstructor.apply(this,arguments);
this.property=_326||null;
this.value=_327||null;
};
nitobi.lang.extend(nitobi.ui.StyleEventArgs,nitobi.base.EventArgs);
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.IScrollable=function(_328){
this.scrollableElement=_328;
};
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(_32b){
_32b=_32b||25;
this.scrollableElement.scrollLeft-=_32b;
};
nitobi.ui.IScrollable.prototype.scrollRight=function(_32c){
_32c=_32c||25;
this.scrollableElement.scrollLeft+=_32c;
};
nitobi.ui.IScrollable.prototype.isOverflowed=function(_32d){
_32d=_32d||this.scrollableElement.childNodes[0];
return !(parseInt(nitobi.html.getBox(this.scrollableElement).width)>=parseInt(nitobi.html.getBox(_32d).width));
};
nitobi.lang.defineNs("nitobi.ui");
if(false){
nitobi.ui=function(){
};
}
nitobi.ui.startDragOperation=function(_32e,_32f,_330,_331,_332,_333){
var ddo=new nitobi.ui.DragDrop(_32e,_330,_331);
ddo.onDragStop.subscribe(_333,_332);
ddo.startDrag(_32f);
};
nitobi.ui.DragDrop=function(_335,_336,_337){
this.allowVertDrag=(_336!=null?_336:true);
this.allowHorizDrag=(_337!=null?_337: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(_335.nodeType==3){
alert("Text node not supported. Use parent element");
}
this.element=_335;
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(_338){
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 _339=nitobi.html.getEventCoords(_338);
x=_339.x;
y=_339.y;
this.originX=x;
this.originY=y;
nitobi.html.attachEvents(document,this.events,this);
nitobi.html.cancelEvent(_338);
this.onDragStart.notify();
};
nitobi.ui.DragDrop.prototype.handleMouseMove=function(_33a){
var x,y;
var _33d=nitobi.html.getEventCoords(_33a);
x=_33d.x;
y=_33d.y;
if(nitobi.browser.IE){
this.surface.style.display="block";
if(document.compat=="CSS1Compat"){
var _33e=nitobi.html.getBodyArea();
var _33f=0;
if(document.compatMode=="CSS1Compat"){
_33f=25;
}
this.surface.style.width=(_33e.clientWidth-_33f)+"px";
this.surface.style.height=(_33e.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(_33a);
};
nitobi.ui.DragDrop.prototype.handleMouseUp=function(_340){
this.onDragStop.notify({"event":_340,"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 _341=null;
try{
_341=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_341=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(ee){
}
}
return _341;
}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 _342=null;
var _343=null;
if((this.httpObj.responseXML!=null&&this.httpObj.responseXML.documentElement!=null)&&this.responseType!="text"){
_342=this.httpObj.responseXML;
}else{
if(this.responseType=="xml"){
_342=nitobi.xml.createXmlDoc(this.httpObj.responseText);
}else{
_342=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 _342;
};
nitobi.ajax.HttpRequest.prototype.post=function(data){
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 _345={"response":this.handleResponse(),"params":this.params};
this.onPostComplete.notify(_345);
if(this.completeCallback){
this.completeCallback.call(this,_345);
}
}
};
nitobi.ajax.HttpRequest.prototype.postXml=function(_346){
this.setTimeout();
if(("undefined"==typeof (_346.documentElement))||(null==_346.documentElement)||("undefined"==typeof (_346.documentElement.childNodes))||(1>_346.documentElement.childNodes.length)){
ebaErrorReport("updategram is empty. No request sent. xmlData["+_346+"]\nxmlData.xml["+_346.xml+"]");
return;
}
if(null==_346.xml){
var _347=new XMLSerializer();
_346.xml=_347.serializeToString(_346);
}
var sync=this.post(_346.xml);
if(!this.async){
return sync;
}
};
nitobi.ajax.HttpRequest.prototype.get=function(){
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 _349={"response":this.handleResponse(),"params":this.params,"status":this.httpObj.status,"statusText":this.httpObj.statusText};
this.onGetComplete.notify(_349);
if(this.completeCallback){
this.completeCallback.call(this,_349);
}
}
};
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 _34c=url.split("?");
var _34d="nitobi_cachebust="+(new Date().getTime());
if(_34c.length==1){
url+="?"+_34d;
}else{
url+="&"+_34d;
}
return url;
};
nitobi.ajax.HttpRequestPool=function(_34e){
this.inUse=new Array();
this.free=new Array();
this.max=_34e||nitobi.ajax.HttpRequestPool_MAXCONNECTIONS;
this.locked=false;
this.context=null;
};
nitobi.ajax.HttpRequestPool.prototype.reserve=function(){
this.locked=true;
var _34f;
if(this.free.length){
_34f=this.free.pop();
_34f.clear();
this.inUse.push(_34f);
}else{
if(this.inUse.length<this.max){
try{
_34f=new nitobi.ajax.HttpRequest();
}
catch(e){
_34f=null;
}
this.inUse.push(_34f);
}else{
throw "No request objects available";
}
}
this.locked=false;
return _34f;
};
nitobi.ajax.HttpRequestPool.prototype.release=function(_350){
var _351=false;
this.locked=true;
if(null!=_350){
for(var i=0;i<this.inUse.length;i++){
if(_350==this.inUse[i]){
this.free.push(this.inUse[i]);
this.inUse.splice(i,1);
_351=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,_356){
this.url=url||null;
this.transformer=_356||null;
this.async=true;
};
nitobi.data.UrlConnector.prototype.get=function(_357,_358){
var _359=nitobi.data.UrlConnector.requestPool.reserve();
var _35a=this.url;
for(var p in _357){
_35a=nitobi.html.Url.setParameter(_35a,p,_357[p]);
}
_359.handler=_35a;
_359.async=this.async;
_359.responseType="xml";
_359.params={dataReadyCallback:_358};
_359.completeCallback=nitobi.lang.close(this,this.getComplete);
_359.get();
};
nitobi.data.UrlConnector.prototype.getComplete=function(_35c){
if(_35c.params.dataReadyCallback){
var _35d=_35c.response;
var _35e=_35c.params.dataReadyCallback;
var _35f=_35d;
if(this.transformer){
if(typeof (this.transformer)==="function"){
_35f=this.transformer.call(null,_35d);
}else{
_35f=nitobi.xml.transform(_35d,this.transformer,"xml");
}
}
if(_35e){
_35e.call(null,{result:_35f,response:_35c.response});
}
}
};
nitobi.data.UrlConnector.requestPool=new nitobi.ajax.HttpRequestPool();
function ntbAssert(_360,_361,_362,_363){
}
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 _366=(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(_36a,_36b){
}
function ebaSetOnErrorEvent(_36c){
nitobi.debug.setOnErrorEvent.apply(this,arguments);
}
nitobi.debug.setOnErrorEvent=function(_36d){
NTB_ON_ERROR=_36d;
};
function ebaReportError(_36e,_36f,_370){
nitobi.debug.errorReport("dude stop calling this method it is now called nitobi.debug.errorReport","");
nitobi.debug.errorReport(_36e,_36f,_370);
}
function ebaErrorReport(_371,_372,_373){
nitobi.debug.errorReport.apply(this,arguments);
}
nitobi.debug.errorReport=function(_374,_375,_376){
_376=(_376)?_376:NTB_DEBUG;
if(NTB_DEBUG==_376&&!NTB_DEBUG_MODE){
return;
}
var _377=_374+"\nerror code    ["+_375+"]\nerror Severity["+_376+"]";
LastError=_377;
if(eval(NTB_ON_ERROR||"true")){
switch(_375){
case NTB_EM_ATTRIBUTE_ERROR:
confirm(_374);
break;
case NTB_XHR_RESPONSE_ERROR:
confirm(_374);
break;
default:
window.status=_374;
break;
}
}
if(NTB_THROW==_376){
throw (_377);
}
};
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(_378,_379,type){
nitobi.error.ErrorEventArgs.baseConstructor.call(this,_378);
this.description=_379;
this.type=type;
};
nitobi.lang.extend(nitobi.error.ErrorEventArgs,nitobi.base.EventArgs);
nitobi.error.isError=function(err,_37c){
return (err.indexOf(_37c)>-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(_37d){
this.setTemplate(_37d);
this.parameters={};
};
nitobi.html.IRenderer.prototype.renderAfter=function(_37e,data){
_37e=$(_37e);
var _380=_37e.parentNode;
_37e=_37e.nextSibling;
return this._renderBefore(_380,_37e,data);
};
nitobi.html.IRenderer.prototype.renderBefore=function(_381,data){
_381=$(_381);
return this._renderBefore(_381.parentNode,_381,data);
};
nitobi.html.IRenderer.prototype._renderBefore=function(_383,_384,data){
var s=this.renderToString(data);
var _387=document.createElement("div");
_387.innerHTML=s;
var _388=new Array();
if(_387.childNodes){
var i=0;
while(_387.childNodes.length){
_388[i++]=_387.firstChild;
_383.insertBefore(_387.firstChild,_384);
}
}else{
}
return _388;
};
nitobi.html.IRenderer.prototype.renderIn=function(_38a,data){
_38a=$(_38a);
var s=this.renderToString(data);
_38a.innerHTML=s;
return _38a.childNodes;
};
nitobi.html.IRenderer.prototype.renderToString=function(data){
};
nitobi.html.IRenderer.prototype.setTemplate=function(_38e){
this.template=_38e;
};
nitobi.html.IRenderer.prototype.getTemplate=function(){
return this.template;
};
nitobi.html.IRenderer.prototype.setParameters=function(_38f){
for(var p in _38f){
this.parameters[p]=_38f[p];
}
};
nitobi.html.IRenderer.prototype.getParameters=function(){
return this.parameters;
};
nitobi.lang.defineNs("nitobi.html");
nitobi.html.XslRenderer=function(_391){
nitobi.html.IRenderer.call(this,_391);
};
nitobi.lang.implement(nitobi.html.XslRenderer,nitobi.html.IRenderer);
nitobi.html.XslRenderer.prototype.setTemplate=function(_392){
if(typeof (_392)==="string"){
_392=nitobi.xml.createXslProcessor(_392);
}
this.template=_392;
};
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 _394=this.getTemplate();
var _395=this.getParameters();
for(var p in _395){
_394.addParameter(p,_395[p],"");
}
var s=nitobi.xml.transformToString(data,_394,"xml");
for(var p in _395){
_394.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 _39a=decl.loadHtml($(id));
var _39b=$(id);
var _39c=_39b.parentNode;
var _39d=_39c.ownerDocument.createElement("ntb:component");
_39c.insertBefore(_39d,_39b);
_39c.removeChild(_39b);
this.setContainer(_39d);
nitobi.base.ISerializable.call(this,_39a);
}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(_39e){
var node=$(_39e);
this.htmlNode=node;
};
nitobi.ui.Element.prototype.getRootId=function(){
var _3a0=this.getParentObject();
if(_3a0==null){
return this.getId();
}else{
return _3a0.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(_3a4,id,_3a6,_3a7){
try{
_3a4=nitobi.html.getEvent(_3a4);
if(_3a7!==false){
nitobi.html.cancelEvent(_3a4);
}
var _3a8=nitobi.ui.Element.parseId(id).id;
if(!this.isDescendantExists(_3a8)){
return false;
}
var _3a9=!(_3a8==this.getId());
var _3aa=new nitobi.ui.ElementEventArgs(this,null,id);
var _3ab=new nitobi.ui.EventNotificationEventArgs(this,null,id,_3a4);
_3a9=_3a9&&this.onBeforePropagate.notify(_3ab);
var _3ac=true;
if(_3a9){
if(_3a6==null){
_3a6=this.getPathToLeaf(_3a8);
}
var _3ad=this.onBeforeEventNotify.notify(_3ab);
var _3ae=(_3ad?this.onEventNotify.notify(_3ab):true);
var _3af=_3a6.pop().getAttribute("id");
var _3b0=this.getObjectById(_3af);
var _3ac=this.onBeforePropagateToChild.notify(_3ab);
if(_3b0.notify&&_3ac&&_3ae){
_3ac=_3b0.notify(_3a4,id,_3a6,_3a7);
}
}else{
_3ac=this.onEventNotify.notify(_3ab);
}
var _3b1=this.eventMap[_3a4.type];
if(_3b1!=null&&_3ac){
_3b1.notify(this.getEventArgs(_3a4,id));
}
return _3ac;
}
catch(err){
nitobi.lang.throwError(nitobi.error.Unexpected+" Element.notify encountered a problem.",err);
}
};
nitobi.ui.Element.prototype.getEventArgs=function(_3b2,_3b3){
var _3b4=new nitobi.ui.ElementEventArgs(this,null,_3b3);
return _3b4;
};
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(_3ba,_3bb){
this.setVisible(false,_3ba,_3bb);
};
nitobi.ui.Element.prototype.show=function(_3bc,_3bd){
this.setVisible(true,_3bc,_3bd);
};
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(_3bf,_3c0,_3c1){
var _3c2=this.getHtmlNode();
if(_3c2&&this.isVisible()!=_3bf&&this.onBeforeSetVisible.notify({source:this,event:this.onBeforeSetVisible,args:arguments})!==false){
if(this.effect){
this.effect.end();
}
if(_3bf){
if(_3c0){
var _3c3=new _3c0(_3c2);
_3c3.callback=nitobi.lang.close(this,this.handleSetVisible,[_3c1]);
this.effect=_3c3;
_3c3.onFinish.subscribeOnce(nitobi.lang.close(this,function(){
this.effect=null;
}));
_3c3.start();
}else{
nitobi.html.Css.removeClass(_3c2,NTB_CSS_HIDE);
this.handleSetVisible(_3c1);
}
}else{
if(_3c0){
var _3c3=new _3c0(_3c2);
_3c3.callback=nitobi.lang.close(this,this.handleSetVisible,[_3c1]);
this.effect=_3c3;
_3c3.onFinish.subscribeOnce(nitobi.lang.close(this,function(){
this.effect=null;
}));
_3c3.start();
}else{
nitobi.html.Css.addClass(this.getHtmlNode(),NTB_CSS_HIDE);
this.handleSetVisible(_3c1);
}
}
}
};
nitobi.ui.Element.prototype.handleSetVisible=function(_3c4){
if(_3c4){
_3c4();
}
this.onSetVisible.notify(new nitobi.ui.ElementEventArgs(this,this.onSetVisible));
};
nitobi.ui.Element.prototype.setEnabled=function(_3c5){
this.enabled=_3c5;
};
nitobi.ui.Element.prototype.isEnabled=function(){
return this.enabled;
};
nitobi.ui.Element.prototype.render=function(_3c6,_3c7){
this.flushHtmlNodeCache();
_3c7=_3c7||this.getState();
_3c6=$(_3c6)||this.getContainer();
if(_3c6==null){
var _3c6=document.createElement("span");
document.body.appendChild(_3c6);
this.setContainer(_3c6);
}
this.htmlNode=this.renderer.renderIn(_3c6,_3c7)[0];
this.htmlNode.jsObject=this;
};
nitobi.ui.Element.prototype.getContainer=function(){
return this.container;
};
nitobi.ui.Element.prototype.setContainer=function(_3c8){
this.container=$(_3c8);
};
nitobi.ui.Element.prototype.getState=function(){
return this.getXmlNode();
};
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.ElementEventArgs=function(_3c9,_3ca,_3cb){
nitobi.ui.ElementEventArgs.baseConstructor.apply(this,arguments);
this.targetId=_3cb||null;
};
nitobi.lang.extend(nitobi.ui.ElementEventArgs,nitobi.base.EventArgs);
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.EventNotificationEventArgs=function(_3cc,_3cd,_3ce,_3cf){
nitobi.ui.EventNotificationEventArgs.baseConstructor.apply(this,arguments);
this.htmlEvent=_3cf||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(_3d1,_3d2,_3d3,_3d4,_3d5){
_3d4=(_3d5?nitobi.lang.close(_3d5,_3d4):_3d4)||nitobi.lang.noop;
_3d1=$(_3d1);
if(typeof _3d3=="string"){
_3d3=nitobi.effects.families[_3d3];
}
if(!_3d3){
_3d3=nitobi.effects.families["none"];
}
if(_3d2){
var _3d6=_3d3.show;
}else{
var _3d6=_3d3.hide;
}
if(_3d6){
var _3d7=new _3d6(_3d1);
_3d7.callback=_3d4;
_3d7.start();
}else{
if(_3d2){
nitobi.html.Css.removeClass(_3d1,NTB_CSS_HIDE);
}else{
nitobi.html.Css.addClass(_3d1,NTB_CSS_HIDE);
}
_3d4();
}
};
nitobi.ui.Effects.shrink=function(_3d8,_3d9,_3da,_3db){
var rect=_3d9.getClientRects()[0];
_3d8.deltaHeight_Doctype=0-parseInt("0"+nitobi.html.getStyle(_3d9,"border-top-width"))-parseInt("0"+nitobi.html.getStyle(_3d9,"border-bottom-width"))-parseInt("0"+nitobi.html.getStyle(_3d9,"padding-top"))-parseInt("0"+nitobi.html.getStyle(_3d9,"padding-bottom"));
_3d8.deltaWidth_Doctype=0-parseInt("0"+nitobi.html.getStyle(_3d9,"border-left-width"))-parseInt("0"+nitobi.html.getStyle(_3d9,"border-right-width"))-parseInt("0"+nitobi.html.getStyle(_3d9,"padding-left"))-parseInt("0"+nitobi.html.getStyle(_3d9,"padding-right"));
_3d8.oldHeight=Math.abs(rect.top-rect.bottom)+_3d8.deltaHeight_Doctype;
_3d8.oldWidth=Math.abs(rect.right-rect.left)+_3d8.deltaWidth_Doctype;
if(!(typeof (_3d8.width)=="undefined")){
_3d8.deltaWidth=Math.floor(Math.ceil(_3d8.width-_3d8.oldWidth)/(_3da/nitobi.ui.Effects.ANIMATION_INTERVAL));
}else{
_3d8.width=_3d8.oldWidth;
_3d8.deltaWidth=0;
}
if(!(typeof (_3d8.height)=="undefined")){
_3d8.deltaHeight=Math.floor(Math.ceil(_3d8.height-_3d8.oldHeight)/(_3da/nitobi.ui.Effects.ANIMATION_INTERVAL));
}else{
_3d8.height=_3d8.oldHeight;
_3d8.deltaHeight=0;
}
nitobi.ui.Effects.resize(_3d8,_3d9,_3da,_3db);
};
nitobi.ui.Effects.resize=function(_3dd,_3de,_3df,_3e0){
var rect=_3de.getClientRects()[0];
var _3e2=Math.abs(rect.top-rect.bottom);
var _3e3=Math.max(_3e2+_3dd.deltaHeight+_3dd.deltaHeight_Doctype,0);
if(Math.abs(_3e2-_3dd.height)<Math.abs(_3dd.deltaHeight)){
_3e3=_3dd.height;
_3dd.deltaHeight=0;
}
var _3e4=Math.abs(rect.right-rect.left);
var _3e5=Math.max(_3e4+_3dd.deltaWidth+_3dd.deltaWidth_Doctype,0);
_3e5=(_3e5>=0)?_3e5:0;
if(Math.abs(_3e4-_3dd.width)<Math.abs(_3dd.deltaWidth)){
_3e5=_3dd.width;
_3dd.deltaWidth=0;
}
_3df-=nitobi.ui.Effects.ANIMATION_INTERVAL;
if(_3df>0){
window.setTimeout(nitobi.lang.closeLater(this,nitobi.ui.Effects.resize,[_3dd,_3de,_3df,_3e0]),nitobi.ui.Effects.ANIMATION_INTERVAL);
}
var _3e6=function(){
_3de.height=_3e3+"px";
_3de.style.height=_3e3+"px";
_3de.width=_3e5+"px";
_3de.style.width=_3e5+"px";
if(_3df<=0){
if(_3e0){
window.setTimeout(_3e0,0);
}
}
};
nitobi.ui.Effects.executeNextPulse.push(_3e6);
};
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(_3e8){
return _3e8*_3e8*_3e8;
};
nitobi.ui.Effects.cubeRoot=function(_3e9){
var T=0;
var N=parseFloat(_3e9);
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(_3ee){
return _3ee;
};
nitobi.ui.Effects.fade=function(_3ef,_3f0,time,_3f2,_3f3){
_3f3=_3f3||nitobi.ui.Effects.linear;
var _3f4=(new Date()).getTime()+time;
var id=nitobi.component.getUniqueId();
var _3f6=(new Date()).getTime();
var el=_3ef;
if(_3ef.length){
el=_3ef[0];
}
var _3f8=nitobi.html.Css.getOpacity(el);
var _3f9=(_3f0-_3f8<0?-1:0);
nitobi.ui.Effects.fadeIntervalId[id]=window.setInterval(function(){
nitobi.ui.Effects.stepFade(_3ef,_3f0,_3f6,_3f4,id,_3f2,_3f3,_3f9);
},nitobi.ui.Effects.fadeIntervalTime);
};
nitobi.ui.Effects.stepFade=function(_3fa,_3fb,_3fc,_3fd,id,_3ff,_400,_401){
var ct=(new Date()).getTime();
var _403=_3fd-_3fc;
var nct=((ct-_3fc)/(_3fd-_3fc));
if(nct<=0||nct>=1){
nitobi.html.Css.setOpacities(_3fa,_3fb);
window.clearInterval(nitobi.ui.Effects.fadeIntervalId[id]);
_3ff();
return;
}else{
nct=Math.abs(nct+_401);
}
var no=_400(nct);
nitobi.html.Css.setOpacities(_3fa,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 _408;
var _409=nitobi.html.getTagName(el);
if(_409=="ntb:grid"){
_408=nitobi.initGrid(el.id);
}else{
if(_409==="ntb:combo"){
_408=nitobi.initCombo(el.id);
}else{
if(el.jsObject==null){
_408=nitobi.base.Factory.getInstance().createByTag(_409,el.id,nitobi.component.renderComponent);
if(_408.render&&!_408.onLoadCallback){
_408.render();
}
}else{
_408=el.jsObject;
}
}
}
return _408;
};
nitobi.component.renderComponent=function(_40a){
_40a.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(_40d,_40e){
if(nitobi.component.isNitobiElement(_40d)){
_40e.push(_40d);
return;
}
var _40f=_40d.childNodes;
for(var i=0;i<_40f.length;i++){
nitobi.component.findNitobiComponents(_40f[i],_40e);
}
return;
};
nitobi.component.isNitobiElement=function(_411){
var _412=nitobi.html.getTagName(_411);
if(_412.substr(0,3)=="ntb"){
return true;
}else{
return false;
}
};
nitobi.component.loadComponentsFromNode=function(_413){
var _414=new Array();
nitobi.component.findNitobiComponents(_413,_414);
for(var i=0;i<_414.length;i++){
nitobi.loadComponent(_414[i].getAttribute("id"));
}
};
nitobi.lang.defineNs("nitobi.effects");
if(false){
nitobi.effects=function(){
};
}
nitobi.effects.Effect=function(_416,_417){
this.element=$(_416);
this.transition=_417.transition||nitobi.effects.Transition.sinoidal;
this.duration=_417.duration||1;
this.fps=_417.fps||50;
this.from=typeof (_417.from)==="number"?_417.from:0;
this.to=typeof (_417.from)==="number"?_417.to:1;
this.delay=_417.delay||0;
this.callback=typeof (_417.callback)==="function"?_417.callback:nitobi.lang.noop;
this.queue=_417.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 _41c=Math.floor(pos*this.totalFrames);
if(this.frame<_41c){
this.render(pos);
this.frame=_41c;
}
}
};
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(_41e,_41f,etc){
var args=nitobi.lang.toArray(arguments,2);
return function(_422){
var f=function(){
_41e.apply(this,[_422,_41f].concat(args));
};
nitobi.lang.extend(f,_41e);
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(_427,_428,_429){
nitobi.effects.Scale.baseConstructor.call(this,_427,_428);
this.scaleX=typeof (_428.scaleX)=="boolean"?_428.scaleX:true;
this.scaleY=typeof (_428.scaleY)=="boolean"?_428.scaleY:true;
this.scaleFrom=typeof (_428.scaleFrom)=="number"?_428.scaleFrom:100;
this.scaleTo=_429;
};
nitobi.lang.extend(nitobi.effects.Scale,nitobi.effects.Effect);
nitobi.effects.Scale.prototype.setup=function(){
var _42a=this.element.style;
this.originalStyle={"top":_42a.top,"left":_42a.left,"width":_42a.width,"height":_42a.height,"overflow":_42a.overflow};
this.factor=(this.scaleTo-this.scaleFrom)/100;
this.dims=[this.element.scrollWidth,this.element.scrollHeight];
_42a.width=this.dims[0]+"px";
_42a.height=this.dims[1]+"px";
_42a.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 _42d=(this.scaleFrom/100)+(this.factor*pos);
this.setDimensions(Math.floor(_42d*this.dims[0])||1,Math.floor(_42d*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(_430){
nitobi.collections.IEnumerable.prototype.add.call(this,_430);
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(_433,_434){
_434=nitobi.lang.merge({scaleX:false,duration:Math.min(0.2*(_433.scrollHeight/100),0.5)},_434||{});
nitobi.effects.BlindUp.baseConstructor.call(this,_433,_434,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(_435,_436){
nitobi.html.Css.swapClass(_435,NTB_CSS_HIDE,NTB_CSS_SMALL);
_436=nitobi.lang.merge({scaleX:false,scaleFrom:0,duration:Math.min(0.2*(_435.scrollHeight/100),0.5)},_436||{});
nitobi.effects.BlindDown.baseConstructor.call(this,_435,_436,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(_437,_438){
_438=nitobi.lang.merge({scaleX:false,duration:Math.min(0.2*(_437.scrollHeight/100),0.3)},_438||{});
nitobi.effects.ShadeUp.baseConstructor.call(this,_437,_438,0);
};
nitobi.lang.extend(nitobi.effects.ShadeUp,nitobi.effects.Scale);
nitobi.effects.ShadeUp.prototype.setup=function(){
nitobi.effects.ShadeUp.base.setup.call(this);
var _439=nitobi.html.getFirstChild(this.element);
this.originalStyle.position=this.element.style.position;
nitobi.html.position(this.element);
if(_439){
var _43a=_439.style;
this.fnodeStyle={position:_43a.position,bottom:_43a.bottom,left:_43a.left};
this.fnode=_439;
_43a.position="absolute";
_43a.bottom="0px";
_43a.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(_43c,_43d){
nitobi.html.Css.swapClass(_43c,NTB_CSS_HIDE,NTB_CSS_SMALL);
_43d=nitobi.lang.merge({scaleX:false,scaleFrom:0,duration:Math.min(0.2*(_43c.scrollHeight/100),0.3)},_43d||{});
nitobi.effects.ShadeDown.baseConstructor.call(this,_43c,_43d,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 _43e=nitobi.html.getFirstChild(this.element);
this.originalStyle.position=this.element.style.position;
nitobi.html.position(this.element);
if(_43e){
var _43f=_43e.style;
this.fnodeStyle={position:_43f.position,bottom:_43f.bottom,left:_43f.left,right:_43f.right,top:_43f.top};
this.fnode=_43e;
_43f.position="absolute";
_43f.top="";
_43f.right="";
_43f.bottom="0px";
_43f.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(_441){
if(_441){
if(typeof (_441)==="string"){
this.strings=[_441];
}else{
this.strings=_441;
}
}else{
this.strings=new Array();
}
};
nitobi.lang.StringBuilder.prototype.append=function(_442){
if(_442){
this.strings.push(_442);
}
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));


