/*
	Copyright (c) 2004-2006, The Dojo Foundation
	All Rights Reserved.

	Licensed under the Academic Free License version 2.1 or above OR the
	modified BSD license. For more information on Dojo licensing, see:

		http://dojotoolkit.org/community/licensing.shtml
*/

/*
	This is a compiled version of Vuit, built for deployment and not for
	development. To get an editable version, please visit:

		http://dojotoolkit.org

	for documentation and information on getting the source.
*/

if(typeof vuit=="undefined"){
var vuit_global=this;
function vuit_undef(_1,_2){
if(_2==null){
_2=vuit.global();
}
return (typeof _2[_1]=="undefined");
}
if(vuit_undef("vuitConfig",this)){
var vuitConfig={};
}
if(vuit_undef("vuit",this)){
var vuit={};
}
vuit._currentContext=this;
if(!vuit_undef("document",vuit._currentContext)){
vuit._currentDocument=this.document;
}
vuit.locale=vuitConfig.locale;
vuit.version={major:0,minor:3,patch:1,flag:"",revision:Number("$Rev: 4898 $".match(/[0-9]+/)[0]),toString:function(){
with(vuit.version){
return major+"."+minor+"."+patch+flag+" ("+revision+")";
}
}};
vuit.evalProp=function(_3,_4,_5){
return (_4&&!vuit_undef(_3,_4)?_4[_3]:(_5?(_4[_3]={}):undefined));
};
vuit.parseObjPath=function(_6,_7,_8){
var _9=(_7!=null?_7:vuit_global);
var _a=_6.split(".");
var _b=_a.pop();
for(var i=0,l=_a.length;i<l&&_9;i++){
_9=vuit.evalProp(_a[i],_9,_8);
}
return {obj:_9,prop:_b};
};
vuit.evalObjPath=function(_d,_e){
if(typeof _d!="string"){
return vuit_global;
}
if(_d.indexOf(".")==-1){
return vuit.evalProp(_d,vuit_global,_e);
}
var _f=vuit.parseObjPath(_d,vuit_global,_e);
if(_f){
return vuit.evalProp(_f.prop,_f.obj,_e);
}
return null;
};
vuit.global=function(){
return vuit._currentContext;
};
vuit.doc=function(){
return vuit._currentDocument;
};
vuit.body=function(){
return vuit.doc().body||vuit.doc().getElementsByTagName("body")[0];
};
vuit.withGlobal=function(_10,_11,_12){
var _13=vuit._currentDocument;
var _14=vuit._currentContext;
var _15;
try{
vuit._currentContext=_10;
vuit._currentDocument=_10.document;
if(_12){
_15=vuit.lang.curryArguments(_12,_11,arguments,3);
}else{
_15=_11();
}
}
catch(e){
vuit._currentContext=_14;
vuit._currentDocument=_13;
throw e;
}
vuit._currentContext=_14;
vuit._currentDocument=_13;
return _15;
};
vuit.withDoc=function(_16,_17,_18){
var _19=this._currentDocument;
var _1a;
try{
vuit._currentDocument=_16;
if(_18){
_1a=vuit.lang.curryArguments(_18,_17,arguments,3);
}else{
_1a=_17();
}
}
catch(e){
vuit._currentDocument=_19;
throw e;
}
vuit._currentDocument=_19;
return _1a;
};
vuit.errorToString=function(_1b){
if(!vuit_undef("message",_1b)){
return _1b.message;
}else{
if(!vuit_undef("description",_1b)){
return _1b.description;
}else{
return _1b;
}
}
};
vuit.raise=function(_1c,_1d){
if(_1d){
_1c=_1c+": "+vuit.errorToString(_1d);
}
try{
vuit.hostenv.println("FATAL: "+_1c);
}
catch(e){
}
throw Error(_1c);
};
vuit.debug=function(){
};
vuit.debugShallow=function(obj){
};
vuit.profile={start:function(){
},end:function(){
},stop:function(){
},dump:function(){
}};
function vuit_eval(_1f){
return vuit_global.eval?vuit_global.eval(_1f):eval(_1f);
}
vuit.unimplemented=function(_20,_21){
var _22="'"+_20+"' not implemented";
if(_21!=null){
_22+=" "+_21;
}
vuit.raise(_22);
};
vuit.deprecated=function(_23,_24,_25){
var _26="DEPRECATED: "+_23;
if(_24){
_26+=" "+_24;
}
if(_25){
_26+=" -- will be removed in version: "+_25;
}
vuit.debug(_26);
};
vuit.inherits=function(_27,_28){
if(typeof _28!="function"){
vuit.raise("vuit.inherits: superclass argument ["+_28+"] must be a function (subclass: ["+_27+"']");
}
_27.prototype=new _28();
_27.prototype.constructor=_27;
_27.superclass=_28.prototype;
_27["super"]=_28.prototype;
};
vuit._mixin=function(obj,_2a){
var _2b={};
for(var x in _2a){
if(typeof _2b[x]=="undefined"||_2b[x]!=_2a[x]){
obj[x]=_2a[x];
}
}
if(vuit.render.html.ie&&vuit.lang.isFunction(_2a["toString"])&&_2a["toString"]!=obj["toString"]){
obj.toString=_2a.toString;
}
return obj;
};
vuit.mixin=function(obj,_2e){
for(var i=1,l=arguments.length;i<l;i++){
vuit._mixin(obj,arguments[i]);
}
return obj;
};
vuit.extend=function(_30,_31){
for(var i=1,l=arguments.length;i<l;i++){
vuit._mixin(_30.prototype,arguments[i]);
}
return _30;
};
vuit.render=(function(){
function vscaffold(_33,_34){
var tmp={capable:false,support:{builtin:false,plugin:false},prefixes:_33};
for(var i=0;i<_34.length;i++){
tmp[_34[i]]=false;
}
return tmp;
}
return {name:"",ver:vuit.version,os:{win:false,linux:false,osx:false},html:vscaffold(["html"],["ie","opera","khtml","safari","moz"]),svg:vscaffold(["svg"],["corel","adobe","batik"]),vml:vscaffold(["vml"],["ie"]),swf:vscaffold(["Swf","Flash","Mm"],["mm"]),swt:vscaffold(["Swt"],["ibm"])};
})();
vuit.hostenv=(function(){
var _37={isDebug:false,allowQueryConfig:false,baseScriptUri:"",baseRelativePath:"",libraryScriptUri:"",iePreventClobber:false,ieClobberMinimal:true,preventBackButtonFix:true,searchIds:[],parseWidgets:true};
if(typeof vuitConfig=="undefined"){
vuitConfig=_37;
}else{
for(var _38 in _37){
if(typeof vuitConfig[_38]=="undefined"){
vuitConfig[_38]=_37[_38];
}
}
}
return {name_:"(unset)",version_:"(unset)",getName:function(){
return this.name_;
},getVersion:function(){
return this.version_;
},getText:function(uri){
vuit.unimplemented("getText","uri="+uri);
}};
})();
vuit.hostenv.getBaseScriptUri=function(){
if(vuitConfig.baseScriptUri.length){
return vuitConfig.baseScriptUri;
}
var uri=new String(vuitConfig.libraryScriptUri||vuitConfig.baseRelativePath);
if(!uri){
vuit.raise("Nothing returned by getLibraryScriptUri(): "+uri);
}
var _3b=uri.lastIndexOf("/");
vuitConfig.baseScriptUri=vuitConfig.baseRelativePath;
return vuitConfig.baseScriptUri;
};
(function(){
var _3c={pkgFileName:"__package__",loading_modules_:{},loaded_modules_:{},addedToLoadingCount:[],removedFromLoadingCount:[],inFlightCount:0,modulePrefixes_:{vuit:{name:"vuit",value:"src"}},setModulePrefix:function(_3d,_3e){
this.modulePrefixes_[_3d]={name:_3d,value:_3e};
},getModulePrefix:function(_3f){
var mp=this.modulePrefixes_;
if((mp[_3f])&&(mp[_3f]["name"])){
return mp[_3f].value;
}
return _3f;
},getTextStack:[],loadUriStack:[],loadedUris:[],post_load_:false,modulesLoadedListeners:[],unloadListeners:[],loadNotifying:false};
for(var _41 in _3c){
vuit.hostenv[_41]=_3c[_41];
}
})();
vuit.hostenv.loadPath=function(_42,_43,cb){
var uri;
if((_42.charAt(0)=="/")||(_42.match(/^\w+:/))){
uri=_42;
}else{
uri=this.getBaseScriptUri()+_42;
}
if(vuitConfig.cacheBust&&vuit.render.html.capable){
uri+="?"+String(vuitConfig.cacheBust).replace(/\W+/g,"");
}
try{
return ((!_43)?this.loadUri(uri,cb):this.loadUriAndCheck(uri,_43,cb));
}
catch(e){
vuit.debug(e);
return false;
}
};
vuit.hostenv.loadUri=function(uri,cb){
if(this.loadedUris[uri]){
return 1;
}
var _48=this.getText(uri,null,true);
if(_48==null){
return 0;
}
this.loadedUris[uri]=true;
if(cb){
_48="("+_48+")";
}
var _49=vuit_eval(_48);
if(cb){
cb(_49);
}
return 1;
};
vuit.hostenv.loadUriAndCheck=function(uri,_4b,cb){
var ok=true;
try{
ok=this.loadUri(uri,cb);
}
catch(e){
vuit.debug("failed loading ",uri," with error: ",e);
}
return ((ok)&&(this.findModule(_4b,false)))?true:false;
};
vuit.loaded=function(){
};
vuit.unloaded=function(){
};
vuit.hostenv.loaded=function(){
this.loadNotifying=true;
this.post_load_=true;
var mll=this.modulesLoadedListeners;
for(var x=0;x<mll.length;x++){
mll[x]();
}
this.modulesLoadedListeners=[];
this.loadNotifying=false;
vuit.loaded();
};
vuit.hostenv.unloaded=function(){
var mll=this.unloadListeners;
while(mll.length){
(mll.pop())();
}
vuit.unloaded();
};
vuit.addOnLoad=function(obj,_52){
var dh=vuit.hostenv;
if(arguments.length==1){
dh.modulesLoadedListeners.push(obj);
}else{
if(arguments.length>1){
dh.modulesLoadedListeners.push(function(){
obj[_52]();
});
}
}
if(dh.post_load_&&dh.inFlightCount==0&&!dh.loadNotifying){
dh.callLoaded();
}
};
vuit.addOnUnload=function(obj,_55){
var dh=vuit.hostenv;
if(arguments.length==1){
dh.unloadListeners.push(obj);
}else{
if(arguments.length>1){
dh.unloadListeners.push(function(){
obj[_55]();
});
}
}
};
vuit.hostenv.modulesLoaded=function(){
if(this.post_load_){
return;
}
if((this.loadUriStack.length==0)&&(this.getTextStack.length==0)){
if(this.inFlightCount>0){
vuit.debug("files still in flight!");
return;
}
vuit.hostenv.callLoaded();
}
};
vuit.hostenv.callLoaded=function(){
if(typeof setTimeout=="object"){
setTimeout("vuit.hostenv.loaded();",0);
}else{
vuit.hostenv.loaded();
}
};
vuit.hostenv.getModuleSymbols=function(_57){
var _58=_57.split(".");
for(var i=_58.length-1;i>0;i--){
var _5a=_58.slice(0,i).join(".");
var _5b=this.getModulePrefix(_5a);
if(_5b!=_5a){
_58.splice(0,i,_5b);
break;
}
}
return _58;
};
vuit._namespaces={};
(function(){
var _5c={};
var _5d={};
vuit.getNamespace=function(_5e){
if(!vuit._namespaces[_5e]&&!_5d[_5e]){
var req=vuit.require;
var _60="vuit.namespaces."+_5e;
if(!_5c[_60]){
_5c[_60]=true;
req(_60,false,true);
_5c[_60]=false;
if(!vuit._namespaces[_5e]){
_5d[_5e]=true;
}
}
}
return vuit._namespaces[_5e];
};
})();
vuit.hostenv._global_omit_module_check=false;
vuit.hostenv.loadModule=function(_61,_62,_63){
if(!_61){
return;
}
_63=this._global_omit_module_check||_63;
var _64=this.findModule(_61,false);
if(_64){
return _64;
}
if(vuit_undef(_61,this.loading_modules_)){
this.addedToLoadingCount.push(_61);
}
this.loading_modules_[_61]=1;
var _65=_61.replace(/\./g,"/")+".js";
var _66=_61.split(".");
if(vuitConfig.autoLoadNamespace){
vuit.getNamespace(_66[0]);
}
var _67=this.getModuleSymbols(_61);
var _68=((_67[0].charAt(0)!="/")&&(!_67[0].match(/^\w+:/)));
var _69=_67[_67.length-1];
if(_69=="*"){
_61=(_66.slice(0,-1)).join(".");
while(_67.length){
_67.pop();
_67.push(this.pkgFileName);
_65=_67.join("/")+".js";
if(_68&&(_65.charAt(0)=="/")){
_65=_65.slice(1);
}
ok=this.loadPath(_65,((!_63)?_61:null));
if(ok){
break;
}
_67.pop();
}
}else{
_65=_67.join("/")+".js";
_61=_66.join(".");
var ok=this.loadPath(_65,((!_63)?_61:null));
if((!ok)&&(!_62)){
_67.pop();
while(_67.length){
_65=_67.join("/")+".js";
ok=this.loadPath(_65,((!_63)?_61:null));
if(ok){
break;
}
_67.pop();
_65=_67.join("/")+"/"+this.pkgFileName+".js";
if(_68&&(_65.charAt(0)=="/")){
_65=_65.slice(1);
}
ok=this.loadPath(_65,((!_63)?_61:null));
if(ok){
break;
}
}
}
if((!ok)&&(!_63)){
vuit.raise("Could not load '"+_61+"'; last tried '"+_65+"'");
}
}
if(!_63&&!this["isXDomain"]){
_64=this.findModule(_61,false);
if(!_64){
vuit.raise("symbol '"+_61+"' is not defined after loading '"+_65+"'");
}
}
return _64;
};
vuit.hostenv.startPackage=function(_6b){
var _6c=vuit.evalObjPath((_6b.split(".").slice(0,-1)).join("."));
this.loaded_modules_[(new String(_6b)).toLowerCase()]=_6c;
var _6d=_6b.split(/\./);
if(_6d[_6d.length-1]=="*"){
_6d.pop();
}
return vuit.evalObjPath(_6d.join("."),true);
};
vuit.hostenv.findModule=function(_6e,_6f){
var lmn=(new String(_6e)).toLowerCase();
if(this.loaded_modules_[lmn]){
return this.loaded_modules_[lmn];
}
var _71=vuit.evalObjPath(_6e);
if((_6e)&&(typeof _71!="undefined")&&(_71)){
this.loaded_modules_[lmn]=_71;
return _71;
}
if(_6f){
vuit.raise("no loaded module named '"+_6e+"'");
}
return null;
};
vuit.kwCompoundRequire=function(_72){
var _73=_72["common"]||[];
var _74=(_72[vuit.hostenv.name_])?_73.concat(_72[vuit.hostenv.name_]||[]):_73.concat(_72["default"]||[]);
for(var x=0;x<_74.length;x++){
var _76=_74[x];
if(_76.constructor==Array){
vuit.hostenv.loadModule.apply(vuit.hostenv,_76);
}else{
vuit.hostenv.loadModule(_76);
}
}
};
vuit.require=function(){
vuit.hostenv.loadModule.apply(vuit.hostenv,arguments);
};
vuit.requireIf=function(){
if((arguments[0]===true)||(arguments[0]=="common")||(arguments[0]&&vuit.render[arguments[0]].capable)){
var _77=[];
for(var i=1;i<arguments.length;i++){
_77.push(arguments[i]);
}
vuit.require.apply(vuit,_77);
}
};
vuit.requireAfterIf=vuit.requireIf;
vuit.provide=function(){
return vuit.hostenv.startPackage.apply(vuit.hostenv,arguments);
};
vuit.setModulePrefix=function(_79,_7a){
return vuit.hostenv.setModulePrefix(_79,_7a);
};
vuit.exists=function(obj,_7c){
var p=_7c.split(".");
for(var i=0;i<p.length;i++){
if(!(obj[p[i]])){
return false;
}
obj=obj[p[i]];
}
return true;
};
}
if(typeof window=="undefined"){
vuit.raise("no window object");
}
(function(){
if(vuitConfig.allowQueryConfig){
var _7f=document.location.toString();
var _80=_7f.split("?",2);
if(_80.length>1){
var _81=_80[1];
var _82=_81.split("&");
for(var x in _82){
var sp=_82[x].split("=");
if((sp[0].length>11)&&(sp[0].substr(0,11)=="vuitConfig.")){
var opt=sp[0].substr(11);
try{
vuitConfig[opt]=eval(sp[1]);
}
catch(e){
vuitConfig[opt]=sp[1];
}
}
}
}
}
if(((vuitConfig["baseScriptUri"]=="")||(vuitConfig["baseRelativePath"]==""))&&(document&&document.getElementsByTagName)){
var _86=document.getElementsByTagName("script");
var _87=/(__package__|vuit|bootstrap1)\.js([\?\.]|$)/i;
for(var i=0;i<_86.length;i++){
var src=_86[i].getAttribute("src");
if(!src){
continue;
}
var m=src.match(_87);
if(m){
var _8b=src.substring(0,m.index);
if(src.indexOf("bootstrap1")>-1){
_8b+="../";
}
if(!this["vuitConfig"]){
vuitConfig={};
}
if(vuitConfig["baseScriptUri"]==""){
vuitConfig["baseScriptUri"]=_8b;
}
if(vuitConfig["baseRelativePath"]==""){
vuitConfig["baseRelativePath"]=_8b;
}
break;
}
}
}
var dr=vuit.render;
var drh=vuit.render.html;
var drs=vuit.render.svg;
var dua=(drh.UA=navigator.userAgent);
var dav=(drh.AV=navigator.appVersion);
var t=true;
var f=false;
drh.capable=t;
drh.support.builtin=t;
dr.ver=parseFloat(drh.AV);
dr.os.mac=dav.indexOf("Macintosh")>=0;
dr.os.win=dav.indexOf("Windows")>=0;
dr.os.linux=dav.indexOf("X11")>=0;
drh.opera=dua.indexOf("Opera")>=0;
drh.khtml=(dav.indexOf("Konqueror")>=0)||(dav.indexOf("Safari")>=0);
drh.safari=dav.indexOf("Safari")>=0;
var _93=dua.indexOf("Gecko");
drh.mozilla=drh.moz=(_93>=0)&&(!drh.khtml);
if(drh.mozilla){
drh.geckoVersion=dua.substring(_93+6,_93+14);
}
drh.ie=(document.all)&&(!drh.opera);
drh.ie50=drh.ie&&dav.indexOf("MSIE 5.0")>=0;
drh.ie55=drh.ie&&dav.indexOf("MSIE 5.5")>=0;
drh.ie60=drh.ie&&dav.indexOf("MSIE 6.0")>=0;
drh.ie70=drh.ie&&dav.indexOf("MSIE 7.0")>=0;
vuit.locale=vuit.locale||(drh.ie?navigator.userLanguage:navigator.language).toLowerCase();
dr.vml.capable=drh.ie;
drs.capable=f;
drs.support.plugin=f;
drs.support.builtin=f;
if(document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("org.w3c.dom.svg","1.0")){
drs.capable=t;
drs.support.builtin=t;
drs.support.plugin=f;
}
})();
vuit.hostenv.startPackage("vuit.hostenv");
vuit.render.name=vuit.hostenv.name_="browser";
vuit.hostenv.searchIds=[];
vuit.hostenv._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];
vuit.hostenv.getXmlhttpObject=function(){
var _94=null;
var _95=null;
try{
_94=new XMLHttpRequest();
}
catch(e){
}
if(!_94){
for(var i=0;i<3;++i){
var _97=vuit.hostenv._XMLHTTP_PROGIDS[i];
try{
_94=new ActiveXObject(_97);
}
catch(e){
_95=e;
}
if(_94){
vuit.hostenv._XMLHTTP_PROGIDS=[_97];
break;
}
}
}
if(!_94){
return vuit.raise("XMLHTTP not available",_95);
}
return _94;
};
vuit.hostenv.getText=function(uri,_99,_9a){
var _9b=this.getXmlhttpObject();
function isDocumentOk(_9c){
var _9d=_9c["status"];
return Boolean((!_9d)||((200<=_9d)&&(300>_9d))||(_9d==304));
}
if(_99){
_9b.onreadystatechange=function(){
if(4==_9b.readyState){
if(isDocumentOk(_9b)){
_99(_9b.responseText);
}
}
};
}
_9b.open("GET",uri,_99?true:false);
try{
_9b.send(null);
if(_99){
return null;
}
if(!isDocumentOk(_9b)){
var err=Error("Unable to load "+uri+" status:"+_9b.status);
err.status=_9b.status;
err.responseText=_9b.responseText;
throw err;
}
}
catch(e){
if((_9a)&&(!_99)){
return null;
}else{
throw e;
}
}
return _9b.responseText;
};
vuit.hostenv.defaultDebugContainerId="vuitDebug";
vuit.hostenv._println_buffer=[];
vuit.hostenv._println_safe=false;
vuit.hostenv.println=function(_9f){
if(!vuit.hostenv._println_safe){
vuit.hostenv._println_buffer.push(_9f);
}else{
try{
var _a0=document.getElementById(vuitConfig.debugContainerId?vuitConfig.debugContainerId:vuit.hostenv.defaultDebugContainerId);
if(!_a0){
_a0=vuit.body();
}
var div=document.createElement("div");
div.appendChild(document.createTextNode(_9f));
_a0.appendChild(div);
}
catch(e){
try{
document.write("<div>"+_9f+"</div>");
}
catch(e2){
window.status=_9f;
}
}
}
};
vuit.addOnLoad(function(){
vuit.hostenv._println_safe=true;
while(vuit.hostenv._println_buffer.length>0){
vuit.hostenv.println(vuit.hostenv._println_buffer.shift());
}
});
function vuit_addNodeEvtHdlr(_a2,_a3,fp,_a5){
try{
if(_a2.addEventListener){
_a2.addEventListener(_a3,fp,_a5);
return true;
}else{
if(_a2.attachEvent){
return _a2.attachEvent("on"+_a3,fp);
}else{
vuit.raise("Error adding node event handler: unknown event model");
}
}
}
catch(e){
vuit.raise("Error adding node event handler");
}
return false;
}
vuit_addNodeEvtHdlr(window,"load",function(){
if(arguments.callee.initialized){
return;
}
arguments.callee.initialized=true;
var _a6=function(){
if(vuit.render.html.ie){
vuit.hostenv.makeWidgets();
}
};
if(vuit.hostenv.inFlightCount==0){
_a6();
vuit.hostenv.modulesLoaded();
}else{
vuit.addOnLoad(_a6);
}
});
vuit_addNodeEvtHdlr(window,"unload",function(){
vuit.hostenv.unloaded();
});
vuit.hostenv.makeWidgets=function(){
var _a7=[];
if(vuitConfig.searchIds&&vuitConfig.searchIds.length>0){
_a7=_a7.concat(vuitConfig.searchIds);
}
if(vuit.hostenv.searchIds&&vuit.hostenv.searchIds.length>0){
_a7=_a7.concat(vuit.hostenv.searchIds);
}
if((vuitConfig.parseWidgets)||(_a7.length>0)){
if(vuit.evalObjPath("vuit.widget.Parse")){
var _a8=new vuit.xml.Parse();
if(_a7.length>0){
for(var x=0;x<_a7.length;x++){
var _aa=document.getElementById(_a7[x]);
if(!_aa){
continue;
}
var _ab=_a8.parseElement(_aa,null,true);
vuit.widget.getParser().createComponents(_ab);
}
}else{
if(vuitConfig.parseWidgets){
var _ab=_a8.parseElement(vuit.body(),null,true);
vuit.widget.getParser().createComponents(_ab);
}
}
}
}
};
vuit.addOnLoad(function(){
if(!vuit.render.html.ie){
vuit.hostenv.makeWidgets();
}
});
try{
if(vuit.render.html.ie){
document.namespaces.add("v","urn:schemas-microsoft-com:vml");
document.createStyleSheet().addRule("v\\:*","behavior:url(#default#VML)");
}
}
catch(e){
}
vuit.hostenv.writeIncludes=function(){
};
vuit.byId=function(id,doc){
if(id&&(typeof id=="string"||id instanceof String)){
if(!doc){
doc=vuit.doc();
}
return doc.getElementById(id);
}
return id;
};
(function(){
if(typeof vuit_usingBootstrap!="undefined"){
return;
}
var _ae=false;
var _af=false;
var _b0=false;
if((typeof this["load"]=="function")&&((typeof this["Packages"]=="function")||(typeof this["Packages"]=="object"))){
_ae=true;
}else{
if(typeof this["load"]=="function"){
_af=true;
}else{
if(window.widget){
_b0=true;
}
}
}
var _b1=[];
if((this["vuitConfig"])&&((vuitConfig["isDebug"])||(vuitConfig["debugAtAllCosts"]))){
_b1.push("debug.js");
}
if((this["vuitConfig"])&&(vuitConfig["debugAtAllCosts"])&&(!_ae)&&(!_b0)){
_b1.push("browser_debug.js");
}
if((this["vuitConfig"])&&(vuitConfig["compat"])){
_b1.push("compat/"+vuitConfig["compat"]+".js");
}
var _b2=vuitConfig["baseScriptUri"];
if((this["vuitConfig"])&&(vuitConfig["baseLoaderUri"])){
_b2=vuitConfig["baseLoaderUri"];
}
for(var x=0;x<_b1.length;x++){
var _b4=_b2+"src/"+_b1[x];
if(_ae||_af){
load(_b4);
}else{
try{
document.write("<scr"+"ipt type='text/javascript' src='"+_b4+"'></scr"+"ipt>");
}
catch(e){
var _b5=document.createElement("script");
_b5.src=_b4;
document.getElementsByTagName("head")[0].appendChild(_b5);
}
}
}
})();
vuit.normalizeLocale=function(_b6){
return _b6?_b6.toLowerCase():vuit.locale;
};
vuit.requireLocalization=function(_b7,_b8,_b9){
vuit.debug("EXPERIMENTAL: vuit.requireLocalization");
var _ba=vuit.hostenv.getModuleSymbols(_b7);
var _bb=_ba.concat("nls").join("/");
_b9=vuit.normalizeLocale(_b9);
var _bc=_b9.split("-");
var _bd=[];
for(var i=_bc.length;i>0;i--){
_bd.push(_bc.slice(0,i).join("-"));
}
_bd.push(false);
var _bf=[_b7,"_nls",_b8].join(".");
var _c0=vuit.hostenv.startPackage(_bf);
vuit.hostenv.loaded_modules_[_bf]=_c0;
var _c1=false;
for(var j=_bd.length-1;j>=0;j--){
var loc=_bd[j]||"ROOT";
var pkg=_bf+"."+loc;
var _c5=false;
if(!vuit.hostenv.findModule(pkg)){
vuit.hostenv.loaded_modules_[pkg]=null;
var _c6=[_bb];
if(_bd[j]){
_c6.push(loc);
}
_c6.push(_b8);
var _c7=_c6.join("/")+".js";
_c5=vuit.hostenv.loadPath(_c7,null,function(_c8){
var _c9=function(){
};
_c9.prototype=_c1;
_c0[loc]=new _c9();
for(var k in _c8){
_c0[loc][k]=_c8[k];
}
});
}else{
_c5=true;
}
if(_c5&&_c0[loc]){
_c1=_c0[loc];
}
}
};
(function(){
var _cb=vuitConfig.extraLocale;
if(_cb){
var req=vuit.requireLocalization;
vuit.requireLocalization=function(m,b,_cf){
req(m,b,_cf);
if(_cf){
return;
}
if(_cb instanceof Array){
for(var i=0;i<_cb.length;i++){
req(m,b,_cb[i]);
}
}else{
req(m,b,_cb);
}
};
}
})();
vuit.provide("vuit.lang.common");
vuit.lang._mixin=vuit._mixin;
vuit.lang.mixin=vuit.mixin;
vuit.lang.extend=vuit.extend;
vuit.lang.find=function(_d1,_d2,_d3,_d4){
if(!vuit.lang.isArrayLike(_d1)&&vuit.lang.isArrayLike(_d2)){
vuit.deprecated("vuit.lang.find(value, array)","use vuit.lang.find(array, value) instead","0.5");
var _d5=_d1;
_d1=_d2;
_d2=_d5;
}
var _d6=vuit.lang.isString(_d1);
if(_d6){
_d1=_d1.split("");
}
if(_d4){
var _d7=-1;
var i=_d1.length-1;
var end=-1;
}else{
var _d7=1;
var i=0;
var end=_d1.length;
}
if(_d3){
while(i!=end){
if(_d1[i]===_d2){
return i;
}
i+=_d7;
}
}else{
while(i!=end){
if(_d1[i]==_d2){
return i;
}
i+=_d7;
}
}
return -1;
};
vuit.lang.indexOf=vuit.lang.find;
vuit.lang.findLast=function(_da,_db,_dc){
return vuit.lang.find(_da,_db,_dc,true);
};
vuit.lang.lastIndexOf=vuit.lang.findLast;
vuit.lang.inArray=function(_dd,_de){
return vuit.lang.find(_dd,_de)>-1;
};
vuit.lang.isObject=function(it){
if(typeof it=="undefined"){
return false;
}
return (typeof it=="object"||it===null||vuit.lang.isArray(it)||vuit.lang.isFunction(it));
};
vuit.lang.isArray=function(it){
return (it instanceof Array||typeof it=="array");
};
vuit.lang.isArrayLike=function(it){
if(vuit.lang.isString(it)){
return false;
}
if(vuit.lang.isFunction(it)){
return false;
}
if(vuit.lang.isArray(it)){
return true;
}
if(typeof it!="undefined"&&it&&vuit.lang.isNumber(it.length)&&isFinite(it.length)){
return true;
}
return false;
};
vuit.lang.isFunction=function(it){
if(!it){
return false;
}
return (it instanceof Function||typeof it=="function");
};
vuit.lang.isString=function(it){
return (it instanceof String||typeof it=="string");
};
vuit.lang.isAlien=function(it){
if(!it){
return false;
}
return !vuit.lang.isFunction()&&/\{\s*\[native code\]\s*\}/.test(String(it));
};
vuit.lang.isBoolean=function(it){
return (it instanceof Boolean||typeof it=="boolean");
};
vuit.lang.isNumber=function(it){
return (it instanceof Number||typeof it=="number");
};
vuit.lang.isUndefined=function(it){
return ((it==undefined)&&(typeof it=="undefined"));
};
vuit.provide("vuit.lang");
vuit.provide("vuit.lang.Lang");
vuit.provide("vuit.lang.array");
vuit.lang.has=function(obj,_e9){
try{
return (typeof obj[_e9]!="undefined");
}
catch(e){
return false;
}
};
vuit.lang.isEmpty=function(obj){
if(vuit.lang.isObject(obj)){
var tmp={};
var _ec=0;
for(var x in obj){
if(obj[x]&&(!tmp[x])){
_ec++;
break;
}
}
return (_ec==0);
}else{
if(vuit.lang.isArrayLike(obj)||vuit.lang.isString(obj)){
return obj.length==0;
}
}
};
vuit.lang.map=function(arr,obj,_f0){
var _f1=vuit.lang.isString(arr);
if(_f1){
arr=arr.split("");
}
if(vuit.lang.isFunction(obj)&&(!_f0)){
_f0=obj;
obj=vuit_global;
}else{
if(vuit.lang.isFunction(obj)&&_f0){
var _f2=obj;
obj=_f0;
_f0=_f2;
}
}
if(Array.map){
var _f3=Array.map(arr,_f0,obj);
}else{
var _f3=[];
for(var i=0;i<arr.length;++i){
_f3.push(_f0.call(obj,arr[i]));
}
}
if(_f1){
return _f3.join("");
}else{
return _f3;
}
};
vuit.lang.forEach=function(_f5,_f6,_f7){
if(vuit.lang.isString(_f5)){
_f5=_f5.split("");
}
if(Array.forEach){
Array.forEach(_f5,_f6,_f7);
}else{
if(!_f7){
_f7=vuit_global;
}
for(var i=0,l=_f5.length;i<l;i++){
_f6.call(_f7,_f5[i],i,_f5);
}
}
};
vuit.lang._everyOrSome=function(_f9,arr,_fb,_fc){
if(vuit.lang.isString(arr)){
arr=arr.split("");
}
if(Array.every){
return Array[(_f9)?"every":"some"](arr,_fb,_fc);
}else{
if(!_fc){
_fc=vuit_global;
}
for(var i=0,l=arr.length;i<l;i++){
var _fe=_fb.call(_fc,arr[i],i,arr);
if((_f9)&&(!_fe)){
return false;
}else{
if((!_f9)&&(_fe)){
return true;
}
}
}
return (_f9)?true:false;
}
};
vuit.lang.every=function(arr,_100,_101){
return this._everyOrSome(true,arr,_100,_101);
};
vuit.lang.some=function(arr,_103,_104){
return this._everyOrSome(false,arr,_103,_104);
};
vuit.lang.filter=function(arr,_106,_107){
var _108=vuit.lang.isString(arr);
if(_108){
arr=arr.split("");
}
if(Array.filter){
var _109=Array.filter(arr,_106,_107);
}else{
if(!_107){
if(arguments.length>=3){
vuit.raise("thisObject doesn't exist!");
}
_107=vuit_global;
}
var _109=[];
for(var i=0;i<arr.length;i++){
if(_106.call(_107,arr[i],i,arr)){
_109.push(arr[i]);
}
}
}
if(_108){
return _109.join("");
}else{
return _109;
}
};
vuit.lang.unnest=function(){
var out=[];
for(var i=0;i<arguments.length;i++){
if(vuit.lang.isArrayLike(arguments[i])){
var add=vuit.lang.unnest.apply(this,arguments[i]);
out=out.concat(add);
}else{
out.push(arguments[i]);
}
}
return out;
};
vuit.lang.toArray=function(_10e,_10f){
var _110=[];
for(var i=_10f||0;i<_10e.length;i++){
_110.push(_10e[i]);
}
return _110;
};
vuit.provide("vuit.lang.extras");
vuit.lang.setTimeout=function(func,_113){
var _114=window,argsStart=2;
if(!vuit.lang.isFunction(func)){
_114=func;
func=_113;
_113=arguments[2];
argsStart++;
}
if(vuit.lang.isString(func)){
func=_114[func];
}
var args=[];
for(var i=argsStart;i<arguments.length;i++){
args.push(arguments[i]);
}
return vuit.global().setTimeout(function(){
func.apply(_114,args);
},_113);
};
vuit.lang.clearTimeout=function(_117){
vuit.global().clearTimeout(_117);
};
vuit.lang.getNameInObj=function(ns,item){
if(!ns){
ns=vuit_global;
}
for(var x in ns){
if(ns[x]===item){
return new String(x);
}
}
return null;
};
vuit.lang.shallowCopy=function(obj,deep){
var i,ret;
if(obj===null){
return null;
}
if(vuit.lang.isObject(obj)){
ret=new obj.constructor();
for(i in obj){
if(vuit.lang.isUndefined(ret[i])){
ret[i]=deep?vuit.lang.shallowCopy(obj[i],deep):obj[i];
}
}
}else{
if(vuit.lang.isArray(obj)){
ret=[];
for(i=0;i<obj.length;i++){
ret[i]=deep?vuit.lang.shallowCopy(obj[i],deep):obj[i];
}
}else{
ret=obj;
}
}
return ret;
};
vuit.lang.firstValued=function(){
for(var i=0;i<arguments.length;i++){
if(typeof arguments[i]!="undefined"){
return arguments[i];
}
}
return undefined;
};
vuit.lang.getObjPathValue=function(_11f,_120,_121){
with(vuit.parseObjPath(_11f,_120,_121)){
return vuit.evalProp(prop,obj,_121);
}
};
vuit.lang.setObjPathValue=function(_122,_123,_124,_125){
if(arguments.length<4){
_125=true;
}
with(vuit.parseObjPath(_122,_124,_125)){
if(obj&&(_125||(prop in obj))){
obj[prop]=_123;
}
}
};
vuit.provide("vuit.lang.func");
vuit.lang.hitch=function(_126,_127){
var fcn=vuit.lang.isString(_127)?_126[_127]:_127;
return function(){
return fcn.apply(_126,arguments);
};
};
vuit.lang.anonCtr=0;
vuit.lang.anon={};
vuit.lang.nameAnonFunc=function(_129,_12a,_12b){
var nso=(_12a||vuit.lang.anon);
if((_12b)||((vuit_global["vuitConfig"])&&(vuitConfig["slowAnonFuncLookups"]==true))){
for(var x in nso){
try{
if(nso[x]===_129){
return x;
}
}
catch(e){
}
}
}
var ret="__"+vuit.lang.anonCtr++;
while(typeof nso[ret]!="undefined"){
ret="__"+vuit.lang.anonCtr++;
}
nso[ret]=_129;
return ret;
};
vuit.lang.forward=function(_12f){
return function(){
return this[_12f].apply(this,arguments);
};
};
vuit.lang.curry=function(ns,func){
var _132=[];
ns=ns||vuit_global;
if(vuit.lang.isString(func)){
func=ns[func];
}
for(var x=2;x<arguments.length;x++){
_132.push(arguments[x]);
}
var _134=(func["__preJoinArity"]||func.length)-_132.length;
function gather(_135,_136,_137){
var _138=_137;
var _139=_136.slice(0);
for(var x=0;x<_135.length;x++){
_139.push(_135[x]);
}
_137=_137-_135.length;
if(_137<=0){
var res=func.apply(ns,_139);
_137=_138;
return res;
}else{
return function(){
return gather(arguments,_139,_137);
};
}
}
return gather([],_132,_134);
};
vuit.lang.curryArguments=function(ns,func,args,_13f){
var _140=[];
var x=_13f||0;
for(x=_13f;x<args.length;x++){
_140.push(args[x]);
}
return vuit.lang.curry.apply(vuit.lang,[ns,func].concat(_140));
};
vuit.lang.tryThese=function(){
for(var x=0;x<arguments.length;x++){
try{
if(typeof arguments[x]=="function"){
var ret=(arguments[x]());
if(ret){
return ret;
}
}
}
catch(e){
vuit.debug(e);
}
}
};
vuit.lang.delayThese=function(farr,cb,_146,_147){
if(!farr.length){
if(typeof _147=="function"){
_147();
}
return;
}
if((typeof _146=="undefined")&&(typeof cb=="number")){
_146=cb;
cb=function(){
};
}else{
if(!cb){
cb=function(){
};
if(!_146){
_146=0;
}
}
}
setTimeout(function(){
(farr.shift())();
cb();
vuit.lang.delayThese(farr,cb,_146,_147);
},_146);
};
vuit.provide("vuit.event");
vuit.event=new function(){
this.canTimeout=vuit.lang.isFunction(vuit_global["setTimeout"])||vuit.lang.isAlien(vuit_global["setTimeout"]);
function interpolateArgs(args,_149){
var dl=vuit.lang;
var ao={srcObj:vuit_global,srcFunc:null,adviceObj:vuit_global,adviceFunc:null,aroundObj:null,aroundFunc:null,adviceType:(args.length>2)?args[0]:"after",precedence:"last",once:false,delay:null,rate:0,adviceMsg:false};
switch(args.length){
case 0:
return;
case 1:
return;
case 2:
ao.srcFunc=args[0];
ao.adviceFunc=args[1];
break;
case 3:
if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isString(args[2]))){
ao.adviceType="after";
ao.srcObj=args[0];
ao.srcFunc=args[1];
ao.adviceFunc=args[2];
}else{
if((dl.isString(args[1]))&&(dl.isString(args[2]))){
ao.srcFunc=args[1];
ao.adviceFunc=args[2];
}else{
if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isFunction(args[2]))){
ao.adviceType="after";
ao.srcObj=args[0];
ao.srcFunc=args[1];
var _14c=dl.nameAnonFunc(args[2],ao.adviceObj,_149);
ao.adviceFunc=_14c;
}else{
if((dl.isFunction(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))){
ao.adviceType="after";
ao.srcObj=vuit_global;
var _14c=dl.nameAnonFunc(args[0],ao.srcObj,_149);
ao.srcFunc=_14c;
ao.adviceObj=args[1];
ao.adviceFunc=args[2];
}
}
}
}
break;
case 4:
if((dl.isObject(args[0]))&&(dl.isObject(args[2]))){
ao.adviceType="after";
ao.srcObj=args[0];
ao.srcFunc=args[1];
ao.adviceObj=args[2];
ao.adviceFunc=args[3];
}else{
if((dl.isString(args[0]))&&(dl.isString(args[1]))&&(dl.isObject(args[2]))){
ao.adviceType=args[0];
ao.srcObj=vuit_global;
ao.srcFunc=args[1];
ao.adviceObj=args[2];
ao.adviceFunc=args[3];
}else{
if((dl.isString(args[0]))&&(dl.isFunction(args[1]))&&(dl.isObject(args[2]))){
ao.adviceType=args[0];
ao.srcObj=vuit_global;
var _14c=dl.nameAnonFunc(args[1],vuit_global,_149);
ao.srcFunc=_14c;
ao.adviceObj=args[2];
ao.adviceFunc=args[3];
}else{
if((dl.isString(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))&&(dl.isFunction(args[3]))){
ao.srcObj=args[1];
ao.srcFunc=args[2];
var _14c=dl.nameAnonFunc(args[3],vuit_global,_149);
ao.adviceObj=vuit_global;
ao.adviceFunc=_14c;
}else{
if(dl.isObject(args[1])){
ao.srcObj=args[1];
ao.srcFunc=args[2];
ao.adviceObj=vuit_global;
ao.adviceFunc=args[3];
}else{
if(dl.isObject(args[2])){
ao.srcObj=vuit_global;
ao.srcFunc=args[1];
ao.adviceObj=args[2];
ao.adviceFunc=args[3];
}else{
ao.srcObj=ao.adviceObj=ao.aroundObj=vuit_global;
ao.srcFunc=args[1];
ao.adviceFunc=args[2];
ao.aroundFunc=args[3];
}
}
}
}
}
}
break;
case 6:
ao.srcObj=args[1];
ao.srcFunc=args[2];
ao.adviceObj=args[3];
ao.adviceFunc=args[4];
ao.aroundFunc=args[5];
ao.aroundObj=vuit_global;
break;
default:
ao.srcObj=args[1];
ao.srcFunc=args[2];
ao.adviceObj=args[3];
ao.adviceFunc=args[4];
ao.aroundObj=args[5];
ao.aroundFunc=args[6];
ao.once=args[7];
ao.delay=args[8];
ao.rate=args[9];
ao.adviceMsg=args[10];
break;
}
if(dl.isFunction(ao.aroundFunc)){
var _14c=dl.nameAnonFunc(ao.aroundFunc,ao.aroundObj,_149);
ao.aroundFunc=_14c;
}
if(dl.isFunction(ao.srcFunc)){
ao.srcFunc=dl.getNameInObj(ao.srcObj,ao.srcFunc);
}
if(dl.isFunction(ao.adviceFunc)){
ao.adviceFunc=dl.getNameInObj(ao.adviceObj,ao.adviceFunc);
}
if((ao.aroundObj)&&(dl.isFunction(ao.aroundFunc))){
ao.aroundFunc=dl.getNameInObj(ao.aroundObj,ao.aroundFunc);
}
if(!ao.srcObj){
vuit.raise("bad srcObj for srcFunc: "+ao.srcFunc);
}
if(!ao.adviceObj){
vuit.raise("bad adviceObj for adviceFunc: "+ao.adviceFunc);
}
return ao;
}
this.connect=function(){
if(arguments.length==1){
var ao=arguments[0];
}else{
var ao=interpolateArgs(arguments,true);
}
if(vuit.lang.isArray(ao.srcObj)&&ao.srcObj!=""){
var _14e={};
for(var x in ao){
_14e[x]=ao[x];
}
var mjps=[];
vuit.lang.forEach(ao.srcObj,function(src){
if((vuit.render.html.capable)&&(vuit.lang.isString(src))){
src=vuit.byId(src);
}
_14e.srcObj=src;
mjps.push(vuit.event.connect.call(vuit.event,_14e));
});
return mjps;
}
var mjp=vuit.event.MethodJoinPoint.getForMethod(ao.srcObj,ao.srcFunc);
if(ao.adviceFunc){
var mjp2=vuit.event.MethodJoinPoint.getForMethod(ao.adviceObj,ao.adviceFunc);
}
mjp.kwAddAdvice(ao);
return mjp;
};
this.log=function(a1,a2){
var _156;
if((arguments.length==1)&&(typeof a1=="object")){
_156=a1;
}else{
_156={srcObj:a1,srcFunc:a2};
}
_156.adviceFunc=function(){
var _157=[];
for(var x=0;x<arguments.length;x++){
_157.push(arguments[x]);
}
vuit.debug("("+_156.srcObj+")."+_156.srcFunc,":",_157.join(", "));
};
this.kwConnect(_156);
};
this.connectBefore=function(){
var args=["before"];
for(var i=0;i<arguments.length;i++){
args.push(arguments[i]);
}
return this.connect.apply(this,args);
};
this.connectAround=function(){
var args=["around"];
for(var i=0;i<arguments.length;i++){
args.push(arguments[i]);
}
return this.connect.apply(this,args);
};
this.connectOnce=function(){
var ao=interpolateArgs(arguments,true);
ao.once=true;
return this.connect(ao);
};
this._kwConnectImpl=function(_15e,_15f){
var fn=(_15f)?"disconnect":"connect";
if(typeof _15e["srcFunc"]=="function"){
_15e.srcObj=_15e["srcObj"]||vuit_global;
var _161=vuit.lang.nameAnonFunc(_15e.srcFunc,_15e.srcObj,true);
_15e.srcFunc=_161;
}
if(typeof _15e["adviceFunc"]=="function"){
_15e.adviceObj=_15e["adviceObj"]||vuit_global;
var _161=vuit.lang.nameAnonFunc(_15e.adviceFunc,_15e.adviceObj,true);
_15e.adviceFunc=_161;
}
return vuit.event[fn]((_15e["type"]||_15e["adviceType"]||"after"),_15e["srcObj"]||vuit_global,_15e["srcFunc"],_15e["adviceObj"]||_15e["targetObj"]||vuit_global,_15e["adviceFunc"]||_15e["targetFunc"],_15e["aroundObj"],_15e["aroundFunc"],_15e["once"],_15e["delay"],_15e["rate"],_15e["adviceMsg"]||false);
};
this.kwConnect=function(_162){
return this._kwConnectImpl(_162,false);
};
this.disconnect=function(){
var ao=interpolateArgs(arguments,true);
if(!ao.adviceFunc){
return;
}
var mjp=vuit.event.MethodJoinPoint.getForMethod(ao.srcObj,ao.srcFunc);
return mjp.removeAdvice(ao.adviceObj,ao.adviceFunc,ao.adviceType,ao.once);
};
this.kwDisconnect=function(_165){
return this._kwConnectImpl(_165,true);
};
};
vuit.event.MethodInvocation=function(_166,obj,args){
this.jp_=_166;
this.object=obj;
this.args=[];
for(var x=0;x<args.length;x++){
this.args[x]=args[x];
}
this.around_index=-1;
};
vuit.event.MethodInvocation.prototype.proceed=function(){
this.around_index++;
if(this.around_index>=this.jp_.around.length){
return this.jp_.object[this.jp_.methodname].apply(this.jp_.object,this.args);
}else{
var ti=this.jp_.around[this.around_index];
var mobj=ti[0]||vuit_global;
var meth=ti[1];
return mobj[meth].call(mobj,this);
}
};
vuit.event.MethodJoinPoint=function(obj,_16e){
this.object=obj||vuit_global;
this.methodname=_16e;
this.methodfunc=this.object[_16e];
this.before=[];
this.after=[];
this.around=[];
};
vuit.event.MethodJoinPoint.getForMethod=function(obj,_170){
if(!obj){
obj=vuit_global;
}
if(!obj[_170]){
obj[_170]=function(){
};
if(!obj[_170]){
vuit.raise("Cannot set do-nothing method on that object "+_170);
}
}else{
if((!vuit.lang.isFunction(obj[_170]))&&(!vuit.lang.isAlien(obj[_170]))){
return null;
}
}
var _171=_170+"$joinpoint";
var _172=_170+"$joinpoint$method";
var _173=obj[_171];
if(!_173){
var _174=false;
if(vuit.event["browser"]){
if((obj["attachEvent"])||(obj["nodeType"])||(obj["addEventListener"])){
_174=true;
vuit.event.browser.addClobberNodeAttrs(obj,[_171,_172,_170]);
}
}
var _175=obj[_170].length;
obj[_172]=obj[_170];
_173=obj[_171]=new vuit.event.MethodJoinPoint(obj,_172);
obj[_170]=function(){
var args=[];
if((_174)&&(!arguments.length)){
var evt=null;
try{
if(obj.ownerDocument){
evt=obj.ownerDocument.parentWindow.event;
}else{
if(obj.documentElement){
evt=obj.documentElement.ownerDocument.parentWindow.event;
}else{
evt=window.event;
}
}
}
catch(e){
evt=window.event;
}
if(evt){
args.push(vuit.event.browser.fixEvent(evt,this));
}
}else{
for(var x=0;x<arguments.length;x++){
if((x==0)&&(_174)&&(vuit.event.browser.isEvent(arguments[x]))){
args.push(vuit.event.browser.fixEvent(arguments[x],this));
}else{
args.push(arguments[x]);
}
}
}
return _173.run.apply(_173,args);
};
obj[_170].__preJoinArity=_175;
}
return _173;
};
vuit.lang.extend(vuit.event.MethodJoinPoint,{unintercept:function(){
this.object[this.methodname]=this.methodfunc;
this.before=[];
this.after=[];
this.around=[];
},disconnect:vuit.lang.forward("unintercept"),run:function(){
var obj=this.object||vuit_global;
var args=arguments;
var _17b=[];
for(var x=0;x<args.length;x++){
_17b[x]=args[x];
}
var _17d=function(marr){
if(!marr){
vuit.debug("Null argument to unrollAdvice()");
return;
}
var _17f=marr[0]||vuit_global;
var _180=marr[1];
if(!_17f[_180]){
vuit.raise("function \""+_180+"\" does not exist on \""+_17f+"\"");
}
var _181=marr[2]||vuit_global;
var _182=marr[3];
var msg=marr[6];
var _184;
var to={args:[],jp_:this,object:obj,proceed:function(){
return _17f[_180].apply(_17f,to.args);
}};
to.args=_17b;
var _186=parseInt(marr[4]);
var _187=((!isNaN(_186))&&(marr[4]!==null)&&(typeof marr[4]!="undefined"));
if(marr[5]){
var rate=parseInt(marr[5]);
var cur=new Date();
var _18a=false;
if((marr["last"])&&((cur-marr.last)<=rate)){
if(vuit.event.canTimeout){
if(marr["delayTimer"]){
clearTimeout(marr.delayTimer);
}
var tod=parseInt(rate*2);
var mcpy=vuit.lang.shallowCopy(marr);
marr.delayTimer=setTimeout(function(){
mcpy[5]=0;
_17d(mcpy);
},tod);
}
return;
}else{
marr.last=cur;
}
}
if(_182){
_181[_182].call(_181,to);
}else{
if((_187)&&((vuit.render.html)||(vuit.render.svg))){
vuit_global["setTimeout"](function(){
if(msg){
_17f[_180].call(_17f,to);
}else{
_17f[_180].apply(_17f,args);
}
},_186);
}else{
if(msg){
_17f[_180].call(_17f,to);
}else{
_17f[_180].apply(_17f,args);
}
}
}
};
if(this.before.length>0){
vuit.lang.forEach(this.before.concat(new Array()),_17d);
}
var _18d;
if(this.around.length>0){
var mi=new vuit.event.MethodInvocation(this,obj,args);
_18d=mi.proceed();
}else{
if(this.methodfunc){
_18d=this.object[this.methodname].apply(this.object,args);
}
}
if(this.after.length>0){
vuit.lang.forEach(this.after.concat(new Array()),_17d);
}
return (this.methodfunc)?_18d:null;
},getArr:function(kind){
var arr=this.after;
if((typeof kind=="string")&&(kind.indexOf("before")!=-1)){
arr=this.before;
}else{
if(kind=="around"){
arr=this.around;
}
}
return arr;
},kwAddAdvice:function(args){
this.addAdvice(args["adviceObj"],args["adviceFunc"],args["aroundObj"],args["aroundFunc"],args["adviceType"],args["precedence"],args["once"],args["delay"],args["rate"],args["adviceMsg"]);
},addAdvice:function(_192,_193,_194,_195,_196,_197,once,_199,rate,_19b){
var arr=this.getArr(_196);
if(!arr){
vuit.raise("bad this: "+this);
}
var ao=[_192,_193,_194,_195,_199,rate,_19b];
if(once){
if(this.hasAdvice(_192,_193,_196,arr)>=0){
return;
}
}
if(_197=="first"){
arr.unshift(ao);
}else{
arr.push(ao);
}
},hasAdvice:function(_19e,_19f,_1a0,arr){
if(!arr){
arr=this.getArr(_1a0);
}
var ind=-1;
for(var x=0;x<arr.length;x++){
var aao=(typeof _19f=="object")?(new String(_19f)).toString():_19f;
var a1o=(typeof arr[x][1]=="object")?(new String(arr[x][1])).toString():arr[x][1];
if((arr[x][0]==_19e)&&(a1o==aao)){
ind=x;
}
}
return ind;
},removeAdvice:function(_1a6,_1a7,_1a8,once){
var arr=this.getArr(_1a8);
var ind=this.hasAdvice(_1a6,_1a7,_1a8,arr);
if(ind==-1){
return false;
}
while(ind!=-1){
arr.splice(ind,1);
if(once){
break;
}
ind=this.hasAdvice(_1a6,_1a7,_1a8,arr);
}
return true;
}});
vuit.provide("vuit.event.topic");
vuit.event.topic=new function(){
this.topics={};
this.getTopic=function(_1ac){
if(!this.topics[_1ac]){
this.topics[_1ac]=new this.TopicImpl(_1ac);
}
return this.topics[_1ac];
};
this.registerPublisher=function(_1ad,obj,_1af){
var _1ad=this.getTopic(_1ad);
_1ad.registerPublisher(obj,_1af);
};
this.subscribe=function(_1b0,obj,_1b2){
var _1b0=this.getTopic(_1b0);
_1b0.subscribe(obj,_1b2);
};
this.unsubscribe=function(_1b3,obj,_1b5){
var _1b3=this.getTopic(_1b3);
_1b3.unsubscribe(obj,_1b5);
};
this.destroy=function(_1b6){
this.getTopic(_1b6).destroy();
delete this.topics[_1b6];
};
this.publishApply=function(_1b7,args){
var _1b7=this.getTopic(_1b7);
_1b7.sendMessage.apply(_1b7,args);
};
this.publish=function(_1b9,_1ba){
var _1b9=this.getTopic(_1b9);
var args=[];
for(var x=1;x<arguments.length;x++){
args.push(arguments[x]);
}
_1b9.sendMessage.apply(_1b9,args);
};
};
vuit.event.topic.TopicImpl=function(_1bd){
this.topicName=_1bd;
this.subscribe=function(_1be,_1bf){
var tf=_1bf||_1be;
var to=(!_1bf)?vuit_global:_1be;
vuit.event.kwConnect({srcObj:this,srcFunc:"sendMessage",adviceObj:to,adviceFunc:tf});
};
this.unsubscribe=function(_1c2,_1c3){
var tf=(!_1c3)?_1c2:_1c3;
var to=(!_1c3)?null:_1c2;
vuit.event.kwDisconnect({srcObj:this,srcFunc:"sendMessage",adviceObj:to,adviceFunc:tf});
};
this.destroy=function(){
vuit.event.MethodJoinPoint.getForMethod(this,"sendMessage").disconnect();
};
this.registerPublisher=function(_1c6,_1c7){
vuit.event.connect(_1c6,_1c7,this,"sendMessage");
};
this.sendMessage=function(_1c8){
};
};
vuit.provide("vuit.event.browser");
vuit._ie_clobber=new function(){
this.clobberNodes=[];
function nukeProp(node,prop){
try{
node[prop]=null;
}
catch(e){
}
try{
delete node[prop];
}
catch(e){
}
try{
node.removeAttribute(prop);
}
catch(e){
}
}
this.clobber=function(_1cb){
var na;
var tna;
if(_1cb){
tna=_1cb.all||_1cb.getElementsByTagName("*");
na=[_1cb];
for(var x=0;x<tna.length;x++){
if(tna[x]["__doClobber__"]){
na.push(tna[x]);
}
}
}else{
try{
window.onload=null;
}
catch(e){
}
na=(this.clobberNodes.length)?this.clobberNodes:document.all;
}
tna=null;
var _1cf={};
for(var i=na.length-1;i>=0;i=i-1){
var el=na[i];
if(el["__clobberAttrs__"]){
for(var j=0;j<el.__clobberAttrs__.length;j++){
nukeProp(el,el.__clobberAttrs__[j]);
}
nukeProp(el,"__clobberAttrs__");
nukeProp(el,"__doClobber__");
}
}
na=null;
};
};
if(vuit.render.html.ie){
vuit.addOnUnload(function(){
vuit._ie_clobber.clobber();
try{
if((vuit["widget"])&&(vuit.widget["manager"])){
vuit.widget.manager.destroyAll();
}
}
catch(e){
}
try{
window.onload=null;
}
catch(e){
}
try{
window.onunload=null;
}
catch(e){
}
vuit._ie_clobber.clobberNodes=[];
});
}
vuit.event.browser=new function(){
var _1d3=0;
this.clean=function(node){
if(vuit.render.html.ie){
vuit._ie_clobber.clobber(node);
}
};
this.addClobberNode=function(node){
if(!vuit.render.html.ie){
return;
}
if(!node["__doClobber__"]){
node.__doClobber__=true;
vuit._ie_clobber.clobberNodes.push(node);
node.__clobberAttrs__=[];
}
};
this.addClobberNodeAttrs=function(node,_1d7){
if(!vuit.render.html.ie){
return;
}
this.addClobberNode(node);
for(var x=0;x<_1d7.length;x++){
node.__clobberAttrs__.push(_1d7[x]);
}
};
this.removeListener=function(node,_1da,fp,_1dc){
if(!_1dc){
var _1dc=false;
}
_1da=_1da.toLowerCase();
if(_1da.substr(0,2)=="on"){
_1da=_1da.substr(2);
}
if(node.removeEventListener){
node.removeEventListener(_1da,fp,_1dc);
}
};
this.addListener=function(node,_1de,fp,_1e0,_1e1){
if(!node){
return;
}
if(!_1e0){
var _1e0=false;
}
_1de=_1de.toLowerCase();
if(_1de.substr(0,2)!="on"){
_1de="on"+_1de;
}
if(!_1e1){
var _1e2=function(evt){
if(!evt){
evt=window.event;
}
var ret=fp(vuit.event.browser.fixEvent(evt,this));
if(_1e0){
vuit.event.browser.stopEvent(evt);
}
return ret;
};
}else{
_1e2=fp;
}
if(node.addEventListener){
node.addEventListener(_1de.substr(2),_1e2,_1e0);
return _1e2;
}else{
if(typeof node[_1de]=="function"){
var _1e5=node[_1de];
node[_1de]=function(e){
_1e5(e);
return _1e2(e);
};
}else{
node[_1de]=_1e2;
}
if(vuit.render.html.ie){
this.addClobberNodeAttrs(node,[_1de]);
}
return _1e2;
}
};
this.isEvent=function(obj){
return (typeof obj!="undefined")&&(typeof Event!="undefined")&&(obj.eventPhase);
};
this.currentEvent=null;
this.callListener=function(_1e8,_1e9){
if(typeof _1e8!="function"){
vuit.raise("listener not a function: "+_1e8);
}
vuit.event.browser.currentEvent.currentTarget=_1e9;
return _1e8.call(_1e9,vuit.event.browser.currentEvent);
};
this.stopPropagation=function(){
vuit.event.browser.currentEvent.cancelBubble=true;
};
this.preventDefault=function(){
vuit.event.browser.currentEvent.returnValue=false;
};
this.keys={KEY_BACKSPACE:8,KEY_TAB:9,KEY_ENTER:13,KEY_SHIFT:16,KEY_CTRL:17,KEY_ALT:18,KEY_PAUSE:19,KEY_CAPS_LOCK:20,KEY_ESCAPE:27,KEY_SPACE:32,KEY_PAGE_UP:33,KEY_PAGE_DOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT_ARROW:37,KEY_UP_ARROW:38,KEY_RIGHT_ARROW:39,KEY_DOWN_ARROW:40,KEY_INSERT:45,KEY_DELETE:46,KEY_LEFT_WINDOW:91,KEY_RIGHT_WINDOW:92,KEY_SELECT:93,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_NUM_LOCK:144,KEY_SCROLL_LOCK:145};
this.revKeys=[];
for(var key in this.keys){
this.revKeys[this.keys[key]]=key;
}
this.fixEvent=function(evt,_1ec){
if((!evt)&&(window["event"])){
var evt=window.event;
}
if((evt["type"])&&(evt["type"].indexOf("key")==0)){
evt.keys=this.revKeys;
for(var key in this.keys){
evt[key]=this.keys[key];
}
if((vuit.render.html.ie)&&(evt["type"]=="keypress")){
evt.charCode=evt.keyCode;
}
}
if(vuit.render.html.ie){
if(!evt.target){
evt.target=evt.srcElement;
}
if(!evt.currentTarget){
evt.currentTarget=(_1ec?_1ec:evt.srcElement);
}
if(!evt.layerX){
evt.layerX=evt.offsetX;
}
if(!evt.layerY){
evt.layerY=evt.offsetY;
}
var _1ee=((vuit.render.html.ie55)||(document["compatMode"]=="BackCompat"))?document.body:document.documentElement;
if(!evt.pageX){
evt.pageX=evt.clientX+(_1ee.scrollLeft||0);
}
if(!evt.pageY){
evt.pageY=evt.clientY+(_1ee.scrollTop||0);
}
if(evt.type=="mouseover"){
evt.relatedTarget=evt.fromElement;
}
if(evt.type=="mouseout"){
evt.relatedTarget=evt.toElement;
}
this.currentEvent=evt;
evt.callListener=this.callListener;
evt.stopPropagation=this.stopPropagation;
evt.preventDefault=this.preventDefault;
}
return evt;
};
this.stopEvent=function(ev){
if(window.event){
ev.returnValue=false;
ev.cancelBubble=true;
}else{
ev.preventDefault();
ev.stopPropagation();
}
};
};
vuit.provide("vuit.event.*");
vuit.provide("vuit.string.common");
vuit.string.trim=function(str,wh){
if(!str.replace){
return str;
}
if(!str.length){
return str;
}
var re=(wh>0)?(/^\s+/):(wh<0)?(/\s+$/):(/^\s+|\s+$/g);
return str.replace(re,"");
};
vuit.string.trimStart=function(str){
return vuit.string.trim(str,1);
};
vuit.string.trimEnd=function(str){
return vuit.string.trim(str,-1);
};
vuit.string.repeat=function(str,_1f6,_1f7){
var out="";
for(var i=0;i<_1f6;i++){
out+=str;
if(_1f7&&i<_1f6-1){
out+=_1f7;
}
}
return out;
};
vuit.string.pad=function(str,len,c,dir){
var out=String(str);
if(!c){
c="0";
}
if(!dir){
dir=1;
}
while(out.length<len){
if(dir>0){
out=c+out;
}else{
out+=c;
}
}
return out;
};
vuit.string.padLeft=function(str,len,c){
return vuit.string.pad(str,len,c,1);
};
vuit.string.padRight=function(str,len,c){
return vuit.string.pad(str,len,c,-1);
};
vuit.provide("vuit.string");
vuit.provide("vuit.io.IO");
vuit.io.transports=[];
vuit.io.hdlrFuncNames=["load","error","timeout"];
vuit.io.Request=function(url,_206,_207,_208){
if((arguments.length==1)&&(arguments[0].constructor==Object)){
this.fromKwArgs(arguments[0]);
}else{
this.url=url;
if(_206){
this.mimetype=_206;
}
if(_207){
this.transport=_207;
}
if(arguments.length>=4){
this.changeUrl=_208;
}
}
};
vuit.lang.extend(vuit.io.Request,{url:"",mimetype:"text/plain",method:"GET",content:undefined,transport:undefined,changeUrl:undefined,formNode:undefined,sync:false,bindSuccess:false,useCache:false,preventCache:false,load:function(type,data,evt){
},error:function(type,_20d){
},timeout:function(type){
},handle:function(){
},timeoutSeconds:0,abort:function(){
},fromKwArgs:function(_20f){
if(_20f["url"]){
_20f.url=_20f.url.toString();
}
if(_20f["formNode"]){
_20f.formNode=vuit.byId(_20f.formNode);
}
if(!_20f["method"]&&_20f["formNode"]&&_20f["formNode"].method){
_20f.method=_20f["formNode"].method;
}
if(!_20f["handle"]&&_20f["handler"]){
_20f.handle=_20f.handler;
}
if(!_20f["load"]&&_20f["loaded"]){
_20f.load=_20f.loaded;
}
if(!_20f["changeUrl"]&&_20f["changeURL"]){
_20f.changeUrl=_20f.changeURL;
}
_20f.encoding=vuit.lang.firstValued(_20f["encoding"],vuitConfig["bindEncoding"],"");
_20f.sendTransport=vuit.lang.firstValued(_20f["sendTransport"],vuitConfig["ioSendTransport"],false);
var _210=vuit.lang.isFunction;
for(var x=0;x<vuit.io.hdlrFuncNames.length;x++){
var fn=vuit.io.hdlrFuncNames[x];
if(_20f[fn]&&_210(_20f[fn])){
continue;
}
if(_20f["handle"]&&_210(_20f["handle"])){
_20f[fn]=_20f.handle;
}
}
vuit.lang.mixin(this,_20f);
}});
vuit.io.Error=function(msg,type,num){
this.message=msg;
this.type=type||"unknown";
this.number=num||0;
};
vuit.io.transports.addTransport=function(name){
this.push(name);
this[name]=vuit.io[name];
};
vuit.io.bind=function(_217){
if(!(_217 instanceof vuit.io.Request)){
try{
_217=new vuit.io.Request(_217);
}
catch(e){
vuit.debug(e);
}
}
var _218="";
if(_217["transport"]){
_218=_217["transport"];
if(!this[_218]){
return _217;
}
}else{
for(var x=0;x<vuit.io.transports.length;x++){
var tmp=vuit.io.transports[x];
if((this[tmp])&&(this[tmp].canHandle(_217))){
_218=tmp;
}
}
if(_218==""){
return _217;
}
}
this[_218].bind(_217);
_217.bindSuccess=true;
return _217;
};
vuit.io.queueBind=function(_21b){
if(!(_21b instanceof vuit.io.Request)){
try{
_21b=new vuit.io.Request(_21b);
}
catch(e){
vuit.debug(e);
}
}
var _21c=_21b.load;
_21b.load=function(){
vuit.io._queueBindInFlight=false;
var ret=_21c.apply(this,arguments);
vuit.io._dispatchNextQueueBind();
return ret;
};
var _21e=_21b.error;
_21b.error=function(){
vuit.io._queueBindInFlight=false;
var ret=_21e.apply(this,arguments);
vuit.io._dispatchNextQueueBind();
return ret;
};
vuit.io._bindQueue.push(_21b);
vuit.io._dispatchNextQueueBind();
return _21b;
};
vuit.io._dispatchNextQueueBind=function(){
if(!vuit.io._queueBindInFlight){
vuit.io._queueBindInFlight=true;
if(vuit.io._bindQueue.length>0){
vuit.io.bind(vuit.io._bindQueue.shift());
}else{
vuit.io._queueBindInFlight=false;
}
}
};
vuit.io._bindQueue=[];
vuit.io._queueBindInFlight=false;
vuit.io.argsFromMap=function(map,_221,last){
var enc=/utf/i.test(_221||"")?encodeURIComponent:vuit.string.encodeAscii;
var _224=[];
var _225=new Object();
for(var name in map){
var _227=function(elt){
var val=enc(name)+"="+enc(elt);
_224[(last==name)?"push":"unshift"](val);
};
if(!_225[name]){
var _22a=map[name];
if(vuit.lang.isArray(_22a)){
vuit.lang.forEach(_22a,_227);
}else{
_227(_22a);
}
}
}
return _224.join("&");
};
vuit.io.setIFrameSrc=function(_22b,src,_22d){
try{
var r=vuit.render.html;
if(!_22d){
if(r.safari){
_22b.location=src;
}else{
frames[_22b.name].location=src;
}
}else{
var idoc;
if(r.ie){
idoc=_22b.contentWindow.document;
}else{
if(r.safari){
idoc=_22b.document;
}else{
idoc=_22b.contentWindow;
}
}
if(!idoc){
_22b.location=src;
return;
}else{
idoc.location.replace(src);
}
}
}
catch(e){
vuit.debug(e);
vuit.debug("setIFrameSrc: "+e);
}
};
vuit.provide("vuit.string.extras");
vuit.string.substituteParams=function(_230,hash){
var map=(typeof hash=="object")?hash:vuit.lang.toArray(arguments,1);
return _230.replace(/\%\{(\w+)\}/g,function(_233,key){
return map[key]||vuit.raise("Substitution not found: "+key);
});
};
vuit.string.capitalize=function(str){
if(!vuit.lang.isString(str)){
return "";
}
if(arguments.length==0){
str=this;
}
var _236=str.split(" ");
for(var i=0;i<_236.length;i++){
_236[i]=_236[i].charAt(0).toUpperCase()+_236[i].substring(1);
}
return _236.join(" ");
};
vuit.string.isBlank=function(str){
if(!vuit.lang.isString(str)){
return true;
}
return (vuit.string.trim(str).length==0);
};
vuit.string.encodeAscii=function(str){
if(!vuit.lang.isString(str)){
return str;
}
var ret="";
var _23b=escape(str);
var _23c,re=/%u([0-9A-F]{4})/i;
while((_23c=_23b.match(re))){
var num=Number("0x"+_23c[1]);
var _23e=escape("&#"+num+";");
ret+=_23b.substring(0,_23c.index)+_23e;
_23b=_23b.substring(_23c.index+_23c[0].length);
}
ret+=_23b.replace(/\+/g,"%2B");
return ret;
};
vuit.string.escape=function(type,str){
var args=vuit.lang.toArray(arguments,1);
switch(type.toLowerCase()){
case "xml":
case "html":
case "xhtml":
return vuit.string.escapeXml.apply(this,args);
case "sql":
return vuit.string.escapeSql.apply(this,args);
case "regexp":
case "regex":
return vuit.string.escapeRegExp.apply(this,args);
case "javascript":
case "jscript":
case "js":
return vuit.string.escapeJavaScript.apply(this,args);
case "ascii":
return vuit.string.encodeAscii.apply(this,args);
default:
return str;
}
};
vuit.string.escapeXml=function(str,_243){
str=str.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;");
if(!_243){
str=str.replace(/'/gm,"&#39;");
}
return str;
};
vuit.string.escapeSql=function(str){
return str.replace(/'/gm,"''");
};
vuit.string.escapeRegExp=function(str){
return str.replace(/\\/gm,"\\\\").replace(/([\f\b\n\t\r[\^$|?*+(){}])/gm,"\\$1");
};
vuit.string.escapeJavaScript=function(str){
return str.replace(/(["'\f\b\n\t\r])/gm,"\\$1");
};
vuit.string.escapeString=function(str){
return ("\""+str.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");
};
vuit.string.summary=function(str,len){
if(!len||str.length<=len){
return str;
}else{
return str.substring(0,len).replace(/\.+$/,"")+"...";
}
};
vuit.string.endsWith=function(str,end,_24c){
if(_24c){
str=str.toLowerCase();
end=end.toLowerCase();
}
if((str.length-end.length)<0){
return false;
}
return str.lastIndexOf(end)==str.length-end.length;
};
vuit.string.endsWithAny=function(str){
for(var i=1;i<arguments.length;i++){
if(vuit.string.endsWith(str,arguments[i])){
return true;
}
}
return false;
};
vuit.string.startsWith=function(str,_250,_251){
if(_251){
str=str.toLowerCase();
_250=_250.toLowerCase();
}
return str.indexOf(_250)==0;
};
vuit.string.startsWithAny=function(str){
for(var i=1;i<arguments.length;i++){
if(vuit.string.startsWith(str,arguments[i])){
return true;
}
}
return false;
};
vuit.string.has=function(str){
for(var i=1;i<arguments.length;i++){
if(str.indexOf(arguments[i])>-1){
return true;
}
}
return false;
};
vuit.string.normalizeNewlines=function(text,_257){
if(_257=="\n"){
text=text.replace(/\r\n/g,"\n");
text=text.replace(/\r/g,"\n");
}else{
if(_257=="\r"){
text=text.replace(/\r\n/g,"\r");
text=text.replace(/\n/g,"\r");
}else{
text=text.replace(/([^\r])\n/g,"$1\r\n");
text=text.replace(/\r([^\n])/g,"\r\n$1");
}
}
return text;
};
vuit.string.splitEscaped=function(str,_259){
var _25a=[];
for(var i=0,prevcomma=0;i<str.length;i++){
if(str.charAt(i)=="\\"){
i++;
continue;
}
if(str.charAt(i)==_259){
_25a.push(str.substring(prevcomma,i));
prevcomma=i+1;
}
}
_25a.push(str.substr(prevcomma));
return _25a;
};
vuit.provide("vuit.dom");
vuit.dom.ELEMENT_NODE=1;
vuit.dom.ATTRIBUTE_NODE=2;
vuit.dom.TEXT_NODE=3;
vuit.dom.CDATA_SECTION_NODE=4;
vuit.dom.ENTITY_REFERENCE_NODE=5;
vuit.dom.ENTITY_NODE=6;
vuit.dom.PROCESSING_INSTRUCTION_NODE=7;
vuit.dom.COMMENT_NODE=8;
vuit.dom.DOCUMENT_NODE=9;
vuit.dom.DOCUMENT_TYPE_NODE=10;
vuit.dom.DOCUMENT_FRAGMENT_NODE=11;
vuit.dom.NOTATION_NODE=12;
vuit.dom.vuitml="http://www.dojotoolkit.org/2004/vuitml";
vuit.dom.xmlns={svg:"http://www.w3.org/2000/svg",smil:"http://www.w3.org/2001/SMIL20/",mml:"http://www.w3.org/1998/Math/MathML",cml:"http://www.xml-cml.org",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml",xul:"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",xbl:"http://www.mozilla.org/xbl",fo:"http://www.w3.org/1999/XSL/Format",xsl:"http://www.w3.org/1999/XSL/Transform",xslt:"http://www.w3.org/1999/XSL/Transform",xi:"http://www.w3.org/2001/XInclude",xforms:"http://www.w3.org/2002/01/xforms",saxon:"http://icl.com/saxon",xalan:"http://xml.apache.org/xslt",xsd:"http://www.w3.org/2001/XMLSchema",dt:"http://www.w3.org/2001/XMLSchema-datatypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/",dcq:"http://purl.org/dc/qualifiers/1.0","soap-env":"http://schemas.xmlsoap.org/soap/envelope/",wsdl:"http://schemas.xmlsoap.org/wsdl/",AdobeExtensions:"http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"};
vuit.dom.isNode=function(wh){
if(typeof Element=="object"){
try{
return wh instanceof Element;
}
catch(E){
}
}else{
return wh&&!isNaN(wh.nodeType);
}
};
vuit.dom.getUniqueId=function(){
var _25d=vuit.doc();
do{
var id="vuit_unique_"+(++arguments.callee._idIncrement);
}while(_25d.getElementById(id));
return id;
};
vuit.dom.getUniqueId._idIncrement=0;
vuit.dom.firstElement=vuit.dom.getFirstChildElement=function(_25f,_260){
var node=_25f.firstChild;
while(node&&node.nodeType!=vuit.dom.ELEMENT_NODE){
node=node.nextSibling;
}
if(_260&&node&&node.tagName&&node.tagName.toLowerCase()!=_260.toLowerCase()){
node=vuit.dom.nextElement(node,_260);
}
return node;
};
vuit.dom.lastElement=vuit.dom.getLastChildElement=function(_262,_263){
var node=_262.lastChild;
while(node&&node.nodeType!=vuit.dom.ELEMENT_NODE){
node=node.previousSibling;
}
if(_263&&node&&node.tagName&&node.tagName.toLowerCase()!=_263.toLowerCase()){
node=vuit.dom.prevElement(node,_263);
}
return node;
};
vuit.dom.nextElement=vuit.dom.getNextSiblingElement=function(node,_266){
if(!node){
return null;
}
do{
node=node.nextSibling;
}while(node&&node.nodeType!=vuit.dom.ELEMENT_NODE);
if(node&&_266&&_266.toLowerCase()!=node.tagName.toLowerCase()){
return vuit.dom.nextElement(node,_266);
}
return node;
};
vuit.dom.prevElement=vuit.dom.getPreviousSiblingElement=function(node,_268){
if(!node){
return null;
}
if(_268){
_268=_268.toLowerCase();
}
do{
node=node.previousSibling;
}while(node&&node.nodeType!=vuit.dom.ELEMENT_NODE);
if(node&&_268&&_268.toLowerCase()!=node.tagName.toLowerCase()){
return vuit.dom.prevElement(node,_268);
}
return node;
};
vuit.dom.moveChildren=function(_269,_26a,trim){
var _26c=0;
if(trim){
while(_269.hasChildNodes()&&_269.firstChild.nodeType==vuit.dom.TEXT_NODE){
_269.removeChild(_269.firstChild);
}
while(_269.hasChildNodes()&&_269.lastChild.nodeType==vuit.dom.TEXT_NODE){
_269.removeChild(_269.lastChild);
}
}
while(_269.hasChildNodes()){
_26a.appendChild(_269.firstChild);
_26c++;
}
return _26c;
};
vuit.dom.copyChildren=function(_26d,_26e,trim){
var _270=_26d.cloneNode(true);
return this.moveChildren(_270,_26e,trim);
};
vuit.dom.removeChildren=function(node){
var _272=node.childNodes.length;
while(node.hasChildNodes()){
node.removeChild(node.firstChild);
}
return _272;
};
vuit.dom.replaceChildren=function(node,_274){
vuit.dom.removeChildren(node);
node.appendChild(_274);
};
vuit.dom.removeNode=function(node){
if(node&&node.parentNode){
return node.parentNode.removeChild(node);
}
};
vuit.dom.getAncestors=function(node,_277,_278){
var _279=[];
var _27a=(_277&&(_277 instanceof Function||typeof _277=="function"));
while(node){
if(!_27a||_277(node)){
_279.push(node);
}
if(_278&&_279.length>0){
return _279[0];
}
node=node.parentNode;
}
if(_278){
return null;
}
return _279;
};
vuit.dom.getAncestorsByTag=function(node,tag,_27d){
tag=tag.toLowerCase();
return vuit.dom.getAncestors(node,function(el){
return ((el.tagName)&&(el.tagName.toLowerCase()==tag));
},_27d);
};
vuit.dom.getFirstAncestorByTag=function(node,tag){
return vuit.dom.getAncestorsByTag(node,tag,true);
};
vuit.dom.isDescendantOf=function(node,_282,_283){
if(_283&&node){
node=node.parentNode;
}
while(node){
if(node==_282){
return true;
}
node=node.parentNode;
}
return false;
};
vuit.dom.innerXML=function(node){
if(node.innerXML){
return node.innerXML;
}else{
if(node.xml){
return node.xml;
}else{
if(typeof XMLSerializer!="undefined"){
return (new XMLSerializer()).serializeToString(node);
}
}
}
};
vuit.dom.createDocument=function(){
var doc=null;
var _286=vuit.doc();
if(!vuit_undef("ActiveXObject")){
var _287=["MSXML2","Microsoft","MSXML","MSXML3"];
for(var i=0;i<_287.length;i++){
try{
doc=new ActiveXObject(_287[i]+".XMLDOM");
}
catch(e){
}
if(doc){
break;
}
}
}else{
if((_286.implementation)&&(_286.implementation.createDocument)){
doc=_286.implementation.createDocument("","",null);
}
}
return doc;
};
vuit.dom.createDocumentFromText=function(str,_28a){
if(!_28a){
_28a="text/xml";
}
if(!vuit_undef("DOMParser")){
var _28b=new DOMParser();
return _28b.parseFromString(str,_28a);
}else{
if(!vuit_undef("ActiveXObject")){
var _28c=vuit.dom.createDocument();
if(_28c){
_28c.async=false;
_28c.loadXML(str);
return _28c;
}else{
vuit.debug("toXml didn't work?");
}
}else{
var _28d=vuit.doc();
if(_28d.createElement){
var tmp=_28d.createElement("xml");
tmp.innerHTML=str;
if(_28d.implementation&&_28d.implementation.createDocument){
var _28f=_28d.implementation.createDocument("foo","",null);
for(var i=0;i<tmp.childNodes.length;i++){
_28f.importNode(tmp.childNodes.item(i),true);
}
return _28f;
}
return ((tmp.document)&&(tmp.document.firstChild?tmp.document.firstChild:tmp));
}
}
}
return null;
};
vuit.dom.prependChild=function(node,_292){
if(_292.firstChild){
_292.insertBefore(node,_292.firstChild);
}else{
_292.appendChild(node);
}
return true;
};
vuit.dom.insertBefore=function(node,ref,_295){
if(_295!=true&&(node===ref||node.nextSibling===ref)){
return false;
}
var _296=ref.parentNode;
_296.insertBefore(node,ref);
return true;
};
vuit.dom.insertAfter=function(node,ref,_299){
var pn=ref.parentNode;
if(ref==pn.lastChild){
if((_299!=true)&&(node===ref)){
return false;
}
pn.appendChild(node);
}else{
return this.insertBefore(node,ref.nextSibling,_299);
}
return true;
};
vuit.dom.insertAtPosition=function(node,ref,_29d){
if((!node)||(!ref)||(!_29d)){
return false;
}
switch(_29d.toLowerCase()){
case "before":
return vuit.dom.insertBefore(node,ref);
case "after":
return vuit.dom.insertAfter(node,ref);
case "first":
if(ref.firstChild){
return vuit.dom.insertBefore(node,ref.firstChild);
}else{
ref.appendChild(node);
return true;
}
break;
default:
ref.appendChild(node);
return true;
}
};
vuit.dom.insertAtIndex=function(node,_29f,_2a0){
var _2a1=_29f.childNodes;
if(!_2a1.length){
_29f.appendChild(node);
return true;
}
var _2a2=null;
for(var i=0;i<_2a1.length;i++){
var _2a4=_2a1.item(i)["getAttribute"]?parseInt(_2a1.item(i).getAttribute("vuitinsertionindex")):-1;
if(_2a4<_2a0){
_2a2=_2a1.item(i);
}
}
if(_2a2){
return vuit.dom.insertAfter(node,_2a2);
}else{
return vuit.dom.insertBefore(node,_2a1.item(0));
}
};
vuit.dom.textContent=function(node,text){
if(text){
var _2a7=vuit.doc();
vuit.dom.replaceChildren(node,_2a7.createTextNode(text));
return text;
}else{
var _2a8="";
if(node==null){
return _2a8;
}
for(var i=0;i<node.childNodes.length;i++){
switch(node.childNodes[i].nodeType){
case 1:
case 5:
_2a8+=vuit.dom.textContent(node.childNodes[i]);
break;
case 3:
case 2:
case 4:
_2a8+=node.childNodes[i].nodeValue;
break;
default:
break;
}
}
return _2a8;
}
};
vuit.dom.hasParent=function(node){
return node&&node.parentNode&&vuit.dom.isNode(node.parentNode);
};
vuit.dom.isTag=function(node){
if(node&&node.tagName){
for(var i=1;i<arguments.length;i++){
if(node.tagName==String(arguments[i])){
return String(arguments[i]);
}
}
}
return "";
};
vuit.dom.setAttributeNS=function(elem,_2ae,_2af,_2b0){
if(elem==null||((elem==undefined)&&(typeof elem=="undefined"))){
vuit.raise("No element given to vuit.dom.setAttributeNS");
}
if(!((elem.setAttributeNS==undefined)&&(typeof elem.setAttributeNS=="undefined"))){
elem.setAttributeNS(_2ae,_2af,_2b0);
}else{
var _2b1=elem.ownerDocument;
var _2b2=_2b1.createNode(2,_2af,_2ae);
_2b2.nodeValue=_2b0;
elem.setAttributeNode(_2b2);
}
};
vuit.provide("vuit.undo.browser");
try{
if((!vuitConfig["preventBackButtonFix"])&&(!vuit.hostenv.post_load_)){
document.write("<iframe style='border: 0px; width: 1px; height: 1px; position: absolute; bottom: 0px; right: 0px; visibility: visible;' name='djhistory' id='djhistory' src='"+(vuit.hostenv.getBaseScriptUri()+"iframe_history.html")+"'></iframe>");
}
}
catch(e){
}
if(vuit.render.html.opera){
vuit.debug("Opera is not supported with vuit.undo.browser, so back/forward detection will not work.");
}
vuit.undo.browser={initialHref:window.location.href,initialHash:window.location.hash,moveForward:false,historyStack:[],forwardStack:[],historyIframe:null,bookmarkAnchor:null,locationTimer:null,setInitialState:function(args){
this.initialState={"url":this.initialHref,"kwArgs":args,"urlHash":this.initialHash};
},addToHistory:function(args){
var hash=null;
if(!this.historyIframe){
this.historyIframe=window.frames["djhistory"];
}
if(!this.bookmarkAnchor){
this.bookmarkAnchor=document.createElement("a");
vuit.body().appendChild(this.bookmarkAnchor);
this.bookmarkAnchor.style.display="none";
}
if((!args["changeUrl"])||(vuit.render.html.ie)){
var url=vuit.hostenv.getBaseScriptUri()+"iframe_history.html?"+(new Date()).getTime();
this.moveForward=true;
vuit.io.setIFrameSrc(this.historyIframe,url,false);
}
if(args["changeUrl"]){
this.changingUrl=true;
hash="#"+((args["changeUrl"]!==true)?args["changeUrl"]:(new Date()).getTime());
setTimeout("window.location.href = '"+hash+"'; vuit.undo.browser.changingUrl = false;",1);
this.bookmarkAnchor.href=hash;
if(vuit.render.html.ie){
var _2b7=args["back"]||args["backButton"]||args["handle"];
var tcb=function(_2b9){
if(window.location.hash!=""){
setTimeout("window.location.href = '"+hash+"';",1);
}
_2b7.apply(this,[_2b9]);
};
if(args["back"]){
args.back=tcb;
}else{
if(args["backButton"]){
args.backButton=tcb;
}else{
if(args["handle"]){
args.handle=tcb;
}
}
}
this.forwardStack=[];
var _2ba=args["forward"]||args["forwardButton"]||args["handle"];
var tfw=function(_2bc){
if(window.location.hash!=""){
window.location.href=hash;
}
if(_2ba){
_2ba.apply(this,[_2bc]);
}
};
if(args["forward"]){
args.forward=tfw;
}else{
if(args["forwardButton"]){
args.forwardButton=tfw;
}else{
if(args["handle"]){
args.handle=tfw;
}
}
}
}else{
if(vuit.render.html.moz){
if(!this.locationTimer){
this.locationTimer=setInterval("vuit.undo.browser.checkLocation();",200);
}
}
}
}
this.historyStack.push({"url":url,"kwArgs":args,"urlHash":hash});
},checkLocation:function(){
if(!this.changingUrl){
var hsl=this.historyStack.length;
if((window.location.hash==this.initialHash||window.location.href==this.initialHref)&&(hsl==1)){
this.handleBackButton();
return;
}
if(this.forwardStack.length>0){
if(this.forwardStack[this.forwardStack.length-1].urlHash==window.location.hash){
this.handleForwardButton();
return;
}
}
if((hsl>=2)&&(this.historyStack[hsl-2])){
if(this.historyStack[hsl-2].urlHash==window.location.hash){
this.handleBackButton();
return;
}
}
}
},iframeLoaded:function(evt,_2bf){
if(!vuit.render.html.opera){
var _2c0=this._getUrlQuery(_2bf.href);
if(_2c0==null){
if(this.historyStack.length==1){
this.handleBackButton();
}
return;
}
if(this.moveForward){
this.moveForward=false;
return;
}
if(this.historyStack.length>=2&&_2c0==this._getUrlQuery(this.historyStack[this.historyStack.length-2].url)){
this.handleBackButton();
}else{
if(this.forwardStack.length>0&&_2c0==this._getUrlQuery(this.forwardStack[this.forwardStack.length-1].url)){
this.handleForwardButton();
}
}
}
},handleBackButton:function(){
var _2c1=this.historyStack.pop();
if(!_2c1){
return;
}
var last=this.historyStack[this.historyStack.length-1];
if(!last&&this.historyStack.length==0){
last=this.initialState;
}
if(last){
if(last.kwArgs["back"]){
last.kwArgs["back"]();
}else{
if(last.kwArgs["backButton"]){
last.kwArgs["backButton"]();
}else{
if(last.kwArgs["handle"]){
last.kwArgs.handle("back");
}
}
}
}
this.forwardStack.push(_2c1);
},handleForwardButton:function(){
var last=this.forwardStack.pop();
if(!last){
return;
}
if(last.kwArgs["forward"]){
last.kwArgs.forward();
}else{
if(last.kwArgs["forwardButton"]){
last.kwArgs.forwardButton();
}else{
if(last.kwArgs["handle"]){
last.kwArgs.handle("forward");
}
}
}
this.historyStack.push(last);
},_getUrlQuery:function(url){
var _2c5=url.split("?");
if(_2c5.length<2){
return null;
}else{
return _2c5[1];
}
}};
vuit.provide("vuit.io.BrowserIO");
vuit.io.checkChildrenForFile=function(node){
var _2c7=false;
var _2c8=node.getElementsByTagName("input");
vuit.lang.forEach(_2c8,function(_2c9){
if(_2c7){
return;
}
if(_2c9.getAttribute("type")=="file"){
_2c7=true;
}
});
return _2c7;
};
vuit.io.formHasFile=function(_2ca){
return vuit.io.checkChildrenForFile(_2ca);
};
vuit.io.updateNode=function(node,_2cc){
node=vuit.byId(node);
var args=_2cc;
if(vuit.lang.isString(_2cc)){
args={url:_2cc};
}
args.mimetype="text/html";
args.load=function(t,d,e){
while(node.firstChild){
if(vuit["event"]){
try{
vuit.event.browser.clean(node.firstChild);
}
catch(e){
}
}
node.removeChild(node.firstChild);
}
node.innerHTML=d;
};
vuit.io.bind(args);
};
vuit.io.formFilter=function(node){
var type=(node.type||"").toLowerCase();
return !node.disabled&&node.name&&!vuit.lang.inArray(["file","submit","image","reset","button"],type);
};
vuit.io.encodeForm=function(_2d3,_2d4,_2d5){
if((!_2d3)||(!_2d3.tagName)||(!_2d3.tagName.toLowerCase()=="form")){
vuit.raise("Attempted to encode a non-form element.");
}
if(!_2d5){
_2d5=vuit.io.formFilter;
}
var enc=/utf/i.test(_2d4||"")?encodeURIComponent:vuit.string.encodeAscii;
var _2d7=[];
for(var i=0;i<_2d3.elements.length;i++){
var elm=_2d3.elements[i];
if(!elm||elm.tagName.toLowerCase()=="fieldset"||!_2d5(elm)){
continue;
}
var name=enc(elm.name);
var type=elm.type.toLowerCase();
if(type=="select-multiple"){
for(var j=0;j<elm.options.length;j++){
if(elm.options[j].selected){
_2d7.push(name+"="+enc(elm.options[j].value));
}
}
}else{
if(vuit.lang.inArray(["radio","checkbox"],type)){
if(elm.checked){
_2d7.push(name+"="+enc(elm.value));
}
}else{
_2d7.push(name+"="+enc(elm.value));
}
}
}
var _2dd=_2d3.getElementsByTagName("input");
for(var i=0;i<_2dd.length;i++){
var _2de=_2dd[i];
if(_2de.type.toLowerCase()=="image"&&_2de.form==_2d3&&_2d5(_2de)){
var name=enc(_2de.name);
_2d7.push(name+"="+enc(_2de.value));
_2d7.push(name+".x=0");
_2d7.push(name+".y=0");
}
}
return _2d7.join("&")+"&";
};
vuit.io.FormBind=function(args){
this.bindArgs={};
if(args&&args.formNode){
this.init(args);
}else{
if(args){
this.init({formNode:args});
}
}
};
vuit.lang.extend(vuit.io.FormBind,{form:null,bindArgs:null,clickedButton:null,init:function(args){
var form=vuit.byId(args.formNode);
if(!form||!form.tagName||form.tagName.toLowerCase()!="form"){
throw new Error("FormBind: Couldn't apply, invalid form");
}else{
if(this.form==form){
return;
}else{
if(this.form){
throw new Error("FormBind: Already applied to a form");
}
}
}
vuit.lang.mixin(this.bindArgs,args);
this.form=form;
this.connect(form,"onsubmit","submit");
for(var i=0;i<form.elements.length;i++){
var node=form.elements[i];
if(node&&node.type&&vuit.lang.inArray(["submit","button"],node.type.toLowerCase())){
this.connect(node,"onclick","click");
}
}
var _2e4=form.getElementsByTagName("input");
for(var i=0;i<_2e4.length;i++){
var _2e5=_2e4[i];
if(_2e5.type.toLowerCase()=="image"&&_2e5.form==form){
this.connect(_2e5,"onclick","click");
}
}
},onSubmit:function(form){
return true;
},submit:function(e){
e.preventDefault();
if(this.onSubmit(this.form)){
vuit.io.bind(vuit.lang.mixin(this.bindArgs,{formFilter:vuit.lang.hitch(this,"formFilter")}));
}
},click:function(e){
var node=e.currentTarget;
if(node.disabled){
return;
}
this.clickedButton=node;
},formFilter:function(node){
var type=(node.type||"").toLowerCase();
var _2ec=false;
if(node.disabled||!node.name){
_2ec=false;
}else{
if(vuit.lang.inArray(["submit","button","image"],type)){
if(!this.clickedButton){
this.clickedButton=node;
}
_2ec=node==this.clickedButton;
}else{
_2ec=!vuit.lang.inArray(["file","submit","reset","button"],type);
}
}
return _2ec;
},connect:function(_2ed,_2ee,_2ef){
if(vuit.evalObjPath("vuit.event.connect")){
vuit.event.connect(_2ed,_2ee,this,_2ef);
}else{
var fcn=vuit.lang.hitch(this,_2ef);
_2ed[_2ee]=function(e){
if(!e){
e=window.event;
}
if(!e.currentTarget){
e.currentTarget=e.srcElement;
}
if(!e.preventDefault){
e.preventDefault=function(){
window.event.returnValue=false;
};
}
fcn(e);
};
}
}});
vuit.io.XMLHTTPTransport=new function(){
var _2f2=this;
var _2f3={};
this.useCache=false;
this.preventCache=false;
function getCacheKey(url,_2f5,_2f6){
return url+"|"+_2f5+"|"+_2f6.toLowerCase();
}
function addToCache(url,_2f8,_2f9,http){
_2f3[getCacheKey(url,_2f8,_2f9)]=http;
}
function getFromCache(url,_2fc,_2fd){
return _2f3[getCacheKey(url,_2fc,_2fd)];
}
this.clearCache=function(){
_2f3={};
};
function doLoad(_2fe,http,url,_301,_302){
if(((http.status>=200)&&(http.status<300))||(http.status==304)||(location.protocol=="file:"&&(http.status==0||http.status==undefined))||(location.protocol=="chrome:"&&(http.status==0||http.status==undefined))){
var ret;
if(_2fe.method.toLowerCase()=="head"){
var _304=http.getAllResponseHeaders();
ret={};
ret.toString=function(){
return _304;
};
var _305=_304.split(/[\r\n]+/g);
for(var i=0;i<_305.length;i++){
var pair=_305[i].match(/^([^:]+)\s*:\s*(.+)$/i);
if(pair){
ret[pair[1]]=pair[2];
}
}
}else{
if(_2fe.mimetype=="text/javascript"){
try{
ret=vuit_eval(http.responseText);
}
catch(e){
vuit.debug(e);
vuit.debug(http.responseText);
ret=null;
}
}else{
if(_2fe.mimetype=="text/json"){
try{
ret=vuit_eval("("+http.responseText+")");
}
catch(e){
vuit.debug(e);
vuit.debug(http.responseText);
ret=false;
}
}else{
if((_2fe.mimetype=="application/xml")||(_2fe.mimetype=="text/xml")){
ret=http.responseXML;
if(!ret||typeof ret=="string"||!http.getResponseHeader("Content-Type")){
ret=vuit.dom.createDocumentFromText(http.responseText);
}
}else{
ret=http.responseText;
}
}
}
}
if(_302){
addToCache(url,_301,_2fe.method,http);
}
_2fe[(typeof _2fe.load=="function")?"load":"handle"]("load",ret,http,_2fe);
}else{
var _308=new vuit.io.Error("XMLHttpTransport Error: "+http.status+" "+http.statusText);
_2fe[(typeof _2fe.error=="function")?"error":"handle"]("error",_308,http,_2fe);
}
}
function setHeaders(http,_30a){
if(_30a["headers"]){
for(var _30b in _30a["headers"]){
if(_30b.toLowerCase()=="content-type"&&!_30a["contentType"]){
_30a["contentType"]=_30a["headers"][_30b];
}else{
http.setRequestHeader(_30b,_30a["headers"][_30b]);
}
}
}
}
this.inFlight=[];
this.inFlightTimer=null;
this.startWatchingInFlight=function(){
if(!this.inFlightTimer){
this.inFlightTimer=setInterval("vuit.io.XMLHTTPTransport.watchInFlight();",10);
}
};
this.watchInFlight=function(){
var now=null;
for(var x=this.inFlight.length-1;x>=0;x--){
var tif=this.inFlight[x];
if(!tif){
this.inFlight.splice(x,1);
continue;
}
if(4==tif.http.readyState){
this.inFlight.splice(x,1);
doLoad(tif.req,tif.http,tif.url,tif.query,tif.useCache);
}else{
if(tif.startTime){
if(!now){
now=(new Date()).getTime();
}
if(tif.startTime+(tif.req.timeoutSeconds*1000)<now){
if(typeof tif.http.abort=="function"){
tif.http.abort();
}
this.inFlight.splice(x,1);
tif.req[(typeof tif.req.timeout=="function")?"timeout":"handle"]("timeout",null,tif.http,tif.req);
}
}
}
}
if(this.inFlight.length==0){
clearInterval(this.inFlightTimer);
this.inFlightTimer=null;
}
};
var _30f=vuit.hostenv.getXmlhttpObject()?true:false;
this.canHandle=function(_310){
return _30f&&vuit.lang.inArray(["text/plain","text/html","application/xml","text/xml","text/javascript","text/json"],(_310["mimetype"].toLowerCase()||""))&&!(_310["formNode"]&&vuit.io.formHasFile(_310["formNode"]));
};
this.multipartBoundary="45309FFF-BD65-4d50-99C9-36986896A96F";
this.bind=function(_311){
if(!_311["url"]){
if(!_311["formNode"]&&(_311["backButton"]||_311["back"]||_311["changeUrl"]||_311["watchForURL"])&&(!vuitConfig.preventBackButtonFix)){
vuit.deprecated("Using vuit.io.XMLHTTPTransport.bind() to add to browser history without doing an IO request","Use vuit.undo.browser.addToHistory() instead.","0.4");
vuit.undo.browser.addToHistory(_311);
return true;
}
}
var url=_311.url;
var _313="";
if(_311["formNode"]){
var ta=_311.formNode.getAttribute("action");
if((ta)&&(!_311["url"])){
url=ta;
}
var tp=_311.formNode.getAttribute("method");
if((tp)&&(!_311["method"])){
_311.method=tp;
}
_313+=vuit.io.encodeForm(_311.formNode,_311.encoding,_311["formFilter"]);
}
if(url.indexOf("#")>-1){
vuit.debug("Warning: vuit.io.bind: stripping hash values from url:",url);
url=url.split("#")[0];
}
if(_311["file"]){
_311.method="post";
}
if(!_311["method"]){
_311.method="get";
}
if(_311.method.toLowerCase()=="get"){
_311.multipart=false;
}else{
if(_311["file"]){
_311.multipart=true;
}else{
if(!_311["multipart"]){
_311.multipart=false;
}
}
}
if(_311["backButton"]||_311["back"]||_311["changeUrl"]){
vuit.undo.browser.addToHistory(_311);
}
var _316=_311["content"]||{};
if(_311.sendTransport){
_316["vuit.transport"]="xmlhttp";
}
do{
if(_311.postContent){
_313=_311.postContent;
break;
}
if(_316){
_313+=vuit.io.argsFromMap(_316,_311.encoding);
}
if(_311.method.toLowerCase()=="get"||!_311.multipart){
break;
}
var t=[];
if(_313.length){
var q=_313.split("&");
for(var i=0;i<q.length;++i){
if(q[i].length){
var p=q[i].split("=");
t.push("--"+this.multipartBoundary,"Content-Disposition: form-data; name=\""+p[0]+"\"","",p[1]);
}
}
}
if(_311.file){
if(vuit.lang.isArray(_311.file)){
for(var i=0;i<_311.file.length;++i){
var o=_311.file[i];
t.push("--"+this.multipartBoundary,"Content-Disposition: form-data; name=\""+o.name+"\"; filename=\""+("fileName" in o?o.fileName:o.name)+"\"","Content-Type: "+("contentType" in o?o.contentType:"application/octet-stream"),"",o.content);
}
}else{
var o=_311.file;
t.push("--"+this.multipartBoundary,"Content-Disposition: form-data; name=\""+o.name+"\"; filename=\""+("fileName" in o?o.fileName:o.name)+"\"","Content-Type: "+("contentType" in o?o.contentType:"application/octet-stream"),"",o.content);
}
}
if(t.length){
t.push("--"+this.multipartBoundary+"--","");
_313=t.join("\r\n");
}
}while(false);
var _31c=_311["sync"]?false:true;
var _31d=_311["preventCache"]||(this.preventCache==true&&_311["preventCache"]!=false);
var _31e=_311["useCache"]==true||(this.useCache==true&&_311["useCache"]!=false);
if(!_31d&&_31e){
var _31f=getFromCache(url,_313,_311.method);
if(_31f){
doLoad(_311,_31f,url,_313,false);
return;
}
}
var http=vuit.hostenv.getXmlhttpObject(_311);
var _321=false;
if(_31c){
var _322=this.inFlight.push({"req":_311,"http":http,"url":url,"query":_313,"useCache":_31e,"startTime":_311.timeoutSeconds?(new Date()).getTime():0});
this.startWatchingInFlight();
}
if(_311.method.toLowerCase()=="post"){
http.open("POST",url,_31c);
setHeaders(http,_311);
http.setRequestHeader("Content-Type",_311.multipart?("multipart/form-data; boundary="+this.multipartBoundary):(_311.contentType||"application/x-www-form-urlencoded"));
try{
http.send(_313);
}
catch(e){
if(typeof http.abort=="function"){
http.abort();
}
doLoad(_311,{status:404},url,_313,_31e);
}
}else{
var _323=url;
if(_313!=""){
_323+=(_323.indexOf("?")>-1?"&":"?")+_313;
}
if(_31d){
_323+=(vuit.string.endsWithAny(_323,"?","&")?"":(_323.indexOf("?")>-1?"&":"?"))+"vuit.preventCache="+new Date().valueOf();
}
http.open(_311.method.toUpperCase(),_323,_31c);
setHeaders(http,_311);
try{
http.send(null);
}
catch(e){
if(typeof http.abort=="function"){
http.abort();
}
doLoad(_311,{status:404},url,_313,_31e);
}
}
if(!_31c){
doLoad(_311,http,url,_313,_31e);
}
_311.abort=function(){
return http.abort();
};
return;
};
vuit.io.transports.addTransport("XMLHTTPTransport");
};
vuit.provide("vuit.io.cookie");
vuit.io.cookie.setCookie=function(name,_325,days,path,_328,_329){
var _32a=-1;
if(typeof days=="number"&&days>=0){
var d=new Date();
d.setTime(d.getTime()+(days*24*60*60*1000));
_32a=d.toGMTString();
}
_325=escape(_325);
document.cookie=name+"="+_325+";"+(_32a!=-1?" expires="+_32a+";":"")+(path?"path="+path:"")+(_328?"; domain="+_328:"")+(_329?"; secure":"");
};
vuit.io.cookie.set=vuit.io.cookie.setCookie;
vuit.io.cookie.getCookie=function(name){
var idx=document.cookie.lastIndexOf(name+"=");
if(idx==-1){
return null;
}
var _32e=document.cookie.substring(idx+name.length+1);
var end=_32e.indexOf(";");
if(end==-1){
end=_32e.length;
}
_32e=_32e.substring(0,end);
_32e=unescape(_32e);
return _32e;
};
vuit.io.cookie.get=vuit.io.cookie.getCookie;
vuit.io.cookie.deleteCookie=function(name){
vuit.io.cookie.setCookie(name,"-",0);
};
vuit.io.cookie.setObjectCookie=function(name,obj,days,path,_335,_336,_337){
if(arguments.length==5){
_337=_335;
_335=null;
_336=null;
}
var _338=[],cookie,value="";
if(!_337){
cookie=vuit.io.cookie.getObjectCookie(name);
}
if(days>=0){
if(!cookie){
cookie={};
}
for(var prop in obj){
if(prop==null){
delete cookie[prop];
}else{
if(typeof obj[prop]=="string"||typeof obj[prop]=="number"){
cookie[prop]=obj[prop];
}
}
}
prop=null;
for(var prop in cookie){
_338.push(escape(prop)+"="+escape(cookie[prop]));
}
value=_338.join("&");
}
vuit.io.cookie.setCookie(name,value,days,path,_335,_336);
};
vuit.io.cookie.getObjectCookie=function(name){
var _33b=null,cookie=vuit.io.cookie.getCookie(name);
if(cookie){
_33b={};
var _33c=cookie.split("&");
for(var i=0;i<_33c.length;i++){
var pair=_33c[i].split("=");
var _33f=pair[1];
if(isNaN(_33f)){
_33f=unescape(pair[1]);
}
_33b[unescape(pair[0])]=_33f;
}
}
return _33b;
};
vuit.io.cookie.isSupported=function(){
if(typeof navigator.cookieEnabled!="boolean"){
vuit.io.cookie.setCookie("__TestingYourBrowserForCookieSupport__","CookiesAllowed",90,null);
var _340=vuit.io.cookie.getCookie("__TestingYourBrowserForCookieSupport__");
navigator.cookieEnabled=(_340=="CookiesAllowed");
if(navigator.cookieEnabled){
this.deleteCookie("__TestingYourBrowserForCookieSupport__");
}
}
return navigator.cookieEnabled;
};
if(!vuit.io.cookies){
vuit.io.cookies=vuit.io.cookie;
}
vuit.provide("vuit.io.*");
vuit.provide("vuit.uri.Uri");
vuit.uri=new function(){
this.vuitUri=function(uri){
return new vuit.uri.Uri(vuit.hostenv.getBaseScriptUri(),uri);
};
this.nsUri=function(_342,uri){
var ns=vuit.getNamespace(_342);
if(!ns){
return null;
}
var loc=ns.location;
if(loc.lastIndexOf("/")!=loc.length-1){
loc+="/";
}
return new vuit.uri.Uri(vuit.hostenv.getBaseScriptUri()+loc,uri);
};
this.Uri=function(){
var uri=arguments[0];
for(var i=1;i<arguments.length;i++){
if(!arguments[i]){
continue;
}
var _348=new vuit.uri.Uri(arguments[i].toString());
var _349=new vuit.uri.Uri(uri.toString());
if(_348.path==""&&_348.scheme==null&&_348.authority==null&&_348.query==null){
if(_348.fragment!=null){
_349.fragment=_348.fragment;
}
_348=_349;
}else{
if(_348.scheme==null){
_348.scheme=_349.scheme;
if(_348.authority==null){
_348.authority=_349.authority;
if(_348.path.charAt(0)!="/"){
var path=_349.path.substring(0,_349.path.lastIndexOf("/")+1)+_348.path;
var segs=path.split("/");
for(var j=0;j<segs.length;j++){
if(segs[j]=="."){
if(j==segs.length-1){
segs[j]="";
}else{
segs.splice(j,1);
j--;
}
}else{
if(j>0&&!(j==1&&segs[0]=="")&&segs[j]==".."&&segs[j-1]!=".."){
if(j==segs.length-1){
segs.splice(j,1);
segs[j-1]="";
}else{
segs.splice(j-1,2);
j-=2;
}
}
}
}
_348.path=segs.join("/");
}
}
}
}
uri="";
if(_348.scheme!=null){
uri+=_348.scheme+":";
}
if(_348.authority!=null){
uri+="//"+_348.authority;
}
uri+=_348.path;
if(_348.query!=null){
uri+="?"+_348.query;
}
if(_348.fragment!=null){
uri+="#"+_348.fragment;
}
}
this.uri=uri.toString();
var _34d="^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
var r=this.uri.match(new RegExp(_34d));
this.scheme=r[2]||(r[1]?"":null);
this.authority=r[4]||(r[3]?"":null);
this.path=r[5];
this.query=r[7]||(r[6]?"":null);
this.fragment=r[9]||(r[8]?"":null);
if(this.authority!=null){
_34d="^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$";
r=this.authority.match(new RegExp(_34d));
this.user=r[3]||null;
this.password=r[4]||null;
this.host=r[5];
this.port=r[7]||null;
}
this.toString=function(){
return this.uri;
};
};
};
vuit.provide("vuit.uri.*");
vuit.provide("vuit.io.IframeIO");
vuit.io.createIFrame=function(_34f,_350,uri){
if(window[_34f]){
return window[_34f];
}
if(window.frames[_34f]){
return window.frames[_34f];
}
var r=vuit.render.html;
var _353=null;
var turi=uri||vuit.uri.vuitUri("iframe_history.html?noInit=true");
var _355=((r.ie)&&(vuit.render.os.win))?"<iframe name='"+_34f+"' src='"+turi+"' onload='"+_350+"'>":"iframe";
_353=document.createElement(_355);
with(_353){
name=_34f;
setAttribute("name",_34f);
id=_34f;
}
vuit.body().appendChild(_353);
window[_34f]=_353;
with(_353.style){
position="absolute";
left=top="0px";
height=width="1px";
visibility="hidden";
}
if(!r.ie){
vuit.io.setIFrameSrc(_353,turi,true);
_353.onload=new Function(_350);
}
return _353;
};
vuit.io.IframeTransport=new function(){
var _356=this;
this.currentRequest=null;
this.requestQueue=[];
this.iframeName="vuitIoIframe";
this.fireNextRequest=function(){
if((this.currentRequest)||(this.requestQueue.length==0)){
return;
}
var cr=this.currentRequest=this.requestQueue.shift();
cr._contentToClean=[];
var fn=cr["formNode"];
var _359=cr["content"]||{};
if(cr.sendTransport){
_359["vuit.transport"]="iframe";
}
if(fn){
if(_359){
for(var x in _359){
if(!fn[x]){
var tn;
if(vuit.render.html.ie){
tn=document.createElement("<input type='hidden' name='"+x+"' value='"+_359[x]+"'>");
fn.appendChild(tn);
}else{
tn=document.createElement("input");
fn.appendChild(tn);
tn.type="hidden";
tn.name=x;
tn.value=_359[x];
}
cr._contentToClean.push(x);
}else{
fn[x].value=_359[x];
}
}
}
if(cr["url"]){
cr._originalAction=fn.getAttribute("action");
fn.setAttribute("action",cr.url);
}
if(!fn.getAttribute("method")){
fn.setAttribute("method",(cr["method"])?cr["method"]:"post");
}
cr._originalTarget=fn.getAttribute("target");
fn.setAttribute("target",this.iframeName);
fn.target=this.iframeName;
fn.submit();
}else{
var _35c=vuit.io.argsFromMap(this.currentRequest.content);
var _35d=(cr.url.indexOf("?")>-1?"&":"?")+_35c;
vuit.io.setIFrameSrc(this.iframe,_35d,true);
}
};
this.canHandle=function(_35e){
return ((vuit.lang.inArray(["text/plain","text/html","text/javascript","text/json"],_35e["mimetype"]))&&((_35e["formNode"])&&(vuit.io.checkChildrenForFile(_35e["formNode"])))&&(vuit.lang.inArray(["post","get"],_35e["method"].toLowerCase()))&&(!((_35e["sync"])&&(_35e["sync"]==true))));
};
this.bind=function(_35f){
if(!this["iframe"]){
this.setUpIframe();
}
this.requestQueue.push(_35f);
this.fireNextRequest();
return;
};
this.setUpIframe=function(){
this.iframe=vuit.io.createIFrame(this.iframeName,"vuit.io.IframeTransport.iframeOnload();");
};
this.iframeOnload=function(){
if(!_356.currentRequest){
_356.fireNextRequest();
return;
}
var req=_356.currentRequest;
var _361=req._contentToClean;
for(var i=0;i<_361.length;i++){
var key=_361[i];
if(vuit.render.html.safari){
var _364=req.formNode;
for(var j=0;j<_364.childNodes.length;j++){
var _366=_364.childNodes[j];
if(_366.name==key){
var _367=_366.parentNode;
_367.removeChild(_366);
break;
}
}
}else{
if(req.formNode){
var _368=req.formNode[key];
req.formNode.removeChild(_368);
req.formNode[key]=null;
}
}
}
if(req["_originalAction"]){
req.formNode.setAttribute("action",req._originalAction);
}
req.formNode.setAttribute("target",req._originalTarget);
req.formNode.target=req._originalTarget;
var _369=function(_36a){
var doc=_36a.contentDocument||((_36a.contentWindow)&&(_36a.contentWindow.document))||((_36a.name)&&(document.frames[_36a.name])&&(document.frames[_36a.name].document))||null;
return doc;
};
var ifd=_369(_356.iframe);
var _36d;
var _36e=false;
try{
var cmt=req.mimetype;
if((cmt=="text/javascript")||(cmt=="text/json")){
var js=ifd.getElementsByTagName("textarea")[0].value;
if(cmt=="text/json"){
js="("+js+")";
}
_36d=vuit_eval(js);
}else{
if(cmt=="text/html"){
_36d=ifd;
}else{
_36d=ifd.getElementsByTagName("textarea")[0].value;
}
}
_36e=true;
}
catch(e){
var _371=new vuit.io.Error("IframeTransport Error");
if(vuit.lang.isFunction(req["error"])){
req.error("error",_371,req);
}
}
try{
if(_36e&&vuit.lang.isFunction(req["load"])){
req.load("load",_36d,req);
}
}
catch(e){
throw e;
}
finally{
_356.currentRequest=null;
_356.fireNextRequest();
}
};
vuit.io.transports.addTransport("IframeTransport");
};
vuit.provide("vuit.xml.Parse");
vuit.xml.Parse=function(){
function getVuitTagName(node){
var _373=node.tagName;
if(vuit.render.html.capable&&vuit.render.html.ie&&node.scopeName!="HTML"){
_373=node.scopeName+":"+_373;
}
if(_373.substr(0,5).toLowerCase()=="vuit:"){
return _373.toLowerCase();
}
if(_373.substr(0,4).toLowerCase()=="vuit"){
return "vuit:"+_373.substring(4).toLowerCase();
}
var djt=node.getAttribute("vuitType")||node.getAttribute("vuittype");
if(djt){
if(djt.indexOf(":")<0){
djt="vuit:"+djt;
}
return djt.toLowerCase();
}
if(node.getAttributeNS&&node.getAttributeNS(vuit.dom.vuitml,"type")){
return "vuit:"+node.getAttributeNS(vuit.dom.vuitml,"type").toLowerCase();
}
try{
djt=node.getAttribute("vuit:type");
}
catch(e){
}
if(djt){
return "vuit:"+djt.toLowerCase();
}
if(!vuit_global["vuitConfig"]||!vuitConfig["ignoreClassNames"]){
var _375=node.className||node.getAttribute("class");
if(_375&&_375.indexOf&&_375.indexOf("vuit-")!=-1){
var _376=_375.split(" ");
for(var x=0;x<_376.length;x++){
if(_376[x].length>5&&_376[x].indexOf("vuit-")>=0){
return "vuit:"+_376[x].substr(5).toLowerCase();
}
}
}
}
return _373.toLowerCase();
}
this.parseElement=function(node,_379,_37a,_37b){
var _37c={};
if(node.tagName&&node.tagName.indexOf("/")==0){
return null;
}
var _37d=getVuitTagName(node);
_37c[_37d]=[];
if(_37d.substr(0,4).toLowerCase()=="vuit"){
_37c.namespace="vuit";
}else{
var pos=_37d.indexOf(":");
if(pos>0){
_37c.namespace=_37d.substring(0,pos);
}
}
var _37f=false;
if(!_37a){
_37f=true;
}else{
if(_37c.namespace&&vuit.getNamespace(_37c.namespace)){
_37f=true;
}else{
if(vuit.widget.tags[_37d]){
vuit.deprecated("vuit.xml.Parse.parseElement","Widgets should be placed in a defined namespace","0.5");
_37f=true;
}
}
}
if(_37f){
var _380=this.parseAttributes(node);
for(var attr in _380){
if((!_37c[_37d][attr])||(typeof _37c[_37d][attr]!="array")){
_37c[_37d][attr]=[];
}
_37c[_37d][attr].push(_380[attr]);
}
_37c[_37d].nodeRef=node;
_37c.tagName=_37d;
_37c.index=_37b||0;
}
var _382=0;
for(var i=0;i<node.childNodes.length;i++){
var tcn=node.childNodes.item(i);
switch(tcn.nodeType){
case vuit.dom.ELEMENT_NODE:
_382++;
var ctn=getVuitTagName(tcn);
if(!_37c[ctn]){
_37c[ctn]=[];
}
_37c[ctn].push(this.parseElement(tcn,true,_37a,_382));
if((tcn.childNodes.length==1)&&(tcn.childNodes.item(0).nodeType==vuit.dom.TEXT_NODE)){
_37c[ctn][_37c[ctn].length-1].value=tcn.childNodes.item(0).nodeValue;
}
break;
case vuit.dom.TEXT_NODE:
if(node.childNodes.length==1){
_37c[_37d].push({value:node.childNodes.item(0).nodeValue});
}
break;
default:
break;
}
}
return _37c;
};
this.parseAttributes=function(node){
var _387={};
var atts=node.attributes;
var _389,i=0;
while((_389=atts[i++])){
if((vuit.render.html.capable)&&(vuit.render.html.ie)){
if(!_389){
continue;
}
if((typeof _389=="object")&&(typeof _389.nodeValue=="undefined")||(_389.nodeValue==null)||(_389.nodeValue=="")){
continue;
}
}
var nn=_389.nodeName.split(":");
nn=(nn.length==2)?nn[1]:_389.nodeName;
_387[nn]={value:_389.nodeValue};
}
return _387;
};
};
vuit.provide("vuit.lang.declare");
vuit.lang.declare=function(_38b,_38c,init,_38e){
if((vuit.lang.isFunction(_38e))||((!_38e)&&(!vuit.lang.isFunction(init)))){
var temp=_38e;
_38e=init;
init=temp;
}
var _390=[];
if(vuit.lang.isArray(_38c)){
_390=_38c;
_38c=_390.shift();
}
if(!init){
init=vuit.evalObjPath(_38b,false);
if((init)&&(!vuit.lang.isFunction(init))){
init=null;
}
}
var ctor=vuit.lang.declare._makeConstructor();
var scp=(_38c?_38c.prototype:null);
if(scp){
scp.prototyping=true;
ctor.prototype=new _38c();
scp.prototyping=false;
}
ctor.superclass=scp;
ctor.mixins=_390;
for(var i=0,l=_390.length;i<l;i++){
vuit.lang.extend(ctor,_390[i].prototype);
}
ctor.prototype.initializer=null;
ctor.prototype.declaredClass=_38b;
if(vuit.lang.isArray(_38e)){
vuit.lang.extend.apply(vuit.lang,[ctor].concat(_38e));
}else{
vuit.lang.extend(ctor,(_38e)||{});
}
vuit.lang.extend(ctor,vuit.lang.declare.base);
ctor.prototype.constructor=ctor;
ctor.prototype.initializer=(ctor.prototype.initializer)||(init)||(function(){
});
vuit.lang.setObjPathValue(_38b,ctor,null,true);
};
vuit.lang.declare._makeConstructor=function(){
return function(){
var self=this._getPropContext();
var s=self.constructor.superclass;
if((s)&&(s.constructor)){
if(s.constructor==arguments.callee){
this.inherited("constructor",arguments);
}else{
this._inherited(s,"constructor",arguments);
}
}
var m=(self.constructor.mixins)||([]);
for(var i=0,l=m.length;i<l;i++){
(((m[i].prototype)&&(m[i].prototype.initializer))||(m[i])).apply(this,arguments);
}
if((!this.prototyping)&&(self.initializer)){
self.initializer.apply(this,arguments);
}
};
};
vuit.lang.declare.base={_getPropContext:function(){
return (this.___proto||this);
},_inherited:function(_398,_399,args){
var _39b=this.___proto;
this.___proto=_398;
var _39c=_398[_399].apply(this,(args||[]));
this.___proto=_39b;
return _39c;
},inheritedFrom:function(ctor,prop,args){
var p=((ctor)&&(ctor.prototype)&&(ctor.prototype[prop]));
return (vuit.lang.isFunction(p)?p.apply(this,(args||[])):p);
},inherited:function(prop,args){
var p=this._getPropContext();
do{
if((!p.constructor)||(!p.constructor.superclass)){
return;
}
p=p.constructor.superclass;
}while(!(prop in p));
return (vuit.lang.isFunction(p[prop])?this._inherited(p,prop,args):p[prop]);
}};
vuit.declare=vuit.lang.declare;
vuit.provide("vuit.widget.Manager");
vuit.widget.manager=new function(){
this.widgets=[];
this.widgetIds=[];
this.topWidgets={};
var _3a4={};
var _3a5=[];
this.getUniqueId=function(_3a6){
return _3a6+"_"+(_3a4[_3a6]!=undefined?++_3a4[_3a6]:_3a4[_3a6]=0);
};
this.add=function(_3a7){
this.widgets.push(_3a7);
if(!_3a7.extraArgs["id"]){
_3a7.extraArgs["id"]=_3a7.extraArgs["ID"];
}
if(_3a7.widgetId==""){
if(_3a7["id"]){
_3a7.widgetId=_3a7["id"];
}else{
if(_3a7.extraArgs["id"]){
_3a7.widgetId=_3a7.extraArgs["id"];
}else{
_3a7.widgetId=this.getUniqueId(_3a7.widgetType);
}
}
}
if(this.widgetIds[_3a7.widgetId]){
vuit.debug("widget ID collision on ID: "+_3a7.widgetId);
}
this.widgetIds[_3a7.widgetId]=_3a7;
};
this.destroyAll=function(){
for(var x=this.widgets.length-1;x>=0;x--){
try{
this.widgets[x].destroy(true);
delete this.widgets[x];
}
catch(e){
}
}
};
this.remove=function(_3a9){
if(vuit.lang.isNumber(_3a9)){
var tw=this.widgets[_3a9].widgetId;
delete this.widgetIds[tw];
this.widgets.splice(_3a9,1);
}else{
this.removeById(_3a9);
}
};
this.removeById=function(id){
if(!vuit.lang.isString(id)){
id=id["widgetId"];
if(!id){
vuit.debug("invalid widget or id passed to removeById");
return;
}
}
for(var i=0;i<this.widgets.length;i++){
if(this.widgets[i].widgetId==id){
this.remove(i);
break;
}
}
};
this.getWidgetById=function(id){
if(vuit.lang.isString(id)){
return this.widgetIds[id];
}
return id;
};
this.getWidgetsByType=function(type){
var lt=type.toLowerCase();
var ret=[];
vuit.lang.forEach(this.widgets,function(x){
if(x.widgetType.toLowerCase()==lt){
ret.push(x);
}
});
return ret;
};
this.getWidgetsByFilter=function(_3b2,_3b3){
var ret=[];
vuit.lang.every(this.widgets,function(x){
if(_3b2(x)){
ret.push(x);
if(_3b3){
return false;
}
}
return true;
});
return (_3b3?ret[0]:ret);
};
this.getAllWidgets=function(){
return this.widgets.concat();
};
this.getWidgetByNode=function(node){
var w=this.getAllWidgets();
node=vuit.byId(node);
for(var i=0;i<w.length;i++){
if(w[i].domNode==node){
return w[i];
}
}
return null;
};
this.byId=this.getWidgetById;
this.byType=this.getWidgetsByType;
this.byFilter=this.getWidgetsByFilter;
this.byNode=this.getWidgetByNode;
var _3b9={};
var _3ba=["vuit.widget"];
for(var i=0;i<_3ba.length;i++){
_3ba[_3ba[i]]=true;
}
this.registerWidgetPackage=function(_3bc){
if(!_3ba[_3bc]){
_3ba[_3bc]=true;
_3ba.push(_3bc);
}
};
this.getWidgetPackageList=function(){
return vuit.lang.map(_3ba,function(elt){
return (elt!==true?elt:undefined);
});
};
this.getImplementation=function(_3be,_3bf,_3c0,_3c1){
var impl=this.getImplementationName(_3be,_3c1);
if(impl){
var ret;
if(_3bf){
ret=new impl(ctor);
}else{
ret=new impl();
}
return ret;
}
};
this.getImplementationName=function(_3c4,_3c5){
if(!_3c5){
_3c5="vuit";
}
var _3c6=_3c4.toLowerCase();
if(!_3b9[_3c5]){
_3b9[_3c5]={};
}
var impl=_3b9[_3c5][_3c6];
if(impl){
return impl;
}
var ns=vuit.getNamespace(_3c5);
if(ns){
ns.load(_3c4);
}
if(!_3a5.length){
for(var _3c9 in vuit.render){
if(vuit.render[_3c9]["capable"]===true){
var _3ca=vuit.render[_3c9].prefixes;
for(var i=0;i<_3ca.length;i++){
_3a5.push(_3ca[i].toLowerCase());
}
}
}
_3a5.push("");
}
var _3cc=null;
var _3cd=false;
for(var _3ce=0;_3ce<2;_3ce++){
for(var i=0;i<_3ba.length;i++){
var _3cf=vuit.evalObjPath(_3ba[i]);
if(!_3cf){
continue;
}
var pos=_3ba[i].indexOf(".");
if(pos>-1){
var n=_3ba[i].substring(0,pos);
if(n!=_3c5){
if(_3ce==0){
continue;
}
if(!_3cd){
_3cd=true;
vuit.deprecated("vuit.widget.Manager.getImplementationName","Wrong namespace ("+_3c5+") specified. Developers should specify correct namespaces for all non-Vuit widgets","0.5");
}
}
}
for(var j=0;j<_3a5.length;j++){
if(!_3cf[_3a5[j]]){
continue;
}
for(var _3d3 in _3cf[_3a5[j]]){
if(_3d3.toLowerCase()!=_3c6){
continue;
}
_3b9[_3c5][_3c6]=_3cf[_3a5[j]][_3d3];
return _3b9[_3c5][_3c6];
}
}
for(var j=0;j<_3a5.length;j++){
for(var _3d3 in _3cf){
if(_3d3.toLowerCase()!=(_3a5[j]+_3c6)&&_3d3.toLowerCase()!=_3c6){
continue;
}
_3b9[_3c5][_3c6]=_3cf[_3d3];
return _3b9[_3c5][_3c6];
}
}
}
var _3d4=vuit.findNamespaceForWidget(_3c6);
if(_3d4){
_3c5=_3d4.nsPrefix;
}
}
throw new Error("Could not locate \""+_3c4+"\" class");
};
this.resizing=false;
this.onWindowResized=function(){
if(this.resizing){
return;
}
try{
this.resizing=true;
for(var id in this.topWidgets){
var _3d6=this.topWidgets[id];
if(_3d6.checkSize){
_3d6.checkSize();
}
}
}
catch(e){
}
finally{
this.resizing=false;
}
};
if(typeof window!="undefined"){
vuit.addOnLoad(this,"onWindowResized");
vuit.event.connect(window,"onresize",this,"onWindowResized");
}
};
(function(){
var dw=vuit.widget;
var dwm=dw.manager;
var h=vuit.lang.curry(vuit.lang,"hitch",dwm);
var g=function(_3db,_3dc){
dw[(_3dc||_3db)]=h(_3db);
};
g("add","addWidget");
g("destroyAll","destroyAllWidgets");
g("remove","removeWidget");
g("removeById","removeWidgetById");
g("getWidgetById");
g("getWidgetById","byId");
g("getWidgetsByType");
g("getWidgetsByFilter");
g("getWidgetsByType","byType");
g("getWidgetsByFilter","byFilter");
g("getWidgetByNode","byNode");
dw.all=function(n){
var _3de=dwm.getAllWidgets.apply(dwm,arguments);
if(arguments.length>0){
return _3de[n];
}
return _3de;
};
g("registerWidgetPackage");
g("getImplementation","getWidgetImplementation");
g("getImplementationName","getWidgetImplementationName");
dw.widgets=dwm.widgets;
dw.widgetIds=dwm.widgetIds;
dw.root=dwm.root;
})();
vuit.provide("vuit.widget.Widget");
vuit.provide("vuit.widget.tags");
vuit.declare("vuit.widget.Widget",null,{initializer:function(){
this.children=[];
this.extraArgs={};
},parent:null,isTopLevel:false,isModal:false,isEnabled:true,isHidden:false,isContainer:false,widgetId:"",widgetType:"Widget",namespace:"vuit",toString:function(){
return "[Widget "+this.widgetType+", "+(this.widgetId||"NO ID")+"]";
},repr:function(){
return this.toString();
},enable:function(){
this.isEnabled=true;
},disable:function(){
this.isEnabled=false;
},hide:function(){
this.isHidden=true;
},show:function(){
this.isHidden=false;
},onResized:function(){
this.notifyChildrenOfResize();
},notifyChildrenOfResize:function(){
for(var i=0;i<this.children.length;i++){
var _3e0=this.children[i];
if(_3e0.onResized){
_3e0.onResized();
}
}
},create:function(args,_3e2,_3e3,_3e4){
if(_3e4){
this.namespace=_3e4;
}
this.satisfyPropertySets(args,_3e2,_3e3);
this.mixInProperties(args,_3e2,_3e3);
this.postMixInProperties(args,_3e2,_3e3);
vuit.widget.manager.add(this);
this.buildRendering(args,_3e2,_3e3);
this.initialize(args,_3e2,_3e3);
this.postInitialize(args,_3e2,_3e3);
this.postCreate(args,_3e2,_3e3);
return this;
},destroy:function(_3e5){
this.destroyChildren();
this.uninitialize();
this.destroyRendering(_3e5);
vuit.widget.manager.removeById(this.widgetId);
},destroyChildren:function(){
while(this.children.length>0){
var tc=this.children[0];
this.removeChild(tc);
tc.destroy();
}
},getChildrenOfType:function(type,_3e8){
var ret=[];
var _3ea=vuit.lang.isFunction(type);
if(!_3ea){
type=type.toLowerCase();
}
for(var x=0;x<this.children.length;x++){
if(_3ea){
if(this.children[x] instanceof type){
ret.push(this.children[x]);
}
}else{
if(this.children[x].widgetType.toLowerCase()==type){
ret.push(this.children[x]);
}
}
if(_3e8){
ret=ret.concat(this.children[x].getChildrenOfType(type,_3e8));
}
}
return ret;
},getDescendants:function(){
var _3ec=[];
var _3ed=[this];
var elem;
while((elem=_3ed.pop())){
_3ec.push(elem);
if(elem.children){
vuit.lang.forEach(elem.children,function(elem){
_3ed.push(elem);
});
}
}
return _3ec;
},isFirstNode:function(){
return this===this.parent.children[0];
},isLastNode:function(){
return this===this.parent.children[this.parent.children.length-1];
},satisfyPropertySets:function(args){
return args;
},mixInProperties:function(args,frag){
if((args["fastMixIn"])||(frag["fastMixIn"])){
for(var x in args){
this[x]=args[x];
}
return;
}
var _3f4;
var _3f5=vuit.widget.lcArgsCache[this.widgetType];
if(_3f5==null){
_3f5={};
for(var y in this){
_3f5[((new String(y)).toLowerCase())]=y;
}
vuit.widget.lcArgsCache[this.widgetType]=_3f5;
}
var _3f7={};
for(var x in args){
if(!this[x]){
var y=_3f5[(new String(x)).toLowerCase()];
if(y){
args[y]=args[x];
x=y;
}
}
if(_3f7[x]){
continue;
}
_3f7[x]=true;
if((typeof this[x])!=(typeof _3f4)){
if(typeof args[x]!="string"){
this[x]=args[x];
}else{
if(vuit.lang.isString(this[x])){
this[x]=args[x];
}else{
if(vuit.lang.isNumber(this[x])){
this[x]=new Number(args[x]);
}else{
if(vuit.lang.isBoolean(this[x])){
this[x]=(args[x].toLowerCase()=="false")?false:true;
}else{
if(vuit.lang.isFunction(this[x])){
if(args[x].search(/[^\w\.]+/i)==-1){
this[x]=vuit.evalObjPath(args[x],false);
}else{
var tn=vuit.lang.nameAnonFunc(new Function(args[x]),this);
vuit.event.connect(this,x,this,tn);
}
}else{
if(vuit.lang.isArray(this[x])){
this[x]=args[x].split(";");
}else{
if(this[x] instanceof Date){
this[x]=new Date(Number(args[x]));
}else{
if(typeof this[x]=="object"){
if(this[x] instanceof vuit.uri.Uri){
this[x]=args[x];
}else{
var _3f9=args[x].split(";");
for(var y=0;y<_3f9.length;y++){
var si=_3f9[y].indexOf(":");
if((si!=-1)&&(_3f9[y].length>si)){
this[x][_3f9[y].substr(0,si).replace(/^\s+|\s+$/g,"")]=_3f9[y].substr(si+1);
}
}
}
}else{
this[x]=args[x];
}
}
}
}
}
}
}
}
}else{
this.extraArgs[x.toLowerCase()]=args[x];
}
}
},postMixInProperties:function(){
},initialize:function(args,frag){
return false;
},postInitialize:function(args,frag){
return false;
},postCreate:function(args,frag){
return false;
},uninitialize:function(){
return false;
},buildRendering:function(){
vuit.unimplemented("vuit.widget.Widget.buildRendering, on "+this.toString()+", ");
return false;
},destroyRendering:function(){
vuit.unimplemented("vuit.widget.Widget.destroyRendering");
return false;
},cleanUp:function(){
vuit.unimplemented("vuit.widget.Widget.cleanUp");
return false;
},addedTo:function(_401){
},addChild:function(_402){
vuit.unimplemented("vuit.widget.Widget.addChild");
return false;
},removeChild:function(_403){
for(var x=0;x<this.children.length;x++){
if(this.children[x]===_403){
this.children.splice(x,1);
break;
}
}
return _403;
},resize:function(_405,_406){
this.setWidth(_405);
this.setHeight(_406);
},setWidth:function(_407){
if((typeof _407=="string")&&(_407.substr(-1)=="%")){
this.setPercentageWidth(_407);
}else{
this.setNativeWidth(_407);
}
},setHeight:function(_408){
if((typeof _408=="string")&&(_408.substr(-1)=="%")){
this.setPercentageHeight(_408);
}else{
this.setNativeHeight(_408);
}
},setPercentageHeight:function(_409){
return false;
},setNativeHeight:function(_40a){
return false;
},setPercentageWidth:function(_40b){
return false;
},setNativeWidth:function(_40c){
return false;
},getPreviousSibling:function(){
var idx=this.getParentIndex();
if(idx<=0){
return null;
}
return this.getSiblings()[idx-1];
},getSiblings:function(){
return this.parent.children;
},getParentIndex:function(){
return vuit.lang.indexOf(this.getSiblings(),this,true);
},getNextSibling:function(){
var idx=this.getParentIndex();
if(idx==this.getSiblings().length-1){
return null;
}
if(idx<0){
return null;
}
return this.getSiblings()[idx+1];
}});
vuit.widget.lcArgsCache={};
vuit.widget.tags={};
vuit.widget.tags.addParseTreeHandler=function(type){
var _410=type.toLowerCase();
this[_410]=function(_411,_412,_413,_414,_415){
var _416=_410;
vuit.profile.start(_416);
var n=vuit.widget.buildWidgetFromParseTree(_410,_411,_412,_413,_414,_415);
vuit.profile.end(_416);
return n;
};
};
vuit.widget.tags.addParseTreeHandler("vuit:widget");
vuit.widget.tags["vuit:propertyset"]=function(_418,_419,_41a){
var _41b=_419.parseProperties(_418["vuit:propertyset"]);
};
vuit.widget.tags["vuit:connect"]=function(_41c,_41d,_41e){
var _41f=_41d.parseProperties(_41c["vuit:connect"]);
};
vuit.widget.buildWidgetFromParseTree=function(type,frag,_422,_423,_424,_425){
var _426=type.split(":");
_426=(_426.length==2)?_426[1]:type;
var _427=_425||_422.parseProperties(frag[frag.namespace+":"+_426]);
var _428=vuit.widget.manager.getImplementation(_426,null,null,frag.namespace);
if(!_428){
throw new Error("cannot find \""+_426+"\" widget");
}else{
if(!_428.create){
throw new Error("\""+_426+"\" widget object does not appear to implement *Widget");
}
}
_427["vuitinsertionindex"]=_424;
var ret=_428.create(_427,frag,_423,frag.namespace);
return ret;
};
vuit.widget.defineWidget=function(_42a,_42b,_42c,init,_42e){
if(vuit.lang.isString(arguments[3])){
vuit.widget._defineWidget(arguments[0],arguments[3],arguments[1],arguments[4],arguments[2]);
}else{
var args=[arguments[0]],p=3;
if(vuit.lang.isString(arguments[1])){
args.push(arguments[1],arguments[2]);
}else{
args.push("",arguments[1]);
p=2;
}
if(vuit.lang.isFunction(arguments[p])){
args.push(arguments[p],arguments[p+1]);
}else{
args.push(null,arguments[p]);
}
vuit.widget._defineWidget.apply(this,args);
}
};
vuit.widget.defineWidget.renderers="html|svg|vml";
vuit.widget._defineWidget=function(_430,_431,_432,init,_434){
var _435=_430.split(".");
var type=_435.pop();
var regx="\\.("+(_431?_431+"|":"")+vuit.widget.defineWidget.renderers+")\\.";
var r=_430.search(new RegExp(regx));
_435=(r<0?_435.join("."):_430.substr(0,r));
vuit.widget.manager.registerWidgetPackage(_435);
var pos=_435.indexOf(".");
var _43a=(pos>-1)?_435.substring(0,pos):_435;
vuit.widget.tags.addParseTreeHandler(_43a+":"+type.toLowerCase());
if(_43a!="vuit"){
vuit.widget.tags.addParseTreeHandler("vuit:"+type.toLowerCase());
}
_434=(_434)||{};
_434.widgetType=type;
if((!init)&&(_434["classConstructor"])){
init=_434.classConstructor;
delete _434.classConstructor;
}
vuit.declare(_430,_432,init,_434);
};
vuit.provide("vuit.namespace");
vuit.Namespace=function(_43b,_43c,_43d,_43e){
this.root=_43b;
this.location=_43c;
this.nsPrefix=_43d;
this.resolver=_43e;
vuit.setModulePrefix(_43d,_43c);
};
vuit.Namespace.prototype._loaded={};
vuit.Namespace.prototype.load=function(name,_440){
if(this.resolver){
var _441=this.resolver(name,_440);
if(_441&&!this._loaded[_441]){
var req=vuit.require;
req(_441);
this._loaded[_441]=true;
}
if(this._loaded[_441]){
return true;
}
}
return false;
};
vuit.defineNamespace=function(_443,_444,_445,_446,_447){
if(vuit._namespaces[_443]){
return;
}
var ns=new vuit.Namespace(_443,_444,_445,_446);
vuit._namespaces[_443]=ns;
if(_445){
vuit._namespaces[_445]=ns;
}
if(_447){
vuit.widget.manager.registerWidgetPackage(_447);
}
};
vuit.findNamespaceForWidget=function(_449){
vuit.deprecated("vuit.findNamespaceForWidget","Widget not defined for a namespace"+", so searching all namespaces. Developers should specify namespaces for all non-Vuit widgets","0.5");
_449=_449.toLowerCase();
for(x in vuit._namespaces){
if(vuit._namespaces[x].load(_449)){
return vuit._namespaces[x];
}
}
};
vuit.provide("vuit.widget.Parse");
vuit.widget.Parse=function(_44a){
this.propertySetsList=[];
this.fragment=_44a;
this.createComponents=function(frag,_44c){
var _44d=[];
var _44e=false;
try{
if((frag)&&(frag["tagName"])&&(frag!=frag["nodeRef"])){
var _44f=vuit.widget.tags;
var tna=String(frag["tagName"]).split(";");
for(var x=0;x<tna.length;x++){
var ltn=(tna[x].replace(/^\s+|\s+$/g,"")).toLowerCase();
var pos=ltn.indexOf(":");
var _454=(pos>0)?ltn.substring(0,pos):null;
if(!_44f[ltn]&&vuit.getNamespace&&vuit.lang.isString(ltn)&&pos>0){
var ns=vuit.getNamespace(_454);
var _456=ltn.substring(pos+1,ltn.length);
var _457=null;
var _458=frag[ltn]["vuitDomain"]||frag[ltn]["vuitdomain"];
if(_458){
_457=_458[0].value;
}
if(ns){
ns.load(_456,_457);
}
}
if(!_44f[ltn]){
vuit.deprecated("vuit.widget.Parse.createComponents","Widget not defined for  namespace"+_454+", so searching all namespaces. Developers should specify namespaces for all non-Vuit widgets","0.5");
var _459=vuit.findNamespaceForWidget(_456);
if(_459){
ltn=_459.nsPrefix+":"+(ltn.indexOf(":")>0?ltn.substring(ltn.indexOf(":")+1):ltn);
}
}
if(_44f[ltn]){
_44e=true;
frag.tagName=ltn;
var ret=_44f[ltn](frag,this,_44c,frag["index"]);
_44d.push(ret);
}else{
if(vuit.lang.isString(ltn)&&_454&&vuitConfig.namespaces[_454]){
vuit.debug("no tag handler registered for type: ",ltn);
}
}
}
}
}
catch(e){
vuit.debug("vuit.widget.Parse: error:",e);
}
if(!_44e){
_44d=_44d.concat(this.createSubComponents(frag,_44c));
}
return _44d;
};
this.createSubComponents=function(_45b,_45c){
var frag,comps=[];
for(var item in _45b){
frag=_45b[item];
if((frag)&&(typeof frag=="object")&&(frag!=_45b.nodeRef)&&(frag!=_45b["tagName"])){
comps=comps.concat(this.createComponents(frag,_45c));
}
}
return comps;
};
this.parsePropertySets=function(_45f){
return [];
var _460=[];
for(var item in _45f){
if((_45f[item]["tagName"]=="vuit:propertyset")){
_460.push(_45f[item]);
}
}
this.propertySetsList.push(_460);
return _460;
};
this.parseProperties=function(_462){
var _463={};
for(var item in _462){
if((_462[item]==_462["tagName"])||(_462[item]==_462.nodeRef)){
}else{
if((_462[item]["tagName"])&&(vuit.widget.tags[_462[item].tagName.toLowerCase()])){
}else{
if((_462[item][0])&&(_462[item][0].value!="")&&(_462[item][0].value!=null)){
try{
if(item.toLowerCase()=="dataprovider"){
var _465=this;
this.getDataProvider(_465,_462[item][0].value);
_463.dataProvider=this.dataProvider;
}
_463[item]=_462[item][0].value;
var _466=this.parseProperties(_462[item]);
for(var _467 in _466){
_463[_467]=_466[_467];
}
}
catch(e){
vuit.debug(e);
}
}
}
}
}
return _463;
};
this.getDataProvider=function(_468,_469){
vuit.io.bind({url:_469,load:function(type,_46b){
if(type=="load"){
_468.dataProvider=_46b;
}
},mimetype:"text/javascript",sync:true});
};
this.getPropertySetById=function(_46c){
for(var x=0;x<this.propertySetsList.length;x++){
if(_46c==this.propertySetsList[x]["id"][0].value){
return this.propertySetsList[x];
}
}
return "";
};
this.getPropertySetsByType=function(_46e){
var _46f=[];
for(var x=0;x<this.propertySetsList.length;x++){
var cpl=this.propertySetsList[x];
var cpcc=cpl["componentClass"]||cpl["componentType"]||null;
var _473=this.propertySetsList[x]["id"][0].value;
if((cpcc)&&(_473==cpcc[0].value)){
_46f.push(cpl);
}
}
return _46f;
};
this.getPropertySets=function(_474){
var ppl="vuit:propertyproviderlist";
var _476=[];
var _477=_474["tagName"];
if(_474[ppl]){
var _478=_474[ppl].value.split(" ");
for(var _479 in _478){
if((_479.indexOf("..")==-1)&&(_479.indexOf("://")==-1)){
var _47a=this.getPropertySetById(_479);
if(_47a!=""){
_476.push(_47a);
}
}else{
}
}
}
return (this.getPropertySetsByType(_477)).concat(_476);
};
this.createComponentFromScript=function(_47b,_47c,_47d,_47e){
if(!_47e){
_47e="vuit";
}
var ltn=_47e+":"+_47c.toLowerCase();
var _480=vuit.widget.tags;
if(!_480[ltn]&&vuit.getNamespace&&vuit.lang.isString(ltn)){
var ns=vuit.getNamespace(_47e);
if(ns){
ns.load(_47c);
}
}
if(!_480[ltn]){
vuit.deprecated("vuit.widget.Parse.createComponentFromScript","Widget not defined for namespace"+_47e+", so searching all namespaces. Developers should specify namespaces for all non-Vuit widgets","0.5");
var _482=vuit.findNamespaceForWidget(_47c.toLowerCase());
if(_482){
var _483=_482.nsPrefix+":"+(ltn.indexOf(":")>0?ltn.substring(ltn.indexOf(":")+1):ltn);
_47d[_483]=_47d[ltn];
_47d.namespace=_482.nsPrefix;
ltn=_483;
}
}
if(_480[ltn]){
_47d.fastMixIn=true;
var ret=[vuit.widget.buildWidgetFromParseTree(ltn,_47d,this,null,null,_47d)];
return ret;
}else{
vuit.debug("no tag handler registered for type: ",ltn);
}
};
};
vuit.widget._parser_collection={"vuit":new vuit.widget.Parse()};
vuit.widget.getParser=function(name){
if(!name){
name="vuit";
}
if(!this._parser_collection[name]){
this._parser_collection[name]=new vuit.widget.Parse();
}
return this._parser_collection[name];
};
vuit.widget.createWidget=function(name,_487,_488,_489){
var _48a=false;
var _48b=(typeof name=="string");
if(_48b){
var pos=name.indexOf(":");
var _48d=(pos>-1)?name.substring(0,pos):"vuit";
if(pos>-1){
name=name.substring(pos+1);
}
var _48e=name.toLowerCase();
var _48f=_48d+":"+_48e;
_48a=(vuit.byId(name)&&(!vuit.widget.tags[_48f]));
}
if((arguments.length==1)&&((_48a)||(!_48b))){
var xp=new vuit.xml.Parse();
var tn=(_48a)?vuit.byId(name):name;
return vuit.widget.getParser().createComponents(xp.parseElement(tn,null,true))[0];
}
function fromScript(_492,name,_494,_495){
_494[_48f]={vuittype:[{value:_48e}],nodeRef:_492,fastMixIn:true};
_494.namespace=_495;
return vuit.widget.getParser().createComponentFromScript(_492,name,_494,_495);
}
_487=_487||{};
var _496=false;
var tn=null;
var h=vuit.render.html.capable;
if(h){
tn=document.createElement("span");
}
if(!_488){
_496=true;
_488=tn;
if(h){
vuit.body().appendChild(_488);
}
}else{
if(_489){
vuit.dom.insertAtPosition(tn,_488,_489);
}else{
tn=_488;
}
}
var _498=fromScript(tn,name.toLowerCase(),_487,_48d);
if(!_498||!_498[0]||typeof _498[0].widgetType=="undefined"){
throw new Error("createWidget: Creation of \""+name+"\" widget failed.");
}
if(_496){
if(_498[0].domNode.parentNode){
_498[0].domNode.parentNode.removeChild(_498[0].domNode);
}
}
return _498[0];
};
vuit.provide("vuit.namespaces.vuit");
(function(){
var map={html:{"accordioncontainer":"vuit.widget.AccordionContainer","treerpccontroller":"vuit.widget.TreeRPCController","accordionpane":"vuit.widget.AccordionPane","button":"vuit.widget.Button","chart":"vuit.widget.Chart","checkbox":"vuit.widget.Checkbox","civicrmdatepicker":"vuit.widget.CiviCrmDatePicker","colorpalette":"vuit.widget.ColorPalette","combobox":"vuit.widget.ComboBox","contentpane":"vuit.widget.ContentPane","contextmenu":"vuit.widget.ContextMenu","datepicker":"vuit.widget.DatePicker","debugconsole":"vuit.widget.DebugConsole","dialog":"vuit.widget.Dialog","docpane":"vuit.widget.DocPane","dropdownbutton":"vuit.widget.DropdownButton","dropdowndatepicker":"vuit.widget.DropdownDatePicker","editor2":"vuit.widget.Editor2","editor2toolbar":"vuit.widget.Editor2Toolbar","editor":"vuit.widget.Editor","editortree":"vuit.widget.EditorTree","editortreecontextmenu":"vuit.widget.EditorTreeContextMenu","editortreenode":"vuit.widget.EditorTreeNode","fisheyelist":"vuit.widget.FisheyeList","editortreecontroller":"vuit.widget.EditorTreeController","googlemap":"vuit.widget.GoogleMap","editortreeselector":"vuit.widget.EditorTreeSelector","floatingpane":"vuit.widget.FloatingPane","hslcolorpicker":"vuit.widget.HslColorPicker","inlineeditbox":"vuit.widget.InlineEditBox","layoutcontainer":"vuit.widget.LayoutContainer","linkpane":"vuit.widget.LinkPane","manager":"vuit.widget.Manager","popupcontainer":"vuit.widget.Menu2","popupmenu2":"vuit.widget.Menu2","menuitem2":"vuit.widget.Menu2","menuseparator2":"vuit.widget.Menu2","menubar2":"vuit.widget.Menu2","menubaritem2":"vuit.widget.Menu2","monthlyCalendar":"vuit.widget.MonthlyCalendar","popupbutton":"vuit.widget.PopUpButton","richtext":"vuit.widget.RichText","remotetabcontroller":"vuit.widget.RemoteTabController","resizehandle":"vuit.widget.ResizeHandle","resizabletextarea":"vuit.widget.ResizableTextarea","slideshow":"vuit.widget.SlideShow","sortabletable":"vuit.widget.SortableTable","simpledropdownbuttons":"vuit.widget.SimpleDropdownButtons","splitcontainer":"vuit.widget.SplitContainer","svgbutton":"vuit.widget.SvgButton","tabcontainer":"vuit.widget.TabContainer","taskbar":"vuit.widget.TaskBar","timepicker":"vuit.widget.TimerPicker","titlepane":"vuit.widget.TitlePane","toggler":"vuit.widget.Toggler","toolbar":"vuit.widget.Toolbar","tooltip":"vuit.widget.Tooltip","tree":"vuit.widget.Tree","treebasiccontroller":"vuit.widget.TreeBasicController","treecontextmenu":"vuit.widget.TreeContextMenu","treeselector":"vuit.widget.TreeSelector","treecontrollerextension":"vuit.widget.TreeControllerExtension","treenode":"vuit.widget.TreeNode","validate":"vuit.widget.validate","treeloadingcontroller":"vuit.widget.TreeLoadingController","widget":"vuit.widget.Widget","wizard":"vuit.widget.Wizard","yahoomap":"vuit.widget.YahooMap"},svg:{"chart":"vuit.widget.svg.Chart","hslcolorpicker":"vuit.widget.svg.HslColorPicker"},vml:{"chart":"vuit.widget.vml.Chart"}};
function vuitNamespaceResolver(name,_49b){
if(!_49b){
_49b="html";
}
if(!map[_49b]){
return null;
}
return map[_49b][name];
}
vuit.defineNamespace("vuit","src","vuit",vuitNamespaceResolver);
vuit.addVuitNamespaceMapping=function(_49c,_49d){
map[_49c]=_49d;
};
})();
vuit.provide("vuit.html.style");
vuit.html.getClass=function(node){
node=vuit.byId(node);
if(!node){
return "";
}
var cs="";
if(node.className){
cs=node.className;
}else{
if(vuit.html.hasAttribute(node,"class")){
cs=vuit.html.getAttribute(node,"class");
}
}
return cs.replace(/^\s+|\s+$/g,"");
};
vuit.html.getClasses=function(node){
var c=vuit.html.getClass(node);
return (c=="")?[]:c.split(/\s+/g);
};
vuit.html.hasClass=function(node,_4a3){
return (new RegExp("(^|\\s+)"+_4a3+"(\\s+|$)")).test(vuit.html.getClass(node));
};
vuit.html.prependClass=function(node,_4a5){
_4a5+=" "+vuit.html.getClass(node);
return vuit.html.setClass(node,_4a5);
};
vuit.html.addClass=function(node,_4a7){
if(vuit.html.hasClass(node,_4a7)){
return false;
}
_4a7=(vuit.html.getClass(node)+" "+_4a7).replace(/^\s+|\s+$/g,"");
return vuit.html.setClass(node,_4a7);
};
vuit.html.setClass=function(node,_4a9){
node=vuit.byId(node);
var cs=new String(_4a9);
try{
if(typeof node.className=="string"){
node.className=cs;
}else{
if(node.setAttribute){
node.setAttribute("class",_4a9);
node.className=cs;
}else{
return false;
}
}
}
catch(e){
vuit.debug("vuit.html.setClass() failed",e);
}
return true;
};
vuit.html.removeClass=function(node,_4ac,_4ad){
try{
if(!_4ad){
var _4ae=vuit.html.getClass(node).replace(new RegExp("(^|\\s+)"+_4ac+"(\\s+|$)"),"$1$2");
}else{
var _4ae=vuit.html.getClass(node).replace(_4ac,"");
}
vuit.html.setClass(node,_4ae);
}
catch(e){
vuit.debug("vuit.html.removeClass() failed",e);
}
return true;
};
vuit.html.replaceClass=function(node,_4b0,_4b1){
vuit.html.removeClass(node,_4b1);
vuit.html.addClass(node,_4b0);
};
vuit.html.classMatchType={ContainsAll:0,ContainsAny:1,IsOnly:2};
vuit.html.getElementsByClass=function(_4b2,_4b3,_4b4,_4b5,_4b6){
var _4b7=vuit.doc();
_4b3=vuit.byId(_4b3)||_4b7;
var _4b8=_4b2.split(/\s+/g);
var _4b9=[];
if(_4b5!=1&&_4b5!=2){
_4b5=0;
}
var _4ba=new RegExp("(\\s|^)(("+_4b8.join(")|(")+"))(\\s|$)");
var _4bb=_4b8.join(" ").length;
var _4bc=[];
if(!_4b6&&_4b7.evaluate){
var _4bd=".//"+(_4b4||"*")+"[contains(";
if(_4b5!=vuit.html.classMatchType.ContainsAny){
_4bd+="concat(' ',@class,' '), ' "+_4b8.join(" ') and contains(concat(' ',@class,' '), ' ")+" ')";
if(_4b5==2){
_4bd+=" and string-length(@class)="+_4bb+"]";
}else{
_4bd+="]";
}
}else{
_4bd+="concat(' ',@class,' '), ' "+_4b8.join(" ')) or contains(concat(' ',@class,' '), ' ")+" ')]";
}
var _4be=_4b7.evaluate(_4bd,_4b3,null,XPathResult.ANY_TYPE,null);
var _4bf=_4be.iterateNext();
while(_4bf){
try{
_4bc.push(_4bf);
_4bf=_4be.iterateNext();
}
catch(e){
break;
}
}
return _4bc;
}else{
if(!_4b4){
_4b4="*";
}
_4bc=_4b3.getElementsByTagName(_4b4);
var node,i=0;
outer:
while(node=_4bc[i++]){
var _4c1=vuit.html.getClasses(node);
if(_4c1.length==0){
continue outer;
}
var _4c2=0;
for(var j=0;j<_4c1.length;j++){
if(_4ba.test(_4c1[j])){
if(_4b5==vuit.html.classMatchType.ContainsAny){
_4b9.push(node);
continue outer;
}else{
_4c2++;
}
}else{
if(_4b5==vuit.html.classMatchType.IsOnly){
continue outer;
}
}
}
if(_4c2==_4b8.length){
if((_4b5==vuit.html.classMatchType.IsOnly)&&(_4c2==_4c1.length)){
_4b9.push(node);
}else{
if(_4b5==vuit.html.classMatchType.ContainsAll){
_4b9.push(node);
}
}
}
}
return _4b9;
}
};
vuit.html.getElementsByClassName=vuit.html.getElementsByClass;
vuit.html.toCamelCase=function(_4c4){
var arr=_4c4.split("-"),cc=arr[0];
for(var i=1;i<arr.length;i++){
cc+=arr[i].charAt(0).toUpperCase()+arr[i].substring(1);
}
return cc;
};
vuit.html.toSelectorCase=function(_4c7){
return _4c7.replace(/([A-Z])/g,"-$1").toLowerCase();
};
vuit.html.getComputedStyle=function(node,_4c9,_4ca){
node=vuit.byId(node);
var _4c9=vuit.html.toSelectorCase(_4c9);
var _4cb=vuit.html.toCamelCase(_4c9);
if(!node||!node.style){
return _4ca;
}else{
if(document.defaultView){
try{
var cs=document.defaultView.getComputedStyle(node,"");
if(cs){
return cs.getPropertyValue(_4c9);
}
}
catch(e){
if(node.style.getPropertyValue){
return node.style.getPropertyValue(_4c9);
}else{
return _4ca;
}
}
}else{
if(node.currentStyle){
return node.currentStyle[_4cb];
}
}
}
if(node.style.getPropertyValue){
return node.style.getPropertyValue(_4c9);
}else{
return _4ca;
}
};
vuit.html.getStyleProperty=function(node,_4ce){
node=vuit.byId(node);
return (node&&node.style?node.style[vuit.html.toCamelCase(_4ce)]:undefined);
};
vuit.html.getStyle=function(node,_4d0){
var _4d1=vuit.html.getStyleProperty(node,_4d0);
return (_4d1?_4d1:vuit.html.getComputedStyle(node,_4d0));
};
vuit.html.setStyle=function(node,_4d3,_4d4){
node=vuit.byId(node);
if(node&&node.style){
var _4d5=vuit.html.toCamelCase(_4d3);
node.style[_4d5]=_4d4;
}
};
vuit.html.copyStyle=function(_4d6,_4d7){
if(!_4d7.style.cssText){
_4d6.setAttribute("style",_4d7.getAttribute("style"));
}else{
_4d6.style.cssText=_4d7.style.cssText;
}
vuit.html.addClass(_4d6,vuit.html.getClass(_4d7));
};
vuit.html.getUnitValue=function(node,_4d9,_4da){
var s=vuit.html.getComputedStyle(node,_4d9);
if((!s)||((s=="auto")&&(_4da))){
return {value:0,units:"px"};
}
var _4dc=s.match(/(\-?[\d.]+)([a-z%]*)/i);
if(!_4dc){
return vuit.html.getUnitValue.bad;
}
return {value:Number(_4dc[1]),units:_4dc[2].toLowerCase()};
};
vuit.html.getUnitValue.bad={value:NaN,units:""};
vuit.html.getPixelValue=function(node,_4de,_4df){
var _4e0=vuit.html.getUnitValue(node,_4de,_4df);
if(isNaN(_4e0.value)){
return 0;
}
if((_4e0.value)&&(_4e0.units!="px")){
return NaN;
}
return _4e0.value;
};
vuit.html.setPositivePixelValue=function(node,_4e2,_4e3){
if(isNaN(_4e3)){
return false;
}
node.style[_4e2]=Math.max(0,_4e3)+"px";
return true;
};
vuit.html.styleSheet=null;
vuit.html.insertCssRule=function(_4e4,_4e5,_4e6){
if(!vuit.html.styleSheet){
if(document.createStyleSheet){
vuit.html.styleSheet=document.createStyleSheet();
}else{
if(document.styleSheets[0]){
vuit.html.styleSheet=document.styleSheets[0];
}else{
return null;
}
}
}
if(arguments.length<3){
if(vuit.html.styleSheet.cssRules){
_4e6=vuit.html.styleSheet.cssRules.length;
}else{
if(vuit.html.styleSheet.rules){
_4e6=vuit.html.styleSheet.rules.length;
}else{
return null;
}
}
}
if(vuit.html.styleSheet.insertRule){
var rule=_4e4+" { "+_4e5+" }";
return vuit.html.styleSheet.insertRule(rule,_4e6);
}else{
if(vuit.html.styleSheet.addRule){
return vuit.html.styleSheet.addRule(_4e4,_4e5,_4e6);
}else{
return null;
}
}
};
vuit.html.removeCssRule=function(_4e8){
if(!vuit.html.styleSheet){
vuit.debug("no stylesheet defined for removing rules");
return false;
}
if(vuit.html.render.ie){
if(!_4e8){
_4e8=vuit.html.styleSheet.rules.length;
vuit.html.styleSheet.removeRule(_4e8);
}
}else{
if(document.styleSheets[0]){
if(!_4e8){
_4e8=vuit.html.styleSheet.cssRules.length;
}
vuit.html.styleSheet.deleteRule(_4e8);
}
}
return true;
};
vuit.html._insertedCssFiles=[];
vuit.html.insertCssFile=function(URI,doc,_4eb){
if(!URI){
return;
}
if(!doc){
doc=document;
}
var _4ec=vuit.hostenv.getText(URI);
_4ec=vuit.html.fixPathsInCssText(_4ec,URI);
if(_4eb){
var idx=-1,node,ent=vuit.html._insertedCssFiles;
for(var i=0;i<ent.length;i++){
if((ent[i].doc==doc)&&(ent[i].cssText==_4ec)){
idx=i;
node=ent[i].nodeRef;
break;
}
}
if(node){
var _4ef=doc.getElementsByTagName("style");
for(var i=0;i<_4ef.length;i++){
if(_4ef[i]==node){
return;
}
}
vuit.html._insertedCssFiles.shift(idx,1);
}
}
var _4f0=vuit.html.insertCssText(_4ec);
vuit.html._insertedCssFiles.push({"doc":doc,"cssText":_4ec,"nodeRef":_4f0});
if(_4f0&&vuitConfig.isDebug){
_4f0.setAttribute("dbgHref",URI);
}
return _4f0;
};
vuit.html.insertCssText=function(_4f1,doc,URI){
if(!_4f1){
return;
}
if(!doc){
doc=document;
}
if(URI){
_4f1=vuit.html.fixPathsInCssText(_4f1,URI);
}
var _4f4=doc.createElement("style");
_4f4.setAttribute("type","text/css");
var head=doc.getElementsByTagName("head")[0];
if(!head){
vuit.debug("No head tag in document, aborting styles");
return;
}else{
head.appendChild(_4f4);
}
if(_4f4.styleSheet){
_4f4.styleSheet.cssText=_4f1;
}else{
var _4f6=doc.createTextNode(_4f1);
_4f4.appendChild(_4f6);
}
return _4f4;
};
vuit.html.fixPathsInCssText=function(_4f7,URI){
if(!_4f7||!URI){
return;
}
var _4f9,str="",url="";
var _4fa=/url\(\s*([\t\s\w()\/.\\'"-:#=&?]+)\s*\)/;
var _4fb=/(file|https?|ftps?):\/\//;
var _4fc=/^[\s]*(['"]?)([\w()\/.\\'"-:#=&?]*)\1[\s]*?$/;
while(_4f9=_4fa.exec(_4f7)){
url=_4f9[1].replace(_4fc,"$2");
if(!_4fb.exec(url)){
url=(new vuit.uri.Uri(URI,url).toString());
}
str+=_4f7.substring(0,_4f9.index)+"url("+url+")";
_4f7=_4f7.substr(_4f9.index+_4f9[0].length);
}
return str+_4f7;
};
vuit.html.setActiveStyleSheet=function(_4fd){
var i=0,a,els=vuit.doc().getElementsByTagName("link");
while(a=els[i++]){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")){
a.disabled=true;
if(a.getAttribute("title")==_4fd){
a.disabled=false;
}
}
}
};
vuit.html.getActiveStyleSheet=function(){
var i=0,a,els=vuit.doc().getElementsByTagName("link");
while(a=els[i++]){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")&&!a.disabled){
return a.getAttribute("title");
}
}
return null;
};
vuit.html.getPreferredStyleSheet=function(){
var i=0,a,els=vuit.doc().getElementsByTagName("link");
while(a=els[i++]){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("rel").indexOf("alt")==-1&&a.getAttribute("title")){
return a.getAttribute("title");
}
}
return null;
};
vuit.provide("vuit.widget.DomWidget");
vuit.widget._cssFiles={};
vuit.widget._cssStrings={};
vuit.widget._templateCache={};
vuit.widget.defaultStrings={vuitRoot:vuit.hostenv.getBaseScriptUri(),baseScriptUri:vuit.hostenv.getBaseScriptUri()};
vuit.widget.buildFromTemplate=function(){
vuit.lang.forward("fillFromTemplateCache");
};
vuit.widget.fillFromTemplateCache=function(obj,_502,_503,_504){
var _505=_502||obj.templatePath;
if(_505&&!(_505 instanceof vuit.uri.Uri)){
_505=vuit.uri.vuitUri(_505);
vuit.deprecated("templatePath should be of type vuit.uri.Uri",null,"0.4");
}
var _506=vuit.widget._templateCache;
if(!obj["widgetType"]){
do{
var _507="__dummyTemplate__"+vuit.widget._templateCache.dummyCount++;
}while(_506[_507]);
obj.widgetType=_507;
}
var wt=obj.widgetType;
var ts=_506[wt];
if(!ts){
_506[wt]={"string":null,"node":null};
if(_504){
ts={};
}else{
ts=_506[wt];
}
}
if((!obj.templateString)&&(!_504)){
obj.templateString=_503||ts["string"];
}
if((!obj.templateNode)&&(!_504)){
obj.templateNode=ts["node"];
}
if((!obj.templateNode)&&(!obj.templateString)&&(_505)){
var _50a=vuit.hostenv.getText(_505);
if(_50a){
_50a=_50a.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");
var _50b=_50a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if(_50b){
_50a=_50b[1];
}
}else{
_50a="";
}
obj.templateString=_50a;
if(!_504){
_506[wt]["string"]=_50a;
}
}
if((!ts["string"])&&(!_504)){
ts.string=obj.templateString;
}
};
vuit.widget._templateCache.dummyCount=0;
vuit.widget.attachProperties=["vuitAttachPoint","id"];
vuit.widget.eventAttachProperty="vuitAttachEvent";
vuit.widget.onBuildProperty="vuitOnBuild";
vuit.widget.waiNames=["waiRole","waiState"];
vuit.widget.wai={waiRole:{name:"waiRole",namespace:"http://www.w3.org/TR/xhtml2",alias:"x2",prefix:"wairole:"},waiState:{name:"waiState",namespace:"http://www.w3.org/2005/07/aaa",alias:"aaa",prefix:""},setAttr:function(node,ns,attr,_50f){
if(vuit.render.html.ie){
node.setAttribute(this[ns].alias+":"+attr,this[ns].prefix+_50f);
}else{
node.setAttributeNS(this[ns].namespace,attr,this[ns].prefix+_50f);
}
},getAttr:function(node,ns,attr){
if(vuit.render.html.ie){
return node.getAttribute(this[ns].alias+":"+attr);
}else{
return node.getAttributeNS(this[ns].namespace,attr);
}
}};
vuit.widget.attachTemplateNodes=function(_513,_514,_515){
var _516=vuit.dom.ELEMENT_NODE;
function trim(str){
return str.replace(/^\s+|\s+$/g,"");
}
if(!_513){
_513=_514.domNode;
}
if(_513.nodeType!=_516){
return;
}
var _518=_513.all||_513.getElementsByTagName("*");
var _519=_514;
for(var x=-1;x<_518.length;x++){
var _51b=(x==-1)?_513:_518[x];
var _51c=[];
for(var y=0;y<this.attachProperties.length;y++){
var _51e=_51b.getAttribute(this.attachProperties[y]);
if(_51e){
_51c=_51e.split(";");
for(var z=0;z<_51c.length;z++){
if(vuit.lang.isArray(_514[_51c[z]])){
_514[_51c[z]].push(_51b);
}else{
_514[_51c[z]]=_51b;
}
}
break;
}
}
var _520=_51b.getAttribute(this.templateProperty);
if(_520){
_514[_520]=_51b;
}
vuit.lang.forEach(vuit.widget.waiNames,function(name){
var wai=vuit.widget.wai[name];
var val=_51b.getAttribute(wai.name);
if(val){
if(val.indexOf("-")==-1){
vuit.widget.wai.setAttr(_51b,wai.name,"role",val);
}else{
var _524=val.split("-");
vuit.widget.wai.setAttr(_51b,wai.name,_524[0],_524[1]);
}
}
},this);
var _525=_51b.getAttribute(this.eventAttachProperty);
if(_525){
var evts=_525.split(";");
for(var y=0;y<evts.length;y++){
if((!evts[y])||(!evts[y].length)){
continue;
}
var _527=null;
var tevt=trim(evts[y]);
if(evts[y].indexOf(":")>=0){
var _529=tevt.split(":");
tevt=trim(_529[0]);
_527=trim(_529[1]);
}
if(!_527){
_527=tevt;
}
var tf=function(){
var ntf=new String(_527);
return function(evt){
if(_519[ntf]){
_519[ntf](vuit.event.browser.fixEvent(evt,this));
}
};
}();
vuit.event.browser.addListener(_51b,tevt,tf,false,true);
}
}
for(var y=0;y<_515.length;y++){
var _52d=_51b.getAttribute(_515[y]);
if((_52d)&&(_52d.length)){
var _527=null;
var _52e=_515[y].substr(4);
_527=trim(_52d);
var _52f=[_527];
if(_527.indexOf(";")>=0){
_52f=vuit.lang.map(_527.split(";"),trim);
}
for(var z=0;z<_52f.length;z++){
if(!_52f[z].length){
continue;
}
var tf=function(){
var ntf=new String(_52f[z]);
return function(evt){
if(_519[ntf]){
_519[ntf](vuit.event.browser.fixEvent(evt,this));
}
};
}();
vuit.event.browser.addListener(_51b,_52e,tf,false,true);
}
}
}
var _532=_51b.getAttribute(this.onBuildProperty);
if(_532){
eval("var node = baseNode; var widget = targetObj; "+_532);
}
}
};
vuit.widget.getVuitEventsFromStr=function(str){
var re=/(vuitOn([a-z]+)(\s?))=/gi;
var evts=str?str.match(re)||[]:[];
var ret=[];
var lem={};
for(var x=0;x<evts.length;x++){
if(evts[x].legth<1){
continue;
}
var cm=evts[x].replace(/\s/,"");
cm=(cm.slice(0,cm.length-1));
if(!lem[cm]){
lem[cm]=true;
ret.push(cm);
}
}
return ret;
};
vuit.declare("vuit.widget.DomWidget",vuit.widget.Widget,{initializer:function(){
if((arguments.length>0)&&(typeof arguments[0]=="object")){
this.create(arguments[0]);
}
},templateNode:null,templateString:null,templateCssString:null,preventClobber:false,domNode:null,containerNode:null,addChild:function(_53a,_53b,pos,ref,_53e){
if(!this.isContainer){
vuit.debug("vuit.widget.DomWidget.addChild() attempted on non-container widget");
return null;
}else{
if(_53e==undefined){
_53e=this.children.length;
}
this.addWidgetAsDirectChild(_53a,_53b,pos,ref,_53e);
this.registerChild(_53a,_53e);
}
return _53a;
},addWidgetAsDirectChild:function(_53f,_540,pos,ref,_543){
if((!this.containerNode)&&(!_540)){
this.containerNode=this.domNode;
}
var cn=(_540)?_540:this.containerNode;
if(!pos){
pos="after";
}
if(!ref){
if(!cn){
cn=vuit.body();
}
ref=cn.lastChild;
}
if(!_543){
_543=0;
}
_53f.domNode.setAttribute("vuitinsertionindex",_543);
if(!ref){
cn.appendChild(_53f.domNode);
}else{
if(pos=="insertAtIndex"){
vuit.dom.insertAtIndex(_53f.domNode,ref.parentNode,_543);
}else{
if((pos=="after")&&(ref===cn.lastChild)){
cn.appendChild(_53f.domNode);
}else{
vuit.dom.insertAtPosition(_53f.domNode,cn,pos);
}
}
}
},registerChild:function(_545,_546){
_545.vuitInsertionIndex=_546;
var idx=-1;
for(var i=0;i<this.children.length;i++){
if(this.children[i].vuitInsertionIndex<_546){
idx=i;
}
}
this.children.splice(idx+1,0,_545);
_545.parent=this;
_545.addedTo(this,idx+1);
delete vuit.widget.manager.topWidgets[_545.widgetId];
},removeChild:function(_549){
vuit.dom.removeNode(_549.domNode);
return vuit.widget.DomWidget.superclass.removeChild.call(this,_549);
},getFragNodeRef:function(frag){
if(!frag||!frag[this.namespace+":"+this.widgetType.toLowerCase()]){
vuit.raise("Error: no frag for widget type "+this.widgetType+" with namespace "+this.namespace+", id "+this.widgetId+" (maybe a widget has set it's type incorrectly)");
}
return frag?frag[this.namespace+":"+this.widgetType.toLowerCase()]["nodeRef"]:null;
},postInitialize:function(args,frag,_54d){
var _54e=this.getFragNodeRef(frag);
if(_54d&&(_54d.snarfChildDomOutput||!_54e)){
_54d.addWidgetAsDirectChild(this,"","insertAtIndex","",args["vuitinsertionindex"],_54e);
}else{
if(_54e){
if(this.domNode&&(this.domNode!==_54e)){
var _54f=_54e.parentNode.replaceChild(this.domNode,_54e);
}
}
}
if(_54d){
_54d.registerChild(this,args.vuitinsertionindex);
}else{
vuit.widget.manager.topWidgets[this.widgetId]=this;
}
if(this.isContainer){
var _550=vuit.widget.getParser();
_550.createSubComponents(frag,this);
}
},buildRendering:function(args,frag){
var ts=vuit.widget._templateCache[this.widgetType];
if(args["templatecsspath"]){
args["templateCssPath"]=args["templatecsspath"];
}
var _554=args["templateCssPath"]||this.templateCssPath;
if(_554&&!(_554 instanceof vuit.uri.Uri)){
_554=vuit.uri.vuitUri(_554);
vuit.deprecated("templateCssPath should be of type vuit.uri.Uri",null,"0.4");
}
if(_554&&!vuit.widget._cssFiles[_554.toString()]){
if((!this.templateCssString)&&(_554)){
this.templateCssString=vuit.hostenv.getText(_554);
this.templateCssPath=null;
}
vuit.widget._cssFiles[_554.toString()]=true;
}
if((this["templateCssString"])&&(!this.templateCssString["loaded"])){
vuit.html.insertCssText(this.templateCssString,null,_554);
if(!this.templateCssString){
this.templateCssString="";
}
this.templateCssString.loaded=true;
}
if((!this.preventClobber)&&((this.templatePath)||(this.templateNode)||((this["templateString"])&&(this.templateString.length))||((typeof ts!="undefined")&&((ts["string"])||(ts["node"]))))){
this.buildFromTemplate(args,frag);
}else{
this.domNode=this.getFragNodeRef(frag);
}
this.fillInTemplate(args,frag);
},buildFromTemplate:function(args,frag){
var _557=false;
if(args["templatepath"]){
_557=true;
args["templatePath"]=args["templatepath"];
}
vuit.widget.fillFromTemplateCache(this,args["templatePath"],null,_557);
var ts=vuit.widget._templateCache[this.widgetType];
if((ts)&&(!_557)){
if(!this.templateString.length){
this.templateString=ts["string"];
}
if(!this.templateNode){
this.templateNode=ts["node"];
}
}
var _559=false;
var node=null;
var tstr=this.templateString;
if((!this.templateNode)&&(this.templateString)){
_559=this.templateString.match(/\$\{([^\}]+)\}/g);
if(_559){
var hash=this.strings||{};
for(var key in vuit.widget.defaultStrings){
if(vuit.lang.isUndefined(hash[key])){
hash[key]=vuit.widget.defaultStrings[key];
}
}
for(var i=0;i<_559.length;i++){
var key=_559[i];
key=key.substring(2,key.length-1);
var kval=(key.substring(0,5)=="this.")?vuit.lang.getObjPathValue(key.substring(5),this):hash[key];
var _560;
if((kval)||(vuit.lang.isString(kval))){
_560=(vuit.lang.isFunction(kval))?kval.call(this,key,this.templateString):kval;
tstr=tstr.replace(_559[i],_560);
}
}
}else{
this.templateNode=this.createNodesFromText(this.templateString,true)[0];
if(!_557){
ts.node=this.templateNode;
}
}
}
if((!this.templateNode)&&(!_559)){
vuit.debug("DomWidget.buildFromTemplate: could not create template");
return false;
}else{
if(!_559){
node=this.templateNode.cloneNode(true);
if(!node){
return false;
}
}else{
node=this.createNodesFromText(tstr,true)[0];
}
}
this.domNode=node;
this.attachTemplateNodes(this.domNode,this);
if(this.isContainer&&this.containerNode){
var src=this.getFragNodeRef(frag);
if(src){
vuit.dom.moveChildren(src,this.containerNode);
}
}
},attachTemplateNodes:function(_562,_563){
if(!_563){
_563=this;
}
return vuit.widget.attachTemplateNodes(_562,_563,vuit.widget.getVuitEventsFromStr(this.templateString));
},fillInTemplate:function(){
},destroyRendering:function(){
try{
delete this.domNode;
}
catch(e){
}
},cleanUp:function(){
},getContainerHeight:function(){
vuit.unimplemented("vuit.widget.DomWidget.getContainerHeight");
},getContainerWidth:function(){
vuit.unimplemented("vuit.widget.DomWidget.getContainerWidth");
},createNodesFromText:function(){
vuit.unimplemented("vuit.widget.DomWidget.createNodesFromText");
}});
vuit.provide("vuit.html.common");
vuit.lang.mixin(vuit.html,vuit.dom);
vuit.html.body=function(){
vuit.deprecated("vuit.html.body() moved to vuit.body()","0.5");
return vuit.body();
};
vuit.html.getEventTarget=function(evt){
if(!evt){
evt=vuit.global().event||{};
}
var t=(evt.srcElement?evt.srcElement:(evt.target?evt.target:null));
while((t)&&(t.nodeType!=1)){
t=t.parentNode;
}
return t;
};
vuit.html.getViewport=function(){
var _566=vuit.global();
var _567=vuit.doc();
var w=0;
var h=0;
if(!vuit.render.html.opera&&_566.innerWidth){
w=_566.innerWidth;
h=_566.innerHeight;
}else{
if(!vuit.render.html.opera&&vuit.exists(_567,"documentElement.clientWidth")){
var w2=_567.documentElement.clientWidth;
if(!w||w2&&w2<w){
w=w2;
}
h=_567.documentElement.clientHeight;
}else{
if(vuit.body().clientWidth){
w=vuit.body().clientWidth;
h=vuit.body().clientHeight;
}
}
}
return {width:w,height:h};
};
vuit.html.getScroll=function(){
var _56b=vuit.global();
var _56c=vuit.doc();
var top=_56b.pageYOffset||_56c.documentElement.scrollTop||vuit.body().scrollTop||0;
var left=_56b.pageXOffset||_56c.documentElement.scrollLeft||vuit.body().scrollLeft||0;
return {top:top,left:left,offset:{x:left,y:top}};
};
vuit.html.getParentByType=function(node,type){
var _571=vuit.doc();
var _572=vuit.byId(node);
type=type.toLowerCase();
while((_572)&&(_572.nodeName.toLowerCase()!=type)){
if(_572==(_571["body"]||_571["documentElement"])){
return null;
}
_572=_572.parentNode;
}
return _572;
};
vuit.html.getAttribute=function(node,attr){
node=vuit.byId(node);
if((!node)||(!node.getAttribute)){
return null;
}
var ta=typeof attr=="string"?attr:new String(attr);
var v=node.getAttribute(ta.toUpperCase());
if((v)&&(typeof v=="string")&&(v!="")){
return v;
}
if(v&&v.value){
return v.value;
}
if((node.getAttributeNode)&&(node.getAttributeNode(ta))){
return (node.getAttributeNode(ta)).value;
}else{
if(node.getAttribute(ta)){
return node.getAttribute(ta);
}else{
if(node.getAttribute(ta.toLowerCase())){
return node.getAttribute(ta.toLowerCase());
}
}
}
return null;
};
vuit.html.hasAttribute=function(node,attr){
return vuit.html.getAttribute(vuit.byId(node),attr)?true:false;
};
vuit.html.getCursorPosition=function(e){
e=e||vuit.global().event;
var _57a={x:0,y:0};
if(e.pageX||e.pageY){
_57a.x=e.pageX;
_57a.y=e.pageY;
}else{
var de=vuit.doc().documentElement;
var db=vuit.body();
_57a.x=e.clientX+((de||db)["scrollLeft"])-((de||db)["clientLeft"]);
_57a.y=e.clientY+((de||db)["scrollTop"])-((de||db)["clientTop"]);
}
return _57a;
};
vuit.html.isTag=function(node){
node=vuit.byId(node);
if(node&&node.tagName){
for(var i=1;i<arguments.length;i++){
if(node.tagName.toLowerCase()==String(arguments[i]).toLowerCase()){
return String(arguments[i]).toLowerCase();
}
}
}
return "";
};
if(vuit.render.html.ie){
(function(){
var _57f=vuit.doc().createElement("script");
_57f.src="javascript:'vuit.html.createExternalElement=function(doc, tag){return doc.createElement(tag);}'";
vuit.doc().getElementsByTagName("head")[0].appendChild(_57f);
})();
}else{
vuit.html.createExternalElement=function(doc,tag){
return doc.createElement(tag);
};
}
vuit.html._callDeprecated=function(_582,_583,args,_585,_586){
vuit.deprecated("vuit.html."+_582,"replaced by vuit.html."+_583+"("+(_585?"node, {"+_585+": "+_585+"}":"")+")"+(_586?"."+_586:""),"0.5");
var _587=[];
if(_585){
var _588={};
_588[_585]=args[1];
_587.push(args[0]);
_587.push(_588);
}else{
_587=args;
}
var ret=vuit.html[_583].apply(vuit.html,args);
if(_586){
return ret[_586];
}else{
return ret;
}
};
vuit.html.getViewportWidth=function(){
return vuit.html._callDeprecated("getViewportWidth","getViewport",arguments,null,"width");
};
vuit.html.getViewportHeight=function(){
return vuit.html._callDeprecated("getViewportHeight","getViewport",arguments,null,"height");
};
vuit.html.getViewportSize=function(){
return vuit.html._callDeprecated("getViewportSize","getViewport",arguments);
};
vuit.html.getScrollTop=function(){
return vuit.html._callDeprecated("getScrollTop","getScroll",arguments,null,"top");
};
vuit.html.getScrollLeft=function(){
return vuit.html._callDeprecated("getScrollLeft","getScroll",arguments,null,"left");
};
vuit.html.getScrollOffset=function(){
return vuit.html._callDeprecated("getScrollOffset","getScroll",arguments,null,"offset");
};
vuit.provide("vuit.html.layout");
vuit.html.sumAncestorProperties=function(node,prop){
node=vuit.byId(node);
if(!node){
return 0;
}
var _58c=0;
while(node){
var val=node[prop];
if(val){
_58c+=val-0;
if(node==vuit.body()){
break;
}
}
node=node.parentNode;
}
return _58c;
};
vuit.html.setStyleAttributes=function(node,_58f){
node=vuit.byId(node);
var _590=_58f.replace(/(;)?\s*$/,"").split(";");
for(var i=0;i<_590.length;i++){
var _592=_590[i].split(":");
var name=_592[0].replace(/\s*$/,"").replace(/^\s*/,"").toLowerCase();
var _594=_592[1].replace(/\s*$/,"").replace(/^\s*/,"");
switch(name){
case "opacity":
vuit.html.setOpacity(node,_594);
break;
case "content-height":
vuit.html.setContentBox(node,{height:_594});
break;
case "content-width":
vuit.html.setContentBox(node,{width:_594});
break;
case "outer-height":
vuit.html.setMarginBox(node,{height:_594});
break;
case "outer-width":
vuit.html.setMarginBox(node,{width:_594});
break;
default:
node.style[vuit.html.toCamelCase(name)]=_594;
}
}
};
vuit.html.getAbsolutePosition=vuit.html.abs=function(node,_596){
node=vuit.byId(node,node.ownerDocument);
var ret={x:0,y:0};
var h=vuit.render.html;
var db=document["body"]||document["documentElement"];
if(h.ie){
with(node.getBoundingClientRect()){
ret.x=left-2;
ret.y=top-2;
}
}else{
if(document.getBoxObjectFor){
try{
var bo=document.getBoxObjectFor(node);
ret.x=bo.x-vuit.html.sumAncestorProperties(node,"scrollLeft");
ret.y=bo.y-vuit.html.sumAncestorProperties(node,"scrollTop");
}
catch(e){
}
}else{
if(node["offsetParent"]){
var _59b;
if((h.safari)&&(node.style.getPropertyValue("position")=="absolute")&&(node.parentNode==db)){
_59b=db;
}else{
_59b=db.parentNode;
}
if(node.parentNode!=db){
var nd=node;
if(vuit.render.html.opera){
nd=db;
}
ret.x-=vuit.html.sumAncestorProperties(nd,"scrollLeft");
ret.y-=vuit.html.sumAncestorProperties(nd,"scrollTop");
}
do{
var n=node["offsetLeft"];
if(!vuit.render.html.opera||n>0){
ret.x+=isNaN(n)?0:n;
}
var m=node["offsetTop"];
ret.y+=isNaN(m)?0:m;
node=node.offsetParent;
}while((node!=_59b)&&(node!=null));
}else{
if(node["x"]&&node["y"]){
ret.x+=isNaN(node.x)?0:node.x;
ret.y+=isNaN(node.y)?0:node.y;
}
}
}
}
if(_596){
var _59f=vuit.html.getScroll();
ret.y+=_59f.top;
ret.x+=_59f.left;
}
ret.top=ret.y;
ret.left=ret.x;
return ret;
};
vuit.html.isPositionAbsolute=function(node){
return (vuit.html.getComputedStyle(node,"position")=="absolute");
};
vuit.html._sumPixelValues=function(node,_5a2,_5a3){
var _5a4=0;
for(var x=0;x<_5a2.length;x++){
_5a4+=vuit.html.getPixelValue(node,_5a2[x],_5a3);
}
return _5a4;
};
vuit.html.getMargin=function(node){
return {width:vuit.html._sumPixelValues(node,["margin-left","margin-right"],(vuit.html.getComputedStyle(node,"position")=="absolute")),height:vuit.html._sumPixelValues(node,["margin-top","margin-bottom"],(vuit.html.getComputedStyle(node,"position")=="absolute"))};
};
vuit.html.getBorder=function(node){
return {width:vuit.html.getBorderExtent(node,"left")+vuit.html.getBorderExtent(node,"right"),height:vuit.html.getBorderExtent(node,"top")+vuit.html.getBorderExtent(node,"bottom")};
};
vuit.html.getBorderExtent=function(node,side){
return (vuit.html.getStyle(node,"border-"+side+"-style")=="none"?0:vuit.html.getPixelValue(node,"border-"+side+"-width"));
};
vuit.html.getMarginExtent=function(node,side){
return vuit.html._sumPixelValues(node,["margin-"+side],vuit.html.isPositionAbsolute(node));
};
vuit.html.getPaddingExtent=function(node,side){
return vuit.html._sumPixelValues(node,["padding-"+side],true);
};
vuit.html.getPadding=function(node){
return {width:vuit.html._sumPixelValues(node,["padding-left","padding-right"],true),height:vuit.html._sumPixelValues(node,["padding-top","padding-bottom"],true)};
};
vuit.html.getPadBorder=function(node){
var pad=vuit.html.getPadding(node);
var _5b1=vuit.html.getBorder(node);
return {width:pad.width+_5b1.width,height:pad.height+_5b1.height};
};
vuit.html.boxSizing={MARGIN_BOX:"margin-box",BORDER_BOX:"border-box",PADDING_BOX:"padding-box",CONTENT_BOX:"content-box"};
vuit.html.getBoxSizing=function(node){
var h=vuit.render.html;
var bs=vuit.html.boxSizing;
if((h.ie)||(h.opera)){
var cm=document["compatMode"];
if((cm=="BackCompat")||(cm=="QuirksMode")){
return bs.BORDER_BOX;
}else{
return bs.CONTENT_BOX;
}
}else{
if(arguments.length==0){
node=document.documentElement;
}
var _5b6=vuit.html.getStyle(node,"-moz-box-sizing");
if(!_5b6){
_5b6=vuit.html.getStyle(node,"box-sizing");
}
return (_5b6?_5b6:bs.CONTENT_BOX);
}
};
vuit.html.isBorderBox=function(node){
return (vuit.html.getBoxSizing(node)==vuit.html.boxSizing.BORDER_BOX);
};
vuit.html.getBorderBox=function(node){
node=vuit.byId(node);
return {width:node.offsetWidth,height:node.offsetHeight};
};
vuit.html.getContentBox=function(node){
node=vuit.byId(node);
var _5ba=vuit.html.getPadBorder(node);
return {width:node.offsetWidth-_5ba.width,height:node.offsetHeight-_5ba.height};
};
vuit.html.setContentBox=function(node,args){
node=vuit.byId(node);
var _5bd=0;
var _5be=0;
var isbb=vuit.html.isBorderBox(node);
var _5c0=(isbb?vuit.html.getPadBorder(node):{width:0,height:0});
var ret={};
if(typeof args.width!=undefined){
_5bd=args.width+_5c0.width;
ret.width=vuit.html.setPositivePixelValue(node,"width",_5bd);
}
if(typeof args.height!=undefined){
_5be=args.height+_5c0.height;
ret.height=vuit.html.setPositivePixelValue(node,"height",_5be);
}
return ret;
};
vuit.html.getMarginBox=function(node){
var _5c3=vuit.html.getBorderBox(node);
var _5c4=vuit.html.getMargin(node);
return {width:_5c3.width+_5c4.width,height:_5c3.height+_5c4.height};
};
vuit.html.setMarginBox=function(node,args){
node=vuit.byId(node);
var _5c7=0;
var _5c8=0;
var isbb=vuit.html.isBorderBox(node);
var _5ca=(!isbb?vuit.html.getPadBorder(node):{width:0,height:0});
var _5cb=vuit.html.getMargin(node);
var ret={};
if(typeof args.width!=undefined){
_5c7=args.width-_5ca.width;
_5c7-=_5cb.width;
ret.width=vuit.html.setPositivePixelValue(node,"width",_5c7);
}
if(typeof args.height!=undefined){
_5c8=args.height-_5ca.height;
_5c8-=_5cb.height;
ret.height=vuit.html.setPositivePixelValue(node,"height",_5c8);
}
return ret;
};
vuit.html.toCoordinateObject=vuit.html.toCoordinateArray=function(_5cd,_5ce){
if(_5cd instanceof Array||typeof _5cd=="array"){
vuit.deprecated("vuit.html.toCoordinateArray","use vuit.html.toCoordinateObject({left: , top: , width: , height: }) instead","0.5");
while(_5cd.length<4){
_5cd.push(0);
}
while(_5cd.length>4){
_5cd.pop();
}
var ret={left:_5cd[0],top:_5cd[1],width:_5cd[2],height:_5cd[3]};
}else{
if(!_5cd.nodeType&&!(_5cd instanceof String||typeof _5cd=="string")&&("width" in _5cd||"height" in _5cd||"left" in _5cd||"x" in _5cd||"top" in _5cd||"y" in _5cd)){
var ret={left:_5cd.left||_5cd.x||0,top:_5cd.top||_5cd.y||0,width:_5cd.width||0,height:_5cd.height||0};
}else{
var node=vuit.byId(_5cd);
var pos=vuit.html.abs(node,_5ce);
var _5d2=vuit.html.getBorderBox(node);
var ret={left:pos.left,top:pos.top,width:_5d2.width,height:_5d2.height};
}
}
ret.x=ret.left;
ret.y=ret.top;
return ret;
};
vuit.html.setMarginBoxWidth=vuit.html.setOuterWidth=function(node,_5d4){
return vuit.html._callDeprecated("setMarginBoxWidth","setMarginBox",arguments,"width");
};
vuit.html.setMarginBoxHeight=vuit.html.setOuterHeight=function(){
return vuit.html._callDeprecated("setMarginBoxHeight","setMarginBox",arguments,"height");
};
vuit.html.getMarginBoxWidth=vuit.html.getOuterWidth=function(){
return vuit.html._callDeprecated("getMarginBoxWidth","getMarginBox",arguments,null,"width");
};
vuit.html.getMarginBoxHeight=vuit.html.getOuterHeight=function(){
return vuit.html._callDeprecated("getMarginBoxHeight","getMarginBox",arguments,null,"height");
};
vuit.html.getTotalOffset=function(node,type,_5d7){
return vuit.html._callDeprecated("getTotalOffset","getAbsolutePosition",arguments,null,type);
};
vuit.html.getAbsoluteX=function(node,_5d9){
return vuit.html._callDeprecated("getAbsoluteX","getAbsolutePosition",arguments,null,"x");
};
vuit.html.getAbsoluteY=function(node,_5db){
return vuit.html._callDeprecated("getAbsoluteY","getAbsolutePosition",arguments,null,"y");
};
vuit.html.totalOffsetLeft=function(node,_5dd){
return vuit.html._callDeprecated("totalOffsetLeft","getAbsolutePosition",arguments,null,"left");
};
vuit.html.totalOffsetTop=function(node,_5df){
return vuit.html._callDeprecated("totalOffsetTop","getAbsolutePosition",arguments,null,"top");
};
vuit.html.getMarginWidth=function(node){
return vuit.html._callDeprecated("getMarginWidth","getMargin",arguments,null,"width");
};
vuit.html.getMarginHeight=function(node){
return vuit.html._callDeprecated("getMarginHeight","getMargin",arguments,null,"height");
};
vuit.html.getBorderWidth=function(node){
return vuit.html._callDeprecated("getBorderWidth","getBorder",arguments,null,"width");
};
vuit.html.getBorderHeight=function(node){
return vuit.html._callDeprecated("getBorderHeight","getBorder",arguments,null,"height");
};
vuit.html.getPaddingWidth=function(node){
return vuit.html._callDeprecated("getPaddingWidth","getPadding",arguments,null,"width");
};
vuit.html.getPaddingHeight=function(node){
return vuit.html._callDeprecated("getPaddingHeight","getPadding",arguments,null,"height");
};
vuit.html.getPadBorderWidth=function(node){
return vuit.html._callDeprecated("getPadBorderWidth","getPadBorder",arguments,null,"width");
};
vuit.html.getPadBorderHeight=function(node){
return vuit.html._callDeprecated("getPadBorderHeight","getPadBorder",arguments,null,"height");
};
vuit.html.getBorderBoxWidth=vuit.html.getInnerWidth=function(){
return vuit.html._callDeprecated("getBorderBoxWidth","getBorderBox",arguments,null,"width");
};
vuit.html.getBorderBoxHeight=vuit.html.getInnerHeight=function(){
return vuit.html._callDeprecated("getBorderBoxHeight","getBorderBox",arguments,null,"height");
};
vuit.html.getContentBoxWidth=vuit.html.getContentWidth=function(){
return vuit.html._callDeprecated("getContentBoxWidth","getContentBox",arguments,null,"width");
};
vuit.html.getContentBoxHeight=vuit.html.getContentHeight=function(){
return vuit.html._callDeprecated("getContentBoxHeight","getContentBox",arguments,null,"height");
};
vuit.html.setContentBoxWidth=vuit.html.setContentWidth=function(node,_5e9){
return vuit.html._callDeprecated("setContentBoxWidth","setContentBox",arguments,"width");
};
vuit.html.setContentBoxHeight=vuit.html.setContentHeight=function(node,_5eb){
return vuit.html._callDeprecated("setContentBoxHeight","setContentBox",arguments,"height");
};
vuit.provide("vuit.html.util");
vuit.html.getElementWindow=function(_5ec){
return vuit.html.getDocumentWindow(_5ec.ownerDocument);
};
vuit.html.getDocumentWindow=function(doc){
if(vuit.render.html.safari&&!doc._parentWindow){
var fix=function(win){
win.document._parentWindow=win;
for(var i=0;i<win.frames.length;i++){
fix(win.frames[i]);
}
};
fix(window.top);
}
if(vuit.render.html.ie&&window!==document.parentWindow&&!doc._parentWindow){
doc.parentWindow.execScript("document._parentWindow = window;","Javascript");
}
return doc._parentWindow||doc.parentWindow||doc.defaultView;
};
vuit.html.gravity=function(node,e){
node=vuit.byId(node);
var _5f3=vuit.html.getCursorPosition(e);
with(vuit.html){
var _5f4=getAbsolutePosition(node,true);
var bb=getBorderBox(node);
var _5f6=_5f4.x+(bb.width/2);
var _5f7=_5f4.y+(bb.height/2);
}
with(vuit.html.gravity){
return ((_5f3.x<_5f6?WEST:EAST)|(_5f3.y<_5f7?NORTH:SOUTH));
}
};
vuit.html.gravity.NORTH=1;
vuit.html.gravity.SOUTH=1<<1;
vuit.html.gravity.EAST=1<<2;
vuit.html.gravity.WEST=1<<3;
vuit.html.overElement=function(_5f8,e){
_5f8=vuit.byId(_5f8);
var _5fa=vuit.html.getCursorPosition(e);
with(vuit.html){
var bb=getBorderBox(_5f8);
var _5fc=getAbsolutePosition(_5f8,true);
var top=_5fc.y;
var _5fe=top+bb.height;
var left=_5fc.x;
var _600=left+bb.width;
}
return (_5fa.x>=left&&_5fa.x<=_600&&_5fa.y>=top&&_5fa.y<=_5fe);
};
vuit.html.renderedTextContent=function(node){
node=vuit.byId(node);
var _602="";
if(node==null){
return _602;
}
for(var i=0;i<node.childNodes.length;i++){
switch(node.childNodes[i].nodeType){
case 1:
case 5:
var _604="unknown";
try{
_604=vuit.html.getStyle(node.childNodes[i],"display");
}
catch(E){
}
switch(_604){
case "block":
case "list-item":
case "run-in":
case "table":
case "table-row-group":
case "table-header-group":
case "table-footer-group":
case "table-row":
case "table-column-group":
case "table-column":
case "table-cell":
case "table-caption":
_602+="\n";
_602+=vuit.html.renderedTextContent(node.childNodes[i]);
_602+="\n";
break;
case "none":
break;
default:
if(node.childNodes[i].tagName&&node.childNodes[i].tagName.toLowerCase()=="br"){
_602+="\n";
}else{
_602+=vuit.html.renderedTextContent(node.childNodes[i]);
}
break;
}
break;
case 3:
case 2:
case 4:
var text=node.childNodes[i].nodeValue;
var _606="unknown";
try{
_606=vuit.html.getStyle(node,"text-transform");
}
catch(E){
}
switch(_606){
case "capitalize":
var _607=text.split(" ");
for(var i=0;i<_607.length;i++){
_607[i]=_607[i].charAt(0).toUpperCase()+_607[i].substring(1);
}
text=_607.join(" ");
break;
case "uppercase":
text=text.toUpperCase();
break;
case "lowercase":
text=text.toLowerCase();
break;
default:
break;
}
switch(_606){
case "nowrap":
break;
case "pre-wrap":
break;
case "pre-line":
break;
case "pre":
break;
default:
text=text.replace(/\s+/," ");
if(/\s$/.test(_602)){
text.replace(/^\s/,"");
}
break;
}
_602+=text;
break;
default:
break;
}
}
return _602;
};
vuit.html.createNodesFromText=function(txt,trim){
if(trim){
txt=txt.replace(/^\s+|\s+$/g,"");
}
var tn=vuit.doc().createElement("div");
tn.style.visibility="hidden";
vuit.body().appendChild(tn);
var _60b="none";
if((/^<t[dh][\s\r\n>]/i).test(txt.replace(/^\s+/))){
txt="<table><tbody><tr>"+txt+"</tr></tbody></table>";
_60b="cell";
}else{
if((/^<tr[\s\r\n>]/i).test(txt.replace(/^\s+/))){
txt="<table><tbody>"+txt+"</tbody></table>";
_60b="row";
}else{
if((/^<(thead|tbody|tfoot)[\s\r\n>]/i).test(txt.replace(/^\s+/))){
txt="<table>"+txt+"</table>";
_60b="section";
}
}
}
tn.innerHTML=txt;
if(tn["normalize"]){
tn.normalize();
}
var _60c=null;
switch(_60b){
case "cell":
_60c=tn.getElementsByTagName("tr")[0];
break;
case "row":
_60c=tn.getElementsByTagName("tbody")[0];
break;
case "section":
_60c=tn.getElementsByTagName("table")[0];
break;
default:
_60c=tn;
break;
}
var _60d=[];
for(var x=0;x<_60c.childNodes.length;x++){
_60d.push(_60c.childNodes[x].cloneNode(true));
}
tn.style.display="none";
vuit.body().removeChild(tn);
return _60d;
};
vuit.html.placeOnScreen=function(node,_610,_611,_612,_613,_614,_615){
if(_610 instanceof Array||typeof _610=="array"){
_615=_614;
_614=_613;
_613=_612;
_612=_611;
_611=_610[1];
_610=_610[0];
}
if(_614 instanceof String||typeof _614=="string"){
_614=_614.split(",");
}
if(!isNaN(_612)){
_612=[Number(_612),Number(_612)];
}else{
if(!(_612 instanceof Array||typeof _612=="array")){
_612=[0,0];
}
}
var _616=vuit.html.getScroll().offset;
var view=vuit.html.getViewport();
node=vuit.byId(node);
var _618=node.style.display;
node.style.display="";
var bb=vuit.html.getBorderBox(node);
var w=bb.width;
var h=bb.height;
node.style.display=_618;
if(!(_614 instanceof Array||typeof _614=="array")){
_614=["TL"];
}
var _61c,besty,bestDistance=Infinity;
for(var _61d=0;_61d<_614.length;++_61d){
var _61e=_614[_61d];
var _61f=true;
var tryX=_610-(_61e.charAt(1)=="L"?0:w)+_612[0]*(_61e.charAt(1)=="L"?1:-1);
var tryY=_611-(_61e.charAt(0)=="T"?0:h)+_612[1]*(_61e.charAt(0)=="T"?1:-1);
if(_613){
tryX-=_616.x;
tryY-=_616.y;
}
var x=tryX+w;
if(x>view.width){
x=view.width-w;
_61f=false;
}else{
x=tryX;
}
x=Math.max(_612[0],x)+_616.x;
var y=tryY+h;
if(y>view.height){
y=view.height-h;
_61f=false;
}else{
y=tryY;
}
y=Math.max(_612[1],y)+_616.y;
if(_61f){
_61c=x;
besty=y;
bestDistance=0;
break;
}else{
var dist=Math.pow(x-tryX-_616.x,2)+Math.pow(y-tryY-_616.y,2);
if(bestDistance>dist){
bestDistance=dist;
_61c=x;
besty=y;
}
}
}
if(!_615){
node.style.left=_61c+"px";
node.style.top=besty+"px";
}
return {left:_61c,top:besty,x:_61c,y:besty,dist:bestDistance};
};
vuit.html.placeOnScreenPoint=function(node,_626,_627,_628,_629){
vuit.deprecated("vuit.html.placeOnScreenPoint","use vuit.html.placeOnScreen() instead","0.5");
return vuit.html.placeOnScreen(node,_626,_627,_628,_629,["TL","TR","BL","BR"]);
};
vuit.html.placeOnScreenAroundElement=function(node,_62b,_62c,_62d,_62e,_62f){
var best,bestDistance=Infinity;
_62b=vuit.byId(_62b);
var _631=_62b.style.display;
_62b.style.display="";
var mb=vuit.html.getMarginBox(_62b);
var _633=mb.width;
var _634=mb.height;
var _635=vuit.html.getAbsolutePosition(_62b,true);
_62b.style.display=_631;
for(var _636 in _62e){
var pos,desiredX,desiredY;
var _638=_62e[_636];
desiredX=_635.x+(_636.charAt(1)=="L"?0:_633);
desiredY=_635.y+(_636.charAt(0)=="T"?0:_634);
pos=vuit.html.placeOnScreen(node,desiredX,desiredY,_62c,_62d,_638,true);
if(pos.dist==0){
best=pos;
break;
}else{
if(bestDistance>pos.dist){
bestDistance=pos.dist;
best=pos;
}
}
}
if(!_62f){
node.style.left=best.left+"px";
node.style.top=best.top+"px";
}
return best;
};
vuit.html.scrollIntoView=function(node){
if(!node){
return;
}
if(vuit.render.html.ie){
if(vuit.html.getBorderBox(node.parentNode).height<node.parentNode.scrollHeight){
node.scrollIntoView(false);
}
}else{
if(vuit.render.html.mozilla){
node.scrollIntoView(false);
}else{
var _63a=node.parentNode;
var _63b=_63a.scrollTop+vuit.html.getBorderBox(_63a).height;
var _63c=node.offsetTop+vuit.html.getMarginBox(node).height;
if(_63b<_63c){
_63a.scrollTop+=(_63c-_63b);
}else{
if(_63a.scrollTop>node.offsetTop){
_63a.scrollTop-=(_63a.scrollTop-node.offsetTop);
}
}
}
}
};
vuit.provide("vuit.html.display");
vuit.html._toggle=function(node,_63e,_63f){
node=vuit.byId(node);
_63f(node,!_63e(node));
return _63e(node);
};
vuit.html.show=function(node){
node=vuit.byId(node);
if(vuit.html.getStyleProperty(node,"display")=="none"){
vuit.html.setStyle(node,"display",(node.vuitDisplayCache||""));
node.vuitDisplayCache=undefined;
}
};
vuit.html.hide=function(node){
node=vuit.byId(node);
if(typeof node["vuitDisplayCache"]=="undefined"){
var d=vuit.html.getStyleProperty(node,"display");
if(d!="none"){
node.vuitDisplayCache=d;
}
}
vuit.html.setStyle(node,"display","none");
};
vuit.html.setShowing=function(node,_644){
vuit.html[(_644?"show":"hide")](node);
};
vuit.html.isShowing=function(node){
return (vuit.html.getStyleProperty(node,"display")!="none");
};
vuit.html.toggleShowing=function(node){
return vuit.html._toggle(node,vuit.html.isShowing,vuit.html.setShowing);
};
vuit.html.displayMap={tr:"",td:"",th:"",img:"inline",span:"inline",input:"inline",button:"inline"};
vuit.html.suggestDisplayByTagName=function(node){
node=vuit.byId(node);
if(node&&node.tagName){
var tag=node.tagName.toLowerCase();
return (tag in vuit.html.displayMap?vuit.html.displayMap[tag]:"block");
}
};
vuit.html.setDisplay=function(node,_64a){
vuit.html.setStyle(node,"display",((_64a instanceof String||typeof _64a=="string")?_64a:(_64a?vuit.html.suggestDisplayByTagName(node):"none")));
};
vuit.html.isDisplayed=function(node){
return (vuit.html.getComputedStyle(node,"display")!="none");
};
vuit.html.toggleDisplay=function(node){
return vuit.html._toggle(node,vuit.html.isDisplayed,vuit.html.setDisplay);
};
vuit.html.setVisibility=function(node,_64e){
vuit.html.setStyle(node,"visibility",((_64e instanceof String||typeof _64e=="string")?_64e:(_64e?"visible":"hidden")));
};
vuit.html.isVisible=function(node){
return (vuit.html.getComputedStyle(node,"visibility")!="hidden");
};
vuit.html.toggleVisibility=function(node){
return vuit.html._toggle(node,vuit.html.isVisible,vuit.html.setVisibility);
};
vuit.html.setOpacity=function(node,_652,_653){
node=vuit.byId(node);
var h=vuit.render.html;
if(!_653){
if(_652>=1){
if(h.ie){
vuit.html.clearOpacity(node);
return;
}else{
_652=0.999999;
}
}else{
if(_652<0){
_652=0;
}
}
}
if(h.ie){
if(node.nodeName.toLowerCase()=="tr"){
var tds=node.getElementsByTagName("td");
for(var x=0;x<tds.length;x++){
tds[x].style.filter="Alpha(Opacity="+_652*100+")";
}
}
node.style.filter="Alpha(Opacity="+_652*100+")";
}else{
if(h.moz){
node.style.opacity=_652;
node.style.MozOpacity=_652;
}else{
if(h.safari){
node.style.opacity=_652;
node.style.KhtmlOpacity=_652;
}else{
node.style.opacity=_652;
}
}
}
};
vuit.html.clearOpacity=function clearOpacity(node){
node=vuit.byId(node);
var ns=node.style;
var h=vuit.render.html;
if(h.ie){
try{
if(node.filters&&node.filters.alpha){
ns.filter="";
}
}
catch(e){
}
}else{
if(h.moz){
ns.opacity=1;
ns.MozOpacity=1;
}else{
if(h.safari){
ns.opacity=1;
ns.KhtmlOpacity=1;
}else{
ns.opacity=1;
}
}
}
};
vuit.html.getOpacity=function getOpacity(node){
node=vuit.byId(node);
var h=vuit.render.html;
if(h.ie){
var opac=(node.filters&&node.filters.alpha&&typeof node.filters.alpha.opacity=="number"?node.filters.alpha.opacity:100)/100;
}else{
var opac=node.style.opacity||node.style.MozOpacity||node.style.KhtmlOpacity||1;
}
return opac>=0.999999?1:Number(opac);
};
vuit.provide("vuit.lfx.Animation");
vuit.provide("vuit.lfx.Line");
vuit.lfx.Line=function(_65d,end){
this.start=_65d;
this.end=end;
if(vuit.lang.isArray(_65d)){
var diff=[];
vuit.lang.forEach(this.start,function(s,i){
diff[i]=this.end[i]-s;
},this);
this.getValue=function(n){
var res=[];
vuit.lang.forEach(this.start,function(s,i){
res[i]=(diff[i]*n)+s;
},this);
return res;
};
}else{
var diff=end-_65d;
this.getValue=function(n){
return (diff*n)+this.start;
};
}
};
vuit.lfx.easeIn=function(n){
return Math.pow(n,3);
};
vuit.lfx.easeOut=function(n){
return (1-Math.pow(1-n,3));
};
vuit.lfx.easeInOut=function(n){
return ((3*Math.pow(n,2))-(2*Math.pow(n,3)));
};
vuit.lfx.IAnimation=function(){
};
vuit.lang.extend(vuit.lfx.IAnimation,{curve:null,duration:1000,easing:null,repeatCount:0,rate:25,handler:null,beforeBegin:null,onBegin:null,onAnimate:null,onEnd:null,onPlay:null,onPause:null,onStop:null,play:null,pause:null,stop:null,fire:function(evt,args){
if(this[evt]){
this[evt].apply(this,(args||[]));
}
},_active:false,_paused:false});
vuit.lfx.Animation=function(_66c,_66d,_66e,_66f,_670,rate){
vuit.lfx.IAnimation.call(this);
if(vuit.lang.isNumber(_66c)||(!_66c&&_66d.getValue)){
rate=_670;
_670=_66f;
_66f=_66e;
_66e=_66d;
_66d=_66c;
_66c=null;
}else{
if(_66c.getValue||vuit.lang.isArray(_66c)){
rate=_66f;
_670=_66e;
_66f=_66d;
_66e=_66c;
_66d=null;
_66c=null;
}
}
if(vuit.lang.isArray(_66e)){
this.curve=new vuit.lfx.Line(_66e[0],_66e[1]);
}else{
this.curve=_66e;
}
if(_66d!=null&&_66d>0){
this.duration=_66d;
}
if(_670){
this.repeatCount=_670;
}
if(rate){
this.rate=rate;
}
if(_66c){
this.handler=_66c.handler;
this.beforeBegin=_66c.beforeBegin;
this.onBegin=_66c.onBegin;
this.onEnd=_66c.onEnd;
this.onPlay=_66c.onPlay;
this.onPause=_66c.onPause;
this.onStop=_66c.onStop;
this.onAnimate=_66c.onAnimate;
}
if(_66f&&vuit.lang.isFunction(_66f)){
this.easing=_66f;
}
};
vuit.inherits(vuit.lfx.Animation,vuit.lfx.IAnimation);
vuit.lang.extend(vuit.lfx.Animation,{_startTime:null,_endTime:null,_timer:null,_percent:0,_startRepeatCount:0,play:function(_672,_673){
if(_673){
clearTimeout(this._timer);
this._active=false;
this._paused=false;
this._percent=0;
}else{
if(this._active&&!this._paused){
return this;
}
}
this.fire("handler",["beforeBegin"]);
this.fire("beforeBegin");
if(_672>0){
setTimeout(vuit.lang.hitch(this,function(){
this.play(null,_673);
}),_672);
return this;
}
this._startTime=new Date().valueOf();
if(this._paused){
this._startTime-=(this.duration*this._percent/100);
}
this._endTime=this._startTime+this.duration;
this._active=true;
this._paused=false;
var step=this._percent/100;
var _675=this.curve.getValue(step);
if(this._percent==0){
if(!this._startRepeatCount){
this._startRepeatCount=this.repeatCount;
}
this.fire("handler",["begin",_675]);
this.fire("onBegin",[_675]);
}
this.fire("handler",["play",_675]);
this.fire("onPlay",[_675]);
this._cycle();
return this;
},pause:function(){
clearTimeout(this._timer);
if(!this._active){
return this;
}
this._paused=true;
var _676=this.curve.getValue(this._percent/100);
this.fire("handler",["pause",_676]);
this.fire("onPause",[_676]);
return this;
},gotoPercent:function(pct,_678){
clearTimeout(this._timer);
this._active=true;
this._paused=true;
this._percent=pct;
if(_678){
this.play();
}
},stop:function(_679){
clearTimeout(this._timer);
var step=this._percent/100;
if(_679){
step=1;
}
var _67b=this.curve.getValue(step);
this.fire("handler",["stop",_67b]);
this.fire("onStop",[_67b]);
this._active=false;
this._paused=false;
return this;
},status:function(){
if(this._active){
return this._paused?"paused":"playing";
}else{
return "stopped";
}
},_cycle:function(){
clearTimeout(this._timer);
if(this._active){
var curr=new Date().valueOf();
var step=(curr-this._startTime)/(this._endTime-this._startTime);
if(step>=1){
step=1;
this._percent=100;
}else{
this._percent=step*100;
}
if((this.easing)&&(vuit.lang.isFunction(this.easing))){
step=this.easing(step);
}
var _67e=this.curve.getValue(step);
this.fire("handler",["animate",_67e]);
this.fire("onAnimate",[_67e]);
if(step<1){
this._timer=setTimeout(vuit.lang.hitch(this,"_cycle"),this.rate);
}else{
this._active=false;
this.fire("handler",["end"]);
this.fire("onEnd");
if(this.repeatCount>0){
this.repeatCount--;
this.play(null,true);
}else{
if(this.repeatCount==-1){
this.play(null,true);
}else{
if(this._startRepeatCount){
this.repeatCount=this._startRepeatCount;
this._startRepeatCount=0;
}
}
}
}
}
return this;
}});
vuit.lfx.Combine=function(){
vuit.lfx.IAnimation.call(this);
this._anims=[];
this._animsEnded=0;
var _67f=arguments;
if(_67f.length==1&&(vuit.lang.isArray(_67f[0])||vuit.lang.isArrayLike(_67f[0]))){
_67f=_67f[0];
}
var _680=this;
vuit.lang.forEach(_67f,function(anim){
_680._anims.push(anim);
var _682=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_682();
_680._onAnimsEnded();
};
});
};
vuit.inherits(vuit.lfx.Combine,vuit.lfx.IAnimation);
vuit.lang.extend(vuit.lfx.Combine,{_animsEnded:0,play:function(_683,_684){
if(!this._anims.length){
return this;
}
this.fire("beforeBegin");
if(_683>0){
setTimeout(vuit.lang.hitch(this,function(){
this.play(null,_684);
}),_683);
return this;
}
if(_684||this._anims[0].percent==0){
this.fire("onBegin");
}
this.fire("onPlay");
this._animsCall("play",null,_684);
return this;
},pause:function(){
this.fire("onPause");
this._animsCall("pause");
return this;
},stop:function(_685){
this.fire("onStop");
this._animsCall("stop",_685);
return this;
},_onAnimsEnded:function(){
this._animsEnded++;
if(this._animsEnded>=this._anims.length){
this.fire("onEnd");
}
return this;
},_animsCall:function(_686){
var args=[];
if(arguments.length>1){
for(var i=1;i<arguments.length;i++){
args.push(arguments[i]);
}
}
var _689=this;
vuit.lang.forEach(this._anims,function(anim){
anim[_686](args);
},_689);
return this;
}});
vuit.lfx.Chain=function(){
vuit.lfx.IAnimation.call(this);
this._anims=[];
this._currAnim=-1;
var _68b=arguments;
if(_68b.length==1&&(vuit.lang.isArray(_68b[0])||vuit.lang.isArrayLike(_68b[0]))){
_68b=_68b[0];
}
var _68c=this;
vuit.lang.forEach(_68b,function(anim,i,_68f){
_68c._anims.push(anim);
var _690=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
if(i<_68f.length-1){
anim.onEnd=function(){
_690();
_68c._playNext();
};
}else{
anim.onEnd=function(){
_690();
_68c.fire("onEnd");
};
}
},_68c);
};
vuit.inherits(vuit.lfx.Chain,vuit.lfx.IAnimation);
vuit.lang.extend(vuit.lfx.Chain,{_currAnim:-1,play:function(_691,_692){
if(!this._anims.length){
return this;
}
if(_692||!this._anims[this._currAnim]){
this._currAnim=0;
}
var _693=this._anims[this._currAnim];
this.fire("beforeBegin");
if(_691>0){
setTimeout(vuit.lang.hitch(this,function(){
this.play(null,_692);
}),_691);
return this;
}
if(_693){
if(this._currAnim==0){
this.fire("handler",["begin",this._currAnim]);
this.fire("onBegin",[this._currAnim]);
}
this.fire("onPlay",[this._currAnim]);
_693.play(null,_692);
}
return this;
},pause:function(){
if(this._anims[this._currAnim]){
this._anims[this._currAnim].pause();
this.fire("onPause",[this._currAnim]);
}
return this;
},playPause:function(){
if(this._anims.length==0){
return this;
}
if(this._currAnim==-1){
this._currAnim=0;
}
var _694=this._anims[this._currAnim];
if(_694){
if(!_694._active||_694._paused){
this.play();
}else{
this.pause();
}
}
return this;
},stop:function(){
var _695=this._anims[this._currAnim];
if(_695){
_695.stop();
this.fire("onStop",[this._currAnim]);
}
return _695;
},_playNext:function(){
if(this._currAnim==-1||this._anims.length==0){
return this;
}
this._currAnim++;
if(this._anims[this._currAnim]){
this._anims[this._currAnim].play(null,true);
}
return this;
}});
vuit.lfx.combine=function(){
var _696=arguments;
if(vuit.lang.isArray(arguments[0])){
_696=arguments[0];
}
return new vuit.lfx.Combine(_696);
};
vuit.lfx.chain=function(){
var _697=arguments;
if(vuit.lang.isArray(arguments[0])){
_697=arguments[0];
}
return new vuit.lfx.Chain(_697);
};
vuit.provide("vuit.graphics.color");
vuit.graphics.color.Color=function(r,g,b,a){
if(vuit.lang.isArray(r)){
this.r=r[0];
this.g=r[1];
this.b=r[2];
this.a=r[3]||1;
}else{
if(vuit.lang.isString(r)){
var rgb=vuit.graphics.color.extractRGB(r);
this.r=rgb[0];
this.g=rgb[1];
this.b=rgb[2];
this.a=g||1;
}else{
if(r instanceof vuit.graphics.color.Color){
this.r=r.r;
this.b=r.b;
this.g=r.g;
this.a=r.a;
}else{
this.r=r;
this.g=g;
this.b=b;
this.a=a;
}
}
}
};
vuit.graphics.color.Color.fromArray=function(arr){
return new vuit.graphics.color.Color(arr[0],arr[1],arr[2],arr[3]);
};
vuit.lang.extend(vuit.graphics.color.Color,{toRgb:function(_69e){
if(_69e){
return this.toRgba();
}else{
return [this.r,this.g,this.b];
}
},toRgba:function(){
return [this.r,this.g,this.b,this.a];
},toHex:function(){
return vuit.graphics.color.rgb2hex(this.toRgb());
},toCss:function(){
return "rgb("+this.toRgb().join()+")";
},toString:function(){
return this.toHex();
},blend:function(_69f,_6a0){
return vuit.graphics.color.blend(this.toRgb(),new vuit.graphics.color.Color(_69f).toRgb(),_6a0);
}});
vuit.graphics.color.named={white:[255,255,255],black:[0,0,0],red:[255,0,0],green:[0,255,0],blue:[0,0,255],navy:[0,0,128],gray:[128,128,128],silver:[192,192,192]};
vuit.graphics.color.blend=function(a,b,_6a3){
if(typeof a=="string"){
return vuit.graphics.color.blendHex(a,b,_6a3);
}
if(!_6a3){
_6a3=0;
}else{
if(_6a3>1){
_6a3=1;
}else{
if(_6a3<-1){
_6a3=-1;
}
}
}
var c=new Array(3);
for(var i=0;i<3;i++){
var half=Math.abs(a[i]-b[i])/2;
c[i]=Math.floor(Math.min(a[i],b[i])+half+(half*_6a3));
}
return c;
};
vuit.graphics.color.blendHex=function(a,b,_6a9){
return vuit.graphics.color.rgb2hex(vuit.graphics.color.blend(vuit.graphics.color.hex2rgb(a),vuit.graphics.color.hex2rgb(b),_6a9));
};
vuit.graphics.color.extractRGB=function(_6aa){
var hex="0123456789abcdef";
_6aa=_6aa.toLowerCase();
if(_6aa.indexOf("rgb")==0){
var _6ac=_6aa.match(/rgba*\((\d+), *(\d+), *(\d+)/i);
var ret=_6ac.splice(1,3);
return ret;
}else{
var _6ae=vuit.graphics.color.hex2rgb(_6aa);
if(_6ae){
return _6ae;
}else{
return vuit.graphics.color.named[_6aa]||[255,255,255];
}
}
};
vuit.graphics.color.hex2rgb=function(hex){
var _6b0="0123456789ABCDEF";
var rgb=new Array(3);
if(hex.indexOf("#")==0){
hex=hex.substring(1);
}
hex=hex.toUpperCase();
if(hex.replace(new RegExp("["+_6b0+"]","g"),"")!=""){
return null;
}
if(hex.length==3){
rgb[0]=hex.charAt(0)+hex.charAt(0);
rgb[1]=hex.charAt(1)+hex.charAt(1);
rgb[2]=hex.charAt(2)+hex.charAt(2);
}else{
rgb[0]=hex.substring(0,2);
rgb[1]=hex.substring(2,4);
rgb[2]=hex.substring(4);
}
for(var i=0;i<rgb.length;i++){
rgb[i]=_6b0.indexOf(rgb[i].charAt(0))*16+_6b0.indexOf(rgb[i].charAt(1));
}
return rgb;
};
vuit.graphics.color.rgb2hex=function(r,g,b){
if(vuit.lang.isArray(r)){
g=r[1]||0;
b=r[2]||0;
r=r[0]||0;
}
var ret=vuit.lang.map([r,g,b],function(x){
x=new Number(x);
var s=x.toString(16);
while(s.length<2){
s="0"+s;
}
return s;
});
ret.unshift("#");
return ret.join("");
};
vuit.provide("vuit.html.color");
vuit.html.getBackgroundColor=function(node){
node=vuit.byId(node);
var _6ba;
do{
_6ba=vuit.html.getStyle(node,"background-color");
if(_6ba.toLowerCase()=="rgba(0, 0, 0, 0)"){
_6ba="transparent";
}
if(node==document.getElementsByTagName("body")[0]){
node=null;
break;
}
node=node.parentNode;
}while(node&&vuit.lang.inArray(["transparent",""],_6ba));
if(_6ba=="transparent"){
_6ba=[255,255,255,0];
}else{
_6ba=vuit.graphics.color.extractRGB(_6ba);
}
return _6ba;
};
vuit.provide("vuit.lfx.html");
vuit.lfx.html._byId=function(_6bb){
if(!_6bb){
return [];
}
if(vuit.lang.isArray(_6bb)){
if(!_6bb.alreadyChecked){
var n=[];
vuit.lang.forEach(_6bb,function(node){
n.push(vuit.byId(node));
});
n.alreadyChecked=true;
return n;
}else{
return _6bb;
}
}else{
var n=[];
n.push(vuit.byId(_6bb));
n.alreadyChecked=true;
return n;
}
};
vuit.lfx.html.propertyAnimation=function(_6be,_6bf,_6c0,_6c1){
_6be=vuit.lfx.html._byId(_6be);
if(_6be.length==1){
vuit.lang.forEach(_6bf,function(prop){
if(typeof prop["start"]=="undefined"){
if(prop.property!="opacity"){
prop.start=parseInt(vuit.html.getComputedStyle(_6be[0],prop.property));
}else{
prop.start=vuit.html.getOpacity(_6be[0]);
}
}
});
}
var _6c3=function(_6c4){
var _6c5=new Array(_6c4.length);
for(var i=0;i<_6c4.length;i++){
_6c5[i]=Math.round(_6c4[i]);
}
return _6c5;
};
var _6c7=function(n,_6c9){
n=vuit.byId(n);
if(!n||!n.style){
return;
}
for(var s in _6c9){
if(s=="opacity"){
vuit.html.setOpacity(n,_6c9[s]);
}else{
n.style[s]=_6c9[s];
}
}
};
var _6cb=function(_6cc){
this._properties=_6cc;
this.diffs=new Array(_6cc.length);
vuit.lang.forEach(_6cc,function(prop,i){
if(vuit.lang.isArray(prop.start)){
this.diffs[i]=null;
}else{
if(prop.start instanceof vuit.graphics.color.Color){
prop.startRgb=prop.start.toRgb();
prop.endRgb=prop.end.toRgb();
}else{
this.diffs[i]=prop.end-prop.start;
}
}
},this);
this.getValue=function(n){
var ret={};
vuit.lang.forEach(this._properties,function(prop,i){
var _6d3=null;
if(vuit.lang.isArray(prop.start)){
}else{
if(prop.start instanceof vuit.graphics.color.Color){
_6d3=(prop.units||"rgb")+"(";
for(var j=0;j<prop.startRgb.length;j++){
_6d3+=Math.round(((prop.endRgb[j]-prop.startRgb[j])*n)+prop.startRgb[j])+(j<prop.startRgb.length-1?",":"");
}
_6d3+=")";
}else{
_6d3=((this.diffs[i])*n)+prop.start+(prop.property!="opacity"?prop.units||"px":"");
}
}
ret[vuit.html.toCamelCase(prop.property)]=_6d3;
},this);
return ret;
};
};
var anim=new vuit.lfx.Animation({onAnimate:function(_6d6){
vuit.lang.forEach(_6be,function(node){
_6c7(node,_6d6);
});
}},_6c0,new _6cb(_6bf),_6c1);
return anim;
};
vuit.lfx.html._makeFadeable=function(_6d8){
var _6d9=function(node){
if(vuit.render.html.ie){
if((node.style.zoom.length==0)&&(vuit.html.getStyle(node,"zoom")=="normal")){
node.style.zoom="1";
}
if((node.style.width.length==0)&&(vuit.html.getStyle(node,"width")=="auto")){
node.style.width="auto";
}
}
};
if(vuit.lang.isArrayLike(_6d8)){
vuit.lang.forEach(_6d8,_6d9);
}else{
_6d9(_6d8);
}
};
vuit.lfx.html.fadeIn=function(_6db,_6dc,_6dd,_6de){
_6db=vuit.lfx.html._byId(_6db);
vuit.lfx.html._makeFadeable(_6db);
var anim=vuit.lfx.propertyAnimation(_6db,[{property:"opacity",start:vuit.html.getOpacity(_6db[0]),end:1}],_6dc,_6dd);
if(_6de){
var _6e0=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_6e0();
_6de(_6db,anim);
};
}
return anim;
};
vuit.lfx.html.fadeOut=function(_6e1,_6e2,_6e3,_6e4){
_6e1=vuit.lfx.html._byId(_6e1);
vuit.lfx.html._makeFadeable(_6e1);
var anim=vuit.lfx.propertyAnimation(_6e1,[{property:"opacity",start:vuit.html.getOpacity(_6e1[0]),end:0}],_6e2,_6e3);
if(_6e4){
var _6e6=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_6e6();
_6e4(_6e1,anim);
};
}
return anim;
};
vuit.lfx.html.fadeShow=function(_6e7,_6e8,_6e9,_6ea){
_6e7=vuit.lfx.html._byId(_6e7);
vuit.lang.forEach(_6e7,function(node){
vuit.html.setOpacity(node,0);
});
var anim=vuit.lfx.html.fadeIn(_6e7,_6e8,_6e9,_6ea);
var _6ed=(anim["beforeBegin"])?vuit.lang.hitch(anim,"beforeBegin"):function(){
};
anim.beforeBegin=function(){
_6ed();
if(vuit.lang.isArrayLike(_6e7)){
vuit.lang.forEach(_6e7,vuit.html.show);
}else{
vuit.html.show(_6e7);
}
};
return anim;
};
vuit.lfx.html.fadeHide=function(_6ee,_6ef,_6f0,_6f1){
var anim=vuit.lfx.html.fadeOut(_6ee,_6ef,_6f0,function(){
if(vuit.lang.isArrayLike(_6ee)){
vuit.lang.forEach(_6ee,vuit.html.hide);
}else{
vuit.html.hide(_6ee);
}
if(_6f1){
_6f1(_6ee,anim);
}
});
return anim;
};
vuit.lfx.html.wipeIn=function(_6f3,_6f4,_6f5,_6f6){
_6f3=vuit.lfx.html._byId(_6f3);
var _6f7=[];
vuit.lang.forEach(_6f3,function(node){
var _6f9=vuit.html.getStyle(node,"overflow");
if(_6f9=="visible"){
node.style.overflow="hidden";
}
node.style.height="0px";
vuit.html.show(node);
var anim=vuit.lfx.propertyAnimation(node,[{property:"height",start:0,end:node.scrollHeight}],_6f4,_6f5);
var _6fb=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_6fb();
node.style.overflow=_6f9;
node.style.height="auto";
if(_6f6){
_6f6(node,anim);
}
};
_6f7.push(anim);
});
if(_6f3.length>1){
return vuit.lfx.combine(_6f7);
}else{
return _6f7[0];
}
};
vuit.lfx.html.wipeOut=function(_6fc,_6fd,_6fe,_6ff){
_6fc=vuit.lfx.html._byId(_6fc);
var _700=[];
vuit.lang.forEach(_6fc,function(node){
var _702=vuit.html.getStyle(node,"overflow");
if(_702=="visible"){
node.style.overflow="hidden";
}
vuit.html.show(node);
var anim=vuit.lfx.propertyAnimation(node,[{property:"height",start:vuit.html.getContentBox(node).height,end:0}],_6fd,_6fe);
var _704=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_704();
vuit.html.hide(node);
node.style.overflow=_702;
if(_6ff){
_6ff(node,anim);
}
};
_700.push(anim);
});
if(_6fc.length>1){
return vuit.lfx.combine(_700);
}else{
return _700[0];
}
};
vuit.lfx.html.slideTo=function(_705,_706,_707,_708,_709){
_705=vuit.lfx.html._byId(_705);
var _70a=[];
if(vuit.lang.isArray(_706)){
vuit.deprecated("vuit.lfx.html.slideTo(node, array)","use vuit.lfx.html.slideTo(node, {top: value, left: value});","0.5");
_706={top:_706[0],left:_706[1]};
}
vuit.lang.forEach(_705,function(node){
var top=null;
var left=null;
var init=(function(){
var _70f=node;
return function(){
var pos=vuit.html.getComputedStyle(_70f,"position");
top=(pos=="absolute"?node.offsetTop:parseInt(vuit.html.getComputedStyle(node,"top"))||0);
left=(pos=="absolute"?node.offsetLeft:parseInt(vuit.html.getComputedStyle(node,"left"))||0);
if(!vuit.lang.inArray(["absolute","relative"],pos)){
var ret=vuit.html.abs(_70f,true);
vuit.html.setStyleAttributes(_70f,"position:absolute;top:"+ret.y+"px;left:"+ret.x+"px;");
top=ret.y;
left=ret.x;
}
};
})();
init();
var anim=vuit.lfx.propertyAnimation(node,[{property:"top",start:top,end:_706.top||0},{property:"left",start:left,end:_706.left||0}],_707,_708);
var _713=(anim["beforeBegin"])?vuit.lang.hitch(anim,"beforeBegin"):function(){
};
anim.beforeBegin=function(){
_713();
init();
};
if(_709){
var _714=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_714();
_709(_705,anim);
};
}
_70a.push(anim);
});
if(_705.length>1){
return vuit.lfx.combine(_70a);
}else{
return _70a[0];
}
};
vuit.lfx.html.slideBy=function(_715,_716,_717,_718,_719){
_715=vuit.lfx.html._byId(_715);
var _71a=[];
if(vuit.lang.isArray(_716)){
vuit.deprecated("vuit.lfx.html.slideBy(node, array)","use vuit.lfx.html.slideBy(node, {top: value, left: value});","0.5");
_716={top:_716[0],left:_716[1]};
}
vuit.lang.forEach(_715,function(node){
var top=null;
var left=null;
var init=(function(){
var _71f=node;
return function(){
var pos=vuit.html.getComputedStyle(_71f,"position");
top=(pos=="absolute"?node.offsetTop:parseInt(vuit.html.getComputedStyle(node,"top"))||0);
left=(pos=="absolute"?node.offsetLeft:parseInt(vuit.html.getComputedStyle(node,"left"))||0);
if(!vuit.lang.inArray(["absolute","relative"],pos)){
var ret=vuit.html.abs(_71f,true);
vuit.html.setStyleAttributes(_71f,"position:absolute;top:"+ret.y+"px;left:"+ret.x+"px;");
top=ret.y;
left=ret.x;
}
};
})();
init();
var anim=vuit.lfx.propertyAnimation(node,[{property:"top",start:top,end:top+(_716.top||0)},{property:"left",start:left,end:left+(_716.left||0)}],_717,_718);
var _723=(anim["beforeBegin"])?vuit.lang.hitch(anim,"beforeBegin"):function(){
};
anim.beforeBegin=function(){
_723();
init();
};
if(_719){
var _724=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_724();
_719(_715,anim);
};
}
_71a.push(anim);
});
if(_715.length>1){
return vuit.lfx.combine(_71a);
}else{
return _71a[0];
}
};
vuit.lfx.html.explode=function(_725,_726,_727,_728,_729){
_725=vuit.byId(_725);
_726=vuit.byId(_726);
var _72a=vuit.html.toCoordinateObject(_725,true);
var _72b=document.createElement("div");
vuit.html.copyStyle(_72b,_726);
with(_72b.style){
position="absolute";
display="none";
}
vuit.body().appendChild(_72b);
with(_726.style){
visibility="hidden";
display="block";
}
var _72c=vuit.html.toCoordinateObject(_726,true);
with(_726.style){
display="none";
visibility="visible";
}
var anim=new vuit.lfx.propertyAnimation(_72b,[{property:"height",start:_72a.height,end:_72c.height},{property:"width",start:_72a.width,end:_72c.width},{property:"top",start:_72a.top,end:_72c.top},{property:"left",start:_72a.left,end:_72c.left},{property:"opacity",start:0.3,end:1}],_727,_728);
anim.beforeBegin=function(){
vuit.html.setDisplay(_72b,"block");
};
anim.onEnd=function(){
vuit.html.setDisplay(_726,"block");
_72b.parentNode.removeChild(_72b);
};
if(_729){
var _72e=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_72e();
_729(_726,anim);
};
}
return anim;
};
vuit.lfx.html.implode=function(_72f,end,_731,_732,_733){
_72f=vuit.byId(_72f);
end=vuit.byId(end);
var _734=vuit.html.toCoordinateObject(_72f,true);
var _735=vuit.html.toCoordinateObject(end,true);
var _736=document.createElement("div");
vuit.html.copyStyle(_736,_72f);
vuit.html.setOpacity(_736,0.3);
with(_736.style){
position="absolute";
display="none";
}
vuit.body().appendChild(_736);
var anim=new vuit.lfx.propertyAnimation(_736,[{property:"height",start:_734.height,end:_735.height},{property:"width",start:_734.width,end:_735.width},{property:"top",start:_734.top,end:_735.top},{property:"left",start:_734.left,end:_735.left},{property:"opacity",start:1,end:0.3}],_731,_732);
anim.beforeBegin=function(){
vuit.html.hide(_72f);
vuit.html.show(_736);
};
anim.onEnd=function(){
_736.parentNode.removeChild(_736);
};
if(_733){
var _738=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_738();
_733(_72f,anim);
};
}
return anim;
};
vuit.lfx.html.highlight=function(_739,_73a,_73b,_73c,_73d){
_739=vuit.lfx.html._byId(_739);
var _73e=[];
vuit.lang.forEach(_739,function(node){
var _740=vuit.html.getBackgroundColor(node);
var bg=vuit.html.getStyle(node,"background-color").toLowerCase();
var _742=vuit.html.getStyle(node,"background-image");
var _743=(bg=="transparent"||bg=="rgba(0, 0, 0, 0)");
while(_740.length>3){
_740.pop();
}
var rgb=new vuit.graphics.color.Color(_73a);
var _745=new vuit.graphics.color.Color(_740);
var anim=vuit.lfx.propertyAnimation(node,[{property:"background-color",start:rgb,end:_745}],_73b,_73c);
var _747=(anim["beforeBegin"])?vuit.lang.hitch(anim,"beforeBegin"):function(){
};
anim.beforeBegin=function(){
_747();
if(_742){
node.style.backgroundImage="none";
}
node.style.backgroundColor="rgb("+rgb.toRgb().join(",")+")";
};
var _748=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_748();
if(_742){
node.style.backgroundImage=_742;
}
if(_743){
node.style.backgroundColor="transparent";
}
if(_73d){
_73d(node,anim);
}
};
_73e.push(anim);
});
if(_739.length>1){
return vuit.lfx.combine(_73e);
}else{
return _73e[0];
}
};
vuit.lfx.html.unhighlight=function(_749,_74a,_74b,_74c,_74d){
_749=vuit.lfx.html._byId(_749);
var _74e=[];
vuit.lang.forEach(_749,function(node){
var _750=new vuit.graphics.color.Color(vuit.html.getBackgroundColor(node));
var rgb=new vuit.graphics.color.Color(_74a);
var _752=vuit.html.getStyle(node,"background-image");
var anim=vuit.lfx.propertyAnimation(node,[{property:"background-color",start:_750,end:rgb}],_74b,_74c);
var _754=(anim["beforeBegin"])?vuit.lang.hitch(anim,"beforeBegin"):function(){
};
anim.beforeBegin=function(){
_754();
if(_752){
node.style.backgroundImage="none";
}
node.style.backgroundColor="rgb("+_750.toRgb().join(",")+")";
};
var _755=(anim["onEnd"])?vuit.lang.hitch(anim,"onEnd"):function(){
};
anim.onEnd=function(){
_755();
if(_74d){
_74d(node,anim);
}
};
_74e.push(anim);
});
if(_749.length>1){
return vuit.lfx.combine(_74e);
}else{
return _74e[0];
}
};
vuit.lang.mixin(vuit.lfx,vuit.lfx.html);
vuit.provide("vuit.lfx.*");
vuit.provide("vuit.lfx.toggle");
vuit.lfx.toggle.plain={show:function(node,_757,_758,_759){
vuit.html.show(node);
if(vuit.lang.isFunction(_759)){
_759();
}
},hide:function(node,_75b,_75c,_75d){
vuit.html.hide(node);
if(vuit.lang.isFunction(_75d)){
_75d();
}
}};
vuit.lfx.toggle.fade={show:function(node,_75f,_760,_761){
vuit.lfx.fadeShow(node,_75f,_760,_761).play();
},hide:function(node,_763,_764,_765){
vuit.lfx.fadeHide(node,_763,_764,_765).play();
}};
vuit.lfx.toggle.wipe={show:function(node,_767,_768,_769){
vuit.lfx.wipeIn(node,_767,_768,_769).play();
},hide:function(node,_76b,_76c,_76d){
vuit.lfx.wipeOut(node,_76b,_76c,_76d).play();
}};
vuit.lfx.toggle.explode={show:function(node,_76f,_770,_771,_772){
vuit.lfx.explode(_772||{x:0,y:0,width:0,height:0},node,_76f,_770,_771).play();
},hide:function(node,_774,_775,_776,_777){
vuit.lfx.implode(node,_777||{x:0,y:0,width:0,height:0},_774,_775,_776).play();
}};
vuit.provide("vuit.widget.HtmlWidget");
vuit.declare("vuit.widget.HtmlWidget",vuit.widget.DomWidget,{widgetType:"HtmlWidget",templateCssPath:null,templatePath:null,toggle:"plain",toggleDuration:150,animationInProgress:false,initialize:function(args,frag){
},postMixInProperties:function(args,frag){
this.toggleObj=vuit.lfx.toggle[this.toggle.toLowerCase()]||vuit.lfx.toggle.plain;
},getContainerHeight:function(){
vuit.unimplemented("vuit.widget.HtmlWidget.getContainerHeight");
},getContainerWidth:function(){
return this.parent.domNode.offsetWidth;
},setNativeHeight:function(_77c){
var ch=this.getContainerHeight();
},createNodesFromText:function(txt,wrap){
return vuit.html.createNodesFromText(txt,wrap);
},destroyRendering:function(_780){
try{
if(!_780&&this.domNode){
vuit.event.browser.clean(this.domNode);
}
this.domNode.parentNode.removeChild(this.domNode);
delete this.domNode;
}
catch(e){
}
},isShowing:function(){
return vuit.html.isShowing(this.domNode);
},toggleShowing:function(){
if(this.isHidden){
this.show();
}else{
this.hide();
}
},show:function(){
this.animationInProgress=true;
this.isHidden=false;
this.toggleObj.show(this.domNode,this.toggleDuration,null,vuit.lang.hitch(this,this.onShow),this.explodeSrc);
},onShow:function(){
this.animationInProgress=false;
this.checkSize();
},hide:function(){
this.animationInProgress=true;
this.isHidden=true;
this.toggleObj.hide(this.domNode,this.toggleDuration,null,vuit.lang.hitch(this,this.onHide),this.explodeSrc);
},onHide:function(){
this.animationInProgress=false;
},_isResized:function(w,h){
if(!this.isShowing()){
return false;
}
var wh=vuit.html.getMarginBox(this.domNode);
var _784=w||wh.width;
var _785=h||wh.height;
if(this.width==_784&&this.height==_785){
return false;
}
this.width=_784;
this.height=_785;
return true;
},checkSize:function(){
if(!this._isResized()){
return;
}
this.onResized();
},resizeTo:function(w,h){
if(!this._isResized(w,h)){
return;
}
vuit.html.setMarginBox(this.domNode,{width:w,height:h});
this.onResized();
},resizeSoon:function(){
if(this.isShowing()){
vuit.lang.setTimeout(this,this.onResized,0);
}
},onResized:function(){
vuit.lang.forEach(this.children,function(_788){
if(_788["checkSize"]){
_788.checkSize();
}
});
}});
vuit.provide("vuit.widget.*");
vuit.provide("vuit.html.*");
vuit.provide("vuit.widget.TreeNode");
vuit.widget.tags.addParseTreeHandler("vuit:TreeNode");
vuit.widget.TreeNode=function(){
vuit.widget.HtmlWidget.call(this);
this.actionsDisabled=[];
};
vuit.inherits(vuit.widget.TreeNode,vuit.widget.HtmlWidget);
vuit.lang.extend(vuit.widget.TreeNode,{widgetType:"TreeNode",loadStates:{UNCHECKED:"UNCHECKED",LOADING:"LOADING",LOADED:"LOADED"},actions:{MOVE:"MOVE",REMOVE:"REMOVE",EDIT:"EDIT",ADDCHILD:"ADDCHILD"},isContainer:true,lockLevel:0,templateString:("<div class=\"vuitTreeNode\"> "+"<span treeNode=\"${this.widgetId}\" class=\"vuitTreeNodeLabel\" vuitAttachPoint=\"labelNode\"> "+"\t\t<span vuitAttachPoint=\"titleNode\" vuitAttachEvent=\"onClick: onTitleClick\" class=\"vuitTreeNodeLabelTitle\">${this.title}</span> "+"</span> "+"<span class=\"vuitTreeNodeAfterLabel\" vuitAttachPoint=\"afterLabelNode\">${this.afterLabel}</span> "+"<div vuitAttachPoint=\"containerNode\" style=\"display:none\"></div> "+"</div>").replace(/(>|<)\s+/g,"$1"),childIconSrc:"",childIconFolderSrc:vuit.uri.vuitUri("src/widget/templates/images/Tree/closed.gif"),childIconDocumentSrc:vuit.uri.vuitUri("src/widget/templates/images/Tree/document.gif"),childIcon:null,isTreeNode:true,objectId:"",afterLabel:"",afterLabelNode:null,expandIcon:null,title:"",object:"",isFolder:false,labelNode:null,titleNode:null,imgs:null,expandLevel:"",tree:null,depth:0,isExpanded:false,state:null,domNodeInitialized:false,isFirstNode:function(){
return this.getParentIndex()==0?true:false;
},isLastNode:function(){
return this.getParentIndex()==this.parent.children.length-1?true:false;
},lock:function(){
return this.tree.lock.apply(this,arguments);
},unlock:function(){
return this.tree.unlock.apply(this,arguments);
},isLocked:function(){
return this.tree.isLocked.apply(this,arguments);
},cleanLock:function(){
return this.tree.cleanLock.apply(this,arguments);
},actionIsDisabled:function(_789){
var _78a=this;
var _78b=false;
if(this.tree.strictFolders&&_789==this.actions.ADDCHILD&&!this.isFolder){
_78b=true;
}
if(vuit.lang.inArray(_78a.actionsDisabled,_789)){
_78b=true;
}
if(this.isLocked()){
_78b=true;
}
return _78b;
},getInfo:function(){
var info={widgetId:this.widgetId,objectId:this.objectId,index:this.getParentIndex(),isFolder:this.isFolder};
return info;
},initialize:function(args,frag){
this.state=this.loadStates.UNCHECKED;
for(var i=0;i<this.actionsDisabled.length;i++){
this.actionsDisabled[i]=this.actionsDisabled[i].toUpperCase();
}
this.expandLevel=parseInt(this.expandLevel);
},adjustDepth:function(_790){
for(var i=0;i<this.children.length;i++){
this.children[i].adjustDepth(_790);
}
this.depth+=_790;
if(_790>0){
for(var i=0;i<_790;i++){
var img=this.tree.makeBlankImg();
this.imgs.unshift(img);
vuit.html.insertBefore(this.imgs[0],this.domNode.firstChild);
}
}
if(_790<0){
for(var i=0;i<-_790;i++){
this.imgs.shift();
vuit.html.removeNode(this.domNode.firstChild);
}
}
},markLoading:function(){
this._markLoadingSavedIcon=this.expandIcon.src;
this.expandIcon.src=this.tree.expandIconSrcLoading;
},unMarkLoading:function(){
if(!this._markLoadingSavedIcon){
return;
}
var im=new Image();
im.src=this.tree.expandIconSrcLoading;
if(this.expandIcon.src==im.src){
this.expandIcon.src=this._markLoadingSavedIcon;
}
this._markLoadingSavedIcon=null;
},setFolder:function(){
vuit.event.connect(this.expandIcon,"onclick",this,"onTreeClick");
this.expandIcon.src=this.isExpanded?this.tree.expandIconSrcMinus:this.tree.expandIconSrcPlus;
this.isFolder=true;
},createDOMNode:function(tree,_795){
this.tree=tree;
this.depth=_795;
this.imgs=[];
for(var i=0;i<this.depth+1;i++){
var img=this.tree.makeBlankImg();
this.domNode.insertBefore(img,this.labelNode);
this.imgs.push(img);
}
this.expandIcon=this.imgs[this.imgs.length-1];
this.childIcon=this.tree.makeBlankImg();
this.imgs.push(this.childIcon);
vuit.html.insertBefore(this.childIcon,this.titleNode);
if(this.children.length||this.isFolder){
this.setFolder();
}else{
this.state=this.loadStates.LOADED;
}
vuit.event.connect(this.childIcon,"onclick",this,"onIconClick");
for(var i=0;i<this.children.length;i++){
this.children[i].parent=this;
var node=this.children[i].createDOMNode(this.tree,this.depth+1);
this.containerNode.appendChild(node);
}
if(this.children.length){
this.state=this.loadStates.LOADED;
}
this.updateIcons();
this.domNodeInitialized=true;
vuit.event.topic.publish(this.tree.eventNames.createDOMNode,{source:this});
return this.domNode;
},onTreeClick:function(e){
vuit.event.topic.publish(this.tree.eventNames.treeClick,{source:this,event:e});
},onIconClick:function(e){
vuit.event.topic.publish(this.tree.eventNames.iconClick,{source:this,event:e});
},onTitleClick:function(e){
vuit.event.topic.publish(this.tree.eventNames.titleClick,{source:this,event:e});
},markSelected:function(){
vuit.html.addClass(this.titleNode,"vuitTreeNodeLabelSelected");
},unMarkSelected:function(){
vuit.html.removeClass(this.titleNode,"vuitTreeNodeLabelSelected");
},updateExpandIcon:function(){
if(this.isFolder){
this.expandIcon.src=this.isExpanded?this.tree.expandIconSrcMinus:this.tree.expandIconSrcPlus;
}else{
this.expandIcon.src=this.tree.blankIconSrc;
}
},updateExpandGrid:function(){
if(this.tree.showGrid){
if(this.depth){
this.setGridImage(-2,this.isLastNode()?this.tree.gridIconSrcL:this.tree.gridIconSrcT);
}else{
if(this.isFirstNode()){
this.setGridImage(-2,this.isLastNode()?this.tree.gridIconSrcX:this.tree.gridIconSrcY);
}else{
this.setGridImage(-2,this.isLastNode()?this.tree.gridIconSrcL:this.tree.gridIconSrcT);
}
}
}else{
this.setGridImage(-2,this.tree.blankIconSrc);
}
},updateChildGrid:function(){
if((this.depth||this.tree.showRootGrid)&&this.tree.showGrid){
this.setGridImage(-1,(this.children.length&&this.isExpanded)?this.tree.gridIconSrcP:this.tree.gridIconSrcC);
}else{
if(this.tree.showGrid&&!this.tree.showRootGrid){
this.setGridImage(-1,(this.children.length&&this.isExpanded)?this.tree.gridIconSrcZ:this.tree.blankIconSrc);
}else{
this.setGridImage(-1,this.tree.blankIconSrc);
}
}
},updateParentGrid:function(){
var _79c=this.parent;
for(var i=0;i<this.depth;i++){
var idx=this.imgs.length-(3+i);
var img=(this.tree.showGrid&&!_79c.isLastNode())?this.tree.gridIconSrcV:this.tree.blankIconSrc;
this.setGridImage(idx,img);
_79c=_79c.parent;
}
},updateExpandGridColumn:function(){
if(!this.tree.showGrid){
return;
}
var _7a0=this;
var icon=this.isLastNode()?this.tree.blankIconSrc:this.tree.gridIconSrcV;
vuit.lang.forEach(_7a0.getDescendants(),function(node){
node.setGridImage(_7a0.depth,icon);
});
this.updateExpandGrid();
},updateIcons:function(){
this.imgs[0].style.display=this.tree.showRootGrid?"inline":"none";
this.buildChildIcon();
this.updateExpandGrid();
this.updateChildGrid();
this.updateParentGrid();
vuit.profile.stop("updateIcons");
},buildChildIcon:function(){
if(this.childIconSrc){
this.childIcon.src=this.childIconSrc;
}
this.childIcon.style.display=this.childIconSrc?"inline":"none";
},setGridImage:function(idx,src){
if(idx<0){
idx=this.imgs.length+idx;
}
this.imgs[idx].style.backgroundImage="url("+src+")";
},updateIconTree:function(){
this.tree.updateIconTree.call(this);
},expand:function(){
if(this.isExpanded){
return;
}
if(this.children.length){
this.showChildren();
}
this.isExpanded=true;
this.updateExpandIcon();
vuit.event.topic.publish(this.tree.eventNames.expand,{source:this});
},collapse:function(){
if(!this.isExpanded){
return;
}
this.hideChildren();
this.isExpanded=false;
this.updateExpandIcon();
vuit.event.topic.publish(this.tree.eventNames.collapse,{source:this});
},hideChildren:function(){
this.tree.toggleObj.hide(this.containerNode,this.toggleDuration,this.explodeSrc,vuit.lang.hitch(this,"onHide"));
if(vuit.exists(vuit,"dnd.dragManager.dragObjects")&&vuit.dnd.dragManager.dragObjects.length){
vuit.dnd.dragManager.cacheTargetLocations();
}
},showChildren:function(){
this.tree.toggleObj.show(this.containerNode,this.toggleDuration,this.explodeSrc,vuit.lang.hitch(this,"onShow"));
if(vuit.exists(vuit,"dnd.dragManager.dragObjects")&&vuit.dnd.dragManager.dragObjects.length){
vuit.dnd.dragManager.cacheTargetLocations();
}
},addChild:function(){
return this.tree.addChild.apply(this,arguments);
},doAddChild:function(){
return this.tree.doAddChild.apply(this,arguments);
},edit:function(_7a5){
vuit.lang.mixin(this,_7a5);
if(_7a5.title){
this.titleNode.innerHTML=this.title;
}
if(_7a5.afterLabel){
this.afterLabelNode.innerHTML=this.afterLabel;
}
if(_7a5.childIconSrc){
this.buildChildIcon();
}
},removeNode:function(){
return this.tree.removeNode.apply(this,arguments);
},doRemoveNode:function(){
return this.tree.doRemoveNode.apply(this,arguments);
},toString:function(){
return "["+this.widgetType+" Tree:"+this.tree+" ID:"+this.widgetId+" Title:"+this.title+"]";
}});
vuit.provide("vuit.html.selection");
vuit.html.selectionType={NONE:0,TEXT:1,CONTROL:2};
vuit.html.clearSelection=function(){
var _7a6=vuit.global();
var _7a7=vuit.doc();
try{
if(_7a6["getSelection"]){
if(vuit.render.html.safari){
_7a6.getSelection().collapse();
}else{
_7a6.getSelection().removeAllRanges();
}
}else{
if(_7a7.selection){
if(_7a7.selection.empty){
_7a7.selection.empty();
}else{
if(_7a7.selection.clear){
_7a7.selection.clear();
}
}
}
}
return true;
}
catch(e){
vuit.debug(e);
return false;
}
};
vuit.html.disableSelection=function(_7a8){
_7a8=vuit.byId(_7a8)||vuit.body();
var h=vuit.render.html;
if(h.mozilla){
_7a8.style.MozUserSelect="none";
}else{
if(h.safari){
_7a8.style.KhtmlUserSelect="none";
}else{
if(h.ie){
_7a8.unselectable="on";
}else{
return false;
}
}
}
return true;
};
vuit.html.enableSelection=function(_7aa){
_7aa=vuit.byId(_7aa)||vuit.body();
var h=vuit.render.html;
if(h.mozilla){
_7aa.style.MozUserSelect="";
}else{
if(h.safari){
_7aa.style.KhtmlUserSelect="";
}else{
if(h.ie){
_7aa.unselectable="off";
}else{
return false;
}
}
}
return true;
};
vuit.html.selectElement=function(_7ac){
var _7ad=vuit.global();
var _7ae=vuit.doc();
_7ac=vuit.byId(_7ac);
if(_7ae.selection&&vuit.body().createTextRange){
var _7af=vuit.body().createTextRange();
_7af.moveToElementText(_7ac);
_7af.select();
}else{
if(_7ad["getSelection"]){
var _7b0=_7ad.getSelection();
if(_7b0["selectAllChildren"]){
_7b0.selectAllChildren(_7ac);
}
}
}
};
vuit.html.selectInputText=function(_7b1){
var _7b2=vuit.global();
var _7b3=vuit.doc();
_7b1=vuit.byId(_7b1);
if(_7b3.selection&&vuit.body().createTextRange){
var _7b4=_7b1.createTextRange();
_7b4.moveStart("character",0);
_7b4.moveEnd("character",_7b1.value.length);
_7b4.select();
}else{
if(_7b2["getSelection"]){
var _7b5=_7b2.getSelection();
_7b1.setSelectionRange(0,_7b1.value.length);
}
}
_7b1.focus();
};
vuit.html.isSelectionCollapsed=function(){
var _7b6=vuit.global();
var _7b7=vuit.doc();
if(_7b7["selection"]){
return _7b7.selection.createRange().text=="";
}else{
if(_7b6["getSelection"]){
var _7b8=_7b6.getSelection();
if(vuit.lang.isString(_7b8)){
return _7b8=="";
}else{
return _7b8.isCollapsed;
}
}
}
};
vuit.lang.mixin(vuit.html.selection,{getType:function(){
if(vuit.doc().selection){
return vuit.html.selectionType[vuit.doc().selection.type.toUpperCase()];
}else{
var _7b9=vuit.html.selectionType.TEXT;
var oSel;
try{
oSel=vuit.global().getSelection();
}
catch(e){
}
if(oSel&&oSel.rangeCount==1){
var _7bb=oSel.getRangeAt(0);
if(_7bb.startContainer==_7bb.endContainer&&(_7bb.endOffset-_7bb.startOffset)==1&&_7bb.startContainer.nodeType!=vuit.dom.TEXT_NODE){
_7b9=vuit.html.selectionType.CONTROL;
}
}
return _7b9;
}
},getSelectedElement:function(){
if(vuit.html.selection.getType()==vuit.html.selectionType.CONTROL){
if(vuit.doc().selection){
var _7bc=vuit.doc().selection.createRange();
if(_7bc&&_7bc.item){
return vuit.doc().selection.createRange().item(0);
}
}else{
var oSel=vuit.global().getSelection();
return oSel.anchorNode.childNodes[oSel.anchorOffset];
}
}
},getParentElement:function(){
if(vuit.html.selection.getType()==vuit.html.selectionType.CONTROL){
var p=vuit.html.selection.getSelectedElement();
if(p){
return p.parentNode;
}
}else{
if(vuit.doc().selection){
return vuit.doc().selection.createRange().parentElement();
}else{
var oSel=vuit.global().getSelection();
if(oSel){
var _7c0=oSel.anchorNode;
while(_7c0&&_7c0.nodeType!=1){
_7c0=_7c0.parentNode;
}
return _7c0;
}
}
}
},selectNode:function(node){
vuit.html.selectElement(node);
},collapse:function(){
vuit.html.clearSelection();
},remove:function(){
if(vuit.doc().selection){
var oSel=vuit.doc().selection;
if(oSel.type.toUpperCase()!="NONE"){
oSel.clear();
}
return oSel;
}else{
var oSel=vuit.global().getSelection();
for(var i=0;i<oSel.rangeCount;i++){
oSel.getRangeAt(i).deleteContents();
}
return oSel;
}
}});
vuit.provide("vuit.AdapterRegistry");
vuit.AdapterRegistry=function(_7c4){
this.pairs=[];
this.returnWrappers=_7c4||false;
};
vuit.lang.extend(vuit.AdapterRegistry,{register:function(name,_7c6,wrap,_7c8,_7c9){
var type=(_7c9)?"unshift":"push";
this.pairs[type]([name,_7c6,wrap,_7c8]);
},match:function(){
for(var i=0;i<this.pairs.length;i++){
var pair=this.pairs[i];
if(pair[1].apply(this,arguments)){
if((pair[3])||(this.returnWrappers)){
return pair[2];
}else{
return pair[2].apply(this,arguments);
}
}
}
throw new Error("No match found");
},unregister:function(name){
for(var i=0;i<this.pairs.length;i++){
var pair=this.pairs[i];
if(pair[0]==name){
this.pairs.splice(i,1);
return true;
}
}
return false;
}});
vuit.provide("vuit.json");
vuit.json={jsonRegistry:new vuit.AdapterRegistry(),register:function(name,_7d1,wrap,_7d3){
vuit.json.jsonRegistry.register(name,_7d1,wrap,_7d3);
},evalJson:function(json){
try{
return eval("("+json+")");
}
catch(e){
vuit.debug(e);
return json;
}
},serialize:function(o){
var _7d6=typeof (o);
if(_7d6=="undefined"){
return "undefined";
}else{
if((_7d6=="number")||(_7d6=="boolean")){
return o+"";
}else{
if(o===null){
return "null";
}
}
}
if(_7d6=="string"){
return vuit.string.escapeString(o);
}
var me=arguments.callee;
var _7d8;
if(typeof (o.__json__)=="function"){
_7d8=o.__json__();
if(o!==_7d8){
return me(_7d8);
}
}
if(typeof (o.json)=="function"){
_7d8=o.json();
if(o!==_7d8){
return me(_7d8);
}
}
if(_7d6!="function"&&typeof (o.length)=="number"){
var res=[];
for(var i=0;i<o.length;i++){
var val=me(o[i]);
if(typeof (val)!="string"){
val="undefined";
}
res.push(val);
}
return "["+res.join(",")+"]";
}
try{
window.o=o;
_7d8=vuit.json.jsonRegistry.match(o);
return me(_7d8);
}
catch(e){
}
if(_7d6=="function"){
return null;
}
res=[];
for(var k in o){
var _7dd;
if(typeof (k)=="number"){
_7dd="\""+k+"\"";
}else{
if(typeof (k)=="string"){
_7dd=vuit.string.escapeString(k);
}else{
continue;
}
}
val=me(o[k]);
if(typeof (val)!="string"){
continue;
}
res.push(_7dd+":"+val);
}
return "{"+res.join(",")+"}";
}};
vuit.provide("vuit.dnd.DragSource");
vuit.provide("vuit.dnd.DropTarget");
vuit.provide("vuit.dnd.DragObject");
vuit.provide("vuit.dnd.DragAndDrop");
vuit.dnd.DragSource=function(){
var dm=vuit.dnd.dragManager;
if(dm["registerDragSource"]){
dm.registerDragSource(this);
}
};
vuit.lang.extend(vuit.dnd.DragSource,{type:"",onDragEnd:function(){
},onDragStart:function(){
},onSelected:function(){
},unregister:function(){
vuit.dnd.dragManager.unregisterDragSource(this);
},reregister:function(){
vuit.dnd.dragManager.registerDragSource(this);
}});
vuit.dnd.DragObject=function(){
var dm=vuit.dnd.dragManager;
if(dm["registerDragObject"]){
dm.registerDragObject(this);
}
};
vuit.lang.extend(vuit.dnd.DragObject,{type:"",onDragStart:function(){
},onDragMove:function(){
},onDragOver:function(){
},onDragOut:function(){
},onDragEnd:function(){
},onDragLeave:this.onDragOut,onDragEnter:this.onDragOver,ondragout:this.onDragOut,ondragover:this.onDragOver});
vuit.dnd.DropTarget=function(){
if(this.constructor==vuit.dnd.DropTarget){
return;
}
this.acceptedTypes=[];
vuit.dnd.dragManager.registerDropTarget(this);
};
vuit.lang.extend(vuit.dnd.DropTarget,{acceptsType:function(type){
if(!vuit.lang.inArray(this.acceptedTypes,"*")){
if(!vuit.lang.inArray(this.acceptedTypes,type)){
return false;
}
}
return true;
},accepts:function(_7e1){
if(!vuit.lang.inArray(this.acceptedTypes,"*")){
for(var i=0;i<_7e1.length;i++){
if(!vuit.lang.inArray(this.acceptedTypes,_7e1[i].type)){
return false;
}
}
}
return true;
},onDragOver:function(){
},onDragOut:function(){
},onDragMove:function(){
},onDropStart:function(){
},onDrop:function(){
},onDropEnd:function(){
}});
vuit.dnd.DragEvent=function(){
this.dragSource=null;
this.dragObject=null;
this.target=null;
this.eventStatus="success";
};
vuit.dnd.DragManager=function(){
};
vuit.lang.extend(vuit.dnd.DragManager,{selectedSources:[],dragObjects:[],dragSources:[],registerDragSource:function(){
},dropTargets:[],registerDropTarget:function(){
},lastDragTarget:null,currentDragTarget:null,onKeyDown:function(){
},onMouseOut:function(){
},onMouseMove:function(){
},onMouseUp:function(){
}});
vuit.provide("vuit.dnd.HtmlDragManager");
vuit.dnd.HtmlDragManager=function(){
};
vuit.inherits(vuit.dnd.HtmlDragManager,vuit.dnd.DragManager);
vuit.lang.extend(vuit.dnd.HtmlDragManager,{disabled:false,nestedTargets:false,mouseDownTimer:null,dsCounter:0,dsPrefix:"vuitDragSource",dropTargetDimensions:[],currentDropTarget:null,previousDropTarget:null,_dragTriggered:false,selectedSources:[],dragObjects:[],currentX:null,currentY:null,lastX:null,lastY:null,mouseDownX:null,mouseDownY:null,threshold:7,dropAcceptable:false,cancelEvent:function(e){
e.stopPropagation();
e.preventDefault();
},registerDragSource:function(ds){
if(ds["domNode"]){
var dp=this.dsPrefix;
var _7e6=dp+"Idx_"+(this.dsCounter++);
ds.dragSourceId=_7e6;
this.dragSources[_7e6]=ds;
ds.domNode.setAttribute(dp,_7e6);
if(vuit.render.html.ie){
vuit.event.browser.addListener(ds.domNode,"ondragstart",this.cancelEvent);
}
}
},unregisterDragSource:function(ds){
if(ds["domNode"]){
var dp=this.dsPrefix;
var _7e9=ds.dragSourceId;
delete ds.dragSourceId;
delete this.dragSources[_7e9];
ds.domNode.setAttribute(dp,null);
}
if(vuit.render.html.ie){
vuit.event.browser.removeListener(ds.domNode,"ondragstart",this.cancelEvent);
}
},registerDropTarget:function(dt){
this.dropTargets.push(dt);
},unregisterDropTarget:function(dt){
var _7ec=vuit.lang.find(this.dropTargets,dt,true);
if(_7ec>=0){
this.dropTargets.splice(_7ec,1);
}
},getDragSource:function(e){
var tn=e.target;
if(tn===vuit.body()){
return;
}
var ta=vuit.html.getAttribute(tn,this.dsPrefix);
while((!ta)&&(tn)){
tn=tn.parentNode;
if((!tn)||(tn===vuit.body())){
return;
}
ta=vuit.html.getAttribute(tn,this.dsPrefix);
}
return this.dragSources[ta];
},onKeyDown:function(e){
},onMouseDown:function(e){
if(this.disabled){
return;
}
if(vuit.render.html.ie){
if(e.button!=1){
return;
}
}else{
if(e.which!=1){
return;
}
}
var _7f2=e.target.nodeType==vuit.html.TEXT_NODE?e.target.parentNode:e.target;
if(vuit.html.isTag(_7f2,"button","textarea","input","select","option")){
return;
}
var ds=this.getDragSource(e);
if(!ds){
return;
}
if(!vuit.lang.inArray(this.selectedSources,ds)){
this.selectedSources.push(ds);
ds.onSelected();
}
this.mouseDownX=e.pageX;
this.mouseDownY=e.pageY;
e.preventDefault();
vuit.event.connect(document,"onmousemove",this,"onMouseMove");
},onMouseUp:function(e,_7f5){
if(this.selectedSources.length==0){
return;
}
this.mouseDownX=null;
this.mouseDownY=null;
this._dragTriggered=false;
e.dragSource=this.dragSource;
if((!e.shiftKey)&&(!e.ctrlKey)){
if(this.currentDropTarget){
this.currentDropTarget.onDropStart();
}
vuit.lang.forEach(this.dragObjects,function(_7f6){
var ret=null;
if(!_7f6){
return;
}
if(this.currentDropTarget){
e.dragObject=_7f6;
var ce=this.currentDropTarget.domNode.childNodes;
if(ce.length>0){
e.dropTarget=ce[0];
while(e.dropTarget==_7f6.domNode){
e.dropTarget=e.dropTarget.nextSibling;
}
}else{
e.dropTarget=this.currentDropTarget.domNode;
}
if(this.dropAcceptable){
ret=this.currentDropTarget.onDrop(e);
}else{
this.currentDropTarget.onDragOut(e);
}
}
e.dragStatus=this.dropAcceptable&&ret?"dropSuccess":"dropFailure";
vuit.lang.delayThese([function(){
try{
_7f6.dragSource.onDragEnd(e);
}
catch(err){
var _7f9={};
for(var i in e){
if(i=="type"){
_7f9.type="mouseup";
continue;
}
_7f9[i]=e[i];
}
_7f6.dragSource.onDragEnd(_7f9);
}
},function(){
_7f6.onDragEnd(e);
}]);
},this);
this.selectedSources=[];
this.dragObjects=[];
this.dragSource=null;
if(this.currentDropTarget){
this.currentDropTarget.onDropEnd();
}
}
vuit.event.disconnect(document,"onmousemove",this,"onMouseMove");
this.currentDropTarget=null;
},onScroll:function(){
for(var i=0;i<this.dragObjects.length;i++){
if(this.dragObjects[i].updateDragOffset){
this.dragObjects[i].updateDragOffset();
}
}
if(this.dragObjects.length){
this.cacheTargetLocations();
}
},_dragStartDistance:function(x,y){
if((!this.mouseDownX)||(!this.mouseDownX)){
return;
}
var dx=Math.abs(x-this.mouseDownX);
var dx2=dx*dx;
var dy=Math.abs(y-this.mouseDownY);
var dy2=dy*dy;
return parseInt(Math.sqrt(dx2+dy2),10);
},cacheTargetLocations:function(){
vuit.profile.start("cacheTargetLocations");
this.dropTargetDimensions=[];
vuit.lang.forEach(this.dropTargets,function(_802){
var tn=_802.domNode;
if(!tn){
return;
}
var abs=vuit.html.getAbsolutePosition(tn,true);
var bb=vuit.html.getBorderBox(tn);
this.dropTargetDimensions.push([[abs.x,abs.y],[abs.x+bb.width,abs.y+bb.height],_802]);
},this);
vuit.profile.end("cacheTargetLocations");
},onMouseMove:function(e){
if((vuit.render.html.ie)&&(e.button!=1)){
this.currentDropTarget=null;
this.onMouseUp(e,true);
return;
}
if((this.selectedSources.length)&&(!this.dragObjects.length)){
var dx;
var dy;
if(!this._dragTriggered){
this._dragTriggered=(this._dragStartDistance(e.pageX,e.pageY)>this.threshold);
if(!this._dragTriggered){
return;
}
dx=e.pageX-this.mouseDownX;
dy=e.pageY-this.mouseDownY;
}
this.dragSource=this.selectedSources[0];
vuit.lang.forEach(this.selectedSources,function(_809){
if(!_809){
return;
}
var tdo=_809.onDragStart(e);
if(tdo){
tdo.onDragStart(e);
tdo.dragOffset.y+=dy;
tdo.dragOffset.x+=dx;
tdo.dragSource=_809;
this.dragObjects.push(tdo);
}
},this);
this.previousDropTarget=null;
this.cacheTargetLocations();
}
vuit.lang.forEach(this.dragObjects,function(_80b){
if(_80b){
_80b.onDragMove(e);
}
});
if(this.currentDropTarget){
var c=vuit.html.toCoordinateObject(this.currentDropTarget.domNode,true);
var dtp=[[c.x,c.y],[c.x+c.width,c.y+c.height]];
}
if((!this.nestedTargets)&&(dtp)&&(this.isInsideBox(e,dtp))){
if(this.dropAcceptable){
this.currentDropTarget.onDragMove(e,this.dragObjects);
}
}else{
var _80e=this.findBestTarget(e);
if(_80e.target===null){
if(this.currentDropTarget){
this.currentDropTarget.onDragOut(e);
this.previousDropTarget=this.currentDropTarget;
this.currentDropTarget=null;
}
this.dropAcceptable=false;
return;
}
if(this.currentDropTarget!==_80e.target){
if(this.currentDropTarget){
this.previousDropTarget=this.currentDropTarget;
this.currentDropTarget.onDragOut(e);
}
this.currentDropTarget=_80e.target;
e.dragObjects=this.dragObjects;
this.dropAcceptable=this.currentDropTarget.onDragOver(e);
}else{
if(this.dropAcceptable){
this.currentDropTarget.onDragMove(e,this.dragObjects);
}
}
}
},findBestTarget:function(e){
var _810=this;
var _811=new Object();
_811.target=null;
_811.points=null;
vuit.lang.every(this.dropTargetDimensions,function(_812){
if(!_810.isInsideBox(e,_812)){
return true;
}
_811.target=_812[2];
_811.points=_812;
return Boolean(_810.nestedTargets);
});
return _811;
},isInsideBox:function(e,_814){
if((e.pageX>_814[0][0])&&(e.pageX<_814[1][0])&&(e.pageY>_814[0][1])&&(e.pageY<_814[1][1])){
return true;
}
return false;
},onMouseOver:function(e){
},onMouseOut:function(e){
}});
vuit.dnd.dragManager=new vuit.dnd.HtmlDragManager();
(function(){
var d=document;
var dm=vuit.dnd.dragManager;
vuit.event.connect(d,"onkeydown",dm,"onKeyDown");
vuit.event.connect(d,"onmouseover",dm,"onMouseOver");
vuit.event.connect(d,"onmouseout",dm,"onMouseOut");
vuit.event.connect(d,"onmousedown",dm,"onMouseDown");
vuit.event.connect(d,"onmouseup",dm,"onMouseUp");
vuit.event.connect(window,"onscroll",dm,"onScroll");
})();
vuit.provide("vuit.html.iframe");
vuit.html.iframeContentWindow=function(_819){
var win=vuit.html.getDocumentWindow(vuit.html.iframeContentDocument(_819))||vuit.html.iframeContentDocument(_819).__parent__||(_819.name&&document.frames[_819.name])||null;
return win;
};
vuit.html.iframeContentDocument=function(_81b){
var doc=_81b.contentDocument||((_81b.contentWindow)&&(_81b.contentWindow.document))||((_81b.name)&&(document.frames[_81b.name])&&(document.frames[_81b.name].document))||null;
return doc;
};
vuit.html.BackgroundIframe=function(node){
if(vuit.render.html.ie55||vuit.render.html.ie60){
var html="<iframe "+"style='position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;"+"z-index: -1; filter:Alpha(Opacity=\"0\");' "+">";
this.iframe=vuit.doc().createElement(html);
this.iframe.tabIndex=-1;
if(node){
node.appendChild(this.iframe);
this.domNode=node;
}else{
vuit.body().appendChild(this.iframe);
this.iframe.style.display="none";
}
}
};
vuit.lang.extend(vuit.html.BackgroundIframe,{iframe:null,onResized:function(){
if(this.iframe&&this.domNode&&this.domNode.parentNode){
var _81f=vuit.html.getBorderBox(this.domNode);
if(_81f.width==0||_81f.height==0){
vuit.lang.setTimeout(this,this.onResized,100);
return;
}
with(this.iframe.style){
width=_81f.width+"px";
height=_81f.height+"px";
}
}
},size:function(node){
if(!this.iframe){
return;
}
var _821=vuit.html.toCoordinateObject(node,true);
with(this.iframe.style){
width=_821.width+"px";
height=_821.height+"px";
left=_821.left+"px";
top=_821.top+"px";
}
},setZIndex:function(node){
if(!this.iframe){
return;
}
if(vuit.dom.isNode(node)){
this.iframe.style.zIndex=vuit.html.getStyle(node,"z-index")-1;
}else{
if(!isNaN(node)){
this.iframe.style.zIndex=node;
}
}
},show:function(){
if(!this.iframe){
return;
}
this.iframe.style.display="block";
},hide:function(){
if(!this.iframe){
return;
}
this.iframe.style.display="none";
},remove:function(){
vuit.dom.removeNode(this.iframe);
}});
vuit.provide("vuit.dnd.HtmlDragAndDrop");
vuit.provide("vuit.dnd.HtmlDragSource");
vuit.provide("vuit.dnd.HtmlDropTarget");
vuit.provide("vuit.dnd.HtmlDragObject");
vuit.dnd.HtmlDragSource=function(node,type){
node=vuit.byId(node);
this.dragObjects=[];
this.constrainToContainer=false;
if(node){
this.domNode=node;
this.dragObject=node;
vuit.dnd.DragSource.call(this);
this.type=(type)||(this.domNode.nodeName.toLowerCase());
}
};
vuit.inherits(vuit.dnd.HtmlDragSource,vuit.dnd.DragSource);
vuit.lang.extend(vuit.dnd.HtmlDragSource,{dragClass:"",onDragStart:function(){
var _825=new vuit.dnd.HtmlDragObject(this.dragObject,this.type);
if(this.dragClass){
_825.dragClass=this.dragClass;
}
if(this.constrainToContainer){
_825.constrainTo(this.constrainingContainer||this.domNode.parentNode);
}
return _825;
},setDragHandle:function(node){
node=vuit.byId(node);
vuit.dnd.dragManager.unregisterDragSource(this);
this.domNode=node;
vuit.dnd.dragManager.registerDragSource(this);
},setDragTarget:function(node){
this.dragObject=node;
},constrainTo:function(_828){
this.constrainToContainer=true;
if(_828){
this.constrainingContainer=_828;
}
},onSelected:function(){
for(var i=0;i<this.dragObjects.length;i++){
vuit.dnd.dragManager.selectedSources.push(new vuit.dnd.HtmlDragSource(this.dragObjects[i]));
}
},addDragObjects:function(el){
for(var i=0;i<arguments.length;i++){
this.dragObjects.push(arguments[i]);
}
}});
vuit.dnd.HtmlDragObject=function(node,type){
this.domNode=vuit.byId(node);
this.type=type;
this.constrainToContainer=false;
this.dragSource=null;
};
vuit.inherits(vuit.dnd.HtmlDragObject,vuit.dnd.DragObject);
vuit.lang.extend(vuit.dnd.HtmlDragObject,{dragClass:"",opacity:0.5,createIframe:true,disableX:false,disableY:false,createDragNode:function(){
var node=this.domNode.cloneNode(true);
if(this.dragClass){
vuit.html.addClass(node,this.dragClass);
}
if(this.opacity<1){
vuit.html.setOpacity(node,this.opacity);
}
if(node.tagName.toLowerCase()=="tr"){
var doc=this.domNode.ownerDocument;
var _830=doc.createElement("table");
var _831=doc.createElement("tbody");
_831.appendChild(node);
_830.appendChild(_831);
var _832=this.domNode.childNodes;
var _833=node.childNodes;
for(var i=0;i<_832.length;i++){
if((_833[i])&&(_833[i].style)){
_833[i].style.width=vuit.html.getContentBox(_832[i]).width+"px";
}
}
node=_830;
}
if((vuit.render.html.ie55||vuit.render.html.ie60)&&this.createIframe){
with(node.style){
top="0px";
left="0px";
}
var _835=document.createElement("div");
_835.appendChild(node);
this.bgIframe=new vuit.html.BackgroundIframe(_835);
_835.appendChild(this.bgIframe.iframe);
node=_835;
}
node.style.zIndex=999;
return node;
},onDragStart:function(e){
vuit.html.clearSelection();
this.scrollOffset=vuit.html.getScroll().offset;
this.dragStartPosition=vuit.html.getAbsolutePosition(this.domNode,true);
this.dragOffset={y:this.dragStartPosition.y-e.pageY,x:this.dragStartPosition.x-e.pageX};
this.dragClone=this.createDragNode();
this.containingBlockPosition=this.domNode.offsetParent?vuit.html.getAbsolutePosition(this.domNode.offsetParent):{x:0,y:0};
if(this.constrainToContainer){
this.constraints=this.getConstraints();
}
with(this.dragClone.style){
position="absolute";
top=this.dragOffset.y+e.pageY+"px";
left=this.dragOffset.x+e.pageX+"px";
}
vuit.body().appendChild(this.dragClone);
vuit.event.connect(this.domNode,"onclick",this,"squelchOnClick");
vuit.event.topic.publish("dragStart",{source:this});
},getConstraints:function(){
if(this.constrainingContainer.nodeName.toLowerCase()=="body"){
var _837=vuit.html.getViewport();
var _838=_837.width;
var _839=_837.height;
var x=0;
var y=0;
}else{
var _83c=vuit.html.getContentBox(this.constrainingContainer);
_838=_83c.width;
_839=_83c.height;
x=this.containingBlockPosition.x+vuit.html.getPixelValue(this.constrainingContainer,"padding-left",true)+vuit.html.getBorderExtent(this.constrainingContainer,"left");
y=this.containingBlockPosition.y+vuit.html.getPixelValue(this.constrainingContainer,"padding-top",true)+vuit.html.getBorderExtent(this.constrainingContainer,"top");
}
var mb=vuit.html.getMarginBox(this.domNode);
return {minX:x,minY:y,maxX:x+_838-mb.width,maxY:y+_839-mb.height};
},updateDragOffset:function(){
var _83e=vuit.html.getScroll().offset;
if(_83e.y!=this.scrollOffset.y){
var diff=_83e.y-this.scrollOffset.y;
this.dragOffset.y+=diff;
this.scrollOffset.y=_83e.y;
}
if(_83e.x!=this.scrollOffset.x){
var diff=_83e.x-this.scrollOffset.x;
this.dragOffset.x+=diff;
this.scrollOffset.x=_83e.x;
}
},onDragMove:function(e){
this.updateDragOffset();
var x=this.dragOffset.x+e.pageX;
var y=this.dragOffset.y+e.pageY;
if(this.constrainToContainer){
if(x<this.constraints.minX){
x=this.constraints.minX;
}
if(y<this.constraints.minY){
y=this.constraints.minY;
}
if(x>this.constraints.maxX){
x=this.constraints.maxX;
}
if(y>this.constraints.maxY){
y=this.constraints.maxY;
}
}
this.setAbsolutePosition(x,y);
vuit.event.topic.publish("dragMove",{source:this});
},setAbsolutePosition:function(x,y){
if(!this.disableY){
this.dragClone.style.top=y+"px";
}
if(!this.disableX){
this.dragClone.style.left=x+"px";
}
},onDragEnd:function(e){
switch(e.dragStatus){
case "dropSuccess":
vuit.html.removeNode(this.dragClone);
this.dragClone=null;
break;
case "dropFailure":
var _846=vuit.html.getAbsolutePosition(this.dragClone,true);
var _847={left:this.dragStartPosition.x+1,top:this.dragStartPosition.y+1};
var anim=vuit.lfx.slideTo(this.dragClone,_847,500,vuit.lfx.easeOut);
var _849=this;
vuit.event.connect(anim,"onEnd",function(e){
vuit.lang.setTimeout(function(){
vuit.html.removeNode(_849.dragClone);
_849.dragClone=null;
},200);
});
anim.play();
break;
}
vuit.event.topic.publish("dragEnd",{source:this});
},squelchOnClick:function(e){
vuit.event.browser.stopEvent(e);
vuit.lang.setTimeout(function(){
vuit.event.disconnect(this.domNode,"onclick",this,"squelchOnClick");
},50);
},constrainTo:function(_84c){
this.constrainToContainer=true;
if(_84c){
this.constrainingContainer=_84c;
}else{
this.constrainingContainer=this.domNode.parentNode;
}
}});
vuit.dnd.HtmlDropTarget=function(node,_84e){
if(arguments.length==0){
return;
}
this.domNode=vuit.byId(node);
vuit.dnd.DropTarget.call(this);
if(_84e&&vuit.lang.isString(_84e)){
_84e=[_84e];
}
this.acceptedTypes=_84e||[];
};
vuit.inherits(vuit.dnd.HtmlDropTarget,vuit.dnd.DropTarget);
vuit.lang.extend(vuit.dnd.HtmlDropTarget,{onDragOver:function(e){
if(!this.accepts(e.dragObjects)){
return false;
}
this.childBoxes=[];
for(var i=0,child;i<this.domNode.childNodes.length;i++){
child=this.domNode.childNodes[i];
if(child.nodeType!=vuit.html.ELEMENT_NODE){
continue;
}
var pos=vuit.html.getAbsolutePosition(child,true);
var _852=vuit.html.getBorderBox(child);
this.childBoxes.push({top:pos.y,bottom:pos.y+_852.height,left:pos.x,right:pos.x+_852.width,node:child});
}
return true;
},_getNodeUnderMouse:function(e){
for(var i=0,child;i<this.childBoxes.length;i++){
with(this.childBoxes[i]){
if(e.pageX>=left&&e.pageX<=right&&e.pageY>=top&&e.pageY<=bottom){
return i;
}
}
}
return -1;
},createDropIndicator:function(){
this.dropIndicator=document.createElement("div");
with(this.dropIndicator.style){
position="absolute";
zIndex=999;
borderTopWidth="1px";
borderTopColor="black";
borderTopStyle="solid";
width=vuit.html.getBorderBox(this.domNode).width+"px";
left=vuit.html.getAbsolutePosition(this.domNode,true).x+"px";
}
},onDragMove:function(e,_856){
var i=this._getNodeUnderMouse(e);
if(!this.dropIndicator){
this.createDropIndicator();
}
if(i<0){
if(this.childBoxes.length){
var _858=(vuit.html.gravity(this.childBoxes[0].node,e)&vuit.html.gravity.NORTH);
}else{
var _858=true;
}
}else{
var _859=this.childBoxes[i];
var _858=(vuit.html.gravity(_859.node,e)&vuit.html.gravity.NORTH);
}
this.placeIndicator(e,_856,i,_858);
if(!vuit.html.hasParent(this.dropIndicator)){
vuit.body().appendChild(this.dropIndicator);
}
},placeIndicator:function(e,_85b,_85c,_85d){
with(this.dropIndicator.style){
if(_85c<0){
if(this.childBoxes.length){
top=(_85d?this.childBoxes[0].top:this.childBoxes[this.childBoxes.length-1].bottom)+"px";
}else{
top=vuit.html.getAbsolutePosition(this.domNode,true).y+"px";
}
}else{
var _85e=this.childBoxes[_85c];
top=(_85d?_85e.top:_85e.bottom)+"px";
}
}
},onDragOut:function(e){
if(this.dropIndicator){
vuit.html.removeNode(this.dropIndicator);
delete this.dropIndicator;
}
},onDrop:function(e){
this.onDragOut(e);
var i=this._getNodeUnderMouse(e);
if(i<0){
if(this.childBoxes.length){
if(vuit.html.gravity(this.childBoxes[0].node,e)&vuit.html.gravity.NORTH){
return this.insert(e,this.childBoxes[0].node,"before");
}else{
return this.insert(e,this.childBoxes[this.childBoxes.length-1].node,"after");
}
}
return this.insert(e,this.domNode,"append");
}
var _862=this.childBoxes[i];
if(vuit.html.gravity(_862.node,e)&vuit.html.gravity.NORTH){
return this.insert(e,_862.node,"before");
}else{
return this.insert(e,_862.node,"after");
}
},insert:function(e,_864,_865){
var node=e.dragObject.domNode;
if(_865=="before"){
return vuit.html.insertBefore(node,_864);
}else{
if(_865=="after"){
return vuit.html.insertAfter(node,_864);
}else{
if(_865=="append"){
_864.appendChild(node);
return true;
}
}
}
return false;
}});
vuit.provide("vuit.dnd.TreeDragAndDrop");
vuit.provide("vuit.dnd.TreeDragSource");
vuit.provide("vuit.dnd.TreeDropTarget");
vuit.provide("vuit.dnd.TreeDNDController");
vuit.dnd.TreeDragSource=function(node,_868,type,_86a){
this.controller=_868;
this.treeNode=_86a;
vuit.dnd.HtmlDragSource.call(this,node,type);
};
vuit.inherits(vuit.dnd.TreeDragSource,vuit.dnd.HtmlDragSource);
vuit.lang.extend(vuit.dnd.TreeDragSource,{onDragStart:function(){
var _86b=vuit.dnd.HtmlDragSource.prototype.onDragStart.call(this);
_86b.treeNode=this.treeNode;
_86b.onDragStart=vuit.lang.hitch(_86b,function(e){
this.savedSelectedNode=this.treeNode.tree.selector.selectedNode;
if(this.savedSelectedNode){
this.savedSelectedNode.unMarkSelected();
}
var _86d=vuit.dnd.HtmlDragObject.prototype.onDragStart.apply(this,arguments);
var _86e=this.dragClone.getElementsByTagName("img");
for(var i=0;i<_86e.length;i++){
_86e.item(i).style.backgroundImage="url()";
}
return _86d;
});
_86b.onDragEnd=function(e){
if(this.savedSelectedNode){
this.savedSelectedNode.markSelected();
}
return vuit.dnd.HtmlDragObject.prototype.onDragEnd.apply(this,arguments);
};
return _86b;
},onDragEnd:function(e){
var res=vuit.dnd.HtmlDragSource.prototype.onDragEnd.call(this,e);
return res;
}});
vuit.dnd.TreeDropTarget=function(_873,_874,type,_876){
this.treeNode=_876;
this.controller=_874;
vuit.dnd.HtmlDropTarget.apply(this,[_873,type]);
};
vuit.inherits(vuit.dnd.TreeDropTarget,vuit.dnd.HtmlDropTarget);
vuit.lang.extend(vuit.dnd.TreeDropTarget,{autoExpandDelay:1500,autoExpandTimer:null,position:null,indicatorStyle:"2px black solid",showIndicator:function(_877){
if(this.position==_877){
return;
}
this.hideIndicator();
this.position=_877;
if(_877=="before"){
this.treeNode.labelNode.style.borderTop=this.indicatorStyle;
}else{
if(_877=="after"){
this.treeNode.labelNode.style.borderBottom=this.indicatorStyle;
}else{
if(_877=="onto"){
this.treeNode.markSelected();
}
}
}
},hideIndicator:function(){
this.treeNode.labelNode.style.borderBottom="";
this.treeNode.labelNode.style.borderTop="";
this.treeNode.unMarkSelected();
this.position=null;
},onDragOver:function(e){
var _879=vuit.dnd.HtmlDropTarget.prototype.onDragOver.apply(this,arguments);
if(_879&&this.treeNode.isFolder&&!this.treeNode.isExpanded){
this.setAutoExpandTimer();
}
return _879;
},accepts:function(_87a){
var _87b=vuit.dnd.HtmlDropTarget.prototype.accepts.apply(this,arguments);
if(!_87b){
return false;
}
var _87c=_87a[0].treeNode;
if(vuit.lang.isUndefined(_87c)||!_87c||!_87c.isTreeNode){
vuit.raise("Source is not TreeNode or not found");
}
if(_87c===this.treeNode){
return false;
}
return true;
},setAutoExpandTimer:function(){
var _87d=this;
var _87e=function(){
if(vuit.dnd.dragManager.currentDropTarget===_87d){
_87d.controller.expand(_87d.treeNode);
}
};
this.autoExpandTimer=vuit.lang.setTimeout(_87e,_87d.autoExpandDelay);
},getDNDMode:function(){
return this.treeNode.tree.DNDMode;
},getAcceptPosition:function(e,_880){
var _881=this.getDNDMode();
if(_881&vuit.widget.Tree.prototype.DNDModes.ONTO&&!(!this.treeNode.actionIsDisabled(vuit.widget.TreeNode.prototype.actions.ADDCHILD)&&_880.parent!==this.treeNode&&this.controller.canMove(_880,this.treeNode))){
_881&=~vuit.widget.Tree.prototype.DNDModes.ONTO;
}
var _882=this.getPosition(e,_881);
if(_882=="onto"||(!this.isAdjacentNode(_880,_882)&&this.controller.canMove(_880,this.treeNode.parent))){
return _882;
}else{
return false;
}
},onDragOut:function(e){
this.clearAutoExpandTimer();
this.hideIndicator();
},clearAutoExpandTimer:function(){
if(this.autoExpandTimer){
clearTimeout(this.autoExpandTimer);
this.autoExpandTimer=null;
}
},onDragMove:function(e,_885){
var _886=_885[0].treeNode;
var _887=this.getAcceptPosition(e,_886);
if(_887){
this.showIndicator(_887);
}
},isAdjacentNode:function(_888,_889){
if(_888===this.treeNode){
return true;
}
if(_888.getNextSibling()===this.treeNode&&_889=="before"){
return true;
}
if(_888.getPreviousSibling()===this.treeNode&&_889=="after"){
return true;
}
return false;
},getPosition:function(e,_88b){
var node=vuit.byId(this.treeNode.labelNode);
var _88d=e.pageY||e.clientY+vuit.body().scrollTop;
var _88e=vuit.html.getAbsolutePosition(node).y;
var _88f=vuit.html.getBorderBox(node).height;
var relY=_88d-_88e;
var p=relY/_88f;
var _892="";
if(_88b&vuit.widget.Tree.prototype.DNDModes.ONTO&&_88b&vuit.widget.Tree.prototype.DNDModes.BETWEEN){
if(p<=0.3){
_892="before";
}else{
if(p<=0.7){
_892="onto";
}else{
_892="after";
}
}
}else{
if(_88b&vuit.widget.Tree.prototype.DNDModes.BETWEEN){
if(p<=0.5){
_892="before";
}else{
_892="after";
}
}else{
if(_88b&vuit.widget.Tree.prototype.DNDModes.ONTO){
_892="onto";
}
}
}
return _892;
},getTargetParentIndex:function(_893,_894){
var _895=_894=="before"?this.treeNode.getParentIndex():this.treeNode.getParentIndex()+1;
if(this.treeNode.parent===_893.parent&&this.treeNode.getParentIndex()>_893.getParentIndex()){
_895--;
}
return _895;
},onDrop:function(e){
var _897=this.position;
this.onDragOut(e);
var _898=e.dragObject.treeNode;
if(!vuit.lang.isObject(_898)){
vuit.raise("TreeNode not found in dragObject");
}
if(_897=="onto"){
return this.controller.move(_898,this.treeNode,0);
}else{
var _899=this.getTargetParentIndex(_898,_897);
return this.controller.move(_898,this.treeNode.parent,_899);
}
}});
vuit.dnd.TreeDNDController=function(_89a){
this.treeController=_89a;
this.dragSources={};
this.dropTargets={};
};
vuit.lang.extend(vuit.dnd.TreeDNDController,{listenTree:function(tree){
vuit.event.topic.subscribe(tree.eventNames.createDOMNode,this,"onCreateDOMNode");
vuit.event.topic.subscribe(tree.eventNames.moveFrom,this,"onMoveFrom");
vuit.event.topic.subscribe(tree.eventNames.moveTo,this,"onMoveTo");
vuit.event.topic.subscribe(tree.eventNames.addChild,this,"onAddChild");
vuit.event.topic.subscribe(tree.eventNames.removeNode,this,"onRemoveNode");
vuit.event.topic.subscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
},unlistenTree:function(tree){
vuit.event.topic.unsubscribe(tree.eventNames.createDOMNode,this,"onCreateDOMNode");
vuit.event.topic.unsubscribe(tree.eventNames.moveFrom,this,"onMoveFrom");
vuit.event.topic.unsubscribe(tree.eventNames.moveTo,this,"onMoveTo");
vuit.event.topic.unsubscribe(tree.eventNames.addChild,this,"onAddChild");
vuit.event.topic.unsubscribe(tree.eventNames.removeNode,this,"onRemoveNode");
vuit.event.topic.unsubscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
},onTreeDestroy:function(_89d){
this.unlistenTree(_89d.source);
},onCreateDOMNode:function(_89e){
this.registerDNDNode(_89e.source);
},onAddChild:function(_89f){
this.registerDNDNode(_89f.child);
},onMoveFrom:function(_8a0){
var _8a1=this;
vuit.lang.forEach(_8a0.child.getDescendants(),function(node){
_8a1.unregisterDNDNode(node);
});
},onMoveTo:function(_8a3){
var _8a4=this;
vuit.lang.forEach(_8a3.child.getDescendants(),function(node){
_8a4.registerDNDNode(node);
});
},registerDNDNode:function(node){
if(!node.tree.DNDMode){
return;
}
var _8a7=null;
var _8a8=null;
if(!node.actionIsDisabled(node.actions.MOVE)){
var _8a7=new vuit.dnd.TreeDragSource(node.labelNode,this,node.tree.widgetId,node);
this.dragSources[node.widgetId]=_8a7;
}
var _8a8=new vuit.dnd.TreeDropTarget(node.labelNode,this.treeController,node.tree.DNDAcceptTypes,node);
this.dropTargets[node.widgetId]=_8a8;
},unregisterDNDNode:function(node){
if(this.dragSources[node.widgetId]){
vuit.dnd.dragManager.unregisterDragSource(this.dragSources[node.widgetId]);
delete this.dragSources[node.widgetId];
}
if(this.dropTargets[node.widgetId]){
vuit.dnd.dragManager.unregisterDropTarget(this.dropTargets[node.widgetId]);
delete this.dropTargets[node.widgetId];
}
}});
vuit.provide("vuit.widget.TreeBasicController");
vuit.widget.tags.addParseTreeHandler("vuit:TreeBasicController");
vuit.widget.TreeBasicController=function(){
vuit.widget.HtmlWidget.call(this);
};
vuit.inherits(vuit.widget.TreeBasicController,vuit.widget.HtmlWidget);
vuit.lang.extend(vuit.widget.TreeBasicController,{widgetType:"TreeBasicController",DNDController:"",dieWithTree:false,initialize:function(args,frag){
if(this.DNDController=="create"){
vuit.require("vuit.dnd.TreeDragAndDrop");
this.DNDController=new vuit.dnd.TreeDNDController(this);
}
},listenTree:function(tree){
vuit.event.topic.subscribe(tree.eventNames.createDOMNode,this,"onCreateDOMNode");
vuit.event.topic.subscribe(tree.eventNames.treeClick,this,"onTreeClick");
vuit.event.topic.subscribe(tree.eventNames.treeCreate,this,"onTreeCreate");
vuit.event.topic.subscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
if(this.DNDController){
this.DNDController.listenTree(tree);
}
},unlistenTree:function(tree){
vuit.event.topic.unsubscribe(tree.eventNames.createDOMNode,this,"onCreateDOMNode");
vuit.event.topic.unsubscribe(tree.eventNames.treeClick,this,"onTreeClick");
vuit.event.topic.unsubscribe(tree.eventNames.treeCreate,this,"onTreeCreate");
vuit.event.topic.unsubscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
},onTreeDestroy:function(_8ae){
var tree=_8ae.source;
this.unlistenTree(tree);
if(this.dieWithTree){
this.destroy();
}
},onCreateDOMNode:function(_8b0){
var node=_8b0.source;
if(node.expandLevel>0){
this.expandToLevel(node,node.expandLevel);
}
},onTreeCreate:function(_8b2){
var tree=_8b2.source;
var _8b4=this;
if(tree.expandLevel){
vuit.lang.forEach(tree.children,function(_8b5){
_8b4.expandToLevel(_8b5,tree.expandLevel-1);
});
}
},expandToLevel:function(node,_8b7){
if(_8b7==0){
return;
}
var _8b8=node.children;
var _8b9=this;
var _8ba=function(node,_8bc){
this.node=node;
this.expandLevel=_8bc;
this.process=function(){
for(var i=0;i<this.node.children.length;i++){
var _8be=node.children[i];
_8b9.expandToLevel(_8be,this.expandLevel);
}
};
};
var h=new _8ba(node,_8b7-1);
this.expand(node,false,h,h.process);
},onTreeClick:function(_8c0){
var node=_8c0.source;
if(node.isLocked()){
return false;
}
if(node.isExpanded){
this.collapse(node);
}else{
this.expand(node);
}
},expand:function(node,sync,_8c4,_8c5){
node.expand();
if(_8c5){
_8c5.apply(_8c4,[node]);
}
},collapse:function(node){
node.collapse();
},canMove:function(_8c7,_8c8){
if(_8c7.actionIsDisabled(_8c7.actions.MOVE)){
return false;
}
if(_8c7.parent!==_8c8&&_8c8.actionIsDisabled(_8c8.actions.ADDCHILD)){
return false;
}
var node=_8c8;
while(node.isTreeNode){
if(node===_8c7){
return false;
}
node=node.parent;
}
return true;
},move:function(_8ca,_8cb,_8cc){
if(!this.canMove(_8ca,_8cb)){
return false;
}
var _8cd=this.doMove(_8ca,_8cb,_8cc);
if(!_8cd){
return _8cd;
}
if(_8cb.isTreeNode){
this.expand(_8cb);
}
return _8cd;
},doMove:function(_8ce,_8cf,_8d0){
_8ce.tree.move(_8ce,_8cf,_8d0);
return true;
},canRemoveNode:function(_8d1){
if(_8d1.actionIsDisabled(_8d1.actions.REMOVE)){
return false;
}
return true;
},removeNode:function(node,_8d3,_8d4){
if(!this.canRemoveNode(node)){
return false;
}
return this.doRemoveNode(node,_8d3,_8d4);
},doRemoveNode:function(node,_8d6,_8d7){
node.tree.removeNode(node);
if(_8d7){
_8d7.apply(vuit.lang.isUndefined(_8d6)?this:_8d6,[node]);
}
},canCreateChild:function(_8d8,_8d9,data){
if(_8d8.actionIsDisabled(_8d8.actions.ADDCHILD)){
return false;
}
return true;
},createChild:function(_8db,_8dc,data,_8de,_8df){
if(!this.canCreateChild(_8db,_8dc,data)){
return false;
}
return this.doCreateChild.apply(this,arguments);
},doCreateChild:function(_8e0,_8e1,data,_8e3,_8e4){
var _8e5=data.widgetType?data.widgetType:"TreeNode";
var _8e6=vuit.widget.createWidget(_8e5,data);
_8e0.addChild(_8e6,_8e1);
this.expand(_8e0);
if(_8e4){
_8e4.apply(_8e3,[_8e6]);
}
return _8e6;
}});
vuit.provide("vuit.widget.TreeSelector");
vuit.widget.tags.addParseTreeHandler("vuit:TreeSelector");
vuit.widget.TreeSelector=function(){
vuit.widget.HtmlWidget.call(this);
this.eventNames={};
this.listenedTrees=[];
};
vuit.inherits(vuit.widget.TreeSelector,vuit.widget.HtmlWidget);
vuit.lang.extend(vuit.widget.TreeSelector,{widgetType:"TreeSelector",selectedNode:null,dieWithTree:false,eventNamesDefault:{select:"select",destroy:"destroy",deselect:"deselect",dblselect:"dblselect"},initialize:function(){
for(name in this.eventNamesDefault){
if(vuit.lang.isUndefined(this.eventNames[name])){
this.eventNames[name]=this.widgetId+"/"+this.eventNamesDefault[name];
}
}
},destroy:function(){
vuit.event.topic.publish(this.eventNames.destroy,{source:this});
return vuit.widget.HtmlWidget.prototype.destroy.apply(this,arguments);
},listenTree:function(tree){
vuit.event.topic.subscribe(tree.eventNames.titleClick,this,"select");
vuit.event.topic.subscribe(tree.eventNames.iconClick,this,"select");
vuit.event.topic.subscribe(tree.eventNames.collapse,this,"onCollapse");
vuit.event.topic.subscribe(tree.eventNames.moveFrom,this,"onMoveFrom");
vuit.event.topic.subscribe(tree.eventNames.removeNode,this,"onRemoveNode");
vuit.event.topic.subscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
this.listenedTrees.push(tree);
},unlistenTree:function(tree){
vuit.event.topic.unsubscribe(tree.eventNames.titleClick,this,"select");
vuit.event.topic.unsubscribe(tree.eventNames.iconClick,this,"select");
vuit.event.topic.unsubscribe(tree.eventNames.collapse,this,"onCollapse");
vuit.event.topic.unsubscribe(tree.eventNames.moveFrom,this,"onMoveFrom");
vuit.event.topic.unsubscribe(tree.eventNames.removeNode,this,"onRemoveNode");
vuit.event.topic.unsubscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
for(var i=0;i<this.listenedTrees.length;i++){
if(this.listenedTrees[i]===tree){
this.listenedTrees.splice(i,1);
break;
}
}
},onTreeDestroy:function(_8ea){
this.unlistenTree(_8ea.source);
if(this.dieWithTree){
this.destroy();
}
},onCollapse:function(_8eb){
if(!this.selectedNode){
return;
}
var node=_8eb.source;
var _8ed=this.selectedNode.parent;
while(_8ed!==node&&_8ed.isTreeNode){
_8ed=_8ed.parent;
}
if(_8ed.isTreeNode){
this.deselect();
}
},select:function(_8ee){
var node=_8ee.source;
var e=_8ee.event;
if(this.selectedNode===node){
if(e.ctrlKey||e.shiftKey||e.metaKey){
this.deselect();
return;
}
vuit.event.topic.publish(this.eventNames.dblselect,{node:node});
return;
}
if(this.selectedNode){
this.deselect();
}
this.doSelect(node);
vuit.event.topic.publish(this.eventNames.select,{node:node});
},onMoveFrom:function(_8f1){
if(_8f1.child!==this.selectedNode){
return;
}
if(!vuit.lang.inArray(this.listenedTrees,_8f1.newTree)){
this.deselect();
}
},onRemoveNode:function(_8f2){
if(_8f2.child!==this.selectedNode){
return;
}
this.deselect();
},doSelect:function(node){
node.markSelected();
this.selectedNode=node;
},deselect:function(){
var node=this.selectedNode;
this.selectedNode=null;
node.unMarkSelected();
vuit.event.topic.publish(this.eventNames.deselect,{node:node});
}});
vuit.provide("vuit.widget.Tree");
vuit.widget.tags.addParseTreeHandler("vuit:Tree");
vuit.widget.Tree=function(){
vuit.widget.HtmlWidget.call(this);
this.eventNames={};
this.tree=this;
this.DNDAcceptTypes=[];
this.actionsDisabled=[];
};
vuit.inherits(vuit.widget.Tree,vuit.widget.HtmlWidget);
vuit.lang.extend(vuit.widget.Tree,{widgetType:"Tree",eventNamesDefault:{createDOMNode:"createDOMNode",treeCreate:"treeCreate",treeDestroy:"treeDestroy",treeClick:"treeClick",iconClick:"iconClick",titleClick:"titleClick",moveFrom:"moveFrom",moveTo:"moveTo",addChild:"addChild",removeNode:"removeNode",expand:"expand",collapse:"collapse"},isContainer:true,DNDMode:"off",lockLevel:0,strictFolders:true,DNDModes:{BETWEEN:1,ONTO:2},DNDAcceptTypes:"",templateCssPath:vuit.uri.vuitUri("src/widget/templates/images/Tree/Tree.css"),templateString:"<div class=\"vuitTree\"></div>",isExpanded:true,isTree:true,objectId:"",controller:"",selector:"",menu:"",expandLevel:"",blankIconSrc:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_blank.gif"),gridIconSrcT:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_grid_t.gif"),gridIconSrcL:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_grid_l.gif"),gridIconSrcV:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_grid_v.gif"),gridIconSrcP:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_grid_p.gif"),gridIconSrcC:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_grid_c.gif"),gridIconSrcX:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_grid_x.gif"),gridIconSrcY:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_grid_y.gif"),gridIconSrcZ:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_grid_z.gif"),expandIconSrcPlus:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_expand_plus.gif"),expandIconSrcMinus:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_expand_minus.gif"),expandIconSrcLoading:vuit.uri.vuitUri("src/widget/templates/images/Tree/treenode_loading.gif"),iconWidth:18,iconHeight:18,showGrid:true,showRootGrid:true,actionIsDisabled:function(_8f5){
var _8f6=this;
return vuit.lang.inArray(_8f6.actionsDisabled,_8f5);
},actions:{ADDCHILD:"ADDCHILD"},getInfo:function(){
var info={widgetId:this.widgetId,objectId:this.objectId};
return info;
},initializeController:function(){
if(this.controller!="off"){
if(this.controller){
this.controller=vuit.widget.byId(this.controller);
}else{
vuit.require("vuit.widget.TreeBasicController");
this.controller=vuit.widget.createWidget("TreeBasicController",{DNDController:(this.DNDMode?"create":""),dieWithTree:true});
}
this.controller.listenTree(this);
}else{
this.controller=null;
}
},initializeSelector:function(){
if(this.selector!="off"){
if(this.selector){
this.selector=vuit.widget.byId(this.selector);
}else{
vuit.require("vuit.widget.TreeSelector");
this.selector=vuit.widget.createWidget("TreeSelector",{dieWithTree:true});
}
this.selector.listenTree(this);
}else{
this.selector=null;
}
},initialize:function(args,frag){
var _8fa=this;
for(name in this.eventNamesDefault){
if(vuit.lang.isUndefined(this.eventNames[name])){
this.eventNames[name]=this.widgetId+"/"+this.eventNamesDefault[name];
}
}
for(var i=0;i<this.actionsDisabled.length;i++){
this.actionsDisabled[i]=this.actionsDisabled[i].toUpperCase();
}
if(this.DNDMode=="off"){
this.DNDMode=0;
}else{
if(this.DNDMode=="between"){
this.DNDMode=this.DNDModes.ONTO|this.DNDModes.BETWEEN;
}else{
if(this.DNDMode=="onto"){
this.DNDMode=this.DNDModes.ONTO;
}
}
}
this.expandLevel=parseInt(this.expandLevel);
this.initializeSelector();
this.initializeController();
if(this.menu){
this.menu=vuit.widget.byId(this.menu);
this.menu.listenTree(this);
}
this.containerNode=this.domNode;
},postCreate:function(){
this.createDOMNode();
},createDOMNode:function(){
vuit.html.disableSelection(this.domNode);
for(var i=0;i<this.children.length;i++){
this.children[i].parent=this;
var node=this.children[i].createDOMNode(this,0);
this.domNode.appendChild(node);
}
if(!this.showRootGrid){
for(var i=0;i<this.children.length;i++){
this.children[i].expand();
}
}
vuit.event.topic.publish(this.eventNames.treeCreate,{source:this});
},destroy:function(){
vuit.event.topic.publish(this.tree.eventNames.treeDestroy,{source:this});
return vuit.widget.HtmlWidget.prototype.destroy.apply(this,arguments);
},addChild:function(_8fe,_8ff){
var _900={child:_8fe,index:_8ff,parent:this,domNodeInitialized:_8fe.domNodeInitialized};
this.doAddChild.apply(this,arguments);
vuit.event.topic.publish(this.tree.eventNames.addChild,_900);
},doAddChild:function(_901,_902){
if(vuit.lang.isUndefined(_902)){
_902=this.children.length;
}
if(!_901.isTreeNode){
vuit.raise("You can only add TreeNode widgets to a "+this.widgetType+" widget!");
return;
}
if(this.isTreeNode){
if(!this.isFolder){
this.setFolder();
}
}
var _903=this;
vuit.lang.forEach(_901.getDescendants(),function(elem){
elem.tree=_903.tree;
});
_901.parent=this;
if(this.isTreeNode){
this.state=this.loadStates.LOADED;
}
if(_902<this.children.length){
vuit.html.insertBefore(_901.domNode,this.children[_902].domNode);
}else{
this.containerNode.appendChild(_901.domNode);
if(this.isExpanded&&this.isTreeNode){
this.showChildren();
}
}
this.children.splice(_902,0,_901);
if(_901.domNodeInitialized){
var d=this.isTreeNode?this.depth:-1;
_901.adjustDepth(d-_901.depth+1);
_901.updateIconTree();
}else{
_901.depth=this.isTreeNode?this.depth+1:0;
_901.createDOMNode(_901.tree,_901.depth);
}
var _906=_901.getPreviousSibling();
if(_901.isLastNode()&&_906){
_906.updateExpandGridColumn();
}
},makeBlankImg:function(){
var img=document.createElement("img");
img.style.width=this.iconWidth+"px";
img.style.height=this.iconHeight+"px";
img.src=this.blankIconSrc;
img.style.verticalAlign="middle";
return img;
},updateIconTree:function(){
if(!this.isTree){
this.updateIcons();
}
for(var i=0;i<this.children.length;i++){
this.children[i].updateIconTree();
}
},toString:function(){
return "["+this.widgetType+" ID:"+this.widgetId+"]";
},move:function(_909,_90a,_90b){
var _90c=_909.parent;
var _90d=_909.tree;
this.doMove.apply(this,arguments);
var _90a=_909.parent;
var _90e=_909.tree;
var _90f={oldParent:_90c,oldTree:_90d,newParent:_90a,newTree:_90e,child:_909};
vuit.event.topic.publish(_90d.eventNames.moveFrom,_90f);
vuit.event.topic.publish(_90e.eventNames.moveTo,_90f);
},doMove:function(_910,_911,_912){
_910.parent.doRemoveNode(_910);
_911.doAddChild(_910,_912);
},removeNode:function(_913){
if(!_913.parent){
return;
}
var _914=_913.tree;
var _915=_913.parent;
var _916=this.doRemoveNode.apply(this,arguments);
vuit.event.topic.publish(this.tree.eventNames.removeNode,{child:_916,tree:_914,parent:_915});
return _916;
},doRemoveNode:function(_917){
if(!_917.parent){
return;
}
var _918=_917.parent;
var _919=_918.children;
var _91a=_917.getParentIndex();
if(_91a<0){
vuit.raise("Couldn't find node "+_917+" for removal");
}
_919.splice(_91a,1);
vuit.html.removeNode(_917.domNode);
if(_918.children.length==0){
_918.containerNode.style.display="none";
}
if(_91a==_919.length&&_91a>0){
_919[_91a-1].updateExpandGridColumn();
}
if(_918 instanceof vuit.widget.Tree&&_91a==0&&_919.length>0){
_919[0].updateExpandGrid();
}
_917.parent=_917.tree=null;
return _917;
},markLoading:function(){
},unMarkLoading:function(){
},lock:function(){
!this.lockLevel&&this.markLoading();
this.lockLevel++;
},unlock:function(){
if(!this.lockLevel){
vuit.raise("unlock: not locked");
}
this.lockLevel--;
!this.lockLevel&&this.unMarkLoading();
},isLocked:function(){
var node=this;
while(true){
if(node.lockLevel){
return true;
}
if(node instanceof vuit.widget.Tree){
break;
}
node=node.parent;
}
return false;
},flushLock:function(){
this.lockLevel=0;
this.unMarkLoading();
}});
vuit.provide("vuit.widget.PopupContainer");
vuit.provide("vuit.widget.Menu2");
vuit.provide("vuit.widget.PopupMenu2");
vuit.provide("vuit.widget.MenuItem2");
vuit.provide("vuit.widget.MenuBar2");
vuit.widget.defineWidget("vuit.widget.PopupContainer",vuit.widget.HtmlWidget,{initializer:function(){
this.queueOnAnimationFinish=[];
},isContainer:true,templateString:"<div vuitAttachPoint=\"containerNode\" style=\"display:none;\" class=\"vuitPopupContainer\" tabindex=\"-1\"></div>",templateCssString:".vuitPopupContainer{position:absolute;}",snarfChildDomOutput:true,isShowingNow:false,currentSubpopup:null,beginZIndex:1000,parentPopup:null,popupIndex:0,processKey:function(evt){
return false;
},open:function(x,y,_91f,_920,_921,_922){
if(this.isShowingNow){
return;
}
if(this.animationInProgress){
this.queueOnAnimationFinish.push(this.open,arguments);
return;
}
var _923=false,node,aroundOrient;
if(typeof x=="object"){
node=x;
aroundOrient=_920;
_920=_91f;
_91f=y;
_923=true;
}
vuit.body().appendChild(this.domNode);
_920=_920||_91f["domNode"]||[];
var _924=null;
this.isTopLevel=true;
while(_91f){
if(_91f!==this&&_91f instanceof vuit.widget.PopupContainer){
_924=_91f;
this.isTopLevel=false;
_924.setOpenedSubpopup(this);
break;
}
_91f=_91f.parent;
}
this.parentPopup=_924;
this.popupIndex=_924?_924.popupIndex+1:1;
if(this.isTopLevel){
var _925=_920 instanceof Array?null:_920;
vuit.widget.PopupManager.opened(this,_925);
}
if(_920 instanceof Array){
_920={left:_920[0],top:_920[1],width:0,height:0};
}
with(this.domNode.style){
display="";
zIndex=this.beginZIndex+this.popupIndex;
}
if(_923){
this.move(node,_922,aroundOrient);
}else{
this.move(x,y,_922,_921);
}
this.domNode.style.display="none";
this.explodeSrc=_920;
this.show();
this.isShowingNow=true;
},move:function(x,y,_928,_929){
var _92a=(typeof x=="object");
if(_92a){
var _92b=_928;
var node=x;
_928=y;
if(!_92b){
_92b={"BL":"TL","TL":"BL"};
}
vuit.html.placeOnScreenAroundElement(this.domNode,node,_928,true,_92b);
}else{
if(!_929){
_929="TL,TR,BL,BR";
}
vuit.html.placeOnScreen(this.domNode,x,y,_928,true,_929);
}
},close:function(){
if(this.animationInProgress){
this.queueOnAnimationFinish.push(this.close,[]);
return;
}
this.closeSubpopup();
this.hide();
if(this.bgIframe){
this.bgIframe.hide();
this.bgIframe.size({left:0,top:0,width:0,height:0});
}
if(this.isTopLevel){
vuit.widget.PopupManager.closed(this);
}
this.isShowingNow=false;
},closeAll:function(){
if(this.parentPopup){
this.parentPopup.closeAll();
}else{
this.close();
}
},setOpenedSubpopup:function(_92d){
this.currentSubpopup=_92d;
},closeSubpopup:function(){
if(this.currentSubpopup==null){
return;
}
this.currentSubpopup.close();
this.currentSubpopup=null;
},onShow:function(){
vuit.widget.PopupContainer.superclass.onShow.call(this);
this.openedSize={w:this.domNode.style.width,h:this.domNode.style.height};
if(vuit.render.html.ie){
if(!this.bgIframe){
this.bgIframe=new vuit.html.BackgroundIframe();
this.bgIframe.setZIndex(this.domNode);
}
this.bgIframe.size(this.domNode);
this.bgIframe.show();
}
this.processQueue();
},processQueue:function(){
if(!this.queueOnAnimationFinish.length){
return;
}
var func=this.queueOnAnimationFinish.shift();
var args=this.queueOnAnimationFinish.shift();
func.apply(this,args);
},onHide:function(){
vuit.widget.HtmlWidget.prototype.onHide.call(this);
if(this.openedSize){
with(this.domNode.style){
width=this.openedSize.w;
height=this.openedSize.h;
}
}
this.processQueue();
}});
vuit.widget.defineWidget("vuit.widget.PopupMenu2",vuit.widget.PopupContainer,{initializer:function(){
vuit.widget.PopupMenu2.superclass.initializer.call(this);
this.targetNodeIds=[];
this.eventNames={open:""};
},templateCssString:"",currentSubmenuTrigger:null,eventNaming:"default",templateString:"<table class=\"vuitPopupMenu2\" border=0 cellspacing=0 cellpadding=0 style=\"display: none;\"><tbody vuitAttachPoint=\"containerNode\"></tbody></table>",templateCssPath:vuit.uri.vuitUri("src/widget/templates/HtmlMenu2.css"),submenuDelay:500,submenuOverlap:5,contextMenuForWindow:false,openEvent:null,_highlighted_option:null,initialize:function(args,frag){
if(this.eventNaming=="default"){
for(var _932 in this.eventNames){
this.eventNames[_932]=this.widgetId+"/"+_932;
}
}
},postCreate:function(){
if(this.contextMenuForWindow){
var doc=vuit.body();
this.bindDomNode(doc);
}else{
if(this.targetNodeIds.length>0){
vuit.lang.forEach(this.targetNodeIds,this.bindDomNode,this);
}
}
this.subscribeSubitemsOnOpen();
},subscribeSubitemsOnOpen:function(){
var _934=this.getChildrenOfType(vuit.widget.MenuItem2);
for(var i=0;i<_934.length;i++){
vuit.event.topic.subscribe(this.eventNames.open,_934[i],"menuOpen");
}
},getTopOpenEvent:function(){
var menu=this;
while(menu.parentPopup){
menu=menu.parentPopup;
}
return menu.openEvent;
},bindDomNode:function(node){
node=vuit.byId(node);
var win=vuit.html.getElementWindow(node);
if(vuit.html.isTag(node,"iframe")=="iframe"){
win=vuit.html.iframeContentWindow(node);
node=vuit.withGlobal(win,vuit.body);
}
vuit.widget.Menu2.OperaAndKonqFixer.fixNode(node);
vuit.event.kwConnect({srcObj:node,srcFunc:"oncontextmenu",targetObj:this,targetFunc:"onOpen",once:true});
vuit.widget.PopupManager.registerWin(win);
},unBindDomNode:function(_939){
var node=vuit.byId(_939);
vuit.event.kwDisconnect({srcObj:node,srcFunc:"oncontextmenu",targetObj:this,targetFunc:"onOpen",once:true});
vuit.widget.Menu2.OperaAndKonqFixer.cleanNode(node);
},moveToNext:function(evt){
this.highlightOption(1);
return true;
},moveToPrevious:function(evt){
this.highlightOption(-1);
return true;
},moveToParentMenu:function(evt){
if(this._highlighted_option&&this.parentPopup){
if(evt._menu2UpKeyProcessed){
return true;
}else{
this._highlighted_option.onUnhover();
this.closeSubpopup();
evt._menu2UpKeyProcessed=true;
}
}
return false;
},moveToChildMenu:function(evt){
if(this._highlighted_option&&this._highlighted_option.submenuId){
this._highlighted_option._onClick(true);
return true;
}
return false;
},selectCurrentItem:function(evt){
if(this._highlighted_option){
this._highlighted_option._onClick();
return true;
}
return false;
},processKey:function(evt){
if(evt.ctrlKey||evt.altKey){
return false;
}
var _941=evt.keyCode;
var rval=false;
var k=vuit.event.browser.keys;
var _941=evt.keyCode;
if(_941==0&&evt.charCode==k.KEY_SPACE){
_941=k.KEY_SPACE;
}
switch(_941){
case k.KEY_DOWN_ARROW:
rval=this.moveToNext(evt);
break;
case k.KEY_UP_ARROW:
rval=this.moveToPrevious(evt);
break;
case k.KEY_RIGHT_ARROW:
rval=this.moveToChildMenu(evt);
break;
case k.KEY_LEFT_ARROW:
rval=this.moveToParentMenu(evt);
break;
case k.KEY_SPACE:
case k.KEY_ENTER:
if(rval=this.selectCurrentItem(evt)){
break;
}
case k.KEY_ESCAPE:
vuit.widget.PopupManager.currentMenu.close();
rval=true;
break;
}
return rval;
},findValidItem:function(dir,_945){
if(_945){
_945=dir>0?_945.getNextSibling():_945.getPreviousSibling();
}
for(var i=0;i<this.children.length;++i){
if(!_945){
_945=dir>0?this.children[0]:this.children[this.children.length-1];
}
if(_945.onHover){
return _945;
}
_945=dir>0?_945.getNextSibling():_945.getPreviousSibling();
}
},highlightOption:function(dir){
var item;
if((!this._highlighted_option)){
item=this.findValidItem(dir);
}else{
item=this.findValidItem(dir,this._highlighted_option);
}
if(item){
if(this._highlighted_option){
this._highlighted_option.onUnhover();
}
item.onHover();
vuit.html.scrollIntoView(item.domNode);
}
},onItemClick:function(item){
},close:function(){
if(this.animationInProgress){
vuit.widget.PopupMenu2.superclass.close.call(this);
return;
}
if(this._highlighted_option){
this._highlighted_option.onUnhover();
}
vuit.widget.PopupMenu2.superclass.close.call(this);
},closeSubpopup:function(){
if(this.currentSubpopup==null){
return;
}
this.currentSubpopup.close();
this.currentSubpopup=null;
this.currentSubmenuTrigger.is_open=false;
this.currentSubmenuTrigger.closedSubmenu();
this.currentSubmenuTrigger=null;
},openSubmenu:function(_94a,_94b){
var _94c=vuit.html.getAbsolutePosition(_94b.domNode,true);
var _94d=vuit.html.getMarginBox(this.domNode).width;
var x=_94c.x+_94d-this.submenuOverlap;
var y=_94c.y;
_94a.open(x,y,this,_94b.domNode);
this.currentSubmenuTrigger=_94b;
this.currentSubmenuTrigger.is_open=true;
},onOpen:function(e){
this.openEvent=e;
var x=e.pageX,y=e.pageY;
var win=vuit.html.getElementWindow(e.target);
var _953=win.frameElement;
if(_953){
var cood=vuit.html.getAbsolutePosition(_953,!vuit.render.html.ie);
x+=cood.x-(vuit.render.html.ie?0:vuit.withGlobal(win,vuit.html.getScroll).left);
y+=cood.y-(vuit.render.html.ie?0:vuit.withGlobal(win,vuit.html.getScroll).top);
}
this.open(x,y,null,[x,y]);
e.preventDefault();
e.stopPropagation();
}});
vuit.widget.defineWidget("vuit.widget.MenuItem2",vuit.widget.HtmlWidget,{initializer:function(){
this.eventNames={engage:""};
},templateString:"<tr class=\"vuitMenuItem2\" vuitAttachEvent=\"onMouseOver: onHover; onMouseOut: onUnhover; onClick: _onClick;\">"+"<td><div class=\"vuitMenuItem2Icon\" style=\"${this.iconStyle}\"></div></td>"+"<td class=\"vuitMenuItem2Label\"><span><span>${this.caption}</span>${this.caption}</span></td>"+"<td class=\"vuitMenuItem2Accel\"><span><span>${this.accelKey}</span>${this.accelKey}</span></td>"+"<td><div class=\"vuitMenuItem2Submenu\" style=\"display:${this.arrowDisplay};\"></div></td>"+"</tr>",is_hovering:false,hover_timer:null,is_open:false,topPosition:0,caption:"Untitled",accelKey:"",iconSrc:"",submenuId:"",disabled:false,eventNaming:"default",highlightClass:"vuitMenuItem2Hover",postMixInProperties:function(){
this.iconStyle="";
if(this.iconSrc){
if((this.iconSrc.toLowerCase().substring(this.iconSrc.length-4)==".png")&&(vuit.render.html.ie)){
this.iconStyle="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.iconSrc+"', sizingMethod='image')";
}else{
this.iconStyle="background-image: url("+this.iconSrc+")";
}
}
this.arrowDisplay=this.submenuId?"block":"none";
},fillInTemplate:function(){
vuit.html.disableSelection(this.domNode);
if(this.disabled){
this.setDisabled(true);
}
if(this.eventNaming=="default"){
for(var _955 in this.eventNames){
this.eventNames[_955]=this.widgetId+"/"+_955;
}
}
},onHover:function(){
this.onUnhover();
if(this.is_hovering){
return;
}
if(this.is_open){
return;
}
if(this.parent._highlighted_option){
this.parent._highlighted_option.onUnhover();
}
this.parent.closeSubpopup();
this.parent._highlighted_option=this;
vuit.widget.PopupManager.setFocusedMenu(this.parent);
this.highlightItem();
if(this.is_hovering){
this.stopSubmenuTimer();
}
this.is_hovering=true;
this.startSubmenuTimer();
},onUnhover:function(){
if(!this.is_open){
this.unhighlightItem();
}
this.is_hovering=false;
this.parent._highlighted_option=null;
if(this.parent.parentPopup){
vuit.widget.PopupManager.setFocusedMenu(this.parent.parentPopup);
}
this.stopSubmenuTimer();
},_onClick:function(_956){
var _957=false;
if(this.disabled){
return false;
}
if(this.submenuId){
if(!this.is_open){
this.stopSubmenuTimer();
this.openSubmenu();
}
_957=true;
}else{
this.parent.closeAll();
}
if(!_957){
this.onUnhover();
}
this.onClick();
vuit.event.topic.publish(this.eventNames.engage,this);
if(_957&&_956){
vuit.widget.getWidgetById(this.submenuId).highlightOption(1);
}
return;
},onClick:function(){
this.parent.onItemClick(this);
},highlightItem:function(){
vuit.html.addClass(this.domNode,this.highlightClass);
},unhighlightItem:function(){
vuit.html.removeClass(this.domNode,this.highlightClass);
},startSubmenuTimer:function(){
this.stopSubmenuTimer();
if(this.disabled){
return;
}
var self=this;
var _959=function(){
return function(){
self.openSubmenu();
};
}();
this.hover_timer=vuit.lang.setTimeout(_959,this.parent.submenuDelay);
},stopSubmenuTimer:function(){
if(this.hover_timer){
vuit.lang.clearTimeout(this.hover_timer);
this.hover_timer=null;
}
},openSubmenu:function(){
this.parent.closeSubpopup();
var _95a=vuit.widget.getWidgetById(this.submenuId);
if(_95a){
this.parent.openSubmenu(_95a,this);
}
},closedSubmenu:function(){
this.onUnhover();
},setDisabled:function(_95b){
this.disabled=_95b;
if(this.disabled){
vuit.html.addClass(this.domNode,"vuitMenuItem2Disabled");
}else{
vuit.html.removeClass(this.domNode,"vuitMenuItem2Disabled");
}
},enable:function(){
this.setDisabled(false);
},disable:function(){
this.setDisabled(true);
},menuOpen:function(_95c){
}});
vuit.widget.defineWidget("vuit.widget.MenuSeparator2",vuit.widget.HtmlWidget,{templateString:"<tr class=\"vuitMenuSeparator2\"><td colspan=4>"+"<div class=\"vuitMenuSeparator2Top\"></div>"+"<div class=\"vuitMenuSeparator2Bottom\"></div>"+"</td></tr>",postCreate:function(){
vuit.html.disableSelection(this.domNode);
}});
vuit.widget.PopupManager=new function(){
this.currentMenu=null;
this.currentButton=null;
this.currentFocusMenu=null;
this.focusNode=null;
this.registeredWindows=[];
this._keyEventName=vuit.doc().createEvent?"onkeypress":"onkeydown";
this.registerWin=function(win){
if(!win.__PopupManagerRegistered){
vuit.event.connect(win.document,"onmousedown",this,"onClick");
vuit.event.connect(win,"onscroll",this,"onClick");
vuit.event.connect(win.document,this._keyEventName,this,"onKeyPress");
win.__PopupManagerRegistered=true;
this.registeredWindows.push(win);
}
};
this.registerAllWindows=function(_95e){
if(!_95e){
_95e=vuit.html.getDocumentWindow(window.top.document);
}
this.registerWin(_95e);
for(var i=0;i<_95e.frames.length;i++){
var win=vuit.html.getDocumentWindow(_95e.frames[i].document);
if(win){
this.registerAllWindows(win);
}
}
};
vuit.addOnLoad(this,"registerAllWindows");
this.closed=function(menu){
if(this.currentMenu==menu){
this.currentMenu=null;
this.currentButton=null;
this.currentFocusMenu=null;
}
};
this.opened=function(menu,_963){
if(menu==this.currentMenu){
return;
}
if(this.currentMenu){
this.currentMenu.close();
}
this.currentMenu=menu;
this.currentFocusMenu=menu;
this.currentButton=_963;
};
this.setFocusedMenu=function(menu){
this.currentFocusMenu=menu;
};
this.onKeyPress=function(e){
if(!this.currentMenu||!this.currentMenu.isShowingNow){
return;
}
var m=this.currentFocusMenu;
while(m){
if(m.processKey(e)){
e.preventDefault();
e.stopPropagation();
break;
}
m=m.parentPopup;
}
},this.onClick=function(e){
if(!this.currentMenu){
return;
}
var _968=vuit.html.getScroll().offset;
var m=this.currentMenu;
if(!e){
for(var i=0;i<this.registeredWindows.length;++i){
if(this.registeredWindows[i].event){
e=this.registeredWindows[i].event;
break;
}
}
}
while(m){
if(vuit.html.overElement(m.domNode,e)||vuit.html.isDescendantOf(e.target,m.domNode)){
return;
}
m=m.currentSubpopup;
}
if(this.currentButton&&vuit.html.overElement(this.currentButton,e)){
return;
}
this.currentMenu.close();
};
};
vuit.widget.Menu2.OperaAndKonqFixer=new function(){
var _96b=true;
var _96c=false;
if(!vuit.lang.isFunction(vuit.doc().oncontextmenu)){
vuit.doc().oncontextmenu=function(){
_96b=false;
_96c=true;
};
}
if(vuit.doc().createEvent){
try{
var e=vuit.doc().createEvent("MouseEvents");
e.initMouseEvent("contextmenu",1,1,vuit.global(),1,0,0,0,0,0,0,0,0,0,null);
vuit.doc().dispatchEvent(e);
}
catch(e){
}
}else{
_96b=false;
}
if(_96c){
delete vuit.doc().oncontextmenu;
}
this.fixNode=function(node){
if(_96b){
if(!vuit.lang.isFunction(node.oncontextmenu)){
node.oncontextmenu=function(e){
};
}
if(vuit.render.html.opera){
node._menufixer_opera=function(e){
if(e.ctrlKey){
this.oncontextmenu(e);
}
};
vuit.event.connect(node,"onclick",node,"_menufixer_opera");
}else{
node._menufixer_konq=function(e){
if(e.button==2){
e.preventDefault();
this.oncontextmenu(e);
}
};
vuit.event.connect(node,"onmousedown",node,"_menufixer_konq");
}
}
};
this.cleanNode=function(node){
if(_96b){
if(node._menufixer_opera){
vuit.event.disconnect(node,"onclick",node,"_menufixer_opera");
delete node._menufixer_opera;
}else{
if(node._menufixer_konq){
vuit.event.disconnect(node,"onmousedown",node,"_menufixer_konq");
delete node._menufixer_konq;
}
}
if(node.oncontextmenu){
delete node.oncontextmenu;
}
}
};
};
vuit.widget.defineWidget("vuit.widget.MenuBar2",vuit.widget.PopupMenu2,{menuOverlap:2,templateString:"<div class=\"vuitMenuBar2\"><table class=\"vuitMenuBar2Client\"><tr vuitAttachPoint=\"containerNode\"></tr></table></div>",close:function(){
if(this._highlighted_option){
this._highlighted_option.onUnhover();
}
this.closeSubpopup();
},processKey:function(evt){
if(evt.ctrlKey||evt.altKey){
return false;
}
var _974=evt.keyCode;
var rval=false;
var k=vuit.event.browser.keys;
switch(_974){
case k.KEY_DOWN_ARROW:
rval=this.moveToChildMenu(evt);
break;
case k.KEY_UP_ARROW:
rval=this.moveToParentMenu(evt);
break;
case k.KEY_RIGHT_ARROW:
rval=this.moveToNext(evt);
break;
case k.KEY_LEFT_ARROW:
rval=this.moveToPrevious(evt);
break;
default:
rval=this.inherited("processKey",evt);
break;
}
return rval;
},postCreate:function(){
this.inherited("postCreate");
vuit.widget.PopupManager.opened(this);
this.isShowingNow=true;
},openSubmenu:function(_977,_978){
var _979=vuit.html.getAbsolutePosition(_978.domNode,true);
var _97a=vuit.html.getAbsolutePosition(this.domNode,true);
var _97b=vuit.html.getBorderBox(this.domNode).height;
var x=_979.x;
var y=_97a.y+_97b-this.menuOverlap;
_977.open(x,y,this,_978.domNode);
this.currentSubmenuTrigger=_978;
this.currentSubmenuTrigger.is_open=true;
}});
vuit.widget.defineWidget("vuit.widget.MenuBarItem2",vuit.widget.MenuItem2,{templateString:"<td class=\"vuitMenuBarItem2\" vuitAttachEvent=\"onMouseOver: onHover; onMouseOut: onUnhover; onClick: _onClick;\">"+"<span><span>${this.caption}</span>${this.caption}</span>"+"</td>",highlightClass:"vuitMenuBarItem2Hover",setDisabled:function(_97e){
this.disabled=_97e;
if(this.disabled){
vuit.html.addClass(this.domNode,"vuitMenuBarItem2Disabled");
}else{
vuit.html.removeClass(this.domNode,"vuitMenuBarItem2Disabled");
}
}});
vuit.provide("vuit.widget.TreeContextMenu");
vuit.provide("vuit.widget.TreeMenuItem");
vuit.widget.tags.addParseTreeHandler("vuit:TreeContextMenu");
vuit.widget.tags.addParseTreeHandler("vuit:TreeMenuItem");
vuit.widget.TreeContextMenu=function(){
vuit.widget.PopupMenu2.call(this);
this.listenedTrees=[];
};
vuit.inherits(vuit.widget.TreeContextMenu,vuit.widget.PopupMenu2);
vuit.lang.extend(vuit.widget.TreeContextMenu,{widgetType:"TreeContextMenu",open:function(x,y,_981,_982){
var _983=vuit.widget.PopupMenu2.prototype.open.apply(this,arguments);
vuit.event.topic.publish(this.eventNames.open,{menu:this});
return _983;
},listenTree:function(tree){
var _985=tree.getDescendants();
for(var i=0;i<_985.length;i++){
if(!_985[i].isTreeNode){
continue;
}
this.bindDomNode(_985[i].labelNode);
}
var _987=this;
vuit.event.topic.subscribe(tree.eventNames.createDOMNode,this,"onCreateDOMNode");
vuit.event.topic.subscribe(tree.eventNames.moveFrom,this,"onMoveFrom");
vuit.event.topic.subscribe(tree.eventNames.moveTo,this,"onMoveTo");
vuit.event.topic.subscribe(tree.eventNames.removeNode,this,"onRemoveNode");
vuit.event.topic.subscribe(tree.eventNames.addChild,this,"onAddChild");
vuit.event.topic.subscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
this.listenedTrees.push(tree);
},unlistenTree:function(tree){
vuit.event.topic.unsubscribe(tree.eventNames.createDOMNode,this,"onCreateDOMNode");
vuit.event.topic.unsubscribe(tree.eventNames.moveFrom,this,"onMoveFrom");
vuit.event.topic.unsubscribe(tree.eventNames.moveTo,this,"onMoveTo");
vuit.event.topic.unsubscribe(tree.eventNames.removeNode,this,"onRemoveNode");
vuit.event.topic.unsubscribe(tree.eventNames.addChild,this,"onAddChild");
vuit.event.topic.unsubscribe(tree.eventNames.treeDestroy,this,"onTreeDestroy");
for(var i=0;i<this.listenedTrees.length;i++){
if(this.listenedTrees[i]===tree){
this.listenedTrees.splice(i,1);
break;
}
}
},onTreeDestroy:function(_98a){
this.unlistenTree(_98a.source);
},bindTreeNode:function(node){
var _98c=this;
vuit.lang.forEach(node.getDescendants(),function(e){
_98c.bindDomNode(e.labelNode);
});
},unBindTreeNode:function(node){
var _98f=this;
vuit.lang.forEach(node.getDescendants(),function(e){
_98f.unBindDomNode(e.labelNode);
});
},onCreateDOMNode:function(_991){
this.bindTreeNode(_991.source);
},onMoveFrom:function(_992){
if(!vuit.lang.inArray(this.listenedTrees,_992.newTree)){
this.unBindTreeNode(_992.child);
}
},onMoveTo:function(_993){
if(vuit.lang.inArray(this.listenedTrees,_993.newTree)){
this.bindTreeNode(_993.child);
}
},onRemoveNode:function(_994){
this.unBindTreeNode(_994.child);
},onAddChild:function(_995){
if(_995.domNodeInitialized){
this.bindTreeNode(_995.child);
}
}});
vuit.widget.TreeMenuItem=function(){
vuit.widget.MenuItem2.call(this);
};
vuit.inherits(vuit.widget.TreeMenuItem,vuit.widget.MenuItem2);
vuit.lang.extend(vuit.widget.TreeMenuItem,{widgetType:"TreeMenuItem",treeActions:"",initialize:function(args,frag){
this.treeActions=this.treeActions.split(",");
for(var i=0;i<this.treeActions.length;i++){
this.treeActions[i]=this.treeActions[i].toUpperCase();
}
},getTreeNode:function(){
var menu=this;
while(!(menu instanceof vuit.widget.TreeContextMenu)){
menu=menu.parent;
}
var _99a=menu.getTopOpenEvent().target;
while(!_99a.getAttribute("treeNode")&&_99a.tagName!="body"){
_99a=_99a.parentNode;
}
if(_99a.tagName=="body"){
vuit.raise("treeNode not detected");
}
var _99b=vuit.widget.manager.getWidgetById(_99a.getAttribute("treeNode"));
return _99b;
},menuOpen:function(_99c){
var _99d=this.getTreeNode();
this.setDisabled(false);
var _99e=this;
vuit.lang.forEach(_99e.treeActions,function(_99f){
_99e.setDisabled(_99d.actionIsDisabled(_99f));
});
},toString:function(){
return "["+this.widgetType+" node "+this.getTreeNode()+"]";
}});
vuit.provide("vuit.widget.TreeControllerExtension");
vuit.widget.TreeControllerExtension=function(){
};
vuit.lang.extend(vuit.widget.TreeControllerExtension,{saveExpandedIndices:function(node,_9a1){
var obj={};
for(var i=0;i<node.children.length;i++){
if(node.children[i].isExpanded){
var key=vuit.lang.isUndefined(_9a1)?i:node.children[i][_9a1];
obj[key]=this.saveExpandedIndices(node.children[i],_9a1);
}
}
return obj;
},restoreExpandedIndices:function(node,_9a6,_9a7){
var _9a8=this;
var _9a9=function(node,_9ab){
this.node=node;
this.savedIndices=_9ab;
this.process=function(){
_9a8.restoreExpandedIndices(this.node,this.savedIndices,_9a7);
};
};
for(var i=0;i<node.children.length;i++){
var _9ad=node.children[i];
var _9ae=false;
var key=-1;
if(vuit.lang.isUndefined(_9a7)&&_9a6[i]){
_9ae=true;
key=i;
}
if(_9a7){
for(var key in _9a6){
if(key==_9ad[_9a7]){
_9ae=true;
break;
}
}
}
if(_9ae){
var h=new _9a9(_9ad,_9a6[key]);
_9a8.expand(_9ad,false,h,h.process);
}else{
if(_9ad.isExpanded){
vuit.lang.forEach(_9ad.getDescendants(),function(elem){
_9a8.collapse(elem);
});
}
}
}
}});
vuit.provide("vuit.widget.TreeLoadingController");
vuit.widget.tags.addParseTreeHandler("vuit:TreeLoadingController");
vuit.widget.TreeLoadingController=function(){
vuit.widget.TreeBasicController.call(this);
};
vuit.inherits(vuit.widget.TreeLoadingController,vuit.widget.TreeBasicController);
vuit.lang.extend(vuit.widget.TreeLoadingController,{widgetType:"TreeLoadingController",RPCUrl:"",RPCActionParam:"action",RPCErrorHandler:function(type,obj,evt){
alert("RPC Error: "+(obj.message||"no message"));
},getRPCUrl:function(_9b5){
if(this.RPCUrl=="local"){
var dir=document.location.href.substr(0,document.location.href.lastIndexOf("/"));
var _9b7=dir+"/"+_9b5;
return _9b7;
}
if(!this.RPCUrl){
vuit.raise("Empty RPCUrl: can't load");
}
return this.RPCUrl+(this.RPCUrl.indexOf("?")>-1?"&":"?")+this.RPCActionParam+"="+_9b5;
},loadProcessResponse:function(node,_9b9,_9ba,_9bb){
if(!vuit.lang.isUndefined(_9b9.error)){
this.RPCErrorHandler("server",_9b9.error);
return false;
}
var _9bc=_9b9;
if(!vuit.lang.isArray(_9bc)){
vuit.raise("loadProcessResponse: Not array loaded: "+_9bc);
}
for(var i=0;i<_9bc.length;i++){
_9bc[i]=vuit.widget.createWidget(node.widgetType,_9bc[i]);
node.addChild(_9bc[i]);
}
node.state=node.loadStates.LOADED;
if(vuit.lang.isFunction(_9bb)){
_9bb.apply(vuit.lang.isUndefined(_9ba)?this:_9ba,[node,_9bc]);
}
},getInfo:function(obj){
return obj.getInfo();
},runRPC:function(kw){
var _9c0=this;
var _9c1=function(type,data,evt){
if(kw.lock){
vuit.lang.forEach(kw.lock,function(t){
t.unlock();
});
}
if(type=="load"){
kw.load.call(this,data);
}else{
this.RPCErrorHandler(type,data,evt);
}
};
if(kw.lock){
vuit.lang.forEach(kw.lock,function(t){
t.lock();
});
}
vuit.io.bind({url:kw.url,handle:vuit.lang.hitch(this,_9c1),mimetype:"text/json",preventCache:true,sync:kw.sync,content:{data:vuit.json.serialize(kw.params)}});
},loadRemote:function(node,sync,_9c9,_9ca){
var _9cb=this;
var _9cc={node:this.getInfo(node),tree:this.getInfo(node.tree)};
this.runRPC({url:this.getRPCUrl("getChildren"),load:function(_9cd){
_9cb.loadProcessResponse(node,_9cd,_9c9,_9ca);
},sync:sync,lock:[node],params:_9cc});
},expand:function(node,sync,_9d0,_9d1){
if(node.state==node.loadStates.UNCHECKED&&node.isFolder){
this.loadRemote(node,sync,this,function(node,_9d3){
this.expand(node,sync,_9d0,_9d1);
});
return;
}
vuit.widget.TreeBasicController.prototype.expand.apply(this,arguments);
},doMove:function(_9d4,_9d5,_9d6){
if(_9d5.isTreeNode&&_9d5.state==_9d5.loadStates.UNCHECKED){
this.loadRemote(_9d5,true);
}
return vuit.widget.TreeBasicController.prototype.doMove.apply(this,arguments);
},doCreateChild:function(_9d7,_9d8,data,_9da,_9db){
if(_9d7.state==_9d7.loadStates.UNCHECKED){
this.loadRemote(_9d7,true);
}
return vuit.widget.TreeBasicController.prototype.doCreateChild.apply(this,arguments);
}});
if(!this["vuit"]){
alert("\"vuit/__package__.js\" is now located at \"vuit/vuit.js\". Please update your includes accordingly");
}


