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){
for(var _a in _9.prototype){
if(typeof (_8.prototype[_a])=="undefined"||_8.prototype[_a]==null){
_8.prototype[_a]=_9.prototype[_a];
}
}
};
nitobi.lang.setJsProps=function(p,_c){
for(var i=0;i<_c.length;i++){
var _e=_c[i];
p["set"+_e.n]=this.jSET;
p["get"+_e.n]=this.jGET;
p[_e.n]=_e.d;
}
};
nitobi.lang.setXmlProps=function(p,_10){
for(var i=0;i<_10.length;i++){
var _12=_10[i];
var s,g;
switch(_12.t){
case "i":
s=this.xSET;
g=this.xiGET;
break;
case "b":
s=this.xbSET;
g=this.xbGET;
break;
default:
s=this.xSET;
g=this.xGET;
}
p["set"+_12.n]=s;
p["get"+_12.n]=g;
p["sModel"]+=_12.n+"\""+_12.d+"\" ";
}
};
nitobi.lang.setEvents=function(p,_16){
for(var i=0;i<_16.length;i++){
var n=_16[i];
p["set"+n]=this.eSET;
p["get"+n]=this.eGET;
var nn=n.substring(0,n.length-5);
p["set"+nn]=this.eSET;
p["get"+nn]=this.eGET;
p["o"+n.substring(1)]=new nitobi.base.Event();
}
};
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(obj){
var t=typeof (obj);
if(t=="object"){
if(obj.blur){
return nitobi.lang.type.HTMLNODE;
}
if(obj.nodeName&&obj.nodeName.toLowerCase()==="#document"){
return nitobi.lang.type.XMLDOC;
}
if(obj.nodeName){
return nitobi.lang.type.XMLNODE;
}
if(obj instanceof Array){
return nitobi.lang.type.ARRAY;
}
}
return t;
};
nitobi.lang.toBool=function(_1e,_1f){
if(typeof (_1f)!="undefined"){
if((typeof (_1e)=="undefined")||(_1e=="")||(_1e==null)){
_1e=_1f;
}
}
_1e=_1e.toString()||"";
_1e=_1e.toUpperCase();
if((_1e=="Y")||(_1e=="1")||(_1e=="TRUE")){
return true;
}else{
return false;
}
};
nitobi.lang.boolToStr=function(_20){
if(typeof (_20)=="boolean"){
if(_20){
return "1";
}else{
return "0";
}
}else{
return _20;
}
};
nitobi.lang.formatNumber=function(_21,_22,_23,_24){
var n=nitobi.form.numberXslProc;
n.addParameter("number",_21,"");
n.addParameter("mask",_22,"");
n.addParameter("group",_23,"");
n.addParameter("decimal",_24,"");
return nitobi.xml.transformToString(nitobi.xml.Empty,nitobi.form.numberXslProc);
};
nitobi.lang.close=function(_26,_27,_28){
if(null==_28){
return function(){
return _27.apply(_26,arguments);
};
}else{
return function(){
return _27.apply(_26,_28);
};
}
};
nitobi.lang.after=function(_29,_2a,_2b,_2c){
var _2d=_29[_2a];
var _2e=_2b[_2c];
if(_2c instanceof Function){
_2e=_2c;
}
_29[_2a]=function(){
_2d.apply(_29,arguments);
_2e.apply(_2b,arguments);
};
_29[_2a].orig=_2d;
};
nitobi.lang.before=function(_2f,_30,_31,_32){
var _33=_2f[_30];
var _34=function(){
};
if(_31!=null){
_34=_31[_32];
}
if(_32 instanceof Function){
_34=_32;
}
_2f[_30]=function(){
_34.apply(_31,arguments);
_33.apply(_2f,arguments);
};
_2f[_30].orig=_33;
};
nitobi.lang.forEach=function(arr,_36){
var len=arr.length;
for(var i=0;i<len;i++){
_36.call(this,arr[i],i);
}
_36=null;
};
nitobi.lang.throwError=function(_39,_3a){
var msg=_39;
if(_3a!=null){
msg+="\n - because "+nitobi.lang.getErrorDescription(_3a);
}
throw msg;
};
nitobi.lang.getErrorDescription=function(_3c){
var _3d=(typeof (_3c.description)=="undefined")?_3c:_3c.description;
return _3d;
};
nitobi.lang.newObject=function(_3e,_3f,_40){
var a=_3f;
if(null==_40){
_40=0;
}
var e="new "+_3e+"(";
var _43="";
for(var i=_40;i<a.length;i++){
e+=_43+"a["+i+"]";
_43=",";
}
e+=")";
return eval(e);
};
nitobi.lang.getLastFunctionArgs=function(_45,_46){
var a=new Array(_45.length-_46);
for(var i=_46;i<_45.length;i++){
a[i-_46]=_45[i];
}
return a;
};
nitobi.lang.getFirstHashKey=function(_49){
for(var x in _49){
return x;
}
};
nitobi.lang.getFirstFunction=function(obj){
for(var x in obj){
if(obj[x]!=null&&typeof (obj[x])=="function"&&typeof (obj[x].prototype)!="undefined"){
return {name:x,value:obj[x]};
}
}
return null;
};
nitobi.lang.copy=function(obj){
var _4e={};
for(var _4f in obj){
_4e[_4f]=obj[_4f];
}
return _4e;
};
nitobi.lang.dispose=function(_50,_51){
try{
if(_51!=null){
var _52=_51.length;
for(var i=0;i<_52;i++){
if(typeof (_51[i].dispose)=="function"){
_51[i].dispose();
}
if(typeof (_51[i])=="function"){
_51[i].call(_50);
}
_51[i]=null;
}
}
for(var _54 in _50){
if(_50[_54].dispose instanceof Function){
_50[_54].dispose();
}
_50[_54]=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 _5a=(ck2>0?String.fromCharCode(96+ck2):"")+String.fromCharCode(97+ck1);
nitobi.lang.alphaNumCache[_5a]=num;
nitobi.lang.numAlphaCache[num]=_5a;
return _5a;
};
nitobi.lang.alphaToNum=function(_5b){
if(typeof (nitobi.lang.alphaNumCache[_5b])==="number"){
return nitobi.lang.alphaNumCache[_5b];
}
var j=0;
var num=0;
for(var i=_5b.length-1;i>=0;i--){
num+=(_5b.charCodeAt(i)-96)*Math.pow(26,j++);
}
num=num-1;
nitobi.lang.alphaNumCache[_5b]=num;
nitobi.lang.numAlphaCache[num]=_5b;
return num;
};
nitobi.lang.alphaNumCache={};
nitobi.lang.numAlphaCache={};
nitobi.lang.toArray=function(obj,_60){
return Array.prototype.splice.call(obj,_60||0);
};
nitobi.lang.merge=function(_61,_62){
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,_6a){
_6a=_6a||2;
num=num+"";
return nitobi.lang.zeros.substr(0,Math.max(_6a-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(_6b,_6c,_6d){
var _6e=_6d*0.01745329277777778;
if(nitobi.lang.Math.sinTable[_6e]==null){
nitobi.lang.Math.sinTable[_6e]=Math.sin(_6e);
nitobi.lang.Math.cosTable[_6e]=Math.cos(_6e);
}
var cR=nitobi.lang.Math.cosTable[_6e];
var sR=nitobi.lang.Math.sinTable[_6e];
var x=_6b*cR-_6c*sR;
var y=_6c*cR+_6b*sR;
return {x:x,y:y};
};
nitobi.lang.Math.returnAngle=function(_73,_74,_75,_76){
return Math.atan2(_76-_74,_75-_73)/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="6573";
nitobi.toolkit.version="1.0.6573";
nitobi.lang.defineNs("nitobi");
nitobi.Object=function(){
this.disposal=new Array();
this.modelNodes={};
};
nitobi.Object.prototype.setValues=function(_7b){
for(var _7c in _7b){
if(this[_7c]!=null){
if(this[_7c].subscribe!=null){
}else{
this[_7c]=_7b[_7c];
}
}else{
if(this[_7c] instanceof Function){
this[_7c](_7b[_7c]);
}else{
if(this["set"+_7c] instanceof Function){
this["set"+_7c](_7b[_7c]);
}else{
this[_7c]=_7b[_7c];
}
}
}
}
};
nitobi.Object.prototype.xGET=function(){
var _7d=null,_7e="@"+arguments[0],val="";
var _80=this.modelNodes[_7e];
if(_80!=null){
_7d=_80;
}else{
_7d=this.modelNodes[_7e]=this.modelNode.selectSingleNode(_7e);
}
if(_7d!=null){
val=_7d.nodeValue;
}
return val;
};
nitobi.Object.prototype.xSET=function(){
var _81=null,_82="@"+arguments[0];
var _83=this.modelNodes[_82];
if(_83!=null){
_81=_83;
}else{
_81=this.modelNodes[_82]=this.modelNode.selectSingleNode(_82);
}
if(_81==null){
this.modelNode.setAttribute(arguments[0],"");
}
if(arguments[1][0]!=null&&_81!=null){
if(typeof (arguments[1][0])=="boolean"){
_81.nodeValue=nitobi.lang.boolToStr(arguments[1][0]);
}else{
_81.nodeValue=arguments[1][0];
}
}
};
nitobi.Object.prototype.eSET=function(_84,_85){
var _86=_85[0];
var _87=_86;
var _88=_84.substr(2);
_88=_88.substr(0,_88.length-5);
if(typeof (_86)=="string"){
_87=function(){
return nitobi.event.evaluate(_86,arguments[0]);
};
}
if(this[_84]!=null){
this.unsubscribe(_88,this[_84]);
}
var _89=this.subscribe(_88,_87);
this.jSET(_84,[_89]);
return _89;
};
nitobi.Object.prototype.eGET=function(){
};
nitobi.Object.prototype.jSET=function(_8a,val){
this[_8a]=val[0];
};
nitobi.Object.prototype.jGET=function(_8c){
return this[_8c];
};
nitobi.Object.prototype.xsGET=nitobi.Object.prototype.xGET;
nitobi.Object.prototype.xsSET=nitobi.Object.prototype.xSET;
nitobi.Object.prototype.xbGET=function(){
return nitobi.lang.toBool(this.xGET.apply(this,arguments),false);
};
nitobi.Object.prototype.xiGET=function(){
return parseInt(this.xGET.apply(this,arguments));
};
nitobi.Object.prototype.xiSET=nitobi.Object.prototype.xSET;
nitobi.Object.prototype.xdGET=function(){
};
nitobi.Object.prototype.xnGET=function(){
return parseFloat(this.xGET.apply(this,arguments));
};
nitobi.Object.prototype.xbSET=function(){
this.xSET.call(this,arguments[0],[nitobi.lang.boolToStr(arguments[1][0])]);
};
nitobi.Object.prototype.fire=function(evt,_8e){
return nitobi.event.notify(evt+this.uid,_8e);
};
nitobi.Object.prototype.subscribe=function(evt,_90,_91){
if(this.subscribedEvents==null){
this.subscribedEvents={};
}
if(typeof (_91)=="undefined"){
_91=this;
}
var _92=nitobi.event.subscribe(evt+this.uid,nitobi.lang.close(_91,_90));
this.subscribedEvents[_92]=evt+this.uid;
return _92;
};
nitobi.Object.prototype.subscribeOnce=function(evt,_94,_95,_96){
var _97=null;
var _98=this;
var _99=function(){
_94.apply(_95||this,_96||arguments);
_98.unsubscribe(evt,_97);
};
_97=this.subscribe(evt,_99);
};
nitobi.Object.prototype.unsubscribe=function(evt,_9b){
return nitobi.event.unsubscribe(evt+this.uid,_9b);
};
nitobi.Object.prototype.dispose=function(){
if(this.disposing){
return;
}
this.disposing=true;
var _9c=this.disposal.length;
for(var i=0;i<_9c;i++){
if(disposal[i] instanceof Function){
disposal[i].call(context);
}
disposal[i]=null;
}
for(var _9e in this){
if(this[_9e].dispose instanceof Function){
this[_9e].dispose.call(this[_9e]);
}
this[_9e]=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 _9f=[{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"},{string:navigator.vendor,subString:"Camino",identity:"Camino"}];
var _a0="Unknown";
for(var i=0;i<_9f.length;i++){
var _a2=_9f[i].string;
var _a3=_9f[i].prop;
if(_a2){
if(_a2.indexOf(_9f[i].subString)!=-1){
_a0=_9f[i].identity;
break;
}
}else{
if(_a3){
_a0=_9f[i].identity;
break;
}
}
}
nitobi.browser.IE=(_a0=="Explorer");
nitobi.browser.IE6=(nitobi.browser.IE&&!window.XMLHttpRequest);
nitobi.browser.IE7=(nitobi.browser.IE&&window.XMLHttpRequest);
nitobi.browser.MOZ=(_a0=="Netscape"||_a0=="Firefox"||_a0=="Camino");
nitobi.browser.SAFARI=(_a0=="Safari");
nitobi.browser.OPERA=(_a0=="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 _a5,end;
if(document.cookie.length>0){
_a5=document.cookie.indexOf(id+"=");
if(_a5!=-1){
_a5+=id.length+1;
end=document.cookie.indexOf(";",_a5);
if(end==-1){
end=document.cookie.length;
}
return unescape(document.cookie.substring(_a5,end));
}
}
return null;
};
nitobi.browser.Cookies.set=function(id,_a8,_a9){
var _aa=new Date();
_aa.setTime(_aa.getTime()+(_a9*24*3600*1000));
document.cookie=id+"="+escape(_a8)+((_a9==null)?"":"; expires="+_aa.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(_ac){
this.lastPage=this.currentPage=_ac.substr(_ac.indexOf("#")+1);
this.iframe.location.href=_ac;
};
nitobi.browser.History.prototype.monitor=function(){
var _ad=this.iframe.location.href.split("#");
this.currentPage=_ad[1];
if(this.currentPage!=this.lastPage){
this.onChange.notify(_ad[0].substring(_ad[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(_ae){
if(nitobi.browser.IE){
return _ae.childNodes;
}else{
return _ae.selectNodes("./*");
}
};
nitobi.xml.indexOfChildNode=function(_af,_b0){
var _b1=nitobi.xml.getChildNodes(_af);
for(var i=0;i<_b1.length;i++){
if(_b1[i]==_b0){
return i;
}
}
return -1;
};
nitobi.xml.createXmlDoc=function(xml){
if(xml!=null){
xml=xml.substring(xml.indexOf("<?xml"));
}
if(xml!=null&&xml.documentElement!=null){
return xml;
}
var doc=null;
if(nitobi.browser.IE){
doc=new ActiveXObject("Msxml2.DOMDocument.3.0");
doc.setProperty("SelectionNamespaces","xmlns:ntb='http://www.nitobi.com'");
}else{
if(nitobi.browser.MOZ){
doc=document.implementation.createDocument("","",null);
}
}
if(xml!=null&&typeof xml=="string"){
doc=nitobi.xml.loadXml(doc,xml);
}
return doc;
};
nitobi.xml.loadXml=function(doc,xml,_b7){
doc.async=false;
if(nitobi.browser.IE){
doc.loadXML(xml);
}else{
var _b8=nitobi.xml.DOMParser.parseFromString(xml,"text/xml");
if(_b7){
while(doc.hasChildNodes()){
doc.removeChild(doc.firstChild);
}
for(var i=0;i<_b8.childNodes.length;i++){
doc.appendChild(doc.importNode(_b8.childNodes[i],true));
}
}else{
doc=_b8;
}
_b8=null;
}
return doc;
};
nitobi.xml.hasParseError=function(_ba){
if(nitobi.browser.IE){
return (_ba.parseError!=0);
}else{
if(_ba==null||_ba.documentElement==null){
return true;
}
var _bb=_ba.documentElement;
if((_bb.tagName=="parserError")||(_bb.namespaceURI=="http://www.mozilla.org/newlayout/xml/parsererror.xml")){
return true;
}
return false;
}
};
nitobi.xml.getParseErrorReason=function(_bc){
if(!nitobi.xml.hasParseError(_bc)){
return "";
}
if(nitobi.browser.IE){
return (_bc.parseError.reason);
}else{
return (new XMLSerializer().serializeToString(_bc));
}
};
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 _c0=null;
var xt=null;
if(typeof (xsl)!="string"){
xsl=nitobi.xml.serialize(xsl);
}
if(nitobi.browser.IE){
_c0=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0");
xt=new ActiveXObject("MSXML2.XSLTemplate.3.0");
_c0.async=false;
_c0.loadXML(xsl);
xt.stylesheet=_c0;
return xt.createProcessor();
}else{
_c0=nitobi.xml.createXmlDoc(xsl);
xt=new XSLTProcessor();
xt.importStylesheet(_c0);
xt.stylesheet=_c0;
return xt;
}
};
nitobi.xml.parseHtml=function(_c2){
if(typeof (_c2)=="string"){
_c2=document.getElementById(_c2);
}
var _c3=nitobi.html.getOuterHtml(_c2);
var _c4="";
if(nitobi.browser.IE){
var _c5=new RegExp("(\\s+.[^=]*)='(.*?)'","g");
_c3=_c3.replace(_c5,function(m,_1,_2){
return _1+"=\""+_2.replace(/"/g,"&quot;")+"\"";
});
_c4=(_c3.substring(_c3.indexOf("/>")+2).replace(/(\s+.[^\=]*)\=\s*([^\"^\s^\>]+)/g,"$1=\"$2\" ")).replace(/\n/gi,"").replace(/(.*?:.*?\s)/i,"$1  ");
var _c9=new RegExp("=\"([^\"]*)(<)(.*?)\"","gi");
var _ca=new RegExp("=\"([^\"]*)(>)(.*?)\"","gi");
while(true){
_c4=_c4.replace(_c9,"=\"$1&lt;$3\" ");
_c4=_c4.replace(_ca,"=\"$1&gt;$3\" ");
var x=(_c9.test(_c4));
if(!_c9.test(_c4)){
break;
}
}
}else{
if(nitobi.browser.MOZ){
_c4=_c3;
_c4=_c4.replace(/\n/gi,"").replace(/\>\s*\</gi,"><").replace(/(.*?:.*?\s)/i,"$1  ");
_c4=_c4.replace(/\&/g,"&amp;");
_c4=_c4.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(_c4.indexOf("xmlns:ntb=\"http://www.nitobi.com\"")<1){
_c4=_c4.replace(/\<(.*?)(\s|\>|\\)/,"<$1 xmlns:ntb=\"http://www.nitobi.com\"$2");
}
_c4=_c4.replace(/\&nbsp\;/gi," ");
return nitobi.xml.createXmlDoc(_c4);
};
nitobi.xml.transform=function(xml,xsl,_ce){
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 _d0=doc.documentElement;
if(_d0&&_d0.nodeName.indexOf("ntb:")==0){
_d0.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:ntb","http://www.nitobi.com");
}
return doc;
}
};
nitobi.xml.transformToString=function(xml,xsl,_d3){
var _d4=nitobi.xml.transform(xml,xsl,"text");
if(nitobi.browser.MOZ){
if(_d3=="xml"){
_d4=nitobi.xml.Serializer.serializeToString(_d4);
}else{
if(_d4.documentElement.childNodes[0]==null){
nitobi.lang.throwError("The transformToString fn could not find any valid output");
}
if(_d4.documentElement.childNodes[0].data!=null){
_d4=_d4.documentElement.childNodes[0].data;
}else{
if(_d4.documentElement.childNodes[0].textContent!=null){
_d4=_d4.documentElement.childNodes[0].textContent;
}else{
nitobi.lang.throwError("The transformToString fn could not find any valid output");
}
}
}
}
return _d4;
};
nitobi.xml.transformToXml=function(xml,xsl){
var _d7=nitobi.xml.transform(xml,xsl,"xml");
if(nitobi.browser.IE){
_d7=nitobi.xml.createXmlDoc(_d7);
}else{
if(nitobi.browser.MOZ){
if(_d7.documentElement.nodeName=="transformiix:result"){
_d7=nitobi.xml.createXmlDoc(_d7.documentElement.firstChild.data);
}
}
}
return _d7;
};
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 _d9=null;
try{
_d9=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_d9=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(ee){
}
}
return _d9;
}else{
if(nitobi.browser.MOZ){
return new XMLHttpRequest();
}
}
};
nitobi.xml.createElement=function(_da,_db,ns){
ns=ns||"http://www.nitobi.com";
var _dd=null;
if(nitobi.browser.IE){
_dd=_da.createNode(1,nitobi.xml.nsPrefix+_db,ns);
}else{
if(_da.createElementNS){
_dd=_da.createElementNS(ns,nitobi.xml.nsPrefix+_db);
}
}
return _dd;
};
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(_df,_e0,_e1){
if(_e0==null){
this.removeParameter(_e1,_df);
}else{
this.setParameter(_e1,_df,_e0);
}
};
XMLDocument.prototype.selectNodes=function(_e2,_e3){
try{
if(this.nsResolver==null){
this.nsResolver=this.createNSResolver(this.documentElement);
}
var _e4=this.evaluate(_e2,(_e3?_e3:this),this.nsResolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
var _e5=new Array(_e4.snapshotLength);
_e5.expr=_e2;
var j=0;
for(i=0;i<_e4.snapshotLength;i++){
var _e7=_e4.snapshotItem(i);
if(_e7.nodeType!=3){
_e5[j++]=_e7;
}
}
return _e5;
}
catch(e){
}
};
XMLDocument.prototype.selectSingleNode=function(_e8,_e9){
var _ea=_e8.match(/\[\d+\]/ig);
if(_ea!=null){
var x=_ea[_ea.length-1];
if(_e8.lastIndexOf(x)+x.length!=_e8.length){
_e8+="[1]";
}
}
var _ec=this.selectNodes(_e8,_e9||null);
return ((_ec!=null&&_ec.length>0)?_ec[0]:null);
};
Element.prototype.selectNodes=function(_ed){
var doc=this.ownerDocument;
return doc.selectNodes(_ed,this);
};
Element.prototype.selectSingleNode=function(_ef){
var doc=this.ownerDocument;
return doc.selectSingleNode(_ef,this);
};
}
nitobi.xml.getLocalName=function(_f1){
var _f2=_f1.indexOf(":");
if(_f2==-1){
return _f1;
}else{
return _f1.substr(_f2+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(_f4,_f5){
var _f6=_f4.match(/(\"|\')/g);
if(_f6!=null){
var _f7="concat(";
var _f8="";
var _f9;
for(var i=0;i<_f4.length;i++){
if(_f4.substr(i,1)=="\""){
_f9="&apos;";
}else{
_f9="&quot;";
}
_f7+=_f8+_f9+nitobi.xml.encode(_f4.substr(i,1))+_f9;
_f8=",";
}
_f7+=_f8+"&apos;&apos;";
_f7+=")";
_f4=_f7;
}else{
var _fb=(_f5?"\"":"");
_f4=_fb+nitobi.xml.encode(_f4)+_fb;
}
return _f4;
};
nitobi.xml.removeChildren=function(_fc){
while(_fc.firstChild){
_fc.removeChild(_fc.firstChild);
}
};
nitobi.xml.Empty=nitobi.xml.createXmlDoc("<root></root>");
nitobi.lang.defineNs("nitobi.html");
nitobi.html.Url=function(){
};
nitobi.html.Url.setParameter=function(url,key,_ff){
var reg=new RegExp("(\\?|&)("+encodeURIComponent(key)+")=(.*?)(&|$)");
if(url.match(reg)){
return url.replace(reg,"$1$2="+encodeURIComponent(_ff)+"$4");
}
if(url.match(/\?/)){
url=url+"&";
}else{
url=url+"?";
}
return url+encodeURIComponent(key)+"="+encodeURIComponent(_ff);
};
nitobi.html.Url.removeParameter=function(url,key){
var reg=new RegExp("(\\?|&)("+encodeURIComponent(key)+")=(.*?)(&|$)");
return url.replace(reg,function(str,p1,p2,p3,p4,_109,s){
if(((p1)=="?")&&(p4!="&")){
return "";
}else{
return p1;
}
});
};
nitobi.html.Url.normalize=function(url,file){
if(file){
if(file.indexOf("http://")==0||file.indexOf("https://")==0||file.indexOf("/")==0){
return file;
}
}
var href=(url.match(/.*\//)||"")+"";
if(file){
return href+file;
}
return href;
};
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(type){
this.type=type;
this.handlers={};
this.guid=0;
this.setEnabled(true);
};
nitobi.base.Event.prototype.subscribe=function(_110,_111,guid){
if(_110==null){
return;
}
var func=_110;
if(typeof (_110)=="string"){
var s=_110;
s=s.replace(/eventArgs/g,"arguments[0]");
_110=nitobi.lang.close(_111,function(){
eval(s);
});
}
if(typeof _111=="object"&&_110 instanceof Function){
func=nitobi.lang.close(_111,_110);
}
guid=guid||func.observer_guid||_110.observer_guid||this.guid++;
func.observer_guid=guid;
_110.observer_guid=guid;
this.handlers[guid]=func;
return guid;
};
nitobi.base.Event.prototype.subscribeOnce=function(_115,_116){
var guid=null;
var _118=this;
var _119=function(){
_115.apply(_116||null,arguments);
_118.unSubscribe(guid);
};
guid=this.subscribe(_119);
return guid;
};
nitobi.base.Event.prototype.unSubscribe=function(guid){
if(guid instanceof Function){
guid=guid.observer_guid;
}
this.handlers[guid]=null;
delete this.handlers[guid];
};
nitobi.base.Event.prototype.notify=function(_11b){
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 fail=false;
for(var item in this.handlers){
var _11e=this.handlers[item];
if(_11e instanceof Function){
var rv=(_11e.apply(this,arguments)==false);
fail=fail||rv;
}
}
return !fail;
}
return true;
};
nitobi.base.Event.prototype.dispose=function(){
for(var _120 in this.handlers){
this.handlers[_120]=null;
}
this.handlers={};
};
nitobi.base.Event.prototype.setEnabled=function(_121){
this.enabled=_121;
};
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(_122,_123,_124){
if(_122.className){
var reg=new RegExp("(\\s|^)"+_123+"(\\s|$)");
_122.className=_122.className.replace(reg,"$1"+_124+"$2");
}
};
nitobi.html.Css.replaceOrAppend=function(_126,_127,_128){
if(nitobi.html.Css.hasClass(_126,_127)){
nitobi.html.Css.swapClass(_126,_127,_128);
}else{
nitobi.html.Css.addClass(_126,_128);
}
};
nitobi.html.Css.hasClass=function(_129,_12a){
if(!_12a||_12a===""){
return false;
}
return (new RegExp("(\\s|^)"+_12a+"(\\s|$)")).test(_129.className);
};
nitobi.html.Css.addClass=function(_12b,_12c,_12d){
if(_12d==true||!nitobi.html.Css.hasClass(_12b,_12c)){
_12b.className=_12b.className?_12b.className+" "+_12c:_12c;
}
};
nitobi.html.Css.removeClass=function(_12e,_12f,_130){
if(_130==true||nitobi.html.Css.hasClass(_12e,_12f)){
var reg=new RegExp("(\\s|^)"+_12f+"(\\s|$)");
_12e.className=_12e.className.replace(reg,"$2");
}
};
nitobi.html.Css.addRule=function(_132,_133,_134){
if(_132.cssRules){
var _135=_132.insertRule(_133+"{"+(_134||"")+"}",_132.cssRules.length);
return _132.cssRules[_135];
}else{
_132.addRule(_133,_134||"nitobi:placeholder;");
return _132.rules[_132.rules.length-1];
}
};
nitobi.html.Css.getRules=function(_136){
var _137=null;
if(typeof (_136)=="number"){
_137=document.styleSheets[_136];
}else{
_137=_136;
}
if(_137==null){
return null;
}
try{
if(_137.cssRules){
return _137.cssRules;
}
if(_137.rules){
return _137.rules;
}
}
catch(e){
}
return null;
};
nitobi.html.Css.getStyleSheetsByName=function(_138){
var arr=new Array();
var ss=document.styleSheets;
var _13b=new RegExp(_138.replace(".",".")+"($|\\?)");
for(var i=0;i<ss.length;i++){
arr=nitobi.html.Css._getStyleSheetsByName(_13b,ss[i],arr);
}
return arr;
};
nitobi.html.Css._getStyleSheetsByName=function(_13d,_13e,arr){
if(_13d.test(_13e.href)){
arr=arr.concat([_13e]);
}
var _140=nitobi.html.Css.getRules(_13e);
if(_13e.href!=""&&_13e.imports){
for(var i=0;i<_13e.imports.length;i++){
arr=nitobi.html.Css._getStyleSheetsByName(_13d,_13e.imports[i],arr);
}
}else{
for(var i=0;i<_140.length;i++){
var s=_140[i].styleSheet;
if(s){
arr=nitobi.html.Css._getStyleSheetsByName(_13d,s,arr);
}
}
}
return arr;
};
nitobi.html.Css.imageCache={};
nitobi.html.Css.imageCacheDidNotify=false;
nitobi.html.Css.trackPrecache=function(_143){
nitobi.html.Css.precacheArray[_143]=true;
var _144=false;
for(var i in nitobi.html.Css.precacheArray){
if(!nitobi.html.Css.precacheArray[i]){
_144=true;
}
}
if((!nitobi.html.Css.imageCacheDidNotify)&&(!_144)){
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(_146){
nitobi.html.Css.isPrecaching=true;
if(!_146){
var ss=document.styleSheets;
for(var i=0;i<ss.length;i++){
nitobi.html.Css.precacheImages(ss[i]);
}
return;
}
var _149=/.*?url\((.*?)\).*?/;
var _14a=nitobi.html.Css.getRules(_146);
var url=nitobi.html.Css.getPath(_146);
for(var i=0;i<_14a.length;i++){
var rule=_14a[i];
if(rule.styleSheet){
nitobi.html.Css.precacheImages(rule.styleSheet);
}else{
var s=rule.style;
var _14e=s?s.backgroundImage:null;
if(_14e){
_14e=_14e.replace(_149,"$1");
_14e=nitobi.html.Url.normalize(url,_14e);
if(!nitobi.html.Css.imageCache[_14e]){
var _14f=new Image();
_14f.src=_14e;
nitobi.html.Css.precacheArray[_14e]=false;
var _150=nitobi.lang.close({},nitobi.html.Css.trackPrecache,[_14e]);
_14f.onload=_150;
_14f.onerror=_150;
_14f.onabort=_150;
nitobi.html.Css.imageCache[_14e]=_14f;
try{
if(_14f.width>0){
nitobi.html.Css.precacheArray[_14e]=true;
}
}
catch(e){
}
}
}
}
}
if(_146.href!=""&&_146.imports){
for(var i=0;i<_146.imports.length;i++){
nitobi.html.Css.precacheImages(_146.imports[i]);
}
}
};
nitobi.html.Css.getPath=function(_151){
var href=_151.href;
href=nitobi.html.Url.normalize(href);
if(_151.parentStyleSheet&&href.indexOf("/")!=0&&href.indexOf("http://")!=0&&href.indexOf("https://")!=0){
href=nitobi.html.Css.getPath(_151.parentStyleSheet)+href;
}
return href;
};
nitobi.html.Css.getSheetUrl=nitobi.html.Css.getPath;
nitobi.html.Css.findParentStylesheet=function(_153){
var rule=nitobi.html.Css.getRule(_153);
if(rule){
return rule.parentStyleSheet;
}
return null;
};
nitobi.html.Css.findInSheet=function(_155,_156,_157){
if(nitobi.browser.IE6&&typeof _157=="undefined"){
_157=0;
}else{
if(_157>4){
return null;
}
}
_157++;
var _158=nitobi.html.Css.getRules(_156);
for(var rule=0;rule<_158.length;rule++){
var _15a=_158[rule];
var ss=_15a.styleSheet;
var _15c=_15a.selectorText;
if(ss){
var _15d=nitobi.html.Css.findInSheet(_155,ss,_157);
if(_15d){
return _15d;
}
}else{
if(_15c!=null&&_15c.toLowerCase().indexOf(_155)>-1){
if(nitobi.browser.IE){
_15a={selectorText:_15c,style:_15a.style,readOnly:_15a.readOnly,parentStyleSheet:_156};
}
return _15a;
}
}
}
var _15e=_156.imports;
if(_156.href!=""&&_15e){
var _15f=_15e.length;
for(var i=0;i<_15f;i++){
var _15d=nitobi.html.Css.findInSheet(_155,_15e[i],_157);
if(_15d){
return _15d;
}
}
}
return null;
};
nitobi.html.Css.getClass=function(_161){
_161=_161.toLowerCase();
if(_161.indexOf(".")!==0){
_161="."+_161;
}
if(nitobi.html.Css.classCache[_161]==null){
var rule=nitobi.html.Css.getRule(_161);
if(rule!=null){
nitobi.html.Css.classCache[_161]=rule.style;
}else{
return null;
}
}
return nitobi.html.Css.classCache[_161];
};
nitobi.html.Css.classCache={};
nitobi.html.Css.getStyleBySelector=function(_163){
var rule=nitobi.html.Css.getRule(_163);
if(rule!=null){
return rule.style;
}
return null;
};
nitobi.html.Css.getRule=function(_165){
_165=_165.toLowerCase();
if(_165.indexOf(".")!==0){
_165="."+_165;
}
var _166=document.styleSheets;
for(var ss=0;ss<_166.length;ss++){
try{
var _168=nitobi.html.Css.findInSheet(_165,_166[ss]);
if(_168){
return _168;
}
}
catch(err){
}
}
return null;
};
nitobi.html.Css.getClassStyle=function(_169,_16a){
var _16b=nitobi.html.Css.getClass(_169);
if(_16b!=null){
return _16b[_16a];
}else{
return null;
}
};
nitobi.html.Css.setStyle=function(el,rule,_16e){
rule=rule.replace(/\-(\w)/g,function(_16f,p1){
return p1.toUpperCase();
});
el.style[rule]=_16e;
};
nitobi.html.Css.getStyle=function(oElm,_172){
var _173="";
if(document.defaultView&&document.defaultView.getComputedStyle){
_172=_172.replace(/([A-Z])/g,function($1){
return "-"+$1.toLowerCase();
});
_173=document.defaultView.getComputedStyle(oElm,"").getPropertyValue(_172);
}else{
if(oElm.currentStyle){
_172=_172.replace(/\-(\w)/g,function(_175,p1){
return p1.toUpperCase();
});
_173=oElm.currentStyle[_172];
}
}
return _173;
};
nitobi.html.Css.setOpacities=function(_177,_178){
if(_177.length){
for(var i=0;i<_177.length;i++){
nitobi.html.Css.setOpacity(_177[i],_178);
}
}else{
nitobi.html.Css.setOpacity(_177,_178);
}
};
nitobi.html.Css.setOpacity=function(_17a,_17b){
var s=_17a.style;
if(_17b>100){
_17b=100;
}
if(_17b<0){
_17b=0;
}
if(s.filter!=null){
var _17d=s.filter.match(/alpha\(opacity=[\d\.]*?\)/ig);
if(_17d!=null&&_17d.length>0){
s.filter=s.filter.replace(/alpha\(opacity=[\d\.]*?\)/ig,"alpha(opacity="+_17b+")");
}else{
s.filter+="alpha(opacity="+_17b+")";
}
}else{
s.opacity=(_17b/100);
}
};
nitobi.html.Css.getOpacity=function(_17e){
if(_17e==null){
nitobi.lang.throwError(nitobi.error.ArgExpected+" for nitobi.html.Css.getOpacity");
}
if(nitobi.browser.IE){
if(_17e.style.filter==""){
return 100;
}
var s=_17e.style.filter;
s.match(/opacity=([\d\.]*?)\)/ig);
if(RegExp.$1==""){
return 100;
}
return parseInt(RegExp.$1);
}else{
return Math.abs(_17e.style.opacity?_17e.style.opacity*100:100);
}
};
nitobi.html.Css.getCustomStyle=function(_180,_181){
if(nitobi.browser.IE){
return nitobi.html.getClassStyle(_180,_181);
}else{
var rule=nitobi.html.Css.getRule(_180);
var re=new RegExp("(.*?)({)(.*?)(})","gi");
var _184=rule.cssText.match(re);
re=new RegExp("("+_181+")(:)(.*?)(;)","gi");
_184=re.exec(RegExp.$3);
}
};
if(nitobi.browser.MOZ){
Document.prototype.createStyleSheet=function(){
var _185=this.createElement("style");
this.documentElement.childNodes[0].appendChild(_185);
return _185;
};
HTMLStyleElement.prototype.__defineSetter__("cssText",function(_186){
this.innerHTML=_186;
});
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(_18c,_18d,_18e,oh,ow,oy,ox){
oh=oh||0;
ow=ow||0;
oy=oy||0;
ox=ox||0;
var a=_18e;
var td,sd,tt,tb,tl,tr,th,tw,st,sb,sl,sr,sh,sw;
if(nitobi.browser.IE){
td=_18d.getBoundingClientRect();
sd=_18c.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(_18d);
sd=document.getBoxObjectFor(_18c);
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(_18d);
sd=nitobi.html.getCoords(_18c);
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=_18c.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(_18c)+tt-st+oy)+"px";
}
if(a&65536){
s.top=(nitobi.html.getStyleTop(_18c)+tt-st+th-sh+oy)+"px";
}
if(a&4096){
s.left=(nitobi.html.getStyleLeft(_18c)-sl+tl+ox)+"px";
}
if(a&256){
s.left=(nitobi.html.getStyleLeft(_18c)-sl+tl+tw-sw+ox)+"px";
}
if(a&16){
s.top=(nitobi.html.getStyleTop(_18c)+tt-st+oy+Math.floor((th-sh)/2))+"px";
}
if(a&1){
s.left=(nitobi.html.getStyleLeft(_18c)-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(_1a3,_1a4,_1a5,oh,ow,oy,ox,show){
oh=oh||0;
ow=ow||0;
oy=oy||0;
ox=ox||0;
if(nitobi.browser.moz){
td=document.getBoxObjectFor(_1a4);
sd=document.getBoxObjectFor(_1a3);
var _1ab=parseInt(document.defaultView.getComputedStyle(_1a4,"").getPropertyValue("border-left-width"));
var _1ac=parseInt(document.defaultView.getComputedStyle(_1a4,"").getPropertyValue("border-top-width"));
var _1ad=parseInt(document.defaultView.getComputedStyle(_1a3,"").getPropertyValue("border-top-width"));
var _1ae=parseInt(document.defaultView.getComputedStyle(_1a3,"").getPropertyValue("border-bottom-width"));
var _1af=parseInt(document.defaultView.getComputedStyle(_1a3,"").getPropertyValue("border-left-width"));
var _1b0=parseInt(document.defaultView.getComputedStyle(_1a3,"").getPropertyValue("border-right-width"));
oy=oy+_1ad-_1ac;
ox=ox+_1af-_1ab;
}
nitobi.drawing.align(_1a3,_1a4,_1a5,oh,ow,oy,ox,show);
};
nitobi.lang.defineNs("nitobi.html");
if(false){
nitobi.html=function(){
};
}
nitobi.html.createElement=function(_1b1,_1b2,_1b3){
var elem=document.createElement(_1b1);
for(var attr in _1b2){
if(attr.toLowerCase().substring(0,5)=="class"){
elem.className=_1b2[attr];
}else{
elem.setAttribute(attr,_1b2[attr]);
}
}
for(var _1b6 in _1b3){
elem.style[_1b6]=_1b3[_1b6];
}
return elem;
};
nitobi.html.createTable=function(_1b7,_1b8){
var _1b9=nitobi.html.createElement("table",_1b7,_1b8);
var _1ba=document.createElement("tbody");
var _1bb=document.createElement("tr");
var _1bc=document.createElement("td");
_1b9.appendChild(_1ba);
_1ba.appendChild(_1bb);
_1bb.appendChild(_1bc);
return _1b9;
};
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.fitWidth=function(_1c0,_1c1){
var w;
var C=nitobi.html.Css;
if(nitobi.browser.IE&&document.compatMode=="BackCompat"){
w=(parseInt(C.getStyle(_1c0,"width"))-parseInt(C.getStyle(_1c0,"paddingLeft"))-parseInt(C.getStyle(_1c0,"paddingRight"))-parseInt(C.getStyle(_1c0,"borderLeftWidth"))-parseInt(C.getStyle(_1c0,"borderRightWidth")))+"px";
}else{
w=(parseInt(C.getStyle(_1c0,"width"))-(_1c1.offsetWidth-parseInt(C.getStyle(_1c1,"width"))))+"px";
}
_1c1.style.width=w;
};
nitobi.html.getDomNodeByPath=function(Node,Path){
if(nitobi.browser.IE){
}
var _1c6=Node;
var _1c7=Path.split("/");
var len=_1c7.length;
for(var i=0;i<len;i++){
if(_1c6.childNodes[Number(_1c7[i])]!=null){
_1c6=_1c6.childNodes[Number(_1c7[i])];
}else{
alert("Path expression failed."+Path);
}
var s="";
}
return _1c6;
};
nitobi.html.indexOfChildNode=function(_1cb,_1cc){
var _1cd=_1cb.childNodes;
for(var i=0;i<_1cd.length;i++){
if(_1cd[i]==_1cc){
return i;
}
}
return -1;
};
nitobi.html.evalScriptBlocks=function(node){
for(var i=0;i<node.childNodes.length;i++){
var _1d1=node.childNodes[i];
if(_1d1.nodeName.toLowerCase()=="script"){
eval(_1d1.text);
}else{
nitobi.html.evalScriptBlocks(_1d1);
}
}
};
nitobi.html.position=function(node){
var pos=nitobi.html.getStyle($(node),"position");
if(pos=="static"){
node.style.position="relative";
}
};
nitobi.html.setOpacity=function(_1d4,_1d5){
var _1d6=_1d4.style;
_1d6.opacity=(_1d5/100);
_1d6.MozOpacity=(_1d5/100);
_1d6.KhtmlOpacity=(_1d5/100);
_1d6.filter="alpha(opacity="+_1d5+")";
};
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(_1de){
if(typeof (_1de)=="string"){
return document.getElementById(_1de);
}
return _1de;
};
if(typeof ($)=="undefined"){
$=nitobi.html.getElement;
}
if(typeof ($F)=="undefined"){
$F=function(id){
var _1e0=$(id);
if(_1e0!=null){
return _1e0.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 _1e7=nitobi.lang.parseNumber(nitobi.html.getStyle(document.body,"border-top-width"));
var _1e8=nitobi.lang.parseNumber(nitobi.html.getStyle(document.body,"border-left-width"));
var _1e9=nitobi.lang.parseNumber(document.body.scrollTop)-(_1e7==0?2:_1e7);
var _1ea=nitobi.lang.parseNumber(document.body.scrollLeft)-(_1e8==0?2:_1e8);
var rect=elem.getBoundingClientRect();
return {top:rect.top+_1e9,left:rect.left+_1ea,bottom:rect.bottom,right:rect.right,height:rect.bottom-rect.top,width:rect.right-rect.left};
};
}else{
nitobi.html.getBox=function(elem){
var _1ed=0;
var _1ee=0;
var _1ef=elem.parentNode;
while(_1ef.nodeType==1&&_1ef!=document.body){
_1ed+=nitobi.lang.parseNumber(_1ef.scrollTop)-(nitobi.html.getStyle(_1ef,"overflow")=="auto"?nitobi.lang.parseNumber(nitobi.html.getStyle(_1ef,"border-top-width")):0);
_1ee+=nitobi.lang.parseNumber(_1ef.scrollLeft)-(nitobi.html.getStyle(_1ef,"overflow")=="auto"?nitobi.lang.parseNumber(nitobi.html.getStyle(_1ef,"border-left-width")):0);
_1ef=_1ef.parentNode;
}
var _1f0=elem.ownerDocument.getBoxObjectFor(elem);
var _1f1=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-left-width"));
var _1f2=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-right-width"));
var _1f3=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-top-width"));
var top=nitobi.lang.parseNumber(_1f0.y)-_1ed-_1f3;
var left=nitobi.lang.parseNumber(_1f0.x)-_1ee-_1f1;
var _1f6=left+nitobi.lang.parseNumber(_1f0.width);
var _1f7=top+_1f0.height;
var _1f8=nitobi.lang.parseNumber(_1f0.height);
var _1f9=nitobi.lang.parseNumber(_1f0.width);
return {top:top,left:left,bottom:_1f7,right:_1f6,height:_1f8,width:_1f9};
};
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,_1fd,_1fe){
return nitobi.html.getChildNodeByAttribute(elem,"id",_1fd,_1fe);
};
nitobi.html.getChildNodeByAttribute=function(elem,_200,_201,_202){
for(var i=0;i<elem.childNodes.length;i++){
if(elem.nodeType!=3&&Boolean(elem.childNodes[i].getAttribute)){
if(elem.childNodes[i].getAttribute(_200)==_201){
return elem.childNodes[i];
}
}
}
if(_202){
for(var i=0;i<elem.childNodes.length;i++){
var _204=nitobi.html.getChildNodeByAttribute(elem.childNodes[i],_200,_201,_202);
if(_204!=null){
return _204;
}
}
}
return null;
};
nitobi.html.getParentNodeById=function(elem,_206){
return nitobi.html.getParentNodeByAtt(elem,"id",_206);
};
nitobi.html.getParentNodeByAtt=function(elem,att,_209){
while(elem.parentNode!=null){
if(elem.parentNode.getAttribute(att)==_209){
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 _20d,_20e=0;
if((nitobi.browser.OPERA==false)&&(document.documentElement.scrollTop>0)){
_20d=document.documentElement.scrollTop;
_20e=document.documentElement.scrollLeft;
}else{
_20d=document.body.scrollTop;
_20e=document.body.scrollLeft;
}
if(((_20d==0)&&(document.documentElement.scrollTop>0))||((_20e==0)&&(document.documentElement.scrollLeft>0))){
_20d=document.documentElement.scrollTop;
_20e=document.documentElement.scrollLeft;
}
return {"left":_20e,"top":_20d};
};
nitobi.html.getCoords=function(_20f){
var ew,eh;
try{
var _212=_20f;
ew=_20f.offsetWidth;
eh=_20f.offsetHeight;
for(var lx=0,ly=0;_20f!=null;lx+=_20f.offsetLeft,ly+=_20f.offsetTop,_20f=_20f.offsetParent){
}
for(;_212!=document.body;lx-=_212.scrollLeft,ly-=_212.scrollTop,_212=_212.parentNode){
}
}
catch(e){
}
return {"x":lx,"y":ly,"height":eh,"width":ew};
};
nitobi.html.scrollBarWidth=0;
nitobi.html.getScrollBarWidth=function(_215){
if(nitobi.html.scrollBarWidth){
return nitobi.html.scrollBarWidth;
}
try{
if(null==_215){
var _216="ntb-scrollbar-width";
var d=document.getElementById(_216);
if(null==d){
d=nitobi.html.createElement("div",{"id":_216},{width:"100px",height:"100px",overflow:"auto",position:"absolute",top:"-200px"});
d.innerHTML="<div style='height:200px;'></div>";
document.body.appendChild(d);
}
_215=d;
}
if(nitobi.browser.IE){
nitobi.html.scrollBarWidth=Math.abs(_215.offsetWidth-_215.clientWidth-(_215.clientLeft?_215.clientLeft*2:0));
}else{
var b=document.getBoxObjectFor(_215);
nitobi.html.scrollBarWidth=Math.abs((b.width-_215.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 _219,_21a,_21b,_21c;
var x,y;
var _21f=navigator.userAgent.toLowerCase();
var _220=false;
var _221=false;
var _222=false;
var ie=false;
var _224=false;
if(_21f.indexOf("opera")>=0){
_220=true;
}
if(_21f.indexOf("firefox")>=0){
_221=true;
}
if(_21f.indexOf("msie")>=0){
ie=true;
}
if(_21f.indexOf("safari")>=0){
_222=true;
}
if(document.compatMode=="CSS1Compat"){
_224=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;
}
}
}
_21b=x;
_21c=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;
}
}
}
_219=x;
_21a=y;
var _227=db.scrollHeight;
var _228=db.offsetHeight;
if(_227>_228){
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<_21c){
nitobi.html.permHeight=_21c;
if(ie&&_224){
_21b+=20;
}
}
if(_21b<nitobi.html.permWidth){
_21b=nitobi.html.permWidth;
}
if(nitobi.html.permHeight>_21c){
_21b+=20;
}
var _229,_22a;
_229=de.scrollHeight;
_22a=de.scrollWidth;
return {scrollWidth:_22a,scrollHeight:_229,scrollLeft:_219,scrollTop:_21a,clientWidth:_21b,clientHeight:_21c,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 _22e=node.attributes[a].nodeValue;
}
}
html+=">";
html+=_22e;
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 _230=this.nextSibling;
var _231=this.parentNode;
node.parentNode.replaceChild(this,node);
_231.insertBefore(node,_230);
};
HTMLElement.prototype.getBoundingClientRect=function(_232,_233){
_232=_232||0;
_233=_233||0;
var td=document.getBoxObjectFor(this);
var top=td.y-_232;
var left=td.x-_233;
return {top:top,left:left,bottom:(top+td.height),right:(left+td.width)};
};
HTMLElement.prototype.getClientRects=function(_237,_238){
_237=_237||0;
_238=_238||0;
var td=document.getBoxObjectFor(this);
return new Array({top:(td.y-_237),left:(td.x-_238),bottom:(td.y+td.height-_237),right:(td.x+td.width-_238)});
};
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(_23c,_23d,_23e){
var df;
var r=this.ownerDocument.createRange();
switch(String(_23c).toLowerCase()){
case "beforebegin":
r.setStartBefore(this);
df=r.createContextualFragment(_23d);
this.parentNode.insertBefore(df,this);
break;
case "afterbegin":
r.selectNodeContents(this);
r.collapse(true);
df=r.createContextualFragment(_23d);
this.insertBefore(df,this.firstChild);
break;
case "beforeend":
if(_23e==true){
this.innerHTML=this.innerHTML+_23d;
}else{
r.selectNodeContents(this);
r.collapse(false);
df=r.createContextualFragment(_23d);
this.appendChild(df);
}
break;
case "afterend":
r.setStartAfter(this);
df=r.createContextualFragment(_23d);
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(_244,_245,_246){
var _247=[];
for(var i=0;i<_245.length;i++){
var e=_245[i];
_247.push(nitobi.html.attachEvent(_244,e.type,e.handler,_246,e.capture||false));
}
return _247;
};
nitobi.html.attachEvent=function(_24a,type,_24c,_24d,_24e,_24f){
if(type=="anyclick"){
if(nitobi.browser.IE){
nitobi.html.attachEvent(_24a,"dblclick",_24c,_24d,_24e,_24f);
}
type="click";
}
if(!(_24c instanceof Function)){
nitobi.lang.throwError("Event handler needs to be a Function");
}
_24a=$(_24a);
if(type.toLowerCase()=="unload"&&_24f!=true){
var _250=_24c;
if(_24d!=null){
_250=function(){
_24c.call(_24d);
};
}
return this.addUnload(_250);
}
var _251=this.handlerId++;
var _252=this.elementId++;
if(typeof (_24c.ebaguid)!="undefined"){
_251=_24c.ebaguid;
}else{
_24c.ebaguid=_251;
}
if(typeof (_24a.ebaguid)=="undefined"){
_24a.ebaguid=_252;
nitobi.html.elements[_252]=_24a;
}
if(typeof (_24a.eba_events)=="undefined"){
_24a.eba_events={};
}
if(_24a.eba_events[type]==null){
_24a.eba_events[type]={};
if(_24a.attachEvent){
_24a["eba_event_"+type]=function(){
nitobi.html.notify.call(_24a,window.event);
};
_24a.attachEvent("on"+type,_24a["eba_event_"+type]);
if(_24e&&_24a.setCapture!=null){
_24a.setCapture(true);
}
}else{
if(_24a.addEventListener){
_24a["eba_event_"+type]=function(){
nitobi.html.notify.call(_24a,arguments[0]);
};
_24a.addEventListener(type,_24a["eba_event_"+type],_24e);
}
}
}
_24a.eba_events[type][_251]={handler:_24c,context:_24d};
return _251;
};
nitobi.html.notify=function(e){
if(!nitobi.browser.IE){
e.srcElement=e.target;
e.fromElement=e.relatedTarget;
e.toElement=e.relatedTarget;
}
var _254=this;
e.eventSrc=_254;
nitobi.html.Event=e;
for(var _255 in _254.eba_events[e.type]){
var _256=_254.eba_events[e.type][_255];
if(typeof (_256.context)=="object"){
_256.handler.call(_256.context,e,_254);
}else{
_256.handler.call(_254,e,_254);
}
}
};
nitobi.html.detachEvents=function(_257,_258){
for(var i=0;i<_258.length;i++){
var e=_258[i];
nitobi.html.detachEvent(_257,e.type,e.handler);
}
};
nitobi.html.detachEvent=function(_25b,type,_25d){
_25b=$(_25b);
var _25e=_25d;
if(_25d instanceof Function){
_25e=_25d.ebaguid;
}
if(type=="unload"){
this.unload.splice(ebaguid,1);
}
if(_25b.eba_events!=null&&_25b.eba_events[type]!=null&&_25b.eba_events[type][_25e]!=null){
var _25f=_25b.eba_events[type];
_25f[_25e]=null;
delete _25f[_25e];
if(nitobi.collections.isHashEmpty(_25f)){
this.m_detach(_25b,type,_25b["eba_event_"+type]);
_25b["eba_event_"+type]=null;
_25b.eba_events[type]=null;
_25f=null;
if(_25b.nodeType==1){
_25b.removeAttribute("eba_event_"+type);
}
}
}
return true;
};
nitobi.html.m_detach=function(_260,type,_262){
if(_262!=null&&_262 instanceof Function){
if(_260.detachEvent){
_260.detachEvent("on"+type,_262);
}else{
if(_260.removeEventListener){
_260.removeEventListener(type,_262,false);
}
}
_260["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(evt){
for(var i=0;i<nitobi.html.elements.length;i++){
if(typeof (nitobi.html.elements[i])!="undefined"){
for(var _266 in nitobi.html.elements[i].eba_events){
nitobi.html.m_detach(nitobi.html.elements[i],_266,nitobi.html.elements[i]["eba_event_"+_266]);
if(typeof (nitobi.html.elements[i])!="undefined"&&nitobi.html.elements[i].eba_events[_266]!=null){
for(var _267 in nitobi.html.elements[i].eba_events[_266]){
nitobi.html.elements[i].eba_events[_266][_267]=null;
}
}
nitobi.html.elements[i]["eba_event_"+_266]=null;
}
}
}
nitobi.html.elements=null;
};
nitobi.html.addUnload=function(_268){
this.unload.push(_268);
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;
}
try{
if(nitobi.browser.MOZ&&evt.stopPropagation){
evt.stopPropagation();
}else{
if(nitobi.browser.IE){
evt.cancelBubble=true;
}
}
}
catch(e){
}
};
nitobi.html.preventDefault=function(evt,v){
if(evt==null){
return;
}
try{
if(nitobi.browser.MOZ&&evt.preventDefault){
evt.preventDefault();
}else{
if(nitobi.browser.IE){
evt.returnValue=false;
}
}
}
catch(e){
}
if(v!=null){
e.keyCode=v;
}
};
nitobi.html.getEventCoords=function(evt){
var _26f={"x":evt.clientX,"y":evt.clientY};
if(nitobi.browser.IE){
_26f.x+=document.documentElement.scrollLeft+document.body.scrollLeft;
_26f.y+=document.documentElement.scrollTop+document.body.scrollTop;
}else{
_26f.x+=window.scrollX;
_26f.y+=window.scrollY;
}
return _26f;
};
nitobi.html.getEvent=function(_270){
if(nitobi.browser.IE){
return window.event;
}else{
_270.srcElement=_270.target;
_270.fromElement=_270.relatedTarget;
_270.toElement=_270.relatedTarget;
return _270;
}
};
nitobi.html.createEvent=function(_271,_272,_273,_274){
if(nitobi.browser.IE){
_273.target.fireEvent("on"+_272);
}else{
var _275=document.createEvent(_271);
_275.initKeyEvent(_272,true,true,document.defaultView,_273.ctrlKey,_273.altKey,_273.shiftKey,_273.metaKey,_274.keyCode,_274.charCode);
_273.target.dispatchEvent(_275);
}
};
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,_277){
nitobi.event.publish(key);
var guid=this.guid++;
this.keys[key].add(_277,guid);
return guid;
};
nitobi.event.unsubscribe=function(key,guid){
if(this.keys[key]==null){
return true;
}
if(this.keys[key].remove(guid)){
this.keys[key]=null;
delete this.keys[key];
}
};
nitobi.event.evaluate=function(func,_27c){
var _27d=true;
if(typeof func=="string"){
func=func.replace(/eventArgs/gi,"arguments[1]");
var _27e=eval(func);
_27d=(typeof (_27e)=="undefined"?true:_27e);
}
return _27d;
};
nitobi.event.publish=function(key){
if(this.keys[key]==null){
this.keys[key]=new nitobi.event.Key();
}
};
nitobi.event.notify=function(key,_281){
if(this.keys[key]!=null){
return this.keys[key].notify(_281);
}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(_283,guid){
this.handlers[guid]=_283;
};
nitobi.event.Key.prototype.remove=function(guid){
this.handlers[guid]=null;
delete this.handlers[guid];
var i=true;
for(var item in this.handlers){
i=false;
break;
}
return i;
};
nitobi.event.Key.prototype.notify=function(_288){
var fail=false;
for(var item in this.handlers){
var _28b=this.handlers[item];
if(_28b instanceof Function){
var rv=(_28b.apply(this,arguments)==false);
fail=fail||rv;
}else{
}
}
return !fail;
};
nitobi.event.Key.prototype.dispose=function(){
for(var _28d in this.handlers){
this.handlers[_28d]=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(_290,obj){
this.list.splice(_290,0,obj);
this.length++;
};
nitobi.collections.IEnumerable.createNewArray=function(obj,_293){
var _294;
_293=_293||0;
if(obj.count){
_294=obj.count;
}
if(obj.length){
_294=obj.length;
}
var x=new Array(_294-_293);
for(var i=_293;i<_294;i++){
x[i-_293]=obj[i];
}
return x;
};
nitobi.collections.IEnumerable.prototype.get=function(_297){
if(_297<0||_297>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
return this.list[_297];
};
nitobi.collections.IEnumerable.prototype.set=function(_298,_299){
if(_298<0||_298>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
this.list[_298]=_299;
};
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(_29c){
var i;
if(typeof (_29c)!="number"){
i=this.indexOf(_29c);
}else{
i=_29c;
}
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(_2a2,id,xml,_2a5){
nitobi.Object.call(this);
if(typeof (this.ISerializableInitialized)=="undefined"){
this.ISerializableInitialized=true;
}else{
return;
}
this.xmlNode=null;
this.setXmlNode(_2a2);
if(_2a2!=null){
this.profile=nitobi.base.Registry.getInstance().getCompleteProfile({idField:null,tagName:_2a2.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(_2a2!=null){
this.deserializeFromXmlNode(this.getXmlNode());
}else{
if(this.factory!=null&&this.profile.tagName!=null){
this.createByProfile(this.profile,this.getXmlNode());
}else{
if(xml!=null&&_2a2!=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(_2a6,_2a7){
if(_2a7==null){
var xml="<"+_2a6.tagName+" xmlns:"+nitobi.base.XmlNamespace.prefix+"=\""+nitobi.base.XmlNamespace.uri+"\" />";
var _2a9=nitobi.xml.createXmlDoc(xml);
this.setXmlNode(_2a9.firstChild);
this.deserializeFromXmlNode(this.xmlNode);
}else{
this.deserializeFromXmlNode(_2a7);
this.setXmlNode(_2a7);
}
};
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(_2ab){
this.parentObj=_2ab;
this.onSetParentObject.notify();
};
nitobi.base.ISerializable.prototype.addChildObject=function(_2ac){
this.addToCache(_2ac);
_2ac.setParentObject(this);
var _2ad=_2ac.getXmlNode();
if(!this.areGuidsGenerated(_2ad)){
_2ad=this.generateGuids(_2ad);
_2ac.setXmlNode(_2ad);
}
this.xmlNode.appendChild(_2ad);
};
nitobi.base.ISerializable.prototype.insertBeforeChildObject=function(obj,_2af){
_2af=_2af?_2af.getXmlNode():null;
this.addToCache(obj);
obj.setParentObject(this);
var _2b0=obj.getXmlNode();
if(!this.areGuidsGenerated(_2b0)){
_2b0=this.generateGuids(_2b0);
obj.setXmlNode(_2b0);
}
this.xmlNode.insertBefore(_2b0,_2af);
};
nitobi.base.ISerializable.prototype.createElement=function(name){
var _2b2;
if(this.xmlNode==null||this.xmlNode.ownerDocument==null){
_2b2=nitobi.xml.createXmlDoc();
}else{
_2b2=this.xmlNode.ownerDocument;
}
if(nitobi.browser.IE){
return _2b2.createNode(1,name,nitobi.base.XmlNamespace.uri);
}else{
if(_2b2.createElementNS){
return _2b2.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(_2b8){
if(_2b8==null||_2b8.ownerDocument==null){
return false;
}
if(nitobi.browser.IE){
var node=_2b8.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 (_2b8.ownerDocument.generatedGuids==true);
}
};
nitobi.base.ISerializable.prototype.setGuidsGenerated=function(_2bb,_2bc){
if(_2bb==null||_2bb.ownerDocument==null){
return;
}
if(nitobi.browser.IE){
var node=_2bb.ownerDocument.documentElement;
if(node!=null){
var id=node.getAttribute("id");
if(id!=null&&id!=""){
nitobi.base.ISerializable.guidMap[id]=true;
}
}
}else{
_2bb.ownerDocument.generatedGuids=true;
}
};
nitobi.base.ISerializable.prototype.generateGuids=function(_2bf){
nitobi.base.uniqueIdGeneratorProc.addParameter("guid",nitobi.component.getUniqueId(),"");
var doc=nitobi.xml.transformToXml(_2bf,nitobi.base.uniqueIdGeneratorProc);
this.saveDocument=doc;
this.setGuidsGenerated(doc.documentElement,true);
return doc.documentElement;
};
nitobi.base.ISerializable.prototype.deserializeFromXmlNode=function(_2c1){
if(!this.areGuidsGenerated(_2c1)){
_2c1=this.generateGuids(_2c1);
}
this.setXmlNode(_2c1);
this.flushCache();
if(this.profile==null){
this.profile=nitobi.base.Registry.getInstance().getCompleteProfile({idField:null,tagName:_2c1.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 _2c7=this.getElement(id);
if(_2c7==null){
return null;
}else{
obj=this.factory.createByNode(_2c7);
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(_2cb){
this.factory=factory;
};
nitobi.base.ISerializable.prototype.getXmlNode=function(){
return this.xmlNode;
};
nitobi.base.ISerializable.prototype.setXmlNode=function(_2cc){
if(nitobi.lang.typeOf(_2cc)==nitobi.lang.type.XMLDOC&&_2cc!=null){
this.ownerDocument=_2cc;
_2cc=nitobi.html.getFirstChild(_2cc);
}else{
if(_2cc!=null){
this.ownerDocument=_2cc.ownerDocument;
}
}
if(_2cc!=null&&nitobi.browser.MOZ&&_2cc.ownerDocument==null){
nitobi.lang.throwError(nitobi.error.OrphanXmlNode+" ISerializable.setXmlNode");
}
this.xmlNode=_2cc;
};
nitobi.base.ISerializable.prototype.serializeToXml=function(){
return nitobi.xml.serialize(this.xmlNode);
};
nitobi.base.ISerializable.prototype.getAttribute=function(name,_2ce){
if(this[name]!=null){
return this[name];
}
var _2cf=this.xmlNode.getAttribute(name);
return _2cf===null?_2ce:_2cf;
};
nitobi.base.ISerializable.prototype.setAttribute=function(name,_2d1){
this[name]=_2d1;
this.xmlNode.setAttribute(name.toLowerCase(),_2d1!=null?_2d1.toString():"");
};
nitobi.base.ISerializable.prototype.setIntAttribute=function(name,_2d3){
var n=parseInt(_2d3);
if(_2d3!=null&&(typeof (n)!="number"||isNaN(n))){
nitobi.lang.throwError(name+" is not an integer and therefore cannot be set. It's value was "+_2d3);
}
this.setAttribute(name,_2d3);
};
nitobi.base.ISerializable.prototype.getIntAttribute=function(name,_2d6){
var x=this.getAttribute(name,_2d6);
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,_2da){
_2da=nitobi.lang.getBool(_2da);
if(_2da!=null&&typeof (_2da)!="boolean"){
nitobi.lang.throwError(name+" is not an boolean and therefore cannot be set. It's value was "+_2da);
}
this.setAttribute(name,(_2da?"true":"false"));
};
nitobi.base.ISerializable.prototype.getBoolAttribute=function(name,_2dc){
var x=this.getAttribute(name,_2dc);
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,_2e0){
this.setAttribute(name,_2e0);
};
nitobi.base.ISerializable.prototype.getDateAttribute=function(name,_2e2){
if(this[name]){
return this[name];
}
var _2e3=this.getAttribute(name,_2e2);
return _2e3?new Date(_2e3):null;
};
nitobi.base.ISerializable.prototype.getId=function(){
return this.getAttribute("id");
};
nitobi.base.ISerializable.prototype.getChildObjectId=function(_2e4,_2e5){
var _2e6=(typeof (_2e4.className)=="string"?_2e4.tagName:_2e4.getXmlNode().nodeName);
var _2e7=_2e6;
if(_2e5){
_2e7+="[@instancename='"+_2e5+"']";
}
var node=this.getXmlNode().selectSingleNode(_2e7);
if(null==node){
return null;
}else{
return node.getAttribute("id");
}
};
nitobi.base.ISerializable.prototype.setObject=function(_2e9,_2ea){
if(_2e9.ISerializableImplemented!=true){
nitobi.lang.throwError(nitobi.error.ExpectedInterfaceNotFound+" ISerializable");
}
var id=this.getChildObjectId(_2e9,_2ea);
if(null!=id){
this.deleteChildObject(id);
}
if(_2ea){
_2e9.setAttribute("instancename",_2ea);
}
this.addChildObject(_2e9);
};
nitobi.base.ISerializable.prototype.getObject=function(_2ec,_2ed){
var id=this.getChildObjectId(_2ec,_2ed);
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 _2f2=node.selectSingleNode("//*[@id='"+id+"']");
return (_2f2!=null);
};
nitobi.base.ISerializable.prototype.getPathToLeaf=function(id){
var node=this.getXmlNode();
var _2f5=node.selectSingleNode("//*[@id='"+id+"']");
if(nitobi.browser.IE){
_2f5.ownerDocument.setProperty("SelectionLanguage","XPath");
}
var _2f6=_2f5.selectNodes("./ancestor-or-self::*");
var _2f7=this.getId();
var _2f8=0;
for(var i=0;i<_2f6.length;i++){
if(_2f6[i].getAttribute("id")==_2f7){
_2f8=i+1;
break;
}
}
var arr=nitobi.collections.IEnumerable.createNewArray(_2f6,_2f8);
return arr.reverse();
};
nitobi.base.ISerializable.prototype.isDescendantInstantiated=function(id){
var node=this.getXmlNode();
var _2fd=node.selectSingleNode("//*[@id='"+id+"']");
if(nitobi.browser.IE){
_2fd.ownerDocument.setProperty("SelectionLanguage","XPath");
}
var _2fe=_2fd.selectNodes("ancestor::*");
var _2ff=false;
var obj=this;
for(var i=0;i<_2fe.length;i++){
if(_2ff){
var _302=_2fe[i].getAttribute("id");
instantiated=obj.inCache(_302);
if(!instantiated){
return false;
}
obj=this.getObjectById(_302);
}
if(_2fe[i].getAttribute("id")==this.getId()){
_2ff=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(_303){
return this.classMap[_303];
};
nitobi.base.Registry.prototype.getProfileByInstance=function(_304){
var _305=nitobi.lang.getFirstFunction(_304);
var p=_305.value.prototype;
var _307=null;
var _308=0;
for(var _309 in this.classMap){
var _30a=this.classMap[_309].classObject;
var _30b=0;
while(_30a&&_304 instanceof _30a){
_30a=_30a.baseConstructor;
_30b++;
}
if(_30b>_308){
_308=_30b;
_307=_309;
}
}
if(_307){
return this.getProfileByClass(_307);
}else{
return null;
}
};
nitobi.base.Registry.prototype.getProfileByTag=function(_30c){
return this.tagMap[_30c];
};
nitobi.base.Registry.prototype.getCompleteProfile=function(_30d){
if(nitobi.lang.isDefined(_30d.className)&&_30d.className!=null){
return this.classMap[_30d.className];
}
if(nitobi.lang.isDefined(_30d.tagName)&&_30d.tagName!=null){
return this.tagMap[_30d.tagName];
}
nitobi.lang.throwError("A complete class profile could not be found. Insufficient information was provided.");
};
nitobi.base.Registry.prototype.register=function(_30e){
if(!nitobi.lang.isDefined(_30e.tagName)||null==_30e.tagName){
nitobi.lang.throwError("Illegal to register a class without a tagName.");
}
if(!nitobi.lang.isDefined(_30e.className)||null==_30e.className){
nitobi.lang.throwError("Illegal to register a class without a className.");
}
this.tagMap[_30e.tagName]=_30e;
this.classMap[_30e.className]=_30e;
};
}
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(_30f){
try{
return nitobi.lang.newObject(_30f,arguments,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByClass) could not create the class "+_30f+".",err);
}
};
nitobi.base.Factory.prototype.createByNode=function(_310){
try{
if(null==_310){
nitobi.lang.throwError(nitobi.error.ArgExpected);
}
if(nitobi.lang.typeOf(_310)==nitobi.lang.type.XMLDOC){
_310=nitobi.xml.getChildNodes(_310)[0];
}
var _311=this.registry.getProfileByTag(_310.nodeName).className;
var _312=_310.ownerDocument;
var _313=Array.prototype.slice.call(arguments,0);
var obj=nitobi.lang.newObject(_311,_313,0);
return obj;
}
catch(err){
nitobi.lang.throwError("The Factory (createByNode) could not create the class "+_311+".",err);
}
};
nitobi.base.Factory.prototype.createByProfile=function(_315){
try{
return nitobi.lang.newObject(_315.className,arguments,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByProfile) could not create the class "+_315.className+".",err);
}
};
nitobi.base.Factory.prototype.createByTag=function(_316){
try{
var _317=this.registry.getProfileByTag(_316).className;
var _318=Array.prototype.slice.call(arguments,0);
return nitobi.lang.newObject(_317,_318,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByTag) could not create the class "+_317+".",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(_319,_31a,_31b,_31c,_31d){
this.className=_319;
this.classObject=eval(_319);
this.schema=_31a;
this.singleton=_31b;
this.tagName=_31c;
this.idField=_31d||"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(_31e){
try{
_31e=$(_31e);
this.xmlDoc=nitobi.xml.parseHtml(_31e);
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,_321){
if(unit==this.DAY){
date.setDate(date.getDate()+_321);
}else{
if(unit==this.WEEK){
date.setDate(date.getDate()+7*_321);
}else{
if(unit==this.MONTH){
date.setMonth(date.getMonth()+_321);
}else{
if(unit==this.YEAR){
date.setFullYear(date.getFullYear()+_321);
}
}
}
}
return date;
};
nitobi.base.DateMath.add=function(date,unit,_324){
return this._add(date,unit,_324);
};
nitobi.base.DateMath.subtract=function(date,unit,_327){
return this._add(date,unit,-1*_327);
};
nitobi.base.DateMath.after=function(date,_329){
return (date-_329)>0;
};
nitobi.base.DateMath.between=function(date,_32b,end){
return (date-_32b)>=0&&(end-date)>0;
};
nitobi.base.DateMath.before=function(date,_32e){
return (date-_32e)<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 _33a=this.resetTime(new Date());
var end=this.add(this.clone(_33a),this.DAY,1);
return this.between(date,_33a,end);
};
nitobi.base.DateMath.parse=function(str){
};
nitobi.base.DateMath.getWeekNumber=function(date){
var _33e=this.getJanuary1st(date);
return Math.ceil(this.getNumberOfDays(_33e,date)/7);
};
nitobi.base.DateMath.getNumberOfDays=function(_33f,end){
var _341=this.resetTime(this.clone(end)).getTime()-this.resetTime(this.clone(_33f)).getTime();
return Math.round(_341/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(_348,_349){
this.source=_348;
this.event=_349||nitobi.html.Event;
};
nitobi.base.EventArgs.prototype.getSource=function(){
return this.source;
};
nitobi.base.EventArgs.prototype.getEvent=function(){
return this.event;
};
nitobi.lang.defineNs("nitobi.collections");
nitobi.collections.IList=function(){
nitobi.base.ISerializable.call(this);
nitobi.collections.IEnumerable.call(this);
};
nitobi.lang.implement(nitobi.collections.IList,nitobi.base.ISerializable);
nitobi.lang.implement(nitobi.collections.IList,nitobi.collections.IEnumerable);
nitobi.collections.IList.prototype.IListImplemented=true;
nitobi.collections.IList.prototype.add=function(obj){
nitobi.collections.IEnumerable.prototype.add.call(this,obj);
if(obj.ISerializableImplemented==true&&obj.profile!=null){
this.addChildObject(obj);
}
};
nitobi.collections.IList.prototype.insert=function(_34b,obj){
var _34d=this.get(_34b);
nitobi.collections.IEnumerable.prototype.insert.call(this,_34b,obj);
if(obj.ISerializableImplemented==true&&obj.profile!=null){
this.insertBeforeChildObject(obj,_34d);
}
};
nitobi.collections.IList.prototype.addToCache=function(obj,_34f){
nitobi.base.ISerializable.prototype.addToCache.call(this,obj);
this.list[_34f]=obj;
};
nitobi.collections.IList.prototype.removeFromCache=function(_350){
nitobi.base.ISerializable.prototype.removeFromCache.call(this,this.list[_350].getId());
};
nitobi.collections.IList.prototype.flushCache=function(){
nitobi.base.ISerializable.prototype.flushCache.call(this);
this.list=new Array();
};
nitobi.collections.IList.prototype.get=function(_351){
if(typeof (_351)=="object"){
return _351;
}
if(_351<0||_351>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
var obj=null;
if(this.list[_351]!=null){
obj=this.list[_351];
}
if(obj==null){
var _353=nitobi.xml.getChildNodes(this.xmlNode)[_351];
if(_353==null){
return null;
}else{
obj=this.factory.createByNode(_353);
this.onCreateObject.notify(obj);
nitobi.collections.IList.prototype.addToCache.call(this,obj,_351);
}
obj.setParentObject(this);
}
return obj;
};
nitobi.collections.IList.prototype.getById=function(id){
var node=this.xmlNode.selectSingleNode("*[@id='"+id+"']");
var _356=nitobi.xml.indexOfChildNode(node.parentNode,node);
return this.get(_356);
};
nitobi.collections.IList.prototype.set=function(_357,_358){
if(_357<0||_357>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
try{
if(_358.ISerializableImplemented==true){
var obj=this.get(_357);
if(obj.getXmlNode()!=_358.getXmlNode()){
var _35a=this.xmlNode.insertBefore(_358.getXmlNode(),obj.getXmlNode());
this.xmlNode.removeChild(obj.getXmlNode());
obj.setXmlNode(_35a);
}
}
_358.setParentObject(this);
nitobi.collections.IList.prototype.addToCache.call(this,_358,_357);
}
catch(err){
nitobi.lang.throwError(nitobi.error.Unexpected,err);
}
};
nitobi.collections.IList.prototype.remove=function(_35b){
var i;
if(typeof (_35b)!="number"){
i=this.indexOf(_35b);
}else{
i=_35b;
}
var obj=this.get(i);
nitobi.collections.IEnumerable.prototype.remove.call(this,_35b);
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(_35e){
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 _360=true;
for(var item in hash){
if(hash[item]!=null&&hash[item]!=""){
_360=false;
break;
}
}
return _360;
};
nitobi.collections.hashLength=function(hash){
var _363=0;
for(var item in hash){
_363++;
}
return _363;
};
nitobi.collections.serialize=function(hash){
var s="";
for(var item in hash){
var _368=hash[item];
var type=typeof (_368);
if(type=="string"||type=="number"){
s+="'"+item+"':'"+_368+"',";
}
}
s=s.substring(0,s.length-1);
return "{"+s+"}";
};
nitobi.lang.defineNs("nitobi.ui");
if(false){
nitobi.ui=function(){
};
}
nitobi.ui.setWaitScreen=function(_36a){
if(_36a){
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(_36d){
this.htmlNode=_36d||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,_370){
if(this.onBeforeSetStyle.notify(new nitobi.ui.StyleEventArgs(this,this.onBeforeSetStyle,name,_370))&&this.getHtmlNode()!=null){
nitobi.html.Css.setStyle(this.getHtmlNode(),name,_370);
this.onSetStyle.notify(new nitobi.ui.StyleEventArgs(this,this.onSetStyle,name,_370));
}
};
nitobi.ui.IStyleable.prototype.getStyle=function(name){
return nitobi.html.Css.getStyle(this.getHtmlNode(),name);
};
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.StyleEventArgs=function(_372,_373,_374,_375){
nitobi.ui.ElementEventArgs.baseConstructor.apply(this,arguments);
this.property=_374||null;
this.value=_375||null;
};
nitobi.lang.extend(nitobi.ui.StyleEventArgs,nitobi.base.EventArgs);
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.IScrollable=function(_376){
this.scrollableElement=_376;
};
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(_379){
_379=_379||25;
this.scrollableElement.scrollLeft-=_379;
};
nitobi.ui.IScrollable.prototype.scrollRight=function(_37a){
_37a=_37a||25;
this.scrollableElement.scrollLeft+=_37a;
};
nitobi.ui.IScrollable.prototype.isOverflowed=function(_37b){
_37b=_37b||this.scrollableElement.childNodes[0];
return !(parseInt(nitobi.html.getBox(this.scrollableElement).width)>=parseInt(nitobi.html.getBox(_37b).width));
};
nitobi.lang.defineNs("nitobi.ui");
if(false){
nitobi.ui=function(){
};
}
nitobi.ui.startDragOperation=function(_37c,_37d,_37e,_37f,_380,_381){
var ddo=new nitobi.ui.DragDrop(_37c,_37e,_37f);
ddo.onDragStop.subscribe(_381,_380);
ddo.startDrag(_37d);
};
nitobi.ui.DragDrop=function(_383,_384,_385){
this.allowVertDrag=(_384!=null?_384:true);
this.allowHorizDrag=(_385!=null?_385: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(_383.nodeType==3){
alert("Text node not supported. Use parent element");
}
this.element=_383;
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(_386){
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 _387=nitobi.html.getEventCoords(_386);
x=_387.x;
y=_387.y;
this.originX=x;
this.originY=y;
nitobi.html.attachEvents(document,this.events,this);
nitobi.html.cancelEvent(_386);
this.onDragStart.notify();
};
nitobi.ui.DragDrop.prototype.handleMouseMove=function(_388){
var x,y;
var _38b=nitobi.html.getEventCoords(_388);
x=_38b.x;
y=_38b.y;
if(nitobi.browser.IE){
this.surface.style.display="block";
if(document.compat=="CSS1Compat"){
var _38c=nitobi.html.getBodyArea();
var _38d=0;
if(document.compatMode=="CSS1Compat"){
_38d=25;
}
this.surface.style.width=(_38c.clientWidth-_38d)+"px";
this.surface.style.height=(_38c.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(_388);
};
nitobi.ui.DragDrop.prototype.handleMouseUp=function(_38e){
this.onDragStop.notify({"event":_38e,"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 _38f=null;
try{
_38f=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_38f=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(ee){
}
}
return _38f;
}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.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 _390=null;
var _391=null;
if((this.httpObj.responseXML!=null&&this.httpObj.responseXML.documentElement!=null)&&this.responseType!="text"){
_390=this.httpObj.responseXML;
}else{
if(this.responseType=="xml"){
_390=nitobi.xml.createXmlDoc(this.httpObj.responseText);
}else{
_390=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 _390;
};
nitobi.ajax.HttpRequest.prototype.post=function(data,url){
this.handler=url||this.handler;
this.data=data;
this.status="pending";
this.httpObj.open("POST",this.handler,this.async,"","");
if(this.async){
this.httpObj.onreadystatechange=nitobi.lang.close(this,this.postComplete);
}
if(this.responseType=="xml"){
this.httpObj.setRequestHeader("Content-Type","text/xml");
}else{
this.httpObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
this.httpObj.send(data);
if(!this.async){
return this.handleResponse();
}
};
nitobi.ajax.HttpRequest.prototype.postComplete=function(){
if(this.httpObj.readyState==4){
this.status="complete";
var _394={"response":this.handleResponse(),"params":this.params};
this.onPostComplete.notify(_394);
if(this.completeCallback){
this.completeCallback.call(this,_394);
}
}
};
nitobi.ajax.HttpRequest.prototype.postXml=function(_395){
this.setTimeout();
if(("undefined"==typeof (_395.documentElement))||(null==_395.documentElement)||("undefined"==typeof (_395.documentElement.childNodes))||(1>_395.documentElement.childNodes.length)){
ebaErrorReport("updategram is empty. No request sent. xmlData["+_395+"]\nxmlData.xml["+_395.xml+"]");
return;
}
if(null==_395.xml){
var _396=new XMLSerializer();
_395.xml=_396.serializeToString(_395);
}
var sync=this.post(_395.xml);
if(!this.async){
return sync;
}
};
nitobi.ajax.HttpRequest.prototype.get=function(url){
this.handler=url||this.handler;
this.setTimeout();
this.status="pending";
try{
this.httpObj.open("GET",(this.preventCache?this.cacheBust(this.handler):this.handler),this.async);
}
catch(e){
throw (e);
return;
}
if(this.async){
this.httpObj.onreadystatechange=nitobi.lang.close(this,this.getComplete);
}
if(this.responseType=="xml"){
this.httpObj.setRequestHeader("Content-Type","text/xml");
}
this.httpObj.send(null);
if(!this.async){
return this.handleResponse();
}
};
nitobi.ajax.HttpRequest.prototype.setTimeout=function(){
if(this.timeout>0){
this.timeoutId=window.setTimeout(nitobi.lang.close(this,this.abort),this.timeout);
}
};
nitobi.ajax.HttpRequest.prototype.getComplete=function(){
if(this.httpObj.readyState==4){
this.status="complete";
var _399={"response":this.handleResponse(),"params":this.params,"status":this.httpObj.status,"statusText":this.httpObj.statusText};
this.onGetComplete.notify(_399);
if(this.completeCallback){
this.completeCallback.call(this,_399);
}
}
};
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 _39c=url.split("?");
var _39d="nitobi_cachebust="+(new Date().getTime());
if(_39c.length==1){
url+="?"+_39d;
}else{
url+="&"+_39d;
}
return url;
};
nitobi.ajax.HttpRequestPool=function(_39e){
this.inUse=new Array();
this.free=new Array();
this.max=_39e||nitobi.ajax.HttpRequestPool_MAXCONNECTIONS;
this.locked=false;
this.context=null;
};
nitobi.ajax.HttpRequestPool.prototype.reserve=function(){
this.locked=true;
var _39f;
if(this.free.length){
_39f=this.free.pop();
_39f.clear();
this.inUse.push(_39f);
}else{
if(this.inUse.length<this.max){
try{
_39f=new nitobi.ajax.HttpRequest();
}
catch(e){
_39f=null;
}
this.inUse.push(_39f);
}else{
throw "No request objects available";
}
}
this.locked=false;
return _39f;
};
nitobi.ajax.HttpRequestPool.prototype.release=function(_3a0){
var _3a1=false;
this.locked=true;
if(null!=_3a0){
for(var i=0;i<this.inUse.length;i++){
if(_3a0==this.inUse[i]){
this.free.push(this.inUse[i]);
this.inUse.splice(i,1);
_3a1=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,_3a6){
this.url=url||null;
this.transformer=_3a6||null;
this.async=true;
};
nitobi.data.UrlConnector.prototype.get=function(_3a7,_3a8){
this.request=nitobi.data.UrlConnector.requestPool.reserve();
var _3a9=this.url;
for(var p in _3a7){
_3a9=nitobi.html.Url.setParameter(_3a9,p,_3a7[p]);
}
this.request.handler=_3a9;
this.request.async=this.async;
this.request.responseType="xml";
this.request.params={dataReadyCallback:_3a8};
this.request.completeCallback=nitobi.lang.close(this,this.getComplete);
this.request.get();
};
nitobi.data.UrlConnector.prototype.getComplete=function(_3ab){
if(_3ab.params.dataReadyCallback){
var _3ac=_3ab.response;
var _3ad=_3ab.params.dataReadyCallback;
var _3ae=_3ac;
if(this.transformer){
if(typeof (this.transformer)==="function"){
_3ae=this.transformer.call(null,_3ac);
}else{
_3ae=nitobi.xml.transform(_3ac,this.transformer,"xml");
}
}
if(_3ad){
_3ad.call(null,{result:_3ae,response:_3ab.response});
}
}
nitobi.data.UrlConnector.requestPool.release(this.request);
};
nitobi.data.UrlConnector.requestPool=new nitobi.ajax.HttpRequestPool();
function ntbAssert(_3af,_3b0,_3b1,_3b2){
}
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 _3b5=(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(_3b9,_3ba){
}
function ebaSetOnErrorEvent(_3bb){
nitobi.debug.setOnErrorEvent.apply(this,arguments);
}
nitobi.debug.setOnErrorEvent=function(_3bc){
NTB_ON_ERROR=_3bc;
};
function ebaReportError(_3bd,_3be,_3bf){
nitobi.debug.errorReport("dude stop calling this method it is now called nitobi.debug.errorReport","");
nitobi.debug.errorReport(_3bd,_3be,_3bf);
}
function ebaErrorReport(_3c0,_3c1,_3c2){
nitobi.debug.errorReport.apply(this,arguments);
}
nitobi.debug.errorReport=function(_3c3,_3c4,_3c5){
_3c5=(_3c5)?_3c5:NTB_DEBUG;
if(NTB_DEBUG==_3c5&&!NTB_DEBUG_MODE){
return;
}
var _3c6=_3c3+"\nerror code    ["+_3c4+"]\nerror Severity["+_3c5+"]";
LastError=_3c6;
if(eval(NTB_ON_ERROR||"true")){
switch(_3c4){
case NTB_EM_ATTRIBUTE_ERROR:
confirm(_3c3);
break;
case NTB_XHR_RESPONSE_ERROR:
confirm(_3c3);
break;
default:
window.status=_3c3;
break;
}
}
if(NTB_THROW==_3c5){
throw (_3c6);
}
};
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(_3c7,_3c8,type){
nitobi.error.ErrorEventArgs.baseConstructor.call(this,_3c7);
this.description=_3c8;
this.type=type;
};
nitobi.lang.extend(nitobi.error.ErrorEventArgs,nitobi.base.EventArgs);
nitobi.error.isError=function(err,_3cb){
return (err.indexOf(_3cb)>-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(_3cc){
this.setTemplate(_3cc);
this.parameters={};
};
nitobi.html.IRenderer.prototype.renderAfter=function(_3cd,data){
_3cd=$(_3cd);
var _3cf=_3cd.parentNode;
_3cd=_3cd.nextSibling;
return this._renderBefore(_3cf,_3cd,data);
};
nitobi.html.IRenderer.prototype.renderBefore=function(_3d0,data){
_3d0=$(_3d0);
return this._renderBefore(_3d0.parentNode,_3d0,data);
};
nitobi.html.IRenderer.prototype._renderBefore=function(_3d2,_3d3,data){
var s=this.renderToString(data);
var _3d6=document.createElement("div");
_3d6.innerHTML=s;
var _3d7=new Array();
if(_3d6.childNodes){
var i=0;
while(_3d6.childNodes.length){
_3d7[i++]=_3d6.firstChild;
_3d2.insertBefore(_3d6.firstChild,_3d3);
}
}else{
}
return _3d7;
};
nitobi.html.IRenderer.prototype.renderIn=function(_3d9,data){
_3d9=$(_3d9);
var s=this.renderToString(data);
_3d9.innerHTML=s;
return _3d9.childNodes;
};
nitobi.html.IRenderer.prototype.renderToString=function(data){
};
nitobi.html.IRenderer.prototype.setTemplate=function(_3dd){
this.template=_3dd;
};
nitobi.html.IRenderer.prototype.getTemplate=function(){
return this.template;
};
nitobi.html.IRenderer.prototype.setParameters=function(_3de){
for(var p in _3de){
this.parameters[p]=_3de[p];
}
};
nitobi.html.IRenderer.prototype.getParameters=function(){
return this.parameters;
};
nitobi.lang.defineNs("nitobi.html");
nitobi.html.XslRenderer=function(_3e0){
nitobi.html.IRenderer.call(this,_3e0);
};
nitobi.lang.implement(nitobi.html.XslRenderer,nitobi.html.IRenderer);
nitobi.html.XslRenderer.prototype.setTemplate=function(_3e1){
if(typeof (_3e1)==="string"){
_3e1=nitobi.xml.createXslProcessor(_3e1);
}
this.template=_3e1;
};
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 _3e3=this.getTemplate();
var _3e4=this.getParameters();
for(var p in _3e4){
_3e3.addParameter(p,_3e4[p],"");
}
var s=nitobi.xml.transformToString(data,_3e3,"xml");
for(var p in _3e4){
_3e3.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 _3e9=decl.loadHtml($(id));
var _3ea=$(id);
var _3eb=_3ea.parentNode;
var _3ec=_3eb.ownerDocument.createElement("ntb:component");
_3eb.insertBefore(_3ec,_3ea);
_3eb.removeChild(_3ea);
this.setContainer(_3ec);
nitobi.base.ISerializable.call(this,_3e9);
}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(_3ed){
var node=$(_3ed);
this.htmlNode=node;
};
nitobi.ui.Element.prototype.getRootId=function(){
var _3ef=this.getParentObject();
if(_3ef==null){
return this.getId();
}else{
return _3ef.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(_3f3,id,_3f5,_3f6){
try{
_3f3=nitobi.html.getEvent(_3f3);
if(_3f6!==false){
nitobi.html.cancelEvent(_3f3);
}
var _3f7=nitobi.ui.Element.parseId(id).id;
if(!this.isDescendantExists(_3f7)){
return false;
}
var _3f8=!(_3f7==this.getId());
var _3f9=new nitobi.ui.ElementEventArgs(this,null,id);
var _3fa=new nitobi.ui.EventNotificationEventArgs(this,null,id,_3f3);
_3f8=_3f8&&this.onBeforePropagate.notify(_3fa);
var _3fb=true;
if(_3f8){
if(_3f5==null){
_3f5=this.getPathToLeaf(_3f7);
}
var _3fc=this.onBeforeEventNotify.notify(_3fa);
var _3fd=(_3fc?this.onEventNotify.notify(_3fa):true);
var _3fe=_3f5.pop().getAttribute("id");
var _3ff=this.getObjectById(_3fe);
var _3fb=this.onBeforePropagateToChild.notify(_3fa);
if(_3ff.notify&&_3fb&&_3fd){
_3fb=_3ff.notify(_3f3,id,_3f5,_3f6);
}
}else{
_3fb=this.onEventNotify.notify(_3fa);
}
var _400=this.eventMap[_3f3.type];
if(_400!=null&&_3fb){
_400.notify(this.getEventArgs(_3f3,id));
}
return _3fb;
}
catch(err){
nitobi.lang.throwError(nitobi.error.Unexpected+" Element.notify encountered a problem.",err);
}
};
nitobi.ui.Element.prototype.getEventArgs=function(_401,_402){
var _403=new nitobi.ui.ElementEventArgs(this,null,_402);
return _403;
};
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(_409,_40a){
this.setVisible(false,_409,_40a);
};
nitobi.ui.Element.prototype.show=function(_40b,_40c){
this.setVisible(true,_40b,_40c);
};
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(_40e,_40f,_410){
var _411=this.getHtmlNode();
if(_411&&this.isVisible()!=_40e&&this.onBeforeSetVisible.notify({source:this,event:this.onBeforeSetVisible,args:arguments})!==false){
if(this.effect){
this.effect.end();
}
if(_40e){
if(_40f){
var _412=new _40f(_411);
_412.callback=nitobi.lang.close(this,this.handleSetVisible,[_410]);
this.effect=_412;
_412.onFinish.subscribeOnce(nitobi.lang.close(this,function(){
this.effect=null;
}));
_412.start();
}else{
nitobi.html.Css.removeClass(_411,NTB_CSS_HIDE);
this.handleSetVisible(_410);
}
}else{
if(_40f){
var _412=new _40f(_411);
_412.callback=nitobi.lang.close(this,this.handleSetVisible,[_410]);
this.effect=_412;
_412.onFinish.subscribeOnce(nitobi.lang.close(this,function(){
this.effect=null;
}));
_412.start();
}else{
nitobi.html.Css.addClass(this.getHtmlNode(),NTB_CSS_HIDE);
this.handleSetVisible(_410);
}
}
}
};
nitobi.ui.Element.prototype.handleSetVisible=function(_413){
if(_413){
_413();
}
this.onSetVisible.notify(new nitobi.ui.ElementEventArgs(this,this.onSetVisible));
};
nitobi.ui.Element.prototype.setEnabled=function(_414){
this.enabled=_414;
};
nitobi.ui.Element.prototype.isEnabled=function(){
return this.enabled;
};
nitobi.ui.Element.prototype.render=function(_415,_416){
this.flushHtmlNodeCache();
_416=_416||this.getState();
_415=$(_415)||this.getContainer();
if(_415==null){
var _415=document.createElement("span");
document.body.appendChild(_415);
this.setContainer(_415);
}
this.htmlNode=this.renderer.renderIn(_415,_416)[0];
this.htmlNode.jsObject=this;
};
nitobi.ui.Element.prototype.getContainer=function(){
return this.container;
};
nitobi.ui.Element.prototype.setContainer=function(_417){
this.container=$(_417);
};
nitobi.ui.Element.prototype.getState=function(){
return this.getXmlNode();
};
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.ElementEventArgs=function(_418,_419,_41a){
nitobi.ui.ElementEventArgs.baseConstructor.apply(this,arguments);
this.targetId=_41a||null;
};
nitobi.lang.extend(nitobi.ui.ElementEventArgs,nitobi.base.EventArgs);
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.EventNotificationEventArgs=function(_41b,_41c,_41d,_41e){
nitobi.ui.EventNotificationEventArgs.baseConstructor.apply(this,arguments);
this.htmlEvent=_41e||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(_420,_421,_422,_423,_424){
_423=(_424?nitobi.lang.close(_424,_423):_423)||nitobi.lang.noop;
_420=$(_420);
if(typeof _422=="string"){
_422=nitobi.effects.families[_422];
}
if(!_422){
_422=nitobi.effects.families["none"];
}
if(_421){
var _425=_422.show;
}else{
var _425=_422.hide;
}
if(_425){
var _426=new _425(_420);
_426.callback=_423;
_426.start();
}else{
if(_421){
nitobi.html.Css.removeClass(_420,NTB_CSS_HIDE);
}else{
nitobi.html.Css.addClass(_420,NTB_CSS_HIDE);
}
_423();
}
};
nitobi.ui.Effects.shrink=function(_427,_428,_429,_42a){
var rect=_428.getClientRects()[0];
_427.deltaHeight_Doctype=0-parseInt("0"+nitobi.html.getStyle(_428,"border-top-width"))-parseInt("0"+nitobi.html.getStyle(_428,"border-bottom-width"))-parseInt("0"+nitobi.html.getStyle(_428,"padding-top"))-parseInt("0"+nitobi.html.getStyle(_428,"padding-bottom"));
_427.deltaWidth_Doctype=0-parseInt("0"+nitobi.html.getStyle(_428,"border-left-width"))-parseInt("0"+nitobi.html.getStyle(_428,"border-right-width"))-parseInt("0"+nitobi.html.getStyle(_428,"padding-left"))-parseInt("0"+nitobi.html.getStyle(_428,"padding-right"));
_427.oldHeight=Math.abs(rect.top-rect.bottom)+_427.deltaHeight_Doctype;
_427.oldWidth=Math.abs(rect.right-rect.left)+_427.deltaWidth_Doctype;
if(!(typeof (_427.width)=="undefined")){
_427.deltaWidth=Math.floor(Math.ceil(_427.width-_427.oldWidth)/(_429/nitobi.ui.Effects.ANIMATION_INTERVAL));
}else{
_427.width=_427.oldWidth;
_427.deltaWidth=0;
}
if(!(typeof (_427.height)=="undefined")){
_427.deltaHeight=Math.floor(Math.ceil(_427.height-_427.oldHeight)/(_429/nitobi.ui.Effects.ANIMATION_INTERVAL));
}else{
_427.height=_427.oldHeight;
_427.deltaHeight=0;
}
nitobi.ui.Effects.resize(_427,_428,_429,_42a);
};
nitobi.ui.Effects.resize=function(_42c,_42d,_42e,_42f){
var rect=_42d.getClientRects()[0];
var _431=Math.abs(rect.top-rect.bottom);
var _432=Math.max(_431+_42c.deltaHeight+_42c.deltaHeight_Doctype,0);
if(Math.abs(_431-_42c.height)<Math.abs(_42c.deltaHeight)){
_432=_42c.height;
_42c.deltaHeight=0;
}
var _433=Math.abs(rect.right-rect.left);
var _434=Math.max(_433+_42c.deltaWidth+_42c.deltaWidth_Doctype,0);
_434=(_434>=0)?_434:0;
if(Math.abs(_433-_42c.width)<Math.abs(_42c.deltaWidth)){
_434=_42c.width;
_42c.deltaWidth=0;
}
_42e-=nitobi.ui.Effects.ANIMATION_INTERVAL;
if(_42e>0){
window.setTimeout(nitobi.lang.closeLater(this,nitobi.ui.Effects.resize,[_42c,_42d,_42e,_42f]),nitobi.ui.Effects.ANIMATION_INTERVAL);
}
var _435=function(){
_42d.height=_432+"px";
_42d.style.height=_432+"px";
_42d.width=_434+"px";
_42d.style.width=_434+"px";
if(_42e<=0){
if(_42f){
window.setTimeout(_42f,0);
}
}
};
nitobi.ui.Effects.executeNextPulse.push(_435);
};
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(_437){
return _437*_437*_437;
};
nitobi.ui.Effects.cubeRoot=function(_438){
var T=0;
var N=parseFloat(_438);
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(_43d){
return _43d;
};
nitobi.ui.Effects.fade=function(_43e,_43f,time,_441,_442){
_442=_442||nitobi.ui.Effects.linear;
var _443=(new Date()).getTime()+time;
var id=nitobi.component.getUniqueId();
var _445=(new Date()).getTime();
var el=_43e;
if(_43e.length){
el=_43e[0];
}
var _447=nitobi.html.Css.getOpacity(el);
var _448=(_43f-_447<0?-1:0);
nitobi.ui.Effects.fadeIntervalId[id]=window.setInterval(function(){
nitobi.ui.Effects.stepFade(_43e,_43f,_445,_443,id,_441,_442,_448);
},nitobi.ui.Effects.fadeIntervalTime);
};
nitobi.ui.Effects.stepFade=function(_449,_44a,_44b,_44c,id,_44e,_44f,_450){
var ct=(new Date()).getTime();
var _452=_44c-_44b;
var nct=((ct-_44b)/(_44c-_44b));
if(nct<=0||nct>=1){
nitobi.html.Css.setOpacities(_449,_44a);
window.clearInterval(nitobi.ui.Effects.fadeIntervalId[id]);
_44e();
return;
}else{
nct=Math.abs(nct+_450);
}
var no=_44f(nct);
nitobi.html.Css.setOpacities(_449,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 _457;
var _458=nitobi.html.getTagName(el);
if(_458=="ntb:grid"){
_457=nitobi.initGrid(el.id);
}else{
if(_458==="ntb:combo"){
_457=nitobi.initCombo(el.id);
}else{
if(el.jsObject==null){
_457=nitobi.base.Factory.getInstance().createByTag(_458,el.id,nitobi.component.renderComponent);
if(_457.render&&!_457.onLoadCallback){
_457.render();
}
}else{
_457=el.jsObject;
}
}
}
return _457;
};
nitobi.component.renderComponent=function(_459){
_459.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(_45c,_45d){
if(nitobi.component.isNitobiElement(_45c)){
_45d.push(_45c);
return;
}
var _45e=_45c.childNodes;
for(var i=0;i<_45e.length;i++){
nitobi.component.findNitobiComponents(_45e[i],_45d);
}
return;
};
nitobi.component.isNitobiElement=function(_460){
var _461=nitobi.html.getTagName(_460);
if(_461.substr(0,3)=="ntb"){
return true;
}else{
return false;
}
};
nitobi.component.loadComponentsFromNode=function(_462){
var _463=new Array();
nitobi.component.findNitobiComponents(_462,_463);
for(var i=0;i<_463.length;i++){
nitobi.loadComponent(_463[i].getAttribute("id"));
}
};
nitobi.lang.defineNs("nitobi.effects");
if(false){
nitobi.effects=function(){
};
}
nitobi.effects.Effect=function(_465,_466){
this.element=$(_465);
this.transition=_466.transition||nitobi.effects.Transition.sinoidal;
this.duration=_466.duration||1;
this.fps=_466.fps||50;
this.from=typeof (_466.from)==="number"?_466.from:0;
this.to=typeof (_466.from)==="number"?_466.to:1;
this.delay=_466.delay||0;
this.callback=typeof (_466.callback)==="function"?_466.callback:nitobi.lang.noop;
this.queue=_466.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 _46b=Math.floor(pos*this.totalFrames);
if(this.frame<_46b){
this.render(pos);
this.frame=_46b;
}
}
};
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(_46d,_46e,etc){
var args=nitobi.lang.toArray(arguments,2);
return function(_471){
var f=function(){
_46d.apply(this,[_471,_46e].concat(args));
};
nitobi.lang.extend(f,_46d);
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(_476,_477,_478){
nitobi.effects.Scale.baseConstructor.call(this,_476,_477);
this.scaleX=typeof (_477.scaleX)=="boolean"?_477.scaleX:true;
this.scaleY=typeof (_477.scaleY)=="boolean"?_477.scaleY:true;
this.scaleFrom=typeof (_477.scaleFrom)=="number"?_477.scaleFrom:100;
this.scaleTo=_478;
};
nitobi.lang.extend(nitobi.effects.Scale,nitobi.effects.Effect);
nitobi.effects.Scale.prototype.setup=function(){
var _479=this.element.style;
this.originalStyle={"top":_479.top,"left":_479.left,"width":_479.width,"height":_479.height,"overflow":_479.overflow};
this.factor=(this.scaleTo-this.scaleFrom)/100;
this.dims=[this.element.scrollWidth,this.element.scrollHeight];
_479.width=this.dims[0]+"px";
_479.height=this.dims[1]+"px";
_479.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 _47c=(this.scaleFrom/100)+(this.factor*pos);
this.setDimensions(Math.floor(_47c*this.dims[0])||1,Math.floor(_47c*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(_47f){
nitobi.collections.IEnumerable.prototype.add.call(this,_47f);
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(_482,_483){
_483=nitobi.lang.merge({scaleX:false,duration:Math.min(0.2*(_482.scrollHeight/100),0.5)},_483||{});
nitobi.effects.BlindUp.baseConstructor.call(this,_482,_483,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(_484,_485){
nitobi.html.Css.swapClass(_484,NTB_CSS_HIDE,NTB_CSS_SMALL);
_485=nitobi.lang.merge({scaleX:false,scaleFrom:0,duration:Math.min(0.2*(_484.scrollHeight/100),0.5)},_485||{});
nitobi.effects.BlindDown.baseConstructor.call(this,_484,_485,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(_486,_487){
_487=nitobi.lang.merge({scaleX:false,duration:Math.min(0.2*(_486.scrollHeight/100),0.3)},_487||{});
nitobi.effects.ShadeUp.baseConstructor.call(this,_486,_487,0);
};
nitobi.lang.extend(nitobi.effects.ShadeUp,nitobi.effects.Scale);
nitobi.effects.ShadeUp.prototype.setup=function(){
nitobi.effects.ShadeUp.base.setup.call(this);
var _488=nitobi.html.getFirstChild(this.element);
this.originalStyle.position=this.element.style.position;
nitobi.html.position(this.element);
if(_488){
var _489=_488.style;
this.fnodeStyle={position:_489.position,bottom:_489.bottom,left:_489.left};
this.fnode=_488;
_489.position="absolute";
_489.bottom="0px";
_489.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(_48b,_48c){
nitobi.html.Css.swapClass(_48b,NTB_CSS_HIDE,NTB_CSS_SMALL);
_48c=nitobi.lang.merge({scaleX:false,scaleFrom:0,duration:Math.min(0.2*(_48b.scrollHeight/100),0.3)},_48c||{});
nitobi.effects.ShadeDown.baseConstructor.call(this,_48b,_48c,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 _48d=nitobi.html.getFirstChild(this.element);
this.originalStyle.position=this.element.style.position;
nitobi.html.position(this.element);
if(_48d){
var _48e=_48d.style;
this.fnodeStyle={position:_48e.position,bottom:_48e.bottom,left:_48e.left,right:_48e.right,top:_48e.top};
this.fnode=_48d;
_48e.position="absolute";
_48e.top="";
_48e.right="";
_48e.bottom="0px";
_48e.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(_490){
if(_490){
if(typeof (_490)==="string"){
this.strings=[_490];
}else{
this.strings=_490;
}
}else{
this.strings=new Array();
}
};
nitobi.lang.StringBuilder.prototype.append=function(_491){
if(_491){
this.strings.push(_491);
}
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));



