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&&obj.innerHTML){
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"&&_20)||(typeof (_20)=="string"&&(_20.toLowerCase()=="true"||_20=="1"))){
return "1";
}else{
return "0";
}
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]!=null&&_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.isStandards=function(){
var s=(document.compatMode=="CSS1Compat");
if(nitobi.browser.SAFARI){
var _6c=document.createElement("div");
_6c.style.cssText="width:0px;width:1";
s=(parseInt(_6c.style.width)!=1);
}
return s;
};
nitobi.lang.defineNs("nitobi.lang");
nitobi.lang.Math=function(){
};
nitobi.lang.Math.sinTable=Array();
nitobi.lang.Math.cosTable=Array();
nitobi.lang.Math.rotateCoords=function(_6d,_6e,_6f){
var _70=_6f*0.01745329277777778;
if(nitobi.lang.Math.sinTable[_70]==null){
nitobi.lang.Math.sinTable[_70]=Math.sin(_70);
nitobi.lang.Math.cosTable[_70]=Math.cos(_70);
}
var cR=nitobi.lang.Math.cosTable[_70];
var sR=nitobi.lang.Math.sinTable[_70];
var x=_6d*cR-_6e*sR;
var y=_6e*cR+_6d*sR;
return {x:x,y:y};
};
nitobi.lang.Math.returnAngle=function(_75,_76,_77,_78){
return Math.atan2(_78-_76,_77-_75)/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="6843";
nitobi.toolkit.version="1.0.6843";
nitobi.lang.defineNs("nitobi");
nitobi.Object=function(){
this.disposal=new Array();
this.modelNodes={};
};
nitobi.Object.prototype.setValues=function(_7d){
for(var _7e in _7d){
if(this[_7e]!=null){
if(this[_7e].subscribe!=null){
}else{
this[_7e]=_7d[_7e];
}
}else{
if(this[_7e] instanceof Function){
this[_7e](_7d[_7e]);
}else{
if(this["set"+_7e] instanceof Function){
this["set"+_7e](_7d[_7e]);
}else{
this[_7e]=_7d[_7e];
}
}
}
}
};
nitobi.Object.prototype.xGET=function(){
var _7f=null,_80="@"+arguments[0],val="";
var _82=this.modelNodes[_80];
if(_82!=null){
_7f=_82;
}else{
_7f=this.modelNodes[_80]=this.modelNode.selectSingleNode(_80);
}
if(_7f!=null){
val=_7f.nodeValue;
}
return val;
};
nitobi.Object.prototype.xSET=function(){
var _83=null,_84="@"+arguments[0];
var _85=this.modelNodes[_84];
if(_85!=null){
_83=_85;
}else{
_83=this.modelNodes[_84]=this.modelNode.selectSingleNode(_84);
}
if(_83==null){
this.modelNode.setAttribute(arguments[0],"");
}
if(arguments[1][0]!=null&&_83!=null){
if(typeof (arguments[1][0])=="boolean"){
_83.nodeValue=nitobi.lang.boolToStr(arguments[1][0]);
}else{
_83.nodeValue=arguments[1][0];
}
}
};
nitobi.Object.prototype.eSET=function(_86,_87){
var _88=_87[0];
var _89=_88;
var _8a=_86.substr(2);
_8a=_8a.substr(0,_8a.length-5);
if(typeof (_88)=="string"){
_89=function(){
return nitobi.event.evaluate(_88,arguments[0]);
};
}
if(this[_86]!=null){
this.unsubscribe(_8a,this[_86]);
}
var _8b=this.subscribe(_8a,_89);
this.jSET(_86,[_8b]);
return _8b;
};
nitobi.Object.prototype.eGET=function(){
};
nitobi.Object.prototype.jSET=function(_8c,val){
this[_8c]=val[0];
};
nitobi.Object.prototype.jGET=function(_8e){
return this[_8e];
};
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,_90){
return nitobi.event.notify(evt+this.uid,_90);
};
nitobi.Object.prototype.subscribe=function(evt,_92,_93){
if(this.subscribedEvents==null){
this.subscribedEvents={};
}
if(typeof (_93)=="undefined"){
_93=this;
}
var _94=nitobi.event.subscribe(evt+this.uid,nitobi.lang.close(_93,_92));
this.subscribedEvents[_94]=evt+this.uid;
return _94;
};
nitobi.Object.prototype.subscribeOnce=function(evt,_96,_97,_98){
var _99=null;
var _9a=this;
var _9b=function(){
_96.apply(_97||this,_98||arguments);
_9a.unsubscribe(evt,_99);
};
_99=this.subscribe(evt,_9b);
};
nitobi.Object.prototype.unsubscribe=function(evt,_9d){
return nitobi.event.unsubscribe(evt+this.uid,_9d);
};
nitobi.Object.prototype.dispose=function(){
if(this.disposing){
return;
}
this.disposing=true;
var _9e=this.disposal.length;
for(var i=0;i<_9e;i++){
if(disposal[i] instanceof Function){
disposal[i].call(context);
}
disposal[i]=null;
}
for(var _a0 in this){
if(this[_a0].dispose instanceof Function){
this[_a0].dispose.call(this[_a0]);
}
this[_a0]=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 _a1=[{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 _a2="Unknown";
for(var i=0;i<_a1.length;i++){
var _a4=_a1[i].string;
var _a5=_a1[i].prop;
if(_a4){
if(_a4.indexOf(_a1[i].subString)!=-1){
_a2=_a1[i].identity;
break;
}
}else{
if(_a5){
_a2=_a1[i].identity;
break;
}
}
}
nitobi.browser.IE=(_a2=="Explorer");
nitobi.browser.IE6=(nitobi.browser.IE&&!window.XMLHttpRequest);
nitobi.browser.IE7=(nitobi.browser.IE&&window.XMLHttpRequest);
nitobi.browser.MOZ=(_a2=="Netscape"||_a2=="Firefox"||_a2=="Camino");
nitobi.browser.SAFARI=(_a2=="Safari");
nitobi.browser.OPERA=(_a2=="Opera");
if(nitobi.browser.SAFARI){
nitobi.browser.OPERA=true;
}
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 _a7,end;
if(document.cookie.length>0){
_a7=document.cookie.indexOf(id+"=");
if(_a7!=-1){
_a7+=id.length+1;
end=document.cookie.indexOf(";",_a7);
if(end==-1){
end=document.cookie.length;
}
return unescape(document.cookie.substring(_a7,end));
}
}
return null;
};
nitobi.browser.Cookies.set=function(id,_aa,_ab){
var _ac=new Date();
_ac.setTime(_ac.getTime()+(_ab*24*3600*1000));
document.cookie=id+"="+escape(_aa)+((_ab==null)?"":"; expires="+_ac.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(nitobi.xml.importNode(document,this.iframeObject,true));
this.iframe=frames["ntb_history"];
this.monitor();
};
nitobi.browser.History.prototype.add=function(_ae){
this.lastPage=this.currentPage=_ae.substr(_ae.indexOf("#")+1);
this.iframe.location.href=_ae;
};
nitobi.browser.History.prototype.monitor=function(){
var _af=this.iframe.location.href.split("#");
this.currentPage=_af[1];
if(this.currentPage!=this.lastPage){
this.onChange.notify(_af[0].substring(_af[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.browser.SAFARI){
nitobi.xml.Serializer=new XMLSerializer();
nitobi.xml.DOMParser=new DOMParser();
}
if(!nitobi.browser.IE&&!(nitobi.browser.MOZ||nitobi.browser.SAFARI)){
}
nitobi.xml.getChildNodes=function(_b0){
if(nitobi.browser.IE){
return _b0.childNodes;
}else{
return _b0.selectNodes("./*");
}
};
nitobi.xml.indexOfChildNode=function(_b1,_b2){
var _b3=nitobi.xml.getChildNodes(_b1);
for(var i=0;i<_b3.length;i++){
if(_b3[i]==_b2){
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||nitobi.browser.SAFARI){
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,_b9){
doc.async=false;
if(nitobi.browser.IE){
doc.loadXML(xml);
}else{
var _ba=nitobi.xml.DOMParser.parseFromString(xml,"text/xml");
if(_b9){
while(doc.hasChildNodes()){
doc.removeChild(doc.firstChild);
}
for(var i=0;i<_ba.childNodes.length;i++){
doc.appendChild(doc.importNode(_ba.childNodes[i],true));
}
}else{
doc=_ba;
}
_ba=null;
}
return doc;
};
nitobi.xml.hasParseError=function(_bc){
if(nitobi.browser.IE){
return (_bc.parseError!=0);
}else{
if(_bc==null||_bc.documentElement==null){
return true;
}
var _bd=_bc.documentElement;
if((_bd.tagName=="parserError")||(_bd.namespaceURI=="http://www.mozilla.org/newlayout/xml/parsererror.xml")){
return true;
}
return false;
}
};
nitobi.xml.getParseErrorReason=function(_be){
if(!nitobi.xml.hasParseError(_be)){
return "";
}
if(nitobi.browser.IE){
return (_be.parseError.reason);
}else{
return (new XMLSerializer().serializeToString(_be));
}
};
nitobi.xml.createXslDoc=function(xsl){
var doc=null;
if(nitobi.browser.IE){
doc=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0");
}else{
if(nitobi.browser.MOZ||nitobi.browser.SAFARI){
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 _c2=null;
var xt=null;
if(typeof (xsl)!="string"){
xsl=nitobi.xml.serialize(xsl);
}
if(nitobi.browser.IE){
_c2=new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0");
xt=new ActiveXObject("MSXML2.XSLTemplate.3.0");
_c2.async=false;
_c2.loadXML(xsl);
xt.stylesheet=_c2;
return xt.createProcessor();
}else{
if(XSLTProcessor){
_c2=nitobi.xml.createXmlDoc(xsl);
xt=new XSLTProcessor();
xt.importStylesheet(_c2);
xt.stylesheet=_c2;
return xt;
}else{
var obj=function(_c5){
this.params={};
this.stylesheet=nitobi.xml.createXmlDoc(_c5);
};
obj.prototype.addParameter=function(_c6,val){
if(nitobi.lang.typeOf(val)==nitobi.lang.type.XMLNODE){
val="x_"+nitobi.xml.serialize(val);
}
this.params[_c6]=val;
};
obj.prototype.getParams=function(){
var str="";
var _c9="";
for(var i in this.params){
str+=_c9+i+"::"+this.params[i];
_c9="||";
}
return str;
};
return new obj(xsl);
}
}
};
nitobi.xml.parseHtml=function(_cb){
if(typeof (_cb)=="string"){
_cb=document.getElementById(_cb);
}
var _cc=nitobi.html.getOuterHtml(_cb);
var _cd="";
if(nitobi.browser.IE){
var _ce=new RegExp("(\\s+.[^=]*)='(.*?)'","g");
_cc=_cc.replace(_ce,function(m,_1,_2){
return _1+"=\""+_2.replace(/"/g,"&quot;")+"\"";
});
_cd=(_cc.substring(_cc.indexOf("/>")+2).replace(/(\s+.[^\=]*)\=\s*([^\"^\s^\>]+)/g,"$1=\"$2\" ")).replace(/\n/gi,"").replace(/(.*?:.*?\s)/i,"$1  ");
var _d2=new RegExp("=\"([^\"]*)(<)(.*?)\"","gi");
var _d3=new RegExp("=\"([^\"]*)(>)(.*?)\"","gi");
while(true){
_cd=_cd.replace(_d2,"=\"$1&lt;$3\" ");
_cd=_cd.replace(_d3,"=\"$1&gt;$3\" ");
var x=(_d2.test(_cd));
if(!_d2.test(_cd)){
break;
}
}
}else{
if(nitobi.browser.MOZ||nitobi.browser.SAFARI){
_cd=_cc;
_cd=_cd.replace(/\n/gi,"").replace(/\>\s*\</gi,"><").replace(/(.*?:.*?\s)/i,"$1  ");
_cd=_cd.replace(/\&/g,"&amp;");
_cd=_cd.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(_cd.indexOf("xmlns:ntb=\"http://www.nitobi.com\"")<1){
_cd=_cd.replace(/\<(.*?)(\s|\>|\\)/,"<$1 xmlns:ntb=\"http://www.nitobi.com\"$2");
}
_cd=_cd.replace(/\&nbsp\;/gi," ");
return nitobi.xml.createXmlDoc(_cd);
};
nitobi.xml.transform=function(xml,xsl,_d7){
if(xsl.documentElement){
xsl=nitobi.xml.createXslProcessor(xsl);
}
if(nitobi.browser.IE){
xsl.input=xml;
xsl.transform();
return xsl.output;
}else{
if(XSLTProcessor){
var doc=xsl.transformToDocument(xml);
var _d9=doc.documentlement;
if(_d9&&_d9.nodeName.indexOf("ntb:")==0){
_d9.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:ntb","http://www.nitobi.com");
}
return doc;
}
}
};
nitobi.xml.transformToString=function(xml,xsl,_dc){
var _dd=nitobi.xml.transform(xml,xsl,"text");
if(nitobi.browser.MOZ){
if(_dc=="xml"){
_dd=nitobi.xml.Serializer.serializeToString(_dd);
}else{
if(_dd.documentElement.childNodes[0]==null){
nitobi.lang.throwError("The transformToString fn could not find any valid output");
}
if(_dd.documentElement.childNodes[0].data!=null){
_dd=_dd.documentElement.childNodes[0].data;
}else{
if(_dd.documentElement.childNodes[0].textContent!=null){
_dd=_dd.documentElement.childNodes[0].textContent;
}else{
nitobi.lang.throwError("The transformToString fn could not find any valid output");
}
}
}
}else{
if(nitobi.browser.SAFARI){
if(_dc=="xml"){
_dd=nitobi.xml.Serializer.serializeToString(_dd);
}else{
var _de=_dd.documentElement;
if(_de.nodeName!="transformiix:result"){
_de=_de.getElementsByTagName("pre")[0];
}
try{
_dd=_de.childNodes[0].data;
}
catch(e){
_dd=(_de.data);
}
}
}
}
return _dd;
};
nitobi.xml.transformToXml=function(xml,xsl){
var _e1=nitobi.xml.transform(xml,xsl,"xml");
if(typeof _e1=="string"){
_e1=nitobi.xml.createXmlDoc(_e1);
}else{
if(nitobi.browser.MOZ||nitobi.browser.SAFARI){
if(_e1.documentElement.nodeName=="transformiix:result"){
_e1=nitobi.xml.createXmlDoc(_e1.documentElement.firstChild.data);
}
}
}
return _e1;
};
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 _e3=null;
try{
_e3=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_e3=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(ee){
}
}
return _e3;
}else{
if(nitobi.browser.MOZ||nitobi.browser.SAFARI){
return new XMLHttpRequest();
}
}
};
nitobi.xml.createElement=function(_e4,_e5,ns){
ns=ns||"http://www.nitobi.com";
var _e7=null;
if(nitobi.browser.IE){
_e7=_e4.createNode(1,nitobi.xml.nsPrefix+_e5,ns);
}else{
if(_e4.createElementNS){
_e7=_e4.createElementNS(ns,nitobi.xml.nsPrefix+_e5);
}
}
return _e7;
};
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||nitobi.browser.SAFARI){
Document.prototype.loadXML=function(_e9){
changeReadyState(this,1);
var p=new DOMParser();
var d=p.parseFromString(_e9,"text/xml");
while(this.hasChildNodes()){
this.removeChild(this.lastChild);
}
for(var i=0;i<d.childNodes.length;i++){
this.appendChild(this.importNode(d.childNodes[i],true));
}
changeReadyState(this,4);
};
Document.prototype.__defineGetter__("xml",function(){
return (new XMLSerializer()).serializeToString(this);
});
Node.prototype.__defineGetter__("xml",function(){
return (new XMLSerializer()).serializeToString(this);
});
XPathResult.prototype.__defineGetter__("length",function(){
return this.snapshotLength;
});
if(XSLTProcessor){
XSLTProcessor.prototype.addParameter=function(_ed,_ee,_ef){
if(_ee==null){
this.removeParameter(_ef,_ed);
}else{
this.setParameter(_ef,_ed,_ee);
}
};
}
XMLDocument.prototype.selectNodes=function(_f0,_f1){
try{
if(this.nsResolver==null){
this.nsResolver=this.createNSResolver(this.documentElement);
}
var _f2=this.evaluate(_f0,(_f1?_f1:this),new MyNSResolver(),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
var _f3=new Array(_f2.snapshotLength);
_f3.expr=_f0;
var j=0;
for(i=0;i<_f2.snapshotLength;i++){
var _f5=_f2.snapshotItem(i);
if(_f5.nodeType!=3){
_f3[j++]=_f5;
}
}
return _f3;
}
catch(e){
}
};
Document.prototype.selectNodes=XMLDocument.prototype.selectNodes;
function MyNSResolver(){
}
MyNSResolver.prototype.lookupNamespaceURI=function(_f6){
switch(_f6){
case "xsl":
return "http://www.w3.org/1999/XSL/Transform";
break;
case "ntb":
return "http://www.nitobi.com";
break;
case "d":
return "http://exslt.org/dates-and-times";
break;
case "n":
return "http://www.nitobi.com/exslt/numbers";
break;
default:
return null;
break;
}
};
XMLDocument.prototype.selectSingleNode=function(_f7,_f8){
var _f9=_f7.match(/\[\d+\]/ig);
if(_f9!=null){
var x=_f9[_f9.length-1];
if(_f7.lastIndexOf(x)+x.length!=_f7.length){
_f7+="[1]";
}
}
var _fb=this.selectNodes(_f7,_f8||null);
return ((_fb!=null&&_fb.length>0)?_fb[0]:null);
};
Document.prototype.selectSingleNode=XMLDocument.prototype.selectSingleNode;
Element.prototype.selectNodes=function(_fc){
var doc=this.ownerDocument;
return doc.selectNodes(_fc,this);
};
Element.prototype.selectSingleNode=function(_fe){
var doc=this.ownerDocument;
return doc.selectSingleNode(_fe,this);
};
}
nitobi.xml.getLocalName=function(_100){
var _101=_100.indexOf(":");
if(_101==-1){
return _100;
}else{
return _100.substr(_101+1);
}
};
nitobi.xml.importNode=function(doc,node,_104){
if(_104==null){
_104=true;
}
return (doc.importNode?doc.importNode(node,_104):node);
};
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(_106,_107){
var _108=_106.match(/(\"|\')/g);
if(_108!=null){
var _109="concat(";
var _10a="";
var _10b;
for(var i=0;i<_106.length;i++){
if(_106.substr(i,1)=="\""){
_10b="&apos;";
}else{
_10b="&quot;";
}
_109+=_10a+_10b+nitobi.xml.encode(_106.substr(i,1))+_10b;
_10a=",";
}
_109+=_10a+"&apos;&apos;";
_109+=")";
_106=_109;
}else{
var quot=(_107?"'":"");
_106=quot+nitobi.xml.encode(_106)+quot;
}
return _106;
};
nitobi.xml.removeChildren=function(_10e){
while(_10e.firstChild){
_10e.removeChild(_10e.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,_111){
var reg=new RegExp("(\\?|&)("+encodeURIComponent(key)+")=(.*?)(&|$)");
if(url.match(reg)){
return url.replace(reg,"$1$2="+encodeURIComponent(_111)+"$4");
}
if(url.match(/\?/)){
url=url+"&";
}else{
url=url+"?";
}
return url+encodeURIComponent(key)+"="+encodeURIComponent(_111);
};
nitobi.html.Url.removeParameter=function(url,key){
var reg=new RegExp("(\\?|&)("+encodeURIComponent(key)+")=(.*?)(&|$)");
return url.replace(reg,function(str,p1,p2,p3,p4,_11b,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(_122,_123,guid){
if(_122==null){
return;
}
var func=_122;
if(typeof (_122)=="string"){
var s=_122;
s=s.replace(/eventArgs/g,"arguments[0]");
_122=nitobi.lang.close(_123,function(){
eval(s);
});
}
if(typeof _123=="object"&&_122 instanceof Function){
func=nitobi.lang.close(_123,_122);
}
guid=guid||func.observer_guid||_122.observer_guid||this.guid++;
func.observer_guid=guid;
_122.observer_guid=guid;
this.handlers[guid]=func;
return guid;
};
nitobi.base.Event.prototype.subscribeOnce=function(_127,_128){
var guid=null;
var _12a=this;
var _12b=function(){
_127.apply(_128||null,arguments);
_12a.unSubscribe(guid);
};
guid=this.subscribe(_12b);
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(_12d){
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 _130=this.handlers[item];
if(_130 instanceof Function){
var rv=(_130.apply(this,arguments)==false);
fail=fail||rv;
}
}
return !fail;
}
return true;
};
nitobi.base.Event.prototype.dispose=function(){
for(var _132 in this.handlers){
this.handlers[_132]=null;
}
this.handlers={};
};
nitobi.base.Event.prototype.setEnabled=function(_133){
this.enabled=_133;
};
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(_134,_135,_136){
if(_134.className){
var reg=new RegExp("(\\s|^)"+_135+"(\\s|$)");
_134.className=_134.className.replace(reg,"$1"+_136+"$2");
}
};
nitobi.html.Css.replaceOrAppend=function(_138,_139,_13a){
if(nitobi.html.Css.hasClass(_138,_139)){
nitobi.html.Css.swapClass(_138,_139,_13a);
}else{
nitobi.html.Css.addClass(_138,_13a);
}
};
nitobi.html.Css.hasClass=function(_13b,_13c){
if(!_13c||_13c===""){
return false;
}
return (new RegExp("(\\s|^)"+_13c+"(\\s|$)")).test(_13b.className);
};
nitobi.html.Css.addClass=function(_13d,_13e,_13f){
if(_13f==true||!nitobi.html.Css.hasClass(_13d,_13e)){
_13d.className=_13d.className?_13d.className+" "+_13e:_13e;
}
};
nitobi.html.Css.removeClass=function(_140,_141,_142){
if(_142==true||nitobi.html.Css.hasClass(_140,_141)){
var reg=new RegExp("(\\s|^)"+_141+"(\\s|$)");
_140.className=_140.className.replace(reg,"$2");
}
};
nitobi.html.Css.addRule=function(_144,_145,_146){
if(_144.cssRules){
var _147=_144.insertRule(_145+"{"+(_146||"")+"}",_144.cssRules.length);
return _144.cssRules[_147];
}else{
_144.addRule(_145,_146||"nitobi:placeholder;");
return _144.rules[_144.rules.length-1];
}
};
nitobi.html.Css.getRules=function(_148){
var _149=null;
if(typeof (_148)=="number"){
_149=document.styleSheets[_148];
}else{
_149=_148;
}
if(_149==null){
return null;
}
try{
if(_149.cssRules){
return _149.cssRules;
}
if(_149.rules){
return _149.rules;
}
}
catch(e){
}
return null;
};
nitobi.html.Css.getStyleSheetsByName=function(_14a){
var arr=new Array();
var ss=document.styleSheets;
var _14d=new RegExp(_14a.replace(".",".")+"($|\\?)");
for(var i=0;i<ss.length;i++){
arr=nitobi.html.Css._getStyleSheetsByName(_14d,ss[i],arr);
}
return arr;
};
nitobi.html.Css._getStyleSheetsByName=function(_14f,_150,arr){
if(_14f.test(_150.href)){
arr=arr.concat([_150]);
}
var _152=nitobi.html.Css.getRules(_150);
if(_150.href!=""&&_150.imports){
for(var i=0;i<_150.imports.length;i++){
arr=nitobi.html.Css._getStyleSheetsByName(_14f,_150.imports[i],arr);
}
}else{
for(var i=0;i<_152.length;i++){
var s=_152[i].styleSheet;
if(s){
arr=nitobi.html.Css._getStyleSheetsByName(_14f,s,arr);
}
}
}
return arr;
};
nitobi.html.Css.imageCache={};
nitobi.html.Css.imageCacheDidNotify=false;
nitobi.html.Css.trackPrecache=function(_155){
nitobi.html.Css.precacheArray[_155]=true;
var _156=false;
for(var i in nitobi.html.Css.precacheArray){
if(!nitobi.html.Css.precacheArray[i]){
_156=true;
}
}
if((!nitobi.html.Css.imageCacheDidNotify)&&(!_156)){
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(_158){
nitobi.html.Css.isPrecaching=true;
if(!_158){
var ss=document.styleSheets;
for(var i=0;i<ss.length;i++){
nitobi.html.Css.precacheImages(ss[i]);
}
return;
}
var _15b=/.*?url\((.*?)\).*?/;
var _15c=nitobi.html.Css.getRules(_158);
var url=nitobi.html.Css.getPath(_158);
for(var i=0;i<_15c.length;i++){
var rule=_15c[i];
if(rule.styleSheet){
nitobi.html.Css.precacheImages(rule.styleSheet);
}else{
var s=rule.style;
var _160=s?s.backgroundImage:null;
if(_160){
_160=_160.replace(_15b,"$1");
_160=nitobi.html.Url.normalize(url,_160);
if(!nitobi.html.Css.imageCache[_160]){
var _161=new Image();
_161.src=_160;
nitobi.html.Css.precacheArray[_160]=false;
var _162=nitobi.lang.close({},nitobi.html.Css.trackPrecache,[_160]);
_161.onload=_162;
_161.onerror=_162;
_161.onabort=_162;
nitobi.html.Css.imageCache[_160]=_161;
try{
if(_161.width>0){
nitobi.html.Css.precacheArray[_160]=true;
}
}
catch(e){
}
}
}
}
}
if(_158.href!=""&&_158.imports){
for(var i=0;i<_158.imports.length;i++){
nitobi.html.Css.precacheImages(_158.imports[i]);
}
}
};
nitobi.html.Css.getPath=function(_163){
var href=_163.href;
href=nitobi.html.Url.normalize(href);
if(_163.parentStyleSheet&&href.indexOf("/")!=0&&href.indexOf("http://")!=0&&href.indexOf("https://")!=0){
href=nitobi.html.Css.getPath(_163.parentStyleSheet)+href;
}
return href;
};
nitobi.html.Css.getSheetUrl=nitobi.html.Css.getPath;
nitobi.html.Css.findParentStylesheet=function(_165){
var rule=nitobi.html.Css.getRule(_165);
if(rule){
return rule.parentStyleSheet;
}
return null;
};
nitobi.html.Css.findInSheet=function(_167,_168,_169){
if(nitobi.browser.IE6&&typeof _169=="undefined"){
_169=0;
}else{
if(_169>4){
return null;
}
}
_169++;
var _16a=nitobi.html.Css.getRules(_168);
for(var rule=0;rule<_16a.length;rule++){
var _16c=_16a[rule];
var ss=_16c.styleSheet;
var _16e=_16c.selectorText;
if(ss){
var _16f=nitobi.html.Css.findInSheet(_167,ss,_169);
if(_16f){
return _16f;
}
}else{
if(_16e!=null&&_16e.toLowerCase().indexOf(_167)>-1){
if(nitobi.browser.IE){
_16c={selectorText:_16e,style:_16c.style,readOnly:_16c.readOnly,parentStyleSheet:_168};
}
return _16c;
}
}
}
var _170=_168.imports;
if(_168.href!=""&&_170){
var _171=_170.length;
for(var i=0;i<_171;i++){
var _16f=nitobi.html.Css.findInSheet(_167,_170[i],_169);
if(_16f){
return _16f;
}
}
}
return null;
};
nitobi.html.Css.getClass=function(_173){
_173=_173.toLowerCase();
if(_173.indexOf(".")!==0){
_173="."+_173;
}
if(nitobi.html.Css.classCache[_173]==null){
var rule=nitobi.html.Css.getRule(_173);
if(rule!=null){
nitobi.html.Css.classCache[_173]=rule.style;
}else{
return null;
}
}
return nitobi.html.Css.classCache[_173];
};
nitobi.html.Css.classCache={};
nitobi.html.Css.getStyleBySelector=function(_175){
var rule=nitobi.html.Css.getRule(_175);
if(rule!=null){
return rule.style;
}
return null;
};
nitobi.html.Css.getRule=function(_177){
_177=_177.toLowerCase();
if(_177.indexOf(".")!==0){
_177="."+_177;
}
var _178=document.styleSheets;
for(var ss=0;ss<_178.length;ss++){
try{
var _17a=nitobi.html.Css.findInSheet(_177,_178[ss]);
if(_17a){
return _17a;
}
}
catch(err){
}
}
return null;
};
nitobi.html.Css.getClassStyle=function(_17b,_17c){
var _17d=nitobi.html.Css.getClass(_17b);
if(_17d!=null){
return _17d[_17c];
}else{
return null;
}
};
nitobi.html.Css.setStyle=function(el,rule,_180){
rule=rule.replace(/\-(\w)/g,function(_181,p1){
return p1.toUpperCase();
});
el.style[rule]=_180;
};
nitobi.html.Css.getStyle=function(oElm,_184){
var _185="";
if(document.defaultView&&document.defaultView.getComputedStyle){
_184=_184.replace(/([A-Z])/g,function($1){
return "-"+$1.toLowerCase();
});
_185=document.defaultView.getComputedStyle(oElm,"").getPropertyValue(_184);
}else{
if(oElm.currentStyle){
_184=_184.replace(/\-(\w)/g,function(_187,p1){
return p1.toUpperCase();
});
_185=oElm.currentStyle[_184];
}
}
return _185;
};
nitobi.html.Css.setOpacities=function(_189,_18a){
if(_189.length){
for(var i=0;i<_189.length;i++){
nitobi.html.Css.setOpacity(_189[i],_18a);
}
}else{
nitobi.html.Css.setOpacity(_189,_18a);
}
};
nitobi.html.Css.setOpacity=function(_18c,_18d){
var s=_18c.style;
if(_18d>100){
_18d=100;
}
if(_18d<0){
_18d=0;
}
if(s.filter!=null){
var _18f=s.filter.match(/alpha\(opacity=[\d\.]*?\)/ig);
if(_18f!=null&&_18f.length>0){
s.filter=s.filter.replace(/alpha\(opacity=[\d\.]*?\)/ig,"alpha(opacity="+_18d+")");
}else{
s.filter+="alpha(opacity="+_18d+")";
}
}else{
s.opacity=(_18d/100);
}
};
nitobi.html.Css.getOpacity=function(_190){
if(_190==null){
nitobi.lang.throwError(nitobi.error.ArgExpected+" for nitobi.html.Css.getOpacity");
}
if(nitobi.browser.IE){
if(_190.style.filter==""){
return 100;
}
var s=_190.style.filter;
s.match(/opacity=([\d\.]*?)\)/ig);
if(RegExp.$1==""){
return 100;
}
return parseInt(RegExp.$1);
}else{
return Math.abs(_190.style.opacity?_190.style.opacity*100:100);
}
};
nitobi.html.Css.getCustomStyle=function(_192,_193){
if(nitobi.browser.IE){
return nitobi.html.getClassStyle(_192,_193);
}else{
var rule=nitobi.html.Css.getRule(_192);
var re=new RegExp("(.*?)({)(.*?)(})","gi");
var _196=rule.cssText.match(re);
re=new RegExp("("+_193+")(:)(.*?)(;)","gi");
_196=re.exec(RegExp.$3);
}
};
nitobi.html.Css.createStyleSheet=function(_197){
var ss;
if(nitobi.browser.IE){
ss=document.createStyleSheet();
}else{
ss=document.createElement("style");
ss.setAttribute("type","text/css");
document.body.appendChild(ss);
ss.appendChild(document.createTextNode(""));
}
if(_197!=null){
nitobi.html.Css.setStyleSheetValue(ss,_197);
}
return ss;
};
nitobi.html.Css.setStyleSheetValue=function(ss,_19a){
if(nitobi.browser.IE){
ss.cssText=_19a;
}else{
ss.replaceChild(document.createTextNode(_19a),ss.firstChild);
}
return ss;
};
if(nitobi.browser.MOZ){
HTMLStyleElement.prototype.__defineSetter__("cssText",function(_19b){
this.innerHTML=_19b;
});
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(_1a1,_1a2,_1a3,oh,ow,oy,ox){
oh=oh||0;
ow=ow||0;
oy=oy||0;
ox=ox||0;
var a=_1a3;
var td,sd,tt,tb,tl,tr,th,tw,st,sb,sl,sr,sh,sw;
if(nitobi.browser.IE){
td=_1a2.getBoundingClientRect();
sd=_1a1.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(_1a2);
sd=document.getBoxObjectFor(_1a1);
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(_1a2);
sd=nitobi.html.getCoords(_1a1);
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=_1a1.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(_1a1)+tt-st+oy)+"px";
}
if(a&65536){
s.top=(nitobi.html.getStyleTop(_1a1)+tt-st+th-sh+oy)+"px";
}
if(a&4096){
s.left=(nitobi.html.getStyleLeft(_1a1)-sl+tl+ox)+"px";
}
if(a&256){
s.left=(nitobi.html.getStyleLeft(_1a1)-sl+tl+tw-sw+ox)+"px";
}
if(a&16){
s.top=(nitobi.html.getStyleTop(_1a1)+tt-st+oy+Math.floor((th-sh)/2))+"px";
}
if(a&1){
s.left=(nitobi.html.getStyleLeft(_1a1)-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(_1b8,_1b9,_1ba,oh,ow,oy,ox,show){
oh=oh||0;
ow=ow||0;
oy=oy||0;
ox=ox||0;
if(nitobi.browser.moz){
td=document.getBoxObjectFor(_1b9);
sd=document.getBoxObjectFor(_1b8);
var _1c0=parseInt(document.defaultView.getComputedStyle(_1b9,"").getPropertyValue("border-left-width"));
var _1c1=parseInt(document.defaultView.getComputedStyle(_1b9,"").getPropertyValue("border-top-width"));
var _1c2=parseInt(document.defaultView.getComputedStyle(_1b8,"").getPropertyValue("border-top-width"));
var _1c3=parseInt(document.defaultView.getComputedStyle(_1b8,"").getPropertyValue("border-bottom-width"));
var _1c4=parseInt(document.defaultView.getComputedStyle(_1b8,"").getPropertyValue("border-left-width"));
var _1c5=parseInt(document.defaultView.getComputedStyle(_1b8,"").getPropertyValue("border-right-width"));
oy=oy+_1c2-_1c1;
ox=ox+_1c4-_1c0;
}
nitobi.drawing.align(_1b8,_1b9,_1ba,oh,ow,oy,ox,show);
};
nitobi.lang.defineNs("nitobi.html");
if(false){
nitobi.html=function(){
};
}
nitobi.html.createElement=function(_1c6,_1c7,_1c8){
var elem=document.createElement(_1c6);
for(var attr in _1c7){
if(attr.toLowerCase().substring(0,5)=="class"){
elem.className=_1c7[attr];
}else{
elem.setAttribute(attr,_1c7[attr]);
}
}
for(var _1cb in _1c8){
elem.style[_1cb]=_1c8[_1cb];
}
return elem;
};
nitobi.html.createTable=function(_1cc,_1cd){
var _1ce=nitobi.html.createElement("table",_1cc,_1cd);
var _1cf=document.createElement("tbody");
var _1d0=document.createElement("tr");
var _1d1=document.createElement("td");
_1ce.appendChild(_1cf);
_1cf.appendChild(_1d0);
_1d0.appendChild(_1d1);
return _1ce;
};
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(_1d5,_1d6){
var w;
var C=nitobi.html.Css;
if(nitobi.browser.IE&&document.compatMode=="BackCompat"){
w=(parseInt(C.getStyle(_1d5,"width"))-parseInt(C.getStyle(_1d5,"paddingLeft"))-parseInt(C.getStyle(_1d5,"paddingRight"))-parseInt(C.getStyle(_1d5,"borderLeftWidth"))-parseInt(C.getStyle(_1d5,"borderRightWidth")))+"px";
}else{
w=(parseInt(C.getStyle(_1d5,"width"))-(_1d6.offsetWidth-parseInt(C.getStyle(_1d6,"width"))))+"px";
}
_1d6.style.width=w;
};
nitobi.html.getDomNodeByPath=function(Node,Path){
if(nitobi.browser.IE){
}
var _1db=Node;
var _1dc=Path.split("/");
var len=_1dc.length;
for(var i=0;i<len;i++){
if(_1db.childNodes[Number(_1dc[i])]!=null){
_1db=_1db.childNodes[Number(_1dc[i])];
}else{
alert("Path expression failed."+Path);
}
var s="";
}
return _1db;
};
nitobi.html.indexOfChildNode=function(_1e0,_1e1){
var _1e2=_1e0.childNodes;
for(var i=0;i<_1e2.length;i++){
if(_1e2[i]==_1e1){
return i;
}
}
return -1;
};
nitobi.html.evalScriptBlocks=function(node){
for(var i=0;i<node.childNodes.length;i++){
var _1e6=node.childNodes[i];
if(_1e6.nodeName.toLowerCase()=="script"){
eval(_1e6.text);
}else{
nitobi.html.evalScriptBlocks(_1e6);
}
}
};
nitobi.html.position=function(node){
var pos=nitobi.html.getStyle($(node),"position");
if(pos=="static"){
node.style.position="relative";
}
};
nitobi.html.setOpacity=function(_1e9,_1ea){
var _1eb=_1e9.style;
_1eb.opacity=(_1ea/100);
_1eb.MozOpacity=(_1ea/100);
_1eb.KhtmlOpacity=(_1ea/100);
_1eb.filter="alpha(opacity="+_1ea+")";
};
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.getCursor=function(o){
if(o.createTextRange){
o.focus();
var r=document.selection.createRange().duplicate();
r.moveEnd("textedit",1);
return o.value.length-r.text.length;
}else{
if(o.setSelectionRange){
return o.selectionStart;
}
}
return -1;
};
nitobi.html.encode=function(str){
str+="";
str=str.replace(/&/g,"&amp;");
str=str.replace(/\"/g,"&quot;");
str=str.replace(/'/g,"&apos;");
str=str.replace(/</g,"&lt;");
str=str.replace(/>/g,"&gt;");
str=str.replace(/\n/g,"<br>");
return str;
};
nitobi.html.getElement=function(_1f5){
if(typeof (_1f5)=="string"){
return document.getElementById(_1f5);
}
return _1f5;
};
if(typeof ($)=="undefined"){
$=nitobi.html.getElement;
}
if(typeof ($F)=="undefined"){
$F=function(id){
var _1f7=$(id);
if(_1f7!=null){
return _1f7.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){
var top=elem.style.top;
if(top==""){
top=nitobi.html.Css.getStyle(elem,"top");
}
return nitobi.lang.parseNumber(top);
};
nitobi.html.getStyleLeft=function(elem){
var left=elem.style.left;
if(left==""){
left=nitobi.html.Css.getStyle(elem,"left");
}
return nitobi.lang.parseNumber(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 _200=nitobi.lang.parseNumber(nitobi.html.getStyle(document.body,"border-top-width"));
var _201=nitobi.lang.parseNumber(nitobi.html.getStyle(document.body,"border-left-width"));
var _202=nitobi.lang.parseNumber(document.body.scrollTop)-(_200==0?2:_200);
var _203=nitobi.lang.parseNumber(document.body.scrollLeft)-(_201==0?2:_201);
var rect=elem.getBoundingClientRect();
return {top:rect.top+_202,left:rect.left+_203,bottom:rect.bottom,right:rect.right,height:rect.bottom-rect.top,width:rect.right-rect.left};
};
}else{
if(nitobi.browser.MOZ){
nitobi.html.getBox=function(elem){
var _206=0;
var _207=0;
var _208=elem.parentNode;
while(_208.nodeType==1&&_208!=document.body){
_206+=nitobi.lang.parseNumber(_208.scrollTop)-(nitobi.html.getStyle(_208,"overflow")=="auto"?nitobi.lang.parseNumber(nitobi.html.getStyle(_208,"border-top-width")):0);
_207+=nitobi.lang.parseNumber(_208.scrollLeft)-(nitobi.html.getStyle(_208,"overflow")=="auto"?nitobi.lang.parseNumber(nitobi.html.getStyle(_208,"border-left-width")):0);
_208=_208.parentNode;
}
var _209=elem.ownerDocument.getBoxObjectFor(elem);
var _20a=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-left-width"));
var _20b=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-right-width"));
var _20c=nitobi.lang.parseNumber(nitobi.html.getStyle(elem,"border-top-width"));
var top=nitobi.lang.parseNumber(_209.y)-_206-_20c;
var left=nitobi.lang.parseNumber(_209.x)-_207-_20a;
var _20f=left+nitobi.lang.parseNumber(_209.width);
var _210=top+_209.height;
var _211=nitobi.lang.parseNumber(_209.height);
var _212=nitobi.lang.parseNumber(_209.width);
return {top:top,left:left,bottom:_210,right:_20f,height:_211,width:_212};
};
nitobi.html.getBox.cache={};
}else{
if(nitobi.browser.SAFARI){
nitobi.html.getBox=function(elem){
var _214=nitobi.html.getCoords(elem);
return {top:_214.y,left:_214.x,bottom:_214.y+_214.height,right:_214.x+_214.width,height:_214.height,width:_214.width};
};
}
}
}
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,_218,_219){
return nitobi.html.getChildNodeByAttribute(elem,"id",_218,_219);
};
nitobi.html.getChildNodeByAttribute=function(elem,_21b,_21c,_21d){
for(var i=0;i<elem.childNodes.length;i++){
if(elem.nodeType!=3&&Boolean(elem.childNodes[i].getAttribute)){
if(elem.childNodes[i].getAttribute(_21b)==_21c){
return elem.childNodes[i];
}
}
}
if(_21d){
for(var i=0;i<elem.childNodes.length;i++){
var _21f=nitobi.html.getChildNodeByAttribute(elem.childNodes[i],_21b,_21c,_21d);
if(_21f!=null){
return _21f;
}
}
}
return null;
};
nitobi.html.getParentNodeById=function(elem,_221){
return nitobi.html.getParentNodeByAtt(elem,"id",_221);
};
nitobi.html.getParentNodeByAtt=function(elem,att,_224){
while(elem.parentNode!=null){
if(elem.parentNode.getAttribute(att)==_224){
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.browser.SAFARI){
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 _228,_229=0;
if((nitobi.browser.OPERA==false)&&(document.documentElement.scrollTop>0)){
_228=document.documentElement.scrollTop;
_229=document.documentElement.scrollLeft;
}else{
_228=document.body.scrollTop;
_229=document.body.scrollLeft;
}
if(((_228==0)&&(document.documentElement.scrollTop>0))||((_229==0)&&(document.documentElement.scrollLeft>0))){
_228=document.documentElement.scrollTop;
_229=document.documentElement.scrollLeft;
}
return {"left":_229,"top":_228};
};
nitobi.html.getCoords=function(_22a){
var ew,eh;
try{
var _22d=_22a;
ew=_22a.offsetWidth;
eh=_22a.offsetHeight;
for(var lx=0,ly=0;_22a!=null;lx+=_22a.offsetLeft,ly+=_22a.offsetTop,_22a=_22a.offsetParent){
}
for(;_22d!=document.body;lx-=_22d.scrollLeft,ly-=_22d.scrollTop,_22d=_22d.parentNode){
}
}
catch(e){
}
return {"x":lx,"y":ly,"height":eh,"width":ew};
};
nitobi.html.scrollBarWidth=0;
nitobi.html.getScrollBarWidth=function(_230){
if(nitobi.html.scrollBarWidth){
return nitobi.html.scrollBarWidth;
}
try{
if(null==_230){
var _231="ntb-scrollbar-width";
var d=document.getElementById(_231);
if(null==d){
d=nitobi.html.createElement("div",{"id":_231},{width:"100px",height:"100px",overflow:"auto",position:"absolute",top:"-200px",left:"-5000px"});
d.innerHTML="<div style='height:200px;'></div>";
document.body.appendChild(d);
}
_230=d;
}
if(nitobi.browser.IE){
nitobi.html.scrollBarWidth=Math.abs(_230.offsetWidth-_230.clientWidth-(_230.clientLeft?_230.clientLeft*2:0));
}else{
if(nitobi.browser.MOZ){
var b=document.getBoxObjectFor(_230);
nitobi.html.scrollBarWidth=Math.abs((b.width-_230.clientWidth));
}else{
if(nitobi.browser.SAFARI){
var b=nitobi.html.getBox(_230);
nitobi.html.scrollBarWidth=Math.abs((b.width-_230.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 _234,_235,_236,_237;
var x,y;
var _23a=navigator.userAgent.toLowerCase();
var _23b=false;
var _23c=false;
var _23d=false;
var ie=false;
var _23f=false;
if(_23a.indexOf("opera")>=0){
_23b=true;
}
if(_23a.indexOf("firefox")>=0){
_23c=true;
}
if(_23a.indexOf("msie")>=0){
ie=true;
}
if(_23a.indexOf("safari")>=0){
_23d=true;
}
if(nitobi.lang.isStandards()){
_23f=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;
}
}
}
_236=x;
_237=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;
}
}
}
_234=x;
_235=y;
var _242=db.scrollHeight;
var _243=db.offsetHeight;
if(_242>_243){
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<_237){
nitobi.html.permHeight=_237;
if(ie&&_23f){
_236+=20;
}
}
if(_236<nitobi.html.permWidth){
_236=nitobi.html.permWidth;
}
if(nitobi.html.permHeight>_237){
_236+=20;
}
var _244,_245;
_244=de.scrollHeight;
_245=de.scrollWidth;
return {scrollWidth:_245,scrollHeight:_244,scrollLeft:_234,scrollTop:_235,clientWidth:_236,clientHeight:_237,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 _249=node.attributes[a].nodeValue;
}
}
html+=">";
html+=_249;
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 _24b=this.nextSibling;
var _24c=this.parentNode;
node.parentNode.replaceChild(this,node);
_24c.insertBefore(node,_24b);
};
HTMLElement.prototype.getBoundingClientRect=function(_24d,_24e){
_24d=_24d||0;
_24e=_24e||0;
var td;
if(nitobi.browser.SAFARI){
td=nitobi.html.getCoords(this);
_24d=0;
_24e=0;
}else{
var td=document.getBoxObjectFor(this);
}
var top=td.y-_24d;
var left=td.x-_24e;
return {top:top,left:left,bottom:(top+td.height),right:(left+td.width)};
};
HTMLElement.prototype.getClientRects=function(_252,_253){
_252=_252||0;
_253=_253||0;
var td;
if(nitobi.browser.SAFARI){
td=nitobi.html.getCoords(this);
_252=0;
_253=0;
}else{
var td=document.getBoxObjectFor(this);
}
return new Array({top:(td.y-_252),left:(td.x-_253),bottom:(td.y+td.height-_252),right:(td.x+td.width-_253)});
};
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(_257,_258,_259){
var df;
var r=this.ownerDocument.createRange();
switch(String(_257).toLowerCase()){
case "beforebegin":
r.setStartBefore(this);
df=r.createContextualFragment(_258);
this.parentNode.insertBefore(df,this);
break;
case "afterbegin":
r.selectNodeContents(this);
r.collapse(true);
df=r.createContextualFragment(_258);
this.insertBefore(df,this.firstChild);
break;
case "beforeend":
if(_259==true){
this.innerHTML=this.innerHTML+_258;
}else{
r.selectNodeContents(this);
r.collapse(false);
df=r.createContextualFragment(_258);
this.appendChild(df);
}
break;
case "afterend":
r.setStartAfter(this);
df=r.createContextualFragment(_258);
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(_25f,_260,_261){
var _262=[];
for(var i=0;i<_260.length;i++){
var e=_260[i];
_262.push(nitobi.html.attachEvent(_25f,e.type,e.handler,_261,e.capture||false));
}
return _262;
};
nitobi.html.attachEvent=function(_265,type,_267,_268,_269,_26a){
if(type=="anyclick"){
if(nitobi.browser.IE){
nitobi.html.attachEvent(_265,"dblclick",_267,_268,_269,_26a);
}
type="click";
}
if(!(_267 instanceof Function)){
nitobi.lang.throwError("Event handler needs to be a Function");
}
_265=$(_265);
if(type.toLowerCase()=="unload"&&_26a!=true){
var _26b=_267;
if(_268!=null){
_26b=function(){
_267.call(_268);
};
}
return this.addUnload(_26b);
}
var _26c=this.handlerId++;
var _26d=this.elementId++;
if(typeof (_267.ebaguid)!="undefined"){
_26c=_267.ebaguid;
}else{
_267.ebaguid=_26c;
}
if(typeof (_265.ebaguid)=="undefined"){
_265.ebaguid=_26d;
nitobi.html.elements[_26d]=_265;
}
if(typeof (_265.eba_events)=="undefined"){
_265.eba_events={};
}
if(_265.eba_events[type]==null){
_265.eba_events[type]={};
if(_265.attachEvent){
_265["eba_event_"+type]=function(){
nitobi.html.notify.call(_265,window.event);
};
_265.attachEvent("on"+type,_265["eba_event_"+type]);
if(_269&&_265.setCapture!=null){
_265.setCapture(true);
}
}else{
if(_265.addEventListener){
_265["eba_event_"+type]=function(){
nitobi.html.notify.call(_265,arguments[0]);
};
_265.addEventListener(type,_265["eba_event_"+type],_269);
}
}
}
_265.eba_events[type][_26c]={handler:_267,context:_268};
return _26c;
};
nitobi.html.notify=function(e){
if(!nitobi.browser.IE){
e.srcElement=e.target;
e.fromElement=e.relatedTarget;
e.toElement=e.relatedTarget;
}
var _26f=this;
e.eventSrc=_26f;
nitobi.html.Event=e;
for(var _270 in _26f.eba_events[e.type]){
var _271=_26f.eba_events[e.type][_270];
if(typeof (_271.context)=="object"){
_271.handler.call(_271.context,e,_26f);
}else{
_271.handler.call(_26f,e,_26f);
}
}
};
nitobi.html.detachEvents=function(_272,_273){
for(var i=0;i<_273.length;i++){
var e=_273[i];
nitobi.html.detachEvent(_272,e.type,e.handler);
}
};
nitobi.html.detachEvent=function(_276,type,_278){
_276=$(_276);
var _279=_278;
if(_278 instanceof Function){
_279=_278.ebaguid;
}
if(type=="unload"){
this.unload.splice(ebaguid,1);
}
if(_276!=null&&_276.eba_events!=null&&_276.eba_events[type]!=null&&_276.eba_events[type][_279]!=null){
var _27a=_276.eba_events[type];
_27a[_279]=null;
delete _27a[_279];
if(nitobi.collections.isHashEmpty(_27a)){
this.m_detach(_276,type,_276["eba_event_"+type]);
_276["eba_event_"+type]=null;
_276.eba_events[type]=null;
_27a=null;
if(_276.nodeType==1){
_276.removeAttribute("eba_event_"+type);
}
}
}
return true;
};
nitobi.html.m_detach=function(_27b,type,_27d){
if(_27d!=null&&_27d instanceof Function){
if(_27b.detachEvent){
_27b.detachEvent("on"+type,_27d);
}else{
if(_27b.removeEventListener){
_27b.removeEventListener(type,_27d,false);
}
}
_27b["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 _281 in nitobi.html.elements[i].eba_events){
nitobi.html.m_detach(nitobi.html.elements[i],_281,nitobi.html.elements[i]["eba_event_"+_281]);
if(typeof (nitobi.html.elements[i])!="undefined"&&nitobi.html.elements[i].eba_events[_281]!=null){
for(var _282 in nitobi.html.elements[i].eba_events[_281]){
nitobi.html.elements[i].eba_events[_281][_282]=null;
}
}
nitobi.html.elements[i]["eba_event_"+_281]=null;
}
}
}
nitobi.html.elements=null;
};
nitobi.html.addUnload=function(_283){
this.unload.push(_283);
return this.unload.length-1;
};
nitobi.html.cancelEvent=function(evt,v){
nitobi.html.stopPropagation(evt);
nitobi.html.preventDefault(evt);
};
nitobi.html.stopPropagation=function(evt){
if(evt==null){
return;
}
if(nitobi.browser.MOZ||nitobi.browser.SAFARI){
evt.stopPropagation();
}else{
if(nitobi.browser.IE){
evt.cancelBubble=true;
}
}
};
nitobi.html.preventDefault=function(evt,v){
if(evt==null){
return;
}
if(nitobi.browser.MOZ||nitobi.browser.SAFARI){
evt.preventDefault();
}else{
if(nitobi.browser.IE){
evt.returnValue=false;
}
}
if(v!=null){
e.keyCode=v;
}
};
nitobi.html.getEventCoords=function(evt){
var _28a={"x":evt.clientX,"y":evt.clientY};
if(nitobi.browser.IE){
_28a.x+=document.documentElement.scrollLeft+document.body.scrollLeft;
_28a.y+=document.documentElement.scrollTop+document.body.scrollTop;
}else{
_28a.x+=window.scrollX;
_28a.y+=window.scrollY;
}
return _28a;
};
nitobi.html.getEvent=function(_28b){
if(nitobi.browser.IE){
return window.event;
}else{
_28b.srcElement=_28b.target;
_28b.fromElement=_28b.relatedTarget;
_28b.toElement=_28b.relatedTarget;
return _28b;
}
};
nitobi.html.createEvent=function(_28c,_28d,_28e,_28f){
if(nitobi.browser.IE){
_28e.target.fireEvent("on"+_28d);
}else{
var _290=document.createEvent(_28c);
_290.initKeyEvent(_28d,true,true,document.defaultView,_28e.ctrlKey,_28e.altKey,_28e.shiftKey,_28e.metaKey,_28f.keyCode,_28f.charCode);
_28e.target.dispatchEvent(_290);
}
};
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,_292){
nitobi.event.publish(key);
var guid=this.guid++;
this.keys[key].add(_292,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,_297){
var _298=true;
if(typeof func=="string"){
func=func.replace(/eventArgs/gi,"arguments[1]");
var _299=eval(func);
_298=(typeof (_299)=="undefined"?true:_299);
}
return _298;
};
nitobi.event.publish=function(key){
if(this.keys[key]==null){
this.keys[key]=new nitobi.event.Key();
}
};
nitobi.event.notify=function(key,_29c){
if(this.keys[key]!=null){
return this.keys[key].notify(_29c);
}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(_29e,guid){
this.handlers[guid]=_29e;
};
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(_2a3){
var fail=false;
for(var item in this.handlers){
var _2a6=this.handlers[item];
if(_2a6 instanceof Function){
var rv=(_2a6.apply(this,arguments)==false);
fail=fail||rv;
}else{
}
}
return !fail;
};
nitobi.event.Key.prototype.dispose=function(){
for(var _2a8 in this.handlers){
this.handlers[_2a8]=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(_2ab,obj){
this.list.splice(_2ab,0,obj);
this.length++;
};
nitobi.collections.IEnumerable.createNewArray=function(obj,_2ae){
var _2af;
_2ae=_2ae||0;
if(obj.count){
_2af=obj.count;
}
if(obj.length){
_2af=obj.length;
}
var x=new Array(_2af-_2ae);
for(var i=_2ae;i<_2af;i++){
x[i-_2ae]=obj[i];
}
return x;
};
nitobi.collections.IEnumerable.prototype.get=function(_2b2){
if(_2b2<0||_2b2>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
return this.list[_2b2];
};
nitobi.collections.IEnumerable.prototype.set=function(_2b3,_2b4){
if(_2b3<0||_2b3>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
this.list[_2b3]=_2b4;
};
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(_2b7){
var i;
if(typeof (_2b7)!="number"){
i=this.indexOf(_2b7);
}else{
i=_2b7;
}
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(_2bd,id,xml,_2c0){
nitobi.Object.call(this);
if(typeof (this.ISerializableInitialized)=="undefined"){
this.ISerializableInitialized=true;
}else{
return;
}
this.xmlNode=null;
this.setXmlNode(_2bd);
if(_2bd!=null){
this.profile=nitobi.base.Registry.getInstance().getCompleteProfile({idField:null,tagName:_2bd.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(_2bd!=null){
this.deserializeFromXmlNode(this.getXmlNode());
}else{
if(this.factory!=null&&this.profile.tagName!=null){
this.createByProfile(this.profile,this.getXmlNode());
}else{
if(xml!=null&&_2bd!=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(_2c1,_2c2){
if(_2c2==null){
var xml="<"+_2c1.tagName+" xmlns:"+nitobi.base.XmlNamespace.prefix+"=\""+nitobi.base.XmlNamespace.uri+"\" />";
var _2c4=nitobi.xml.createXmlDoc(xml);
this.setXmlNode(_2c4.firstChild);
this.deserializeFromXmlNode(this.xmlNode);
}else{
this.deserializeFromXmlNode(_2c2);
this.setXmlNode(_2c2);
}
};
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(_2c6){
this.parentObj=_2c6;
this.onSetParentObject.notify();
};
nitobi.base.ISerializable.prototype.addChildObject=function(_2c7){
this.addToCache(_2c7);
_2c7.setParentObject(this);
var _2c8=_2c7.getXmlNode();
if(!this.areGuidsGenerated(_2c8)){
_2c8=this.generateGuids(_2c8);
_2c7.setXmlNode(_2c8);
}
_2c7.setXmlNode(this.xmlNode.appendChild(nitobi.xml.importNode(this.xmlNode.ownerDocument,_2c8,true)));
};
nitobi.base.ISerializable.prototype.insertBeforeChildObject=function(obj,_2ca){
_2ca=_2ca?_2ca.getXmlNode():null;
this.addToCache(obj);
obj.setParentObject(this);
var _2cb=obj.getXmlNode();
if(!this.areGuidsGenerated(_2cb)){
_2cb=this.generateGuids(_2cb);
obj.setXmlNode(_2cb);
}
_2cb=nitobi.xml.importNode(this.xmlNode.ownerDocument,_2cb,true);
this.xmlNode.insertBefore(_2cb,_2ca);
};
nitobi.base.ISerializable.prototype.createElement=function(name){
var _2cd;
if(this.xmlNode==null||this.xmlNode.ownerDocument==null){
_2cd=nitobi.xml.createXmlDoc();
}else{
_2cd=this.xmlNode.ownerDocument;
}
if(nitobi.browser.IE){
return _2cd.createNode(1,name,nitobi.base.XmlNamespace.uri);
}else{
if(_2cd.createElementNS){
return _2cd.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(_2d3){
if(_2d3==null||_2d3.ownerDocument==null){
return false;
}
if(nitobi.browser.IE){
var node=_2d3.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 (_2d3.ownerDocument.generatedGuids==true);
}
};
nitobi.base.ISerializable.prototype.setGuidsGenerated=function(_2d6,_2d7){
if(_2d6==null||_2d6.ownerDocument==null){
return;
}
if(nitobi.browser.IE){
var node=_2d6.ownerDocument.documentElement;
if(node!=null){
var id=node.getAttribute("id");
if(id!=null&&id!=""){
nitobi.base.ISerializable.guidMap[id]=true;
}
}
}else{
_2d6.ownerDocument.generatedGuids=true;
}
};
nitobi.base.ISerializable.prototype.generateGuids=function(_2da){
nitobi.base.uniqueIdGeneratorProc.addParameter("guid",nitobi.component.getUniqueId(),"");
var doc=nitobi.xml.transformToXml(_2da,nitobi.base.uniqueIdGeneratorProc);
this.saveDocument=doc;
this.setGuidsGenerated(doc.documentElement,true);
return doc.documentElement;
};
nitobi.base.ISerializable.prototype.deserializeFromXmlNode=function(_2dc){
if(!this.areGuidsGenerated(_2dc)){
_2dc=this.generateGuids(_2dc);
}
this.setXmlNode(_2dc);
this.flushCache();
if(this.profile==null){
this.profile=nitobi.base.Registry.getInstance().getCompleteProfile({idField:null,tagName:_2dc.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 _2e2=this.getElement(id);
if(_2e2==null){
return null;
}else{
obj=this.factory.createByNode(_2e2);
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(_2e6){
this.factory=factory;
};
nitobi.base.ISerializable.prototype.getXmlNode=function(){
return this.xmlNode;
};
nitobi.base.ISerializable.prototype.setXmlNode=function(_2e7){
if(nitobi.lang.typeOf(_2e7)==nitobi.lang.type.XMLDOC&&_2e7!=null){
this.ownerDocument=_2e7;
_2e7=nitobi.html.getFirstChild(_2e7);
}else{
if(_2e7!=null){
this.ownerDocument=_2e7.ownerDocument;
}
}
if(_2e7!=null&&nitobi.browser.MOZ&&_2e7.ownerDocument==null){
nitobi.lang.throwError(nitobi.error.OrphanXmlNode+" ISerializable.setXmlNode");
}
this.xmlNode=_2e7;
};
nitobi.base.ISerializable.prototype.serializeToXml=function(){
return nitobi.xml.serialize(this.xmlNode);
};
nitobi.base.ISerializable.prototype.getAttribute=function(name,_2e9){
if(this[name]!=null){
return this[name];
}
var _2ea=this.xmlNode.getAttribute(name);
return _2ea===null?_2e9:_2ea;
};
nitobi.base.ISerializable.prototype.setAttribute=function(name,_2ec){
this[name]=_2ec;
this.xmlNode.setAttribute(name.toLowerCase(),_2ec!=null?_2ec.toString():"");
};
nitobi.base.ISerializable.prototype.setIntAttribute=function(name,_2ee){
var n=parseInt(_2ee);
if(_2ee!=null&&(typeof (n)!="number"||isNaN(n))){
nitobi.lang.throwError(name+" is not an integer and therefore cannot be set. It's value was "+_2ee);
}
this.setAttribute(name,_2ee);
};
nitobi.base.ISerializable.prototype.getIntAttribute=function(name,_2f1){
var x=this.getAttribute(name,_2f1);
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,_2f5){
_2f5=nitobi.lang.getBool(_2f5);
if(_2f5!=null&&typeof (_2f5)!="boolean"){
nitobi.lang.throwError(name+" is not an boolean and therefore cannot be set. It's value was "+_2f5);
}
this.setAttribute(name,(_2f5?"true":"false"));
};
nitobi.base.ISerializable.prototype.getBoolAttribute=function(name,_2f7){
var x=this.getAttribute(name,_2f7);
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,_2fb){
this.setAttribute(name,_2fb);
};
nitobi.base.ISerializable.prototype.getDateAttribute=function(name,_2fd){
if(this[name]){
return this[name];
}
var _2fe=this.getAttribute(name,_2fd);
return _2fe?new Date(_2fe):null;
};
nitobi.base.ISerializable.prototype.getId=function(){
return this.getAttribute("id");
};
nitobi.base.ISerializable.prototype.getChildObjectId=function(_2ff,_300){
var _301=(typeof (_2ff.className)=="string"?_2ff.tagName:_2ff.getXmlNode().nodeName);
var _302=_301;
if(_300){
_302+="[@instancename='"+_300+"']";
}
var node=this.getXmlNode().selectSingleNode(_302);
if(null==node){
return null;
}else{
return node.getAttribute("id");
}
};
nitobi.base.ISerializable.prototype.setObject=function(_304,_305){
if(_304.ISerializableImplemented!=true){
nitobi.lang.throwError(nitobi.error.ExpectedInterfaceNotFound+" ISerializable");
}
var id=this.getChildObjectId(_304,_305);
if(null!=id){
this.deleteChildObject(id);
}
if(_305){
_304.setAttribute("instancename",_305);
}
this.addChildObject(_304);
};
nitobi.base.ISerializable.prototype.getObject=function(_307,_308){
var id=this.getChildObjectId(_307,_308);
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 _30d=node.selectSingleNode("//*[@id='"+id+"']");
return (_30d!=null);
};
nitobi.base.ISerializable.prototype.getPathToLeaf=function(id){
var node=this.getXmlNode();
var _310=node.selectSingleNode("//*[@id='"+id+"']");
if(nitobi.browser.IE){
_310.ownerDocument.setProperty("SelectionLanguage","XPath");
}
var _311=_310.selectNodes("./ancestor-or-self::*");
var _312=this.getId();
var _313=0;
for(var i=0;i<_311.length;i++){
if(_311[i].getAttribute("id")==_312){
_313=i+1;
break;
}
}
var arr=nitobi.collections.IEnumerable.createNewArray(_311,_313);
return arr.reverse();
};
nitobi.base.ISerializable.prototype.isDescendantInstantiated=function(id){
var node=this.getXmlNode();
var _318=node.selectSingleNode("//*[@id='"+id+"']");
if(nitobi.browser.IE){
_318.ownerDocument.setProperty("SelectionLanguage","XPath");
}
var _319=_318.selectNodes("ancestor::*");
var _31a=false;
var obj=this;
for(var i=0;i<_319.length;i++){
if(_31a){
var _31d=_319[i].getAttribute("id");
instantiated=obj.inCache(_31d);
if(!instantiated){
return false;
}
obj=this.getObjectById(_31d);
}
if(_319[i].getAttribute("id")==this.getId()){
_31a=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(_31e){
return this.classMap[_31e];
};
nitobi.base.Registry.prototype.getProfileByInstance=function(_31f){
var _320=nitobi.lang.getFirstFunction(_31f);
var p=_320.value.prototype;
var _322=null;
var _323=0;
for(var _324 in this.classMap){
var _325=this.classMap[_324].classObject;
var _326=0;
while(_325&&_31f instanceof _325){
_325=_325.baseConstructor;
_326++;
}
if(_326>_323){
_323=_326;
_322=_324;
}
}
if(_322){
return this.getProfileByClass(_322);
}else{
return null;
}
};
nitobi.base.Registry.prototype.getProfileByTag=function(_327){
return this.tagMap[_327];
};
nitobi.base.Registry.prototype.getCompleteProfile=function(_328){
if(nitobi.lang.isDefined(_328.className)&&_328.className!=null){
return this.classMap[_328.className];
}
if(nitobi.lang.isDefined(_328.tagName)&&_328.tagName!=null){
return this.tagMap[_328.tagName];
}
nitobi.lang.throwError("A complete class profile could not be found. Insufficient information was provided.");
};
nitobi.base.Registry.prototype.register=function(_329){
if(!nitobi.lang.isDefined(_329.tagName)||null==_329.tagName){
nitobi.lang.throwError("Illegal to register a class without a tagName.");
}
if(!nitobi.lang.isDefined(_329.className)||null==_329.className){
nitobi.lang.throwError("Illegal to register a class without a className.");
}
this.tagMap[_329.tagName]=_329;
this.classMap[_329.className]=_329;
};
}
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(_32a){
try{
return nitobi.lang.newObject(_32a,arguments,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByClass) could not create the class "+_32a+".",err);
}
};
nitobi.base.Factory.prototype.createByNode=function(_32b){
try{
if(null==_32b){
nitobi.lang.throwError(nitobi.error.ArgExpected);
}
if(nitobi.lang.typeOf(_32b)==nitobi.lang.type.XMLDOC){
_32b=nitobi.xml.getChildNodes(_32b)[0];
}
var _32c=this.registry.getProfileByTag(_32b.nodeName).className;
var _32d=_32b.ownerDocument;
var _32e=Array.prototype.slice.call(arguments,0);
var obj=nitobi.lang.newObject(_32c,_32e,0);
return obj;
}
catch(err){
nitobi.lang.throwError("The Factory (createByNode) could not create the class "+_32c+".",err);
}
};
nitobi.base.Factory.prototype.createByProfile=function(_330){
try{
return nitobi.lang.newObject(_330.className,arguments,1);
}
catch(err){
nitobi.lang.throwError("The Factory (createByProfile) could not create the class "+_330.className+".",err);
}
};
nitobi.base.Factory.prototype.createByTag=function(_331){
var _332=this.registry.getProfileByTag(_331).className;
var _333=Array.prototype.slice.call(arguments,0);
return nitobi.lang.newObject(_332,_333,1);
};
nitobi.base.Factory.getInstance=function(){
if(nitobi.base.Factory.instance==null){
nitobi.base.Factory.instance=new nitobi.base.Factory();
}
return nitobi.base.Factory.instance;
};
nitobi.lang.defineNs("nitobi.base");
nitobi.base.Profile=function(_334,_335,_336,_337,_338){
this.className=_334;
this.classObject=eval(_334);
this.schema=_335;
this.singleton=_336;
this.tagName=_337;
this.idField=_338||"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(_339){
try{
_339=$(_339);
this.xmlDoc=nitobi.xml.parseHtml(_339);
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,_33c){
if(unit==this.DAY){
date.setDate(date.getDate()+_33c);
}else{
if(unit==this.WEEK){
date.setDate(date.getDate()+7*_33c);
}else{
if(unit==this.MONTH){
date.setMonth(date.getMonth()+_33c);
}else{
if(unit==this.YEAR){
date.setFullYear(date.getFullYear()+_33c);
}
}
}
}
return date;
};
nitobi.base.DateMath.add=function(date,unit,_33f){
return this._add(date,unit,_33f);
};
nitobi.base.DateMath.subtract=function(date,unit,_342){
return this._add(date,unit,-1*_342);
};
nitobi.base.DateMath.after=function(date,_344){
return (date-_344)>0;
};
nitobi.base.DateMath.between=function(date,_346,end){
return (date-_346)>=0&&(end-date)>0;
};
nitobi.base.DateMath.before=function(date,_349){
return (date-_349)<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 _355=this.resetTime(new Date());
var end=this.add(this.clone(_355),this.DAY,1);
return this.between(date,_355,end);
};
nitobi.base.DateMath.parse=function(str){
};
nitobi.base.DateMath.getWeekNumber=function(date){
var _359=this.getJanuary1st(date);
return Math.ceil(this.getNumberOfDays(_359,date)/7);
};
nitobi.base.DateMath.getNumberOfDays=function(_35a,end){
var _35c=this.resetTime(this.clone(end)).getTime()-this.resetTime(this.clone(_35a)).getTime();
return Math.round(_35c/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(_363,_364){
this.source=_363;
this.event=_364||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(_366,obj){
var _368=this.get(_366);
nitobi.collections.IEnumerable.prototype.insert.call(this,_366,obj);
if(obj.ISerializableImplemented==true&&obj.profile!=null){
this.insertBeforeChildObject(obj,_368);
}
};
nitobi.collections.IList.prototype.addToCache=function(obj,_36a){
nitobi.base.ISerializable.prototype.addToCache.call(this,obj);
this.list[_36a]=obj;
};
nitobi.collections.IList.prototype.removeFromCache=function(_36b){
nitobi.base.ISerializable.prototype.removeFromCache.call(this,this.list[_36b].getId());
};
nitobi.collections.IList.prototype.flushCache=function(){
nitobi.base.ISerializable.prototype.flushCache.call(this);
this.list=new Array();
};
nitobi.collections.IList.prototype.get=function(_36c){
if(typeof (_36c)=="object"){
return _36c;
}
if(_36c<0||_36c>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
var obj=null;
if(this.list[_36c]!=null){
obj=this.list[_36c];
}
if(obj==null){
var _36e=nitobi.xml.getChildNodes(this.xmlNode)[_36c];
if(_36e==null){
return null;
}else{
obj=this.factory.createByNode(_36e);
this.onCreateObject.notify(obj);
nitobi.collections.IList.prototype.addToCache.call(this,obj,_36c);
}
obj.setParentObject(this);
}
return obj;
};
nitobi.collections.IList.prototype.getById=function(id){
var node=this.xmlNode.selectSingleNode("*[@id='"+id+"']");
var _371=nitobi.xml.indexOfChildNode(node.parentNode,node);
return this.get(_371);
};
nitobi.collections.IList.prototype.set=function(_372,_373){
if(_372<0||_372>=this.getLength()){
nitobi.lang.throwError(nitobi.error.OutOfBounds);
}
try{
if(_373.ISerializableImplemented==true){
var obj=this.get(_372);
if(obj.getXmlNode()!=_373.getXmlNode()){
var _375=this.xmlNode.insertBefore(_373.getXmlNode(),obj.getXmlNode());
this.xmlNode.removeChild(obj.getXmlNode());
obj.setXmlNode(_375);
}
}
_373.setParentObject(this);
nitobi.collections.IList.prototype.addToCache.call(this,_373,_372);
}
catch(err){
nitobi.lang.throwError(nitobi.error.Unexpected,err);
}
};
nitobi.collections.IList.prototype.remove=function(_376){
var i;
if(typeof (_376)!="number"){
i=this.indexOf(_376);
}else{
i=_376;
}
var obj=this.get(i);
nitobi.collections.IEnumerable.prototype.remove.call(this,_376);
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(_379){
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 _37b=true;
for(var item in hash){
if(hash[item]!=null&&hash[item]!=""){
_37b=false;
break;
}
}
return _37b;
};
nitobi.collections.hashLength=function(hash){
var _37e=0;
for(var item in hash){
_37e++;
}
return _37e;
};
nitobi.collections.serialize=function(hash){
var s="";
for(var item in hash){
var _383=hash[item];
var type=typeof (_383);
if(type=="string"||type=="number"){
s+="'"+item+"':'"+_383+"',";
}
}
s=s.substring(0,s.length-1);
return "{"+s+"}";
};
nitobi.lang.defineNs("nitobi.ui");
if(false){
nitobi.ui=function(){
};
}
nitobi.ui.setWaitScreen=function(_385){
if(_385){
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>Yükleniyor, lütfen bekleyin..</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(_388){
this.htmlNode=_388||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,_38b){
if(this.onBeforeSetStyle.notify(new nitobi.ui.StyleEventArgs(this,this.onBeforeSetStyle,name,_38b))&&this.getHtmlNode()!=null){
nitobi.html.Css.setStyle(this.getHtmlNode(),name,_38b);
this.onSetStyle.notify(new nitobi.ui.StyleEventArgs(this,this.onSetStyle,name,_38b));
}
};
nitobi.ui.IStyleable.prototype.getStyle=function(name){
return nitobi.html.Css.getStyle(this.getHtmlNode(),name);
};
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.StyleEventArgs=function(_38d,_38e,_38f,_390){
nitobi.ui.ElementEventArgs.baseConstructor.apply(this,arguments);
this.property=_38f||null;
this.value=_390||null;
};
nitobi.lang.extend(nitobi.ui.StyleEventArgs,nitobi.base.EventArgs);
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.IScrollable=function(_391){
this.scrollableElement=_391;
};
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(_394){
_394=_394||25;
this.scrollableElement.scrollLeft-=_394;
};
nitobi.ui.IScrollable.prototype.scrollRight=function(_395){
_395=_395||25;
this.scrollableElement.scrollLeft+=_395;
};
nitobi.ui.IScrollable.prototype.isOverflowed=function(_396){
_396=_396||this.scrollableElement.childNodes[0];
return !(parseInt(nitobi.html.getBox(this.scrollableElement).width)>=parseInt(nitobi.html.getBox(_396).width));
};
nitobi.lang.defineNs("nitobi.ui");
if(false){
nitobi.ui=function(){
};
}
nitobi.ui.startDragOperation=function(_397,_398,_399,_39a,_39b,_39c){
var ddo=new nitobi.ui.DragDrop(_397,_399,_39a);
ddo.onDragStop.subscribe(_39c,_39b);
ddo.startDrag(_398);
};
nitobi.ui.DragDrop=function(_39e,_39f,_3a0){
this.allowVertDrag=(_39f!=null?_39f:true);
this.allowHorizDrag=(_3a0!=null?_3a0: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(_39e.nodeType==3){
alert("Text node not supported. Use parent element");
}
this.element=_39e;
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(_3a1){
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 _3a2=nitobi.html.getEventCoords(_3a1);
x=_3a2.x;
y=_3a2.y;
this.originX=x;
this.originY=y;
nitobi.html.attachEvents(document,this.events,this);
nitobi.html.cancelEvent(_3a1);
this.onDragStart.notify();
};
nitobi.ui.DragDrop.prototype.handleMouseMove=function(_3a3){
var x,y;
var _3a6=nitobi.html.getEventCoords(_3a3);
x=_3a6.x;
y=_3a6.y;
if(nitobi.browser.IE){
this.surface.style.display="block";
if(document.compat=="CSS1Compat"){
var _3a7=nitobi.html.getBodyArea();
var _3a8=0;
if(document.compatMode=="CSS1Compat"){
_3a8=25;
}
this.surface.style.width=(_3a7.clientWidth-_3a8)+"px";
this.surface.style.height=(_3a7.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(_3a3);
};
nitobi.ui.DragDrop.prototype.handleMouseUp=function(_3a9){
this.onDragStop.notify({"event":_3a9,"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 _3aa=null;
try{
_3aa=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_3aa=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(ee){
}
}
return _3aa;
}else{
if(nitobi.browser.XHR_ENABLED){
return new XMLHttpRequest();
}
}
};
nitobi.lang.defineNs("nitobi.ajax");
nitobi.ajax.HttpRequest=function(){
this.handler="";
this.async=true;
this.responseType=null;
this.httpObj=nitobi.ajax.createXmlHttp();
this.onPostComplete=new nitobi.base.Event();
this.onGetComplete=new nitobi.base.Event();
this.onRequestComplete=new nitobi.base.Event();
this.onError=new nitobi.base.Event();
this.timeout=0;
this.timeoutId=null;
this.params=null;
this.data="";
this.completeCallback=null;
this.status="complete";
this.preventCache=true;
this.username="";
this.password="";
this.requestMethod="get";
this.requestHeaders={};
};
nitobi.lang.extend(nitobi.ajax.HttpRequest,nitobi.Object);
nitobi.ajax.HttpRequestPool_MAXCONNECTIONS=64;
nitobi.ajax.HttpRequest.prototype.handleResponse=function(){
var _3ab=null;
var _3ac=null;
if((this.httpObj.responseXML!=null&&this.httpObj.responseXML.documentElement!=null)&&this.responseType!="text"){
_3ab=this.httpObj.responseXML;
}else{
if(this.responseType=="xml"){
_3ab=nitobi.xml.createXmlDoc(this.httpObj.responseText);
}else{
_3ab=this.httpObj.responseText;
}
}
if(this.httpObj.status!=200){
this.onError.notify({"source":this,"status":this.httpObj.status,"message":"Sunucudan veri alınırken bir hata oluştu. "+"Expected response type was '"+this.responseType+"'."});
}
return _3ab;
};
nitobi.ajax.HttpRequest.prototype.post=function(data,url){
this.data=data;
return this._send("POST",url,data,this.postComplete);
};
nitobi.ajax.HttpRequest.prototype.get=function(url){
return this._send("GET",url,null,this.getComplete);
};
nitobi.ajax.HttpRequest.prototype.postComplete=function(){
if(this.httpObj.readyState==4){
this.status="complete";
var _3b0={"response":this.handleResponse(),"params":this.params};
this.responseXml=this.responseText=_3b0.response;
this.onPostComplete.notify(_3b0);
this.onRequestComplete.notify(_3b0);
if(this.completeCallback){
this.completeCallback.call(this,_3b0);
}
}
};
nitobi.ajax.HttpRequest.prototype.postXml=function(_3b1){
this.setTimeout();
if(("undefined"==typeof (_3b1.documentElement))||(null==_3b1.documentElement)||("undefined"==typeof (_3b1.documentElement.childNodes))||(1>_3b1.documentElement.childNodes.length)){
ebaErrorReport("updategram is empty. No request sent. xmlData["+_3b1+"]\nxmlData.xml["+_3b1.xml+"]");
return;
}
if(null==_3b1.xml){
var _3b2=new XMLSerializer();
_3b1.xml=_3b2.serializeToString(_3b1);
}
return this.post(_3b1.xml);
};
nitobi.ajax.HttpRequest.prototype._send=function(_3b3,url,data,_3b6){
this.handler=url||this.handler;
this.setTimeout();
this.status="pending";
this.httpObj.open(_3b3,(this.preventCache?this.cacheBust(this.handler):this.handler),this.async,this.username,this.password);
if(this.async){
this.httpObj.onreadystatechange=nitobi.lang.close(this,_3b6);
}
for(var item in this.requestHeaders){
this.httpObj.setRequestHeader(item,this.requestHeaders[item]);
}
if(this.responseType=="xml"){
this.httpObj.setRequestHeader("Content-Type","text/xml");
}else{
if(_3b3.toLowerCase()=="post"){
this.httpObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
}
this.httpObj.send(data);
if(!this.async){
return this.handleResponse();
}
return this.httpObj;
};
nitobi.ajax.HttpRequest.prototype.open=function(_3b8,url,_3ba,_3bb,_3bc){
this.requestMethod=_3b8;
this.async=_3ba;
this.username=_3bb;
this.password=_3bc;
this.handler=url;
};
nitobi.ajax.HttpRequest.prototype.send=function(data){
var _3be=null;
switch(this.requestMethod.toUpperCase()){
case "POST":
_3be=this.post(data);
break;
default:
_3be=this.get();
break;
}
this.responseXml=this.responseText=_3be;
};
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 _3bf={"response":this.handleResponse(),"params":this.params,"status":this.httpObj.status,"statusText":this.httpObj.statusText};
this.responseXml=this.responseText=_3bf.response;
this.onGetComplete.notify(_3bf);
this.onRequestComplete.notify(_3bf);
if(this.completeCallback){
this.completeCallback.call(this,_3bf);
}
}
};
nitobi.ajax.HttpRequest.setRequestHeader=function(_3c0,val){
this.requestHeaders[_3c0]=val;
};
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 _3c4=url.split("?");
var _3c5="nitobi_cachebust="+(new Date().getTime());
if(_3c4.length==1){
url+="?"+_3c5;
}else{
url+="&"+_3c5;
}
return url;
};
nitobi.ajax.HttpRequestPool=function(_3c6){
this.inUse=new Array();
this.free=new Array();
this.max=_3c6||nitobi.ajax.HttpRequestPool_MAXCONNECTIONS;
this.locked=false;
this.context=null;
};
nitobi.ajax.HttpRequestPool.prototype.reserve=function(){
this.locked=true;
var _3c7;
if(this.free.length){
_3c7=this.free.pop();
_3c7.clear();
this.inUse.push(_3c7);
}else{
if(this.inUse.length<this.max){
try{
_3c7=new nitobi.ajax.HttpRequest();
}
catch(e){
_3c7=null;
}
this.inUse.push(_3c7);
}else{
throw "No request objects available";
}
}
this.locked=false;
return _3c7;
};
nitobi.ajax.HttpRequestPool.prototype.release=function(_3c8){
var _3c9=false;
this.locked=true;
if(null!=_3c8){
for(var i=0;i<this.inUse.length;i++){
if(_3c8==this.inUse[i]){
this.free.push(this.inUse[i]);
this.inUse.splice(i,1);
_3c9=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,_3ce){
this.url=url||null;
this.transformer=_3ce||null;
this.async=true;
};
nitobi.data.UrlConnector.prototype.get=function(_3cf,_3d0){
this.request=nitobi.data.UrlConnector.requestPool.reserve();
var _3d1=this.url;
for(var p in _3cf){
_3d1=nitobi.html.Url.setParameter(_3d1,p,_3cf[p]);
}
this.request.handler=_3d1;
this.request.async=this.async;
this.request.responseType="xml";
this.request.params={dataReadyCallback:_3d0};
this.request.completeCallback=nitobi.lang.close(this,this.getComplete);
this.request.get();
};
nitobi.data.UrlConnector.prototype.getComplete=function(_3d3){
if(_3d3.params.dataReadyCallback){
var _3d4=_3d3.response;
var _3d5=_3d3.params.dataReadyCallback;
var _3d6=_3d4;
if(this.transformer){
if(typeof (this.transformer)==="function"){
_3d6=this.transformer.call(null,_3d4);
}else{
_3d6=nitobi.xml.transform(_3d4,this.transformer,"xml");
}
}
if(_3d5){
_3d5.call(null,{result:_3d6,response:_3d3.response});
}
}
nitobi.data.UrlConnector.requestPool.release(this.request);
};
nitobi.data.UrlConnector.requestPool=new nitobi.ajax.HttpRequestPool();
function ntbAssert(_3d7,_3d8,_3d9,_3da){
}
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 _3dd=(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(_3e1,_3e2){
}
function ebaSetOnErrorEvent(_3e3){
nitobi.debug.setOnErrorEvent.apply(this,arguments);
}
nitobi.debug.setOnErrorEvent=function(_3e4){
NTB_ON_ERROR=_3e4;
};
function ebaReportError(_3e5,_3e6,_3e7){
nitobi.debug.errorReport("dude stop calling this method it is now called nitobi.debug.errorReport","");
nitobi.debug.errorReport(_3e5,_3e6,_3e7);
}
function ebaErrorReport(_3e8,_3e9,_3ea){
nitobi.debug.errorReport.apply(this,arguments);
}
nitobi.debug.errorReport=function(_3eb,_3ec,_3ed){
_3ed=(_3ed)?_3ed:NTB_DEBUG;
if(NTB_DEBUG==_3ed&&!NTB_DEBUG_MODE){
return;
}
var _3ee=_3eb+"\nerror code    ["+_3ec+"]\nerror Severity["+_3ed+"]";
LastError=_3ee;
if(eval(NTB_ON_ERROR||"true")){
switch(_3ec){
case NTB_EM_ATTRIBUTE_ERROR:
confirm(_3eb);
break;
case NTB_XHR_RESPONSE_ERROR:
confirm(_3eb);
break;
default:
window.status=_3eb;
break;
}
}
if(NTB_THROW==_3ed){
throw (_3ee);
}
};
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(_3ef,_3f0,type){
nitobi.error.ErrorEventArgs.baseConstructor.call(this,_3ef);
this.description=_3f0;
this.type=type;
};
nitobi.lang.extend(nitobi.error.ErrorEventArgs,nitobi.base.EventArgs);
nitobi.error.isError=function(err,_3f3){
return (err.indexOf(_3f3)>-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(_3f4){
this.setTemplate(_3f4);
this.parameters={};
};
nitobi.html.IRenderer.prototype.renderAfter=function(_3f5,data){
_3f5=$(_3f5);
var _3f7=_3f5.parentNode;
_3f5=_3f5.nextSibling;
return this._renderBefore(_3f7,_3f5,data);
};
nitobi.html.IRenderer.prototype.renderBefore=function(_3f8,data){
_3f8=$(_3f8);
return this._renderBefore(_3f8.parentNode,_3f8,data);
};
nitobi.html.IRenderer.prototype._renderBefore=function(_3fa,_3fb,data){
var s=this.renderToString(data);
var _3fe=document.createElement("div");
_3fe.innerHTML=s;
var _3ff=new Array();
if(_3fe.childNodes){
var i=0;
while(_3fe.childNodes.length){
_3ff[i++]=_3fe.firstChild;
_3fa.insertBefore(_3fe.firstChild,_3fb);
}
}else{
}
return _3ff;
};
nitobi.html.IRenderer.prototype.renderIn=function(_401,data){
_401=$(_401);
var s=this.renderToString(data);
_401.innerHTML=s;
return _401.childNodes;
};
nitobi.html.IRenderer.prototype.renderToString=function(data){
};
nitobi.html.IRenderer.prototype.setTemplate=function(_405){
this.template=_405;
};
nitobi.html.IRenderer.prototype.getTemplate=function(){
return this.template;
};
nitobi.html.IRenderer.prototype.setParameters=function(_406){
for(var p in _406){
this.parameters[p]=_406[p];
}
};
nitobi.html.IRenderer.prototype.getParameters=function(){
return this.parameters;
};
nitobi.lang.defineNs("nitobi.html");
nitobi.html.XslRenderer=function(_408){
nitobi.html.IRenderer.call(this,_408);
};
nitobi.lang.implement(nitobi.html.XslRenderer,nitobi.html.IRenderer);
nitobi.html.XslRenderer.prototype.setTemplate=function(_409){
if(typeof (_409)==="string"){
_409=nitobi.xml.createXslProcessor(_409);
}
this.template=_409;
};
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 _40b=this.getTemplate();
var _40c=this.getParameters();
for(var p in _40c){
_40b.addParameter(p,_40c[p],"");
}
var s=nitobi.xml.transformToString(data,_40b,"xml");
for(var p in _40c){
_40b.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 _411=decl.loadHtml($(id));
var _412=$(id);
var _413=_412.parentNode;
var _414=_413.ownerDocument.createElement("ntb:component");
_413.insertBefore(_414,_412);
_413.removeChild(_412);
this.setContainer(_414);
nitobi.base.ISerializable.call(this,_411);
}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(_415){
var node=$(_415);
this.htmlNode=node;
};
nitobi.ui.Element.prototype.getRootId=function(){
var _417=this.getParentObject();
if(_417==null){
return this.getId();
}else{
return _417.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(_41b,id,_41d,_41e){
try{
_41b=nitobi.html.getEvent(_41b);
if(_41e!==false){
nitobi.html.cancelEvent(_41b);
}
var _41f=nitobi.ui.Element.parseId(id).id;
if(!this.isDescendantExists(_41f)){
return false;
}
var _420=!(_41f==this.getId());
var _421=new nitobi.ui.ElementEventArgs(this,null,id);
var _422=new nitobi.ui.EventNotificationEventArgs(this,null,id,_41b);
_420=_420&&this.onBeforePropagate.notify(_422);
var _423=true;
if(_420){
if(_41d==null){
_41d=this.getPathToLeaf(_41f);
}
var _424=this.onBeforeEventNotify.notify(_422);
var _425=(_424?this.onEventNotify.notify(_422):true);
var _426=_41d.pop().getAttribute("id");
var _427=this.getObjectById(_426);
var _423=this.onBeforePropagateToChild.notify(_422);
if(_427.notify&&_423&&_425){
_423=_427.notify(_41b,id,_41d,_41e);
}
}else{
_423=this.onEventNotify.notify(_422);
}
var _428=this.eventMap[_41b.type];
if(_428!=null&&_423){
_428.notify(this.getEventArgs(_41b,id));
}
return _423;
}
catch(err){
nitobi.lang.throwError(nitobi.error.Unexpected+" Element.notify encountered a problem.",err);
}
};
nitobi.ui.Element.prototype.getEventArgs=function(_429,_42a){
var _42b=new nitobi.ui.ElementEventArgs(this,null,_42a);
return _42b;
};
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(_431,_432){
this.setVisible(false,_431,_432);
};
nitobi.ui.Element.prototype.show=function(_433,_434){
this.setVisible(true,_433,_434);
};
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(_436,_437,_438){
var _439=this.getHtmlNode();
if(_439&&this.isVisible()!=_436&&this.onBeforeSetVisible.notify({source:this,event:this.onBeforeSetVisible,args:arguments})!==false){
if(this.effect){
this.effect.end();
}
if(_436){
if(_437){
var _43a=new _437(_439);
_43a.callback=nitobi.lang.close(this,this.handleSetVisible,[_438]);
this.effect=_43a;
_43a.onFinish.subscribeOnce(nitobi.lang.close(this,function(){
this.effect=null;
}));
_43a.start();
}else{
nitobi.html.Css.removeClass(_439,NTB_CSS_HIDE);
this.handleSetVisible(_438);
}
}else{
if(_437){
var _43a=new _437(_439);
_43a.callback=nitobi.lang.close(this,this.handleSetVisible,[_438]);
this.effect=_43a;
_43a.onFinish.subscribeOnce(nitobi.lang.close(this,function(){
this.effect=null;
}));
_43a.start();
}else{
nitobi.html.Css.addClass(this.getHtmlNode(),NTB_CSS_HIDE);
this.handleSetVisible(_438);
}
}
}
};
nitobi.ui.Element.prototype.handleSetVisible=function(_43b){
if(_43b){
_43b();
}
this.onSetVisible.notify(new nitobi.ui.ElementEventArgs(this,this.onSetVisible));
};
nitobi.ui.Element.prototype.setEnabled=function(_43c){
this.enabled=_43c;
};
nitobi.ui.Element.prototype.isEnabled=function(){
return this.enabled;
};
nitobi.ui.Element.prototype.render=function(_43d,_43e){
this.flushHtmlNodeCache();
_43e=_43e||this.getState();
_43d=$(_43d)||this.getContainer();
if(_43d==null){
var _43d=document.createElement("span");
document.body.appendChild(_43d);
this.setContainer(_43d);
}
this.htmlNode=this.renderer.renderIn(_43d,_43e)[0];
this.htmlNode.jsObject=this;
};
nitobi.ui.Element.prototype.getContainer=function(){
return this.container;
};
nitobi.ui.Element.prototype.setContainer=function(_43f){
this.container=$(_43f);
};
nitobi.ui.Element.prototype.getState=function(){
return this.getXmlNode();
};
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.ElementEventArgs=function(_440,_441,_442){
nitobi.ui.ElementEventArgs.baseConstructor.apply(this,arguments);
this.targetId=_442||null;
};
nitobi.lang.extend(nitobi.ui.ElementEventArgs,nitobi.base.EventArgs);
nitobi.lang.defineNs("nitobi.ui");
nitobi.ui.EventNotificationEventArgs=function(_443,_444,_445,_446){
nitobi.ui.EventNotificationEventArgs.baseConstructor.apply(this,arguments);
this.htmlEvent=_446||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(_448,_449,_44a,_44b,_44c){
_44b=(_44c?nitobi.lang.close(_44c,_44b):_44b)||nitobi.lang.noop;
_448=$(_448);
if(typeof _44a=="string"){
_44a=nitobi.effects.families[_44a];
}
if(!_44a){
_44a=nitobi.effects.families["none"];
}
if(_449){
var _44d=_44a.show;
}else{
var _44d=_44a.hide;
}
if(_44d){
var _44e=new _44d(_448);
_44e.callback=_44b;
_44e.start();
}else{
if(_449){
nitobi.html.Css.removeClass(_448,NTB_CSS_HIDE);
}else{
nitobi.html.Css.addClass(_448,NTB_CSS_HIDE);
}
_44b();
}
};
nitobi.ui.Effects.shrink=function(_44f,_450,_451,_452){
var rect=_450.getClientRects()[0];
_44f.deltaHeight_Doctype=0-parseInt("0"+nitobi.html.getStyle(_450,"border-top-width"))-parseInt("0"+nitobi.html.getStyle(_450,"border-bottom-width"))-parseInt("0"+nitobi.html.getStyle(_450,"padding-top"))-parseInt("0"+nitobi.html.getStyle(_450,"padding-bottom"));
_44f.deltaWidth_Doctype=0-parseInt("0"+nitobi.html.getStyle(_450,"border-left-width"))-parseInt("0"+nitobi.html.getStyle(_450,"border-right-width"))-parseInt("0"+nitobi.html.getStyle(_450,"padding-left"))-parseInt("0"+nitobi.html.getStyle(_450,"padding-right"));
_44f.oldHeight=Math.abs(rect.top-rect.bottom)+_44f.deltaHeight_Doctype;
_44f.oldWidth=Math.abs(rect.right-rect.left)+_44f.deltaWidth_Doctype;
if(!(typeof (_44f.width)=="undefined")){
_44f.deltaWidth=Math.floor(Math.ceil(_44f.width-_44f.oldWidth)/(_451/nitobi.ui.Effects.ANIMATION_INTERVAL));
}else{
_44f.width=_44f.oldWidth;
_44f.deltaWidth=0;
}
if(!(typeof (_44f.height)=="undefined")){
_44f.deltaHeight=Math.floor(Math.ceil(_44f.height-_44f.oldHeight)/(_451/nitobi.ui.Effects.ANIMATION_INTERVAL));
}else{
_44f.height=_44f.oldHeight;
_44f.deltaHeight=0;
}
nitobi.ui.Effects.resize(_44f,_450,_451,_452);
};
nitobi.ui.Effects.resize=function(_454,_455,_456,_457){
var rect=_455.getClientRects()[0];
var _459=Math.abs(rect.top-rect.bottom);
var _45a=Math.max(_459+_454.deltaHeight+_454.deltaHeight_Doctype,0);
if(Math.abs(_459-_454.height)<Math.abs(_454.deltaHeight)){
_45a=_454.height;
_454.deltaHeight=0;
}
var _45b=Math.abs(rect.right-rect.left);
var _45c=Math.max(_45b+_454.deltaWidth+_454.deltaWidth_Doctype,0);
_45c=(_45c>=0)?_45c:0;
if(Math.abs(_45b-_454.width)<Math.abs(_454.deltaWidth)){
_45c=_454.width;
_454.deltaWidth=0;
}
_456-=nitobi.ui.Effects.ANIMATION_INTERVAL;
if(_456>0){
window.setTimeout(nitobi.lang.closeLater(this,nitobi.ui.Effects.resize,[_454,_455,_456,_457]),nitobi.ui.Effects.ANIMATION_INTERVAL);
}
var _45d=function(){
_455.height=_45a+"px";
_455.style.height=_45a+"px";
_455.width=_45c+"px";
_455.style.width=_45c+"px";
if(_456<=0){
if(_457){
window.setTimeout(_457,0);
}
}
};
nitobi.ui.Effects.executeNextPulse.push(_45d);
};
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(_45f){
return _45f*_45f*_45f;
};
nitobi.ui.Effects.cubeRoot=function(_460){
var T=0;
var N=parseFloat(_460);
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(_465){
return _465;
};
nitobi.ui.Effects.fade=function(_466,_467,time,_469,_46a){
_46a=_46a||nitobi.ui.Effects.linear;
var _46b=(new Date()).getTime()+time;
var id=nitobi.component.getUniqueId();
var _46d=(new Date()).getTime();
var el=_466;
if(_466.length){
el=_466[0];
}
var _46f=nitobi.html.Css.getOpacity(el);
var _470=(_467-_46f<0?-1:0);
nitobi.ui.Effects.fadeIntervalId[id]=window.setInterval(function(){
nitobi.ui.Effects.stepFade(_466,_467,_46d,_46b,id,_469,_46a,_470);
},nitobi.ui.Effects.fadeIntervalTime);
};
nitobi.ui.Effects.stepFade=function(_471,_472,_473,_474,id,_476,_477,_478){
var ct=(new Date()).getTime();
var _47a=_474-_473;
var nct=((ct-_473)/(_474-_473));
if(nct<=0||nct>=1){
nitobi.html.Css.setOpacities(_471,_472);
window.clearInterval(nitobi.ui.Effects.fadeIntervalId[id]);
_476();
return;
}else{
nct=Math.abs(nct+_478);
}
var no=_477(nct);
nitobi.html.Css.setOpacities(_471,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 _47f;
var _480=nitobi.html.getTagName(el);
if(_480=="ntb:grid"){
_47f=nitobi.initGrid(el.id);
}else{
if(_480==="ntb:combo"){
_47f=nitobi.initCombo(el.id);
}else{
if(_480=="ntb:treegrid"){
_47f=nitobi.initTreeGrid(el.id);
}else{
if(el.jsObject==null){
_47f=nitobi.base.Factory.getInstance().createByTag(_480,el.id,nitobi.component.renderComponent);
if(_47f.render&&!_47f.onLoadCallback){
_47f.render();
}
}else{
_47f=el.jsObject;
}
}
}
}
return _47f;
};
nitobi.component.renderComponent=function(_481){
_481.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.getComponents=function(_484,_485){
if(_485==null){
_485=[];
}
if(nitobi.component.isNitobiElement(_484)){
_485.push(_484);
return;
}
var _486=_484.childNodes;
for(var i=0;i<_486.length;i++){
nitobi.getComponents(_486[i],_485);
}
return _485;
};
nitobi.component.isNitobiElement=function(_488){
var _489=nitobi.html.getTagName(_488);
if(_489.substr(0,3)=="ntb"){
return true;
}else{
return false;
}
};
nitobi.component.loadComponentsFromNode=function(_48a){
var _48b=new Array();
nitobi.getComponents(_48a,_48b);
for(var i=0;i<_48b.length;i++){
nitobi.loadComponent(_48b[i].getAttribute("id"));
}
};
nitobi.lang.defineNs("nitobi.effects");
if(false){
nitobi.effects=function(){
};
}
nitobi.effects.Effect=function(_48d,_48e){
this.element=$(_48d);
this.transition=_48e.transition||nitobi.effects.Transition.sinoidal;
this.duration=_48e.duration||1;
this.fps=_48e.fps||50;
this.from=typeof (_48e.from)==="number"?_48e.from:0;
this.to=typeof (_48e.from)==="number"?_48e.to:1;
this.delay=_48e.delay||0;
this.callback=typeof (_48e.callback)==="function"?_48e.callback:nitobi.lang.noop;
this.queue=_48e.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 _493=Math.floor(pos*this.totalFrames);
if(this.frame<_493){
this.render(pos);
this.frame=_493;
}
}
};
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(_495,_496,etc){
var args=nitobi.lang.toArray(arguments,2);
return function(_499){
var f=function(){
_495.apply(this,[_499,_496].concat(args));
};
nitobi.lang.extend(f,_495);
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(_49e,_49f,_4a0){
nitobi.effects.Scale.baseConstructor.call(this,_49e,_49f);
this.scaleX=typeof (_49f.scaleX)=="boolean"?_49f.scaleX:true;
this.scaleY=typeof (_49f.scaleY)=="boolean"?_49f.scaleY:true;
this.scaleFrom=typeof (_49f.scaleFrom)=="number"?_49f.scaleFrom:100;
this.scaleTo=_4a0;
};
nitobi.lang.extend(nitobi.effects.Scale,nitobi.effects.Effect);
nitobi.effects.Scale.prototype.setup=function(){
var _4a1=this.element.style;
this.originalStyle={"top":_4a1.top,"left":_4a1.left,"width":_4a1.width,"height":_4a1.height,"overflow":_4a1.overflow};
this.factor=(this.scaleTo-this.scaleFrom)/100;
this.dims=[this.element.scrollWidth,this.element.scrollHeight];
_4a1.width=this.dims[0]+"px";
_4a1.height=this.dims[1]+"px";
_4a1.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 _4a4=(this.scaleFrom/100)+(this.factor*pos);
this.setDimensions(Math.floor(_4a4*this.dims[0])||1,Math.floor(_4a4*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(_4a7){
nitobi.collections.IEnumerable.prototype.add.call(this,_4a7);
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(_4aa,_4ab){
_4ab=nitobi.lang.merge({scaleX:false,duration:Math.min(0.2*(_4aa.scrollHeight/100),0.5)},_4ab||{});
nitobi.effects.BlindUp.baseConstructor.call(this,_4aa,_4ab,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(_4ac,_4ad){
nitobi.html.Css.swapClass(_4ac,NTB_CSS_HIDE,NTB_CSS_SMALL);
_4ad=nitobi.lang.merge({scaleX:false,scaleFrom:0,duration:Math.min(0.2*(_4ac.scrollHeight/100),0.5)},_4ad||{});
nitobi.effects.BlindDown.baseConstructor.call(this,_4ac,_4ad,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(_4ae,_4af){
_4af=nitobi.lang.merge({scaleX:false,duration:Math.min(0.2*(_4ae.scrollHeight/100),0.3)},_4af||{});
nitobi.effects.ShadeUp.baseConstructor.call(this,_4ae,_4af,0);
};
nitobi.lang.extend(nitobi.effects.ShadeUp,nitobi.effects.Scale);
nitobi.effects.ShadeUp.prototype.setup=function(){
nitobi.effects.ShadeUp.base.setup.call(this);
var _4b0=nitobi.html.getFirstChild(this.element);
this.originalStyle.position=this.element.style.position;
nitobi.html.position(this.element);
if(_4b0){
var _4b1=_4b0.style;
this.fnodeStyle={position:_4b1.position,bottom:_4b1.bottom,left:_4b1.left};
this.fnode=_4b0;
_4b1.position="absolute";
_4b1.bottom="0px";
_4b1.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(_4b3,_4b4){
nitobi.html.Css.swapClass(_4b3,NTB_CSS_HIDE,NTB_CSS_SMALL);
_4b4=nitobi.lang.merge({scaleX:false,scaleFrom:0,duration:Math.min(0.2*(_4b3.scrollHeight/100),0.3)},_4b4||{});
nitobi.effects.ShadeDown.baseConstructor.call(this,_4b3,_4b4,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 _4b5=nitobi.html.getFirstChild(this.element);
this.originalStyle.position=this.element.style.position;
nitobi.html.position(this.element);
if(_4b5){
var _4b6=_4b5.style;
this.fnodeStyle={position:_4b6.position,bottom:_4b6.bottom,left:_4b6.left,right:_4b6.right,top:_4b6.top};
this.fnode=_4b5;
_4b6.position="absolute";
_4b6.top="";
_4b6.right="";
_4b6.bottom="0px";
_4b6.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(_4b8){
if(_4b8){
if(typeof (_4b8)==="string"){
this.strings=[_4b8];
}else{
this.strings=_4b8;
}
}else{
this.strings=new Array();
}
};
nitobi.lang.StringBuilder.prototype.append=function(_4b9){
if(_4b9){
this.strings.push(_4b9);
}
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));


