/*
	Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/

/*
	This is a compiled version of Dojo, 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(!dojo._hasResource["extLib.trimpath.query"]){dojo._hasResource["extLib.trimpath.query"]=true;dojo.provide("extLib.trimpath.query");if(typeof (TrimPath)=="undefined"){TrimPath={};}(function(){var _1=eval;var _2=String;var _3=Array;if(TrimPath==null){TrimPath=new Object();}if(TrimPath.TEST==null){TrimPath.TEST=new Object();}var _4=function(_5){var _6=[];for(var i=0;i<_5.length;i++){if(_8(_6,_5[i])==false){_6.push(_5[i]);}}return _6;};var _8=function(_9,_a){for(var j=0;j<_9.length;j++){if(_9[j]==_a){return true;}}return false;};var _c=function(_d){var _e=[];for(var i=0;i<_d.length;i++){if(_d[i]!=null){_e.push(_d[i]);}}return _e;};var _10=function(_11,_12){var _13=["{"];for(var i=0;i<_11.length;i++){if(i>0){_13.push(",");}_13.push(_11[i]);_13.push(":");if(_12[i]){_13.push("\"");_13.push(_12[i].replace(/(["\\])/g,"\\$1").replace(/\r/g,"").replace(/\n/g,"\\n"));_13.push("\"");}else{_13.push(null);}}_13.push("}");return _13.join("");};var _15=function(_16){var _17=[];for(var _18 in _16){_17.push(_18);}return _17;};var _19=function(_1a){var _1b=[];for(var _1c in _1a){_1b.push(_1a[_1c]);}return _1b;};var _1d=function(str){return str.replace(/^\s+/,"").replace(/\s+$/,"");};TrimPath.makeQueryLang_etc={};TrimPath.makeQueryLang_etc.Error=function(_1f,_20){this.message=_1f;this.stmt=_20;};TrimPath.makeQueryLang_etc.Error.prototype.toString=function(){return ("TrimPath query Error in "+(this.stmt!=null?this.stmt:"[unknown]")+": "+this.message);};var _21=function(){throw "currently unsupported";};var _22=function(){throw "incorrect keyword usage";};var _23=function(){};TrimPath.makeQueryLang=function(_24,etc){if(etc==null){etc=TrimPath.makeQueryLang_etc;}var _26=[];var _27=function(_28,_29,obj){if(_29[_28]!=null){throw new etc.Error("alias redefinition: "+_28);}_26.push({aliasKey:_28,scope:_29,orig:_29[_28]});_29[_28]=obj;return obj;};var _2b=new _23();var _2c=function(_2d,_2e,_2f,_30,_31){_2d=cleanArray(_2d);if(_2e==null){_2e=1;}if(_2d==null||_2d.length<_2e){throw new etc.Error("not enough arguments for "+_30);}if(_2f!=null&&_2d.length>_2f){throw new etc.Error("too many arguments for "+_30);}if(_31!=null){for(var k in _2d){if(typeof (_2d[k])!="function"&&_2d[k] instanceof _31==false){throw new etc.Error("wrong type for "+_2d[k]+" to "+_30);}}}return _2d;};var _33=function(_34){if(typeof _34=="string"&&_34.match(/\d{4}-\d{1,2}-\d{1,2}/)){var _35=_34.match(/\d{4}-\d{1,2}-\d{1,2}/)[0].split("-");var _36=new Date(parseInt(_35[0],10),(parseInt(_35[1],10)-1),parseInt(_35[2],10));return _36;}return _34;};var _37=function(_38,_39,_3a,_3b){if(_38[_39]){var _3a=eval(_3a);if(_38[_39].type&&_38[_39].type=="Number"){_3a=Number(_3a,10);}else{if(_38[_39].type&&_38[_39].type=="Date"){_3a=_33(_3a);}}_3b[_39]=_3a;}};var _3c={select:function(_3d){var _3e=[];var _3f={from:null,where:null,groupBy:null,having:null,orderBy:null,limit:null};for(var i=0;i<_3d.length;i++){var arg=_3d[i];var _42=false;for(var _43 in _3f){if(arg instanceof _3c[_43]){if(_3f[_43]!=null){throw new etc.Error("too many "+_43.toUpperCase()+" clauses");}_3f[_43]=arg;_42=true;break;}}if(_42==false){_3e.push(arg);}}_3e=_2c(_3e,1,null,"COLUMNS");if(_3f.from==null){throw new etc.Error("missing FROM clause");}var _44=null;var _45=null;var _46=null;var _47=null;var _48=null;var _49=null;var _4a=null;var _4b=function(_4c){for(var i=0;i<_4c.length;i++){var _4e=_4c[i];for(var _4f in _4e){var _50=_4e[_4f];if(_50 instanceof Date){_4c[i][_4f]=dateToString(_50);}}}};this.prepareFilter=function(){if(_44==null){_44=compileJoinDriver(_3f.from.tables);}if(_45==null){_45=compileFilter(compileFilterForJoin,_3f.from.tables);}if(_46==null){_46=compileFilter(compileFilterForWhere,_3f.from.tables,_3f.where!=null?_3f.where.exprs:null);}if(_49==null&&_3f.groupBy!=null){_49=compileGroupByCalcValues(_3f.from.tables,_3f.groupBy.exprs);}if(_4a==null&&_3f.having!=null){_4a=compileFilter(compileFilterForWhere,[],_3f.having.exprs,{aliasOnly:true});}if(_47==null){_47=compileColumnConvertor(_3f.from.tables,_3e);}if(_48==null&&_3f.orderBy!=null){_48=compileOrderByComparator(_3f.orderBy.exprs);}};this.filter=function(_51,_52,_53){this.prepareFilter();if(_52==null){_52={};}if(_53==null){_53={};}var _54=_44(_51,_45,_46,_52);if(_49!=null){for(var i=0;i<_54.length;i++){_54[i].groupByValues=_49.apply(null,_54[i]);}_54.sort(groupByComparator);}if(_53.return_reference){return _54;}var _56={};var _57={SUM:function(key,val){_56[key]=zeroDefault(_56[key])+zeroDefault(val);return _56[key];},COUNT:function(key){_56[key]=zeroDefault(_56[key])+1;return _56[key];},AVG:function(key,val){return _57.SUM(key,val)/_57.COUNT("_COUNT"+key);}};var _5d=[],_5e=null,_5f;for(var i=0;i<_54.length;i++){_5f=_54[i];_5f[0]=_57;if(_5e!=null&&groupByComparator(_5e,_5f)!=0){if(_4a==null||_4a(_5e.record)==true){_5d.push(_5e.record);}_56={};}_5f.record=_47.apply(null,_5f.concat([_53.with_table]));_5e=_5f;}if(_5e!=null&&(_4a==null||_4a(_5e.record)==true)){_5d.push(_5e.record);}if(_48!=null){_5d.sort(_48);}if(_3f.limit!=null){if(_3f.limit.total==0){return [];}var _60=(_3f.limit.offset!=null?_3f.limit.offset:0);_5d=_5d.slice(_60,_60+(_3f.limit.total>0?_3f.limit.total:_5d.length));}_4b(_5d);return _5d;};setSSFunc(this,function(){var _61=["SELECT",map(_3e,toSqlWithAlias).join(", "),_3f.from.toSql()];if(_3f.where!=null){_61.push(_3f.where.toSql());}if(_3f.groupBy!=null){_61.push(_3f.groupBy.toSql());}if(_3f.having!=null){_61.push(_3f.having.toSql());}if(_3f.orderBy!=null){_61.push(_3f.orderBy.toSql());}if(_3f.limit!=null){_61.push(_3f.limit.toSql());}return _61.join(" ");});for(var i=0;i<_26.length;i++){var _62=_26[i];_62.scope[_62.aliasKey]=_62.orig;}_26=[];},insert:function(_63){var _64=_63[0];var _65=_63[1];this.filter=function(_66,_67){var _68=_64[".name"];if(!_66[_68]){_66[_68]=[];}_66[_68].push({});for(var _69 in _65){_37(_64,_69,_65[_69],_66[_68][_66[_68].length-1]);}return true;};setSSFunc(this,function(){var _6a=["INSERT INTO",_64.toSql(),"("+_15(_65).join(", ")+")","VALUES","("+_19(_65).join(", ")+")"];return _6a.join(" ");});},update:function(_6b){var _6c=_6b[0];var _6d=_6b[1];var _6e=_6b[2];this.filter=function(_6f,_70){var _71=_6c.tables[0];var _72=_2b.SELECT(_6c,_6e,1).filter(_6f,null,{return_reference:true});for(var i=0;i<_72.length;i++){var _74=_72[i][1];for(var _75 in _6d){var _76=_75.split(".");var _77=_75;if(_76.length==2){_77=_76[1];}_37(_71,_77,_6d[_75],_74);}}return true;};setSSFunc(this,function(){var _78=["UPDATE",_6c.toSql()];var _79=[];for(var _7a in _6d){_79.push(_7a+"="+_6d[_7a]);}_78.push(_79.join(", "));if(_6e!=null){_78.push(_6e.toSql());}return _78.join(" ");});},destroy:function(_7b){var _7c=_7b[0];this.filter=function(_7d,_7e){var _7f=_7c.filter(_7d,null,{return_reference:true});for(var i=0;i<_7f.length;i++){var _81=_7f[i];for(var j=1;j<_81.length;j++){var _83=_81[j];for(var _84 in _83){delete _83[_84];}}}for(var _85 in _7d){var _86=_7d[_85];for(var i=0;i<_86.length;i++){if(_15(_86[i]).length==0){delete _86[i];}}}for(var _85 in _7d){_7d[_85]=_c(_7d[_85]);}return true;};setSSFunc(this,function(){var _87=["DELETE",_7c.toSql()];return _87.join(" ").replace(/SELECT\s/,"");});},from:function(_88){this.tables=_2c(_88,1,null,"FROM",_3c.tableDef);},where:function(_89){this.exprs=_2c(_89,1,null,"WHERE",_3c.expression);},groupBy:function(_8a){this.exprs=_2c(_8a,1,null,"GROUP_BY");},having:function(_8b){this.exprs=_2c(_8b,1,null,"HAVING",_3c.expression);},orderBy:function(_8c){this.exprs=_2c(_8c,1,null,"ORDER_BY");},expression:function(_8d,_8e,_8f,_90,_91,_92,_93,_94){var _95=this;this.args=_2c(_8d,_91,_92,_8e);this[".name"]=_8e;this[".alias"]=_94!=null?_94:_8e;this.opFix=_8f;this.sqlText=_90!=null?_90:this[".name"];this.jsText=_93!=null?_93:this.sqlText;this.AS=function(_96){this[".alias"]=this.ASC[".alias"]=this.DESC[".alias"]=_96;return _27(_96,_2b,this);};this.ASC=setSSFunc({".name":_8e,".alias":_95[".alias"],order:"ASC"},function(){return _95[".alias"]+" ASC";});this.DESC=setSSFunc({".name":_8e,".alias":_95[".alias"],order:"DESC"},function(){return _95[".alias"]+" DESC";});this.COLLATE=_21;},aggregate:function(){_3c.expression.apply(this,arguments);},limit:function(_97,_98){if(_98==null){this.total=cleanString(_97);}else{this.total=cleanString(_98);this.offset=cleanString(_97);}},tableDef:function(_99,_9a,_9b){this[".name"]=_99;this[".alias"]=_9b!=null?_9b:_99;this[".allColumns"]=[];for(var _9c in _9a){this[_9c]=new _3c.columnDef(_9c,_9a[_9c],this);this[".allColumns"].push(this[_9c]);}_9d(this,function(){return _99;});this.AS=function(_9e){return _27(_9e,_2b,new _3c.tableDef(_99,_9a,_9e));};this.ALL=new _3c.columnDef("*",null,this);this.ALL.AS=null;},columnDef:function(_9f,_a0,_a1,_a2){var _a3=this;this[".name"]=_9f;this[".alias"]=_a2!=null?_a2:_9f;this.tableDef=_a1;_9d(this,function(_a4){if(_a4!=null&&_a4.aliasOnly==true){return this[".alias"];}return _a1!=null?((_a1[".alias"])+"."+_9f):_9f;});this.AS=function(_a5){return _27(_a5,_2b,new _3c.columnDef(_9f,_a0,_a1,_a5));};if(_a0&&_a0.type){this.type=_a0.type;}else{this.type="String";}this.ASC=_9d({".name":_9f,".alias":_a3[".alias"],tableDef:_a1,order:"ASC"},function(){return _a3.toSql()+" ASC";});this.DESC=_9d({".name":_9f,".alias":_a3[".alias"],tableDef:_a1,order:"DESC"},function(){return _a3.toSql()+" DESC";});this.COLLATE=_21;},join:function(_a6,_a7){var _a8=this;this.joinType=_a6;this.fromSeparator=" "+_a6+" JOIN ";for(var k in _a7){this[k]=_a7[k];}this.ON=function(){_a8.ON_exprs=_2c(arguments,1,null,"ON");return _a8;};this.USING=function(){_a8.USING_exprs=cleanArray(arguments,false);return _a8;};this.fromSuffix=function(){if(_a8.ON_exprs!=null){return (" ON "+map(_a8.ON_exprs,toSql).join(" AND "));}if(_a8.USING_exprs!=null){return (" USING ("+_a8.USING_exprs.join(", ")+")");}return "";};}};var _9d=function(obj,_ab){obj.toSql=obj.toJs=obj.toString=_ab;return obj;};_9d(_3c.from.prototype,function(){var _ac=["FROM "];for(var i=0;i<this.tables.length;i++){if(i>0){var sep=this.tables[i].fromSeparator;if(sep==null){sep=", ";}_ac.push(sep);}_ac.push(toSqlWithAlias(this.tables[i]));if(this.tables[i].fromSuffix!=null){_ac.push(this.tables[i].fromSuffix());}}return _ac.join("");});_9d(_3c.where.prototype,function(){return "WHERE "+map(this.exprs,toSql).join(" AND ");});_9d(_3c.orderBy.prototype,function(){return "ORDER BY "+map(this.exprs,toSql).join(", ");});_9d(_3c.groupBy.prototype,function(){return "GROUP BY "+map(this.exprs,toSql).join(", ");});_9d(_3c.having.prototype,function(){return "HAVING "+map(this.exprs,toSql,{aliasOnly:true}).join(" AND ");});_9d(_3c.limit.prototype,function(){return "LIMIT "+(this.total<0?"ALL":this.total)+(this.offset!=null?(" OFFSET "+this.offset):"");});var _af=function(_b0,_b1){return function(_b2){if(_b2!=null&&_b2.aliasOnly==true&&this[".alias"]!=this[".name"]){return this[".alias"];}if(this.opFix<0){return this[_b1]+" ("+map(this.args,_b0,_b2).join(") "+this[_b1]+" (")+")";}if(this.opFix>0){return "("+map(this.args,_b0,_b2).join(") "+this[_b1]+" (")+") "+this[_b1];}return "("+map(this.args,_b0,_b2).join(") "+this[_b1]+" (")+")";};};_3c.expression.prototype.toSql=_af(toSql,"sqlText");_3c.expression.prototype.toJs=_af(toJs,"jsText");_3c.aggregate.prototype=new _3c.expression([],null,null,null,0);_3c.aggregate.prototype.toJs=function(_b3){if(_b3!=null&&_b3.aliasOnly==true&&this[".alias"]!=this[".name"]){return this[".alias"];}return this.jsText+" ('"+this[".alias"]+"', ("+map(this.args,toJs).join("), (")+"))";};_3c.join.prototype=new _3c.tableDef();_3c.whereSql=function(sql){this.exprs=[new _3c.rawSql(sql)];};_3c.whereSql.prototype=new _3c.where([new _3c.expression([0],null,0,null,0,null,null,null)]);_3c.havingSql=function(sql){this.exprs=[new _3c.rawSql(sql)];};_3c.havingSql.prototype=new _3c.having([new _3c.expression([0],null,0,null,0,null,null,null)]);_3c.rawSql=function(sql){this.sql=sql;};_3c.rawSql.prototype.toSql=function(_b7){return this.sql;};_3c.rawSql.prototype.toJs=function(_b8){var js=this.sql;js=js.replace(/ AND /g," && ");js=js.replace(/ OR /g," || ");js=js.replace(/ = /g," == ");js=js.replace(/ IS NULL/g," == null");js=js.replace(/ IS NOT NULL/g," != null");js=js.replace(/ NOT /g," ! ");var _ba=/(\S+)\sLIKE\s'(\S+)'/g;var _bb;while(_bb=_ba.exec(js)){_bb[2]=_bb[2].replace(/%/,".*");js=js.replace(_ba,"$1.match(/"+_bb[2]+"/)");}var _bc=/'(\d{4})-(\d{1,2})-(\d{1,2})'/g;while(_bb=_bc.exec(js)){var _bd=[parseInt(_bb[1],10).toString(),(parseInt(_bb[2],10)-1).toString(),parseInt(_bb[3],10).toString()];var _be="(new Date("+_bd.join(", ")+").valueOf())";js=js.replace(_bb[0],_be);}return js;};var _bf={INSERT:function(){return new _3c.insert(arguments);},UPDATE:function(){return new _3c.update(arguments);},DESTROY:function(){return new _3c.destroy(arguments);},SELECT_ALL:function(){return new _3c.select(arguments);},SELECT_DISTINCT:_21,ALL:_22,FROM:function(){return new _3c.from(arguments);},WHERE:function(){return new _3c.where(arguments);},AND:function(){return new _3c.expression(arguments,"AND",0,null,1,null,"&&");},OR:function(){return new _3c.expression(arguments,"OR",0,null,1,null,"||");},NOT:function(){return new _3c.expression(arguments,"NOT",-1,null,1,1,"!");},EQ:function(){return new _3c.expression(arguments,"EQ",0,"=",2,2,"==");},NEQ:function(){return new _3c.expression(arguments,"NEQ",0,"!=",2,2);},LT:function(){return new _3c.expression(arguments,"LT",0,"<",2,2);},GT:function(){return new _3c.expression(arguments,"GT",0,">",2,2);},LTE:function(){return new _3c.expression(arguments,"LTE",0,"<=",2,2);},GTE:function(){return new _3c.expression(arguments,"GTE",0,">=",2,2);},IS_NULL:function(){return new _3c.expression(arguments,"IS_NULL",1,"IS NULL",1,1,"== null");},IS_NOT_NULL:function(){return new _3c.expression(arguments,"IS_NOT_NULL",1,"IS NOT NULL",1,1,"!= null");},ADD:function(){return new _3c.expression(arguments,"ADD",0,"+",2,null);},SUBTRACT:function(){return new _3c.expression(arguments,"SUBTRACT",0,"-",2,null);},NEGATE:function(){return new _3c.expression(arguments,"NEGATE",-1,"-",1,1);},MULTIPLY:function(){return new _3c.expression(arguments,"MULTIPLY",0,"*",2,null);},DIVIDE:function(){return new _3c.expression(arguments,"DIVIDE",0,"/",2,null);},PAREN:function(){return new _3c.expression(arguments,"PAREN",0,"",1,1);},LIKE:function(){return new _3c.expression(arguments,"LIKE",0,"LIKE",2,2,"match");},BETWEEN:_21,AVG:function(){return new _3c.aggregate(arguments,"AVG",-1,null,1,1);},AVG_ALL:_21,AVG_DISTINCT:_21,SUM:function(){return new _3c.aggregate(arguments,"SUM",-1,null,1,1);},SUM_ALL:_21,SUM_DISTINCT:_21,COUNT:function(){return new _3c.aggregate(arguments,"COUNT",-1,null,1,1);},COUNT_ALL:_21,COUNT_DISTINCT:_21,AS:_22,IN:_21,UNION:_21,UNION_ALL:_21,EXCEPT:_21,EXCEPT_ALL:_21,INTERSECT:_21,INTERSECT_ALL:_21,CROSS_JOIN:function(_c0){return _c0;},INNER_JOIN:function(_c1){return new _3c.join("INNER",_c1);},LEFT_OUTER_JOIN:function(_c2){return new _3c.join("LEFT OUTER",_c2);},RIGHT_OUTER_JOIN:_21,FULL_OUTER_JOIN:_21,ON:_22,USING:_22,GROUP_BY:function(){return new _3c.groupBy(arguments);},HAVING:function(){return new _3c.having(arguments);},ORDER_BY:function(){return new _3c.orderBy(arguments);},LIMIT:function(_c3,_c4){return new _3c.limit(_c3,_c4);},LIMIT_ALL:function(_c5){return _2b.LIMIT(-1,_c5);},OFFSET:_22,ANY_SELECT:_21,ALL_SELECT:_21,EXISTS:_21,WHERE_SQL:function(sql){return new _3c.whereSql(sql);},HAVING_SQL:function(sql){return new _3c.havingSql(sql);}};_bf.SELECT=_bf.SELECT_ALL;for(var k in _bf){_2b[k]=_bf[k];}for(var _c9 in _24){_2b[_c9]=new _3c.tableDef(_c9,_24[_c9]);}return _2b;};var _ca=function(_cb){var _cc=["var TrimPath_query_tmpJD = function(dataTables, joinFilter, whereFilter, bindings) {","var result = [], filterArgs = [ bindings ];"];for(var i=0;i<_cb.length;i++){_cc.push("var T"+i+" = dataTables['"+_cb[i][".name"]+"'] || [];");}for(var i=0;i<_cb.length;i++){_cc.push("for (var t"+i+" = 0; t"+i+" < T"+i+".length; t"+i+"++) {");_cc.push("var resultLength"+i+" = result.length;");_cc.push("filterArgs["+(i+1)+"] = T"+i+"[t"+i+"];");}_cc.push("if ((joinFilter == null || joinFilter.apply(null, filterArgs) == true) && ");_cc.push("    (whereFilter == null || whereFilter.apply(null, filterArgs) == true))");_cc.push("result.push(filterArgs.slice(0));");for(var i=_cb.length-1;i>=0;i--){_cc.push("}");if(i>=1&&_cb[i].joinType=="LEFT OUTER"){_cc.push("if (resultLength"+(i-1)+" == result.length) {");for(var j=i;j<_cb.length;j++){_cc.push("filterArgs["+(j+1)+"] = ");}_cc.push("{}; if (whereFilter == null || whereFilter.apply(null, filterArgs) == true) result.push(filterArgs.slice(0)); }");}}_cc.push("return result; }; TrimPath_query_tmpJD");return _1(_cc.join(""));};var _cf=function(_d0,_d1,_d2,_d3){var _d4=["var TrimPath_query_tmpWF = function(_BINDINGS"];for(var i=0;i<_d1.length;i++){_d4.push(", "+_d1[i][".alias"]);}_d4.push("){ with(_BINDINGS) {");_d0(_d4,_d1,_d2,_d3);_d4.push("return true; }}; TrimPath_query_tmpWF");return _1(_d4.join(""));};var _d6=function(_d7,_d8,_d9,_da){for(var i=0;i<_d8.length;i++){if(_d8[i].joinType!=null){if(_d8[i].ON_exprs!=null||_d8[i].USING_exprs!=null){_d7.push("if (!(");if(_d8[i].ON_exprs!=null&&_d8[i].ON_exprs[0].exprs!=null){_d7.push(_d8[i].ON_exprs[0].exprs[0].toJs());}else{if(_d8[i].ON_exprs!=null){_d7.push(map(_d8[i].ON_exprs,_dd).join(" && "));}}if(_d8[i].USING_exprs!=null){_d7.push(map(_d8[i].USING_exprs,function(col){return "("+_d8[i-1][".alias"]+"."+col+" == "+_d8[i][".alias"]+"."+col+")";}).join(" && "));}_d7.push(")) return false;");}}}};var _df=function(_e0,_e1,_e2,_e3){if(_e2!=null){_e0.push("if (!((");for(var i=0;i<_e2.length;i++){if(i>0){_e0.push(") && (");}_e0.push(_dd(_e2[i],_e3));}_e0.push("))) return false;");}};var _e5=function(_e6,_e7){var _e8=["var TrimPath_query_tmpCC = function(_BINDINGS, "];var _e9=[];for(var i=0;i<_e6.length;i++){_e9.push(_e6[i][".alias"]);}_e8.push(_4(_e9).join(", "));_e8.push(", with_table){ with(_BINDINGS) {");_e8.push("var _RESULT = {};");_e8.push("if(with_table) {");_eb(_e8,_e7,true);_e8.push("} else {");_eb(_e8,_e7,false);_e8.push("}");_e8.push("return _RESULT; }}; TrimPath_query_tmpCC");return _1(_e8.join(""));};var _ec=function(_ed){var i;};var _eb=function(_ef,_f0,_f1){for(var i=0;i<_f0.length;i++){var _f3=_f0[i];if(_f3[".name"]=="*"){_eb(_ef,_f3.tableDef[".allColumns"],_f1);}else{_ef.push("_RESULT['");if(_f1==true){_ef.push(_f3.toString());}else{_ef.push(_f3[".alias"]);}_ef.push("'] = (");_ef.push(_dd(_f3));_ef.push(");");}}};var _f4=function(_f5){if(typeof _f5=="object"){return [_f5.getFullYear(),"-",(_f5.getMonth()+1),"-",_f5.getDate()].join("");}if(_f5==null){return null;}};var _f6=function(_f7){var _f8=["var TrimPath_query_tmpOC = function(A, B) { var a, b; "];for(var i=0;i<_f7.length;i++){var _fa=_f7[i];if(_fa.tableDef){_f8.push("a = A['"+_fa[".alias"]+"'] || A['"+_fa.tableDef[".alias"]+"."+_fa[".alias"]+"'] || '';");_f8.push("b = B['"+_fa[".alias"]+"'] || B['"+_fa.tableDef[".alias"]+"."+_fa[".alias"]+"'] || '';");}else{_f8.push("a = A['"+_fa[".alias"]+"'] || '';");_f8.push("b = B['"+_fa[".alias"]+"'] || '';");}var _fb=(_fa.order=="DESC"?-1:1);_f8.push("if (a.valueOf() < b.valueOf()) return "+(_fb*-1)+";");_f8.push("if (a.valueOf() > b.valueOf()) return "+(_fb*1)+";");}_f8.push("return 0; }; TrimPath_query_tmpOC");return _1(_f8.join(""));};var _fc=function(_fd,_fe){var _ff=["var TrimPath_query_tmpGC = function(_BINDINGS"];for(var i=0;i<_fd.length;i++){_ff.push(", "+_fd[i][".alias"]);}_ff.push("){ var _RESULT = [];");for(var i=0;i<_fe.length;i++){_ff.push("_RESULT.push(");_ff.push(_dd(_fe[i]));_ff.push(");");}_ff.push("return _RESULT; }; TrimPath_query_tmpGC");return _1(_ff.join(""));};var _101=function(a,b){return _104(a.groupByValues,b.groupByValues);};var _104=function(x,y){if(x==null||y==null){return -1;}for(var i=0;i<x.length&&i<y.length;i++){if(x[i]<y[i]){return -1;}if(x[i]>y[i]){return 1;}}return 0;};var _108=function(obj,_10a){var res=_10c(obj,_10a);if(obj[".alias"]!=null&&obj[".alias"]!=obj[".name"]){return res+" AS "+obj[".alias"];}return res;};var _10c=function(obj,_10e){return toX(obj,"toSql",_10e);};var _dd=function(obj,_111){return toX(obj,"toJs",_111);};var toX=function(obj,_113,_114){if(typeof (obj)=="object"&&obj[_113]!=null){return obj[_113].call(obj,_114);}return _2(obj);};var _115=function(x){return (x!=null?x:0);};var map=function(arr,func,arg2){for(var _11a=[],i=0;i<arr.length;i++){_11a.push(func(arr[i],arg2));}return _11a;};var _11c=function(src,_11e){for(var _11f=[],i=0;i<src.length;i++){_11f.push(_121(src[i],_11e));}return _11f;};var _121=TrimPath.TEST.cleanString=function(src,_123){if(src instanceof _2||typeof (src)=="string"){src=_2(src).replace(/\\/g,"\\\\").replace(/'/g,"\\'");if(_123!=false){src="'"+src+"'";}}return src;};var _124=function(str,_126){var _127=str.search(_126);if(_127<0){_127=str.length;}return str.substring(0,_127);};_23.prototype.parseSQL=function(_128,_129){var _12a=_128.replace(/\n/g," ").replace(/\r/g,"");if(_129!=null){if(_129 instanceof _3==false){_129=[_129];}var _12b=_12a.split(" ?");for(var i=0;i<_12b.length-1;i++){_12b[i]=_12b[i]+" "+_121(_129[i],true);}_12a=_12b.join("");}_12a=_12a.replace(/ AS ([_a-zA-z0-9]+)/g,".AS('$1')");var err=function(_12e){throw ("[ERROR: "+_12e+" in query: "+_128+"]");};var _12f=_12a.split(/\s+/)[0];if(_12f=="DELETE"){_12f="DESTROY";}if(!_8(["SELECT","DESTROY","UPDATE","INSERT"],_12f)){err("not a valid query type");}var _130=function(str){return str.replace(/\s+/g,"");};if(_12f=="SELECT"||_12f=="DESTROY"){var _132=_12a.substring(7).split(" FROM ");if(_132.length!=2){err("missing a FROM clause");}var _133=_132[0].replace(/\.\*/g,".ALL");var _134=_132[1];var _135=_124(_134,/\sWHERE\s|\sGROUP BY\s|\sHAVING\s|\sORDER BY\s|\sLIMIT/);var _136=_124(_135,/\sLEFT OUTER JOIN\s/);var _137=_130(_136).split(",");_134=_134.substring(_135.length);var _138=_135.split(" LEFT OUTER JOIN ");var _139=[_138[0]];var _13a;for(var i=1;i<_138.length;i++){_13a=/(\w+)\sON\s(.+)/.exec(_138[i]);_137.push(_13a[1]);_139.push("("+_13a[1]+")"+".ON(WHERE_SQL(\""+_13a[2]+"\"))");}_135=_139.join(", LEFT_OUTER_JOIN");if(_130(_133)=="*"){var _13b=[];for(var i=0;i<_137.length;i++){_13b.push(_137[i]+".ALL");}_133=_133.replace(/\*/,_13b.join(", "));}var _13c=_124(_134,/\sGROUP BY\s|\sHAVING\s|\sORDER BY\s|\sLIMIT/);_134=_134.substring(_13c.length);var _13d=_124(_134,/\sHAVING\s|\sORDER BY\s|\sLIMIT /);_134=_134.substring(_13d.length);var _13e=_124(_134,/\sORDER BY\s|\sLIMIT /);_134=_134.substring(_13e.length);var _13f=_124(_134,/\sLIMIT /).replace(/\sASC/g,".ASC").replace(/\sDESC/g,".DESC");_134=_134.substring(_13f.length);var _140=_134;var tql=["SELECT(FROM(",_135,"), ",_133];if(_13c.length>0){tql.push(", WHERE_SQL(\""+_13c.substring(7)+"\")");}if(_13d.length>0){tql.push(", GROUP_BY("+_13d.substring(10)+")");}if(_13e.length>0){tql.push(", HAVING_SQL(\""+_13e.substring(8)+"\")");}if(_13f.length>0){tql.push(", ORDER_BY("+_13f.substring(10)+")");}if(_140.length>0){tql.push(", LIMIT("+_140.substring(7)+")");}tql.push(")");}else{if(_12f=="INSERT"){var _142=_12a.substring(6).split(" INTO ");if(_142.length!=2){err("missing an INTO clause");}var _143=/^\s*(\w+)\s*\((.+)\)\s+VALUES\s+\((.+)\)/;var _144=_142[1].match(_143);var _145=_144[1];var _146=_130(_144[2]).split(",");var _147=_144[3].split(",");if(_146.length!=_147.length){err("values and fields must have same number of elements");}tql=["INSERT(",_145,",",_10(_146,_147),")"];}else{if(_12f=="UPDATE"){var _148=_12a.substring(7).split(" SET ");if(_148.length!=2){err("missing a SET clause");}var _135=_148[0];var _134=_148[1];var _149=_124(_134,/\sWHERE\s/);_134=_134.substring(_149.length);var _13c=_134;var _14a=_149.split(",");var _146=[];var _147=[];for(var i=0;i<_14a.length;i++){var _14b=_14a[i].split("=");_146.push(_1d(_14b[0]));_147.push(_1d(_14b[1]));}var _14c=/^UPDATE\s+(\w+)\s+SET\s+(\w+\s*=\s*\w+)/;var _144=_12a.match(_14c);var tql=["UPDATE(FROM(",_135,"), ",_10(_146,_147)];tql.push(", WHERE_SQL(\""+_13c.substring(7)+"\")");tql.push(")");}}}if(_12f=="DESTROY"){tql.unshift("DESTROY(");tql.push(")");}with(this){return eval(tql.join(""));}};})();}if(!dojo._hasResource["extLib.trimpath.template"]){dojo._hasResource["extLib.trimpath.template"]=true;dojo.provide("extLib.trimpath.template");if(typeof (TrimPath)=="undefined"){TrimPath={};}(function(){if(TrimPath==null){TrimPath=new Object();}if(TrimPath.evalEx==null){TrimPath.evalEx=function(src){return eval(src);};}var _14e;if(Array.prototype.pop==null){Array.prototype.pop=function(){if(this.length===0){return _14e;}return this[--this.length];};}if(Array.prototype.push==null){Array.prototype.push=function(){for(var i=0;i<arguments.length;++i){this[this.length]=arguments[i];}return this.length;};}TrimPath.parseTemplate=function(_150,_151,_152){if(_152==null){_152=TrimPath.parseTemplate_etc;}var _153=_154(_150,_151,_152);var func=TrimPath.evalEx(_153,_151,1);if(func!=null){return new _152.Template(_151,_150,_153,func,_152);}return null;};try{String.prototype.process=function(_156,_157){var _158=TrimPath.parseTemplate(this,null);if(_158!=null){return _158.process(_156,_157);}return this;};}catch(e){}TrimPath.parseTemplate_etc={};TrimPath.parseTemplate_etc.statementTag="forelse|for|if|elseif|else|var|macro";TrimPath.parseTemplate_etc.statementDef={"if":{delta:1,prefix:"if (",suffix:") {",paramMin:1},"else":{delta:0,prefix:"} else {"},"elseif":{delta:0,prefix:"} else if (",suffix:") {",paramDefault:"true"},"/if":{delta:-1,prefix:"}"},"for":{delta:1,paramMin:3,prefixFunc:function(_159,_15a,_15b,etc){if(_159[2]!="in"){throw new etc.ParseError(_15b,_15a.line,"bad for loop statement: "+_159.join(" "));}var _15d=_159[1];var _15e="__LIST__"+_15d;return ["var ",_15e," = ",_159[3],";","var __LENGTH_STACK__;","if (typeof(__LENGTH_STACK__) == 'undefined' || !__LENGTH_STACK__.length) __LENGTH_STACK__ = new Array();","__LENGTH_STACK__[__LENGTH_STACK__.length] = 0;","if ((",_15e,") != null) { ","var ",_15d,"_ct = 0;","for (var ",_15d,"_index in ",_15e,") { ",_15d,"_ct++;","if (typeof(",_15e,"[",_15d,"_index]) == 'function') {continue;}","__LENGTH_STACK__[__LENGTH_STACK__.length - 1]++;","var ",_15d," = ",_15e,"[",_15d,"_index];"].join("");}},"forelse":{delta:0,prefix:"} } if (__LENGTH_STACK__[__LENGTH_STACK__.length - 1] == 0) { if (",suffix:") {",paramDefault:"true"},"/for":{delta:-1,prefix:"} }; delete __LENGTH_STACK__[__LENGTH_STACK__.length - 1];"},"var":{delta:0,prefix:"var ",suffix:";"},"macro":{delta:1,prefixFunc:function(_15f,_160,_161,etc){var _163=_15f[1].split("(")[0];return ["var ",_163," = function",_15f.slice(1).join(" ").substring(_163.length),"{ var _OUT_arr = []; var _OUT = { write: function(m) { if (m) _OUT_arr.push(m); } }; "].join("");}},"/macro":{delta:-1,prefix:" return _OUT_arr.join(''); };"}};TrimPath.parseTemplate_etc.modifierDef={"eat":function(v){return "";},"escape":function(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");},"capitalize":function(s){return String(s).toUpperCase();},"default":function(s,d){return s!=null?s:d;}};TrimPath.parseTemplate_etc.modifierDef.h=TrimPath.parseTemplate_etc.modifierDef.escape;TrimPath.parseTemplate_etc.Template=function(_169,_16a,_16b,func,etc){this.process=function(_16e,_16f){if(_16e==null){_16e={};}if(_16e._MODIFIERS==null){_16e._MODIFIERS={};}if(_16e.defined==null){_16e.defined=function(str){return (_16e[str]!=undefined);};}for(var k in etc.modifierDef){if(_16e._MODIFIERS[k]==null){_16e._MODIFIERS[k]=etc.modifierDef[k];}}if(_16f==null){_16f={};}var _172=[];var _173={write:function(m){_172.push(m);}};try{func(_173,_16e,_16f);}catch(e){if(_16f.throwExceptions==true){throw e;}var _175=new String(_172.join("")+"[ERROR: "+e.toString()+(e.message?"; "+e.message:"")+"]");_175["exception"]=e;return _175;}return _172.join("");};this.name=_169;this.source=_16a;this.sourceFunc=_16b;this.toString=function(){return "TrimPath.Template ["+_169+"]";};};TrimPath.parseTemplate_etc.ParseError=function(name,line,_178){this.name=name;this.line=line;this.message=_178;};TrimPath.parseTemplate_etc.ParseError.prototype.toString=function(){return ("TrimPath template ParseError in "+this.name+": line "+this.line+", "+this.message);};var _154=function(body,_17a,etc){body=_17c(body);var _17d=["var TrimPath_Template_TEMP = function(_OUT, _CONTEXT, _FLAGS) { with (_CONTEXT) {"];var _17e={stack:[],line:1};var _17f=-1;while(_17f+1<body.length){var _180=_17f;_180=body.indexOf("{",_180+1);while(_180>=0){var _181=body.indexOf("}",_180+1);var stmt=body.substring(_180,_181);var _183=stmt.match(/^\{(cdata|minify|eval)/);if(_183){var _184=_183[1];var _185=_180+_184.length+1;var _186=body.indexOf("}",_185);if(_186>=0){var _187;if(_186-_185<=0){_187="{/"+_184+"}";}else{_187=body.substring(_185+1,_186);}var _188=body.indexOf(_187,_186+1);if(_188>=0){_189(body.substring(_17f+1,_180),_17d);var _18a=body.substring(_186+1,_188);if(_184=="cdata"){_18b(_18a,_17d);}else{if(_184=="minify"){_18b(_18c(_18a),_17d);}else{if(_184=="eval"){if(_18a!=null&&_18a.length>0){_17d.push("_OUT.write( (function() { "+_18a+" })() );");}}}}_180=_17f=_188+_187.length-1;}}}else{if(body.charAt(_180-1)!="$"&&body.charAt(_180-1)!="\\"){var _18d=(body.charAt(_180+1)=="/"?2:1);if(body.substring(_180+_18d,_180+10+_18d).search(TrimPath.parseTemplate_etc.statementTag)==0){break;}}}_180=body.indexOf("{",_180+1);}if(_180<0){break;}var _181=body.indexOf("}",_180+1);if(_181<0){break;}_189(body.substring(_17f+1,_180),_17d);_18e(body.substring(_180,_181+1),_17e,_17d,_17a,etc);_17f=_181;}_189(body.substring(_17f+1),_17d);if(_17e.stack.length!=0){throw new etc.ParseError(_17a,_17e.line,"unclosed, unmatched statement(s): "+_17e.stack.join(","));}_17d.push("}}; TrimPath_Template_TEMP");return _17d.join("");};var _18e=function(_18f,_190,_191,_192,etc){var _194=_18f.slice(1,-1).split(" ");var stmt=etc.statementDef[_194[0]];if(stmt==null){_189(_18f,_191);return;}if(stmt.delta<0){if(_190.stack.length<=0){throw new etc.ParseError(_192,_190.line,"close tag does not match any previous statement: "+_18f);}_190.stack.pop();}if(stmt.delta>0){_190.stack.push(_18f);}if(stmt.paramMin!=null&&stmt.paramMin>=_194.length){throw new etc.ParseError(_192,_190.line,"statement needs more parameters: "+_18f);}if(stmt.prefixFunc!=null){_191.push(stmt.prefixFunc(_194,_190,_192,etc));}else{_191.push(stmt.prefix);}if(stmt.suffix!=null){if(_194.length<=1){if(stmt.paramDefault!=null){_191.push(stmt.paramDefault);}}else{for(var i=1;i<_194.length;i++){if(i>1){_191.push(" ");}_191.push(_194[i]);}}_191.push(stmt.suffix);}};var _189=function(text,_198){if(text.length<=0){return;}var _199=0;var _19a=text.length-1;while(_199<text.length&&(text.charAt(_199)=="\n")){_199++;}while(_19a>=0&&(text.charAt(_19a)==" "||text.charAt(_19a)=="\t")){_19a--;}if(_19a<_199){_19a=_199;}if(_199>0){_198.push("if (_FLAGS.keepWhitespace == true) _OUT.write(\"");var s=text.substring(0,_199).replace("\n","\\n");if(s.charAt(s.length-1)=="\n"){s=s.substring(0,s.length-1);}_198.push(s);_198.push("\");");}var _19c=text.substring(_199,_19a+1).split("\n");for(var i=0;i<_19c.length;i++){_19e(_19c[i],_198);if(i<_19c.length-1){_198.push("_OUT.write(\"\\n\");\n");}}if(_19a+1<text.length){_198.push("if (_FLAGS.keepWhitespace == true) _OUT.write(\"");var s=text.substring(_19a+1).replace("\n","\\n");if(s.charAt(s.length-1)=="\n"){s=s.substring(0,s.length-1);}_198.push(s);_198.push("\");");}};var _19e=function(line,_1a0){var _1a1="}";var _1a2=-1;while(_1a2+_1a1.length<line.length){var _1a3="${",_1a4="}";var _1a5=line.indexOf(_1a3,_1a2+_1a1.length);if(_1a5<0){break;}if(line.charAt(_1a5+2)=="%"){_1a3="${%";_1a4="%}";}var _1a6=line.indexOf(_1a4,_1a5+_1a3.length);if(_1a6<0){break;}_18b(line.substring(_1a2+_1a1.length,_1a5),_1a0);var _1a7=line.substring(_1a5+_1a3.length,_1a6).replace(/\|\|/g,"#@@#").split("|");for(var k in _1a7){if(_1a7[k].replace){_1a7[k]=_1a7[k].replace(/#@@#/g,"||");}}_1a0.push("_OUT.write(");_1a9(_1a7,_1a7.length-1,_1a0);_1a0.push(");");_1a2=_1a6;_1a1=_1a4;}_18b(line.substring(_1a2+_1a1.length),_1a0);};var _18b=function(text,_1ab){if(text==null||text.length<=0){return;}text=text.replace(/\\/g,"\\\\");text=text.replace(/\n/g,"\\n");text=text.replace(/"/g,"\\\"");_1ab.push("_OUT.write(\"");_1ab.push(text);_1ab.push("\");");};var _1a9=function(_1ac,_1ad,_1ae){var expr=_1ac[_1ad];if(_1ad<=0){_1ae.push(expr);return;}var _1b0=expr.split(":");_1ae.push("_MODIFIERS[\"");_1ae.push(_1b0[0]);_1ae.push("\"](");_1a9(_1ac,_1ad-1,_1ae);if(_1b0.length>1){_1ae.push(",");_1ae.push(_1b0[1]);}_1ae.push(")");};var _17c=function(_1b1){_1b1=_1b1.replace(/\t/g,"    ");_1b1=_1b1.replace(/\r\n/g,"\n");_1b1=_1b1.replace(/\r/g,"\n");_1b1=_1b1.replace(/^(\s*\S*(\s+\S+)*)\s*$/,"$1");return _1b1;};var _18c=function(_1b2){_1b2=_1b2.replace(/^\s+/g,"");_1b2=_1b2.replace(/\s+$/g,"");_1b2=_1b2.replace(/\s+/g," ");_1b2=_1b2.replace(/^(\s*\S*(\s+\S+)*)\s*$/,"$1");return _1b2;};TrimPath.parseDOMTemplate=function(_1b3,_1b4,_1b5){if(_1b4==null){_1b4=document;}var _1b6=_1b4.getElementById(_1b3);var _1b7=_1b6.value;if(_1b7==null){_1b7=_1b6.innerHTML;}_1b7=_1b7.replace(/&lt;/g,"<").replace(/&gt;/g,">");return TrimPath.parseTemplate(_1b7,_1b3,_1b5);};TrimPath.processDOMTemplate=function(_1b8,_1b9,_1ba,_1bb,_1bc){return TrimPath.parseDOMTemplate(_1b8,_1bb,_1bc).process(_1b9,_1ba);};})();}if(!dojo._hasResource["mojo.MessagingTopic"]){dojo._hasResource["mojo.MessagingTopic"]=true;dojo.provide("mojo.MessagingTopic");dojo.declare("mojo.MessagingTopic",null,{onPublish:function(){},constructor:function(_1bd){if(_1bd==null||typeof _1bd=="undefined"){throw new Error("ERROR mojo.MessagingTopic - topic parameter is required");}if(typeof _1bd=="string"){if(_1bd==""){throw new Error("ERROR mojo.MessagingTopic - topic parameter must be a non-empty string");}}else{throw new Error("ERROR mojo.MessagingTopic - topic parameter is not type String");}this._topic=_1bd;__mojoMessagingTopics[_1bd]=this;},_topic:null,_messageObj:null,getTopic:function(){return this._topic;},getMessage:function(){return this._messageObj;},setMessage:function(_1be){this._messageObj=_1be;}});}if(!dojo._hasResource["mojo.Messaging"]){dojo._hasResource["mojo.Messaging"]=true;dojo.provide("mojo.Messaging");__mojoMessagingTopics=new Array();mojo.Messaging.publish=function(_1bf,_1c0){if(_1bf==null||typeof _1bf=="undefined"){throw new Error("ERROR mojo.Messaging.publish - topic parameter is required");}if(!dojo.isString(_1bf)||_1bf==""){throw new Error("ERROR mojo.Messaging.publish - topic parameter must be a non-empty string");}var _1c1=mojo.Messaging.getTopic(_1bf);_1c1.setMessage(_1c0);_1c1.onPublish(_1c0);if(!dojo.isArray(_1c0)){_1c0=[_1c0];}dojo.publish(_1bf,_1c0);_1c1.setMessage(null);};mojo.Messaging.subscribe=function(_1c2,_1c3,_1c4){if(_1c2==null||typeof _1c2=="undefined"){throw new Error("ERROR mojo.Messaging.subscribe - topic parameter is required");}if(!dojo.isString(_1c2)||_1c2==""){throw new Error("ERROR mojo.Messaging.subscribe - topic parameter must be a non-empty string");}if(!dojo.isObject(_1c3)&&!dojo.isString(_1c3)){throw new Error("ERROR mojo.Messaging.subscribe - targetObj parameter must be an object or a string");}mojo.Messaging.getTopic(_1c2);return dojo.subscribe(_1c2,_1c3,_1c4);};mojo.Messaging.unsubscribe=function(_1c5){dojo.unsubscribe(_1c5);};mojo.Messaging.getTopic=function(_1c6){if(_1c6==null||typeof _1c6=="undefined"){throw new Error("ERROR mojo.Messaging.getTopic - topic parameter is required");}if(!dojo.isString(_1c6)||_1c6==""){throw new Error("ERROR mojo.Messaging.getTopic - topic parameter must be a non-empty string");}if(!__mojoMessagingTopics[_1c6]){__mojoMessagingTopics[_1c6]=new mojo.MessagingTopic(_1c6);}return __mojoMessagingTopics[_1c6];};}if(!dojo._hasResource["mojo.ModelReference"]){dojo._hasResource["mojo.ModelReference"]=true;dojo.provide("mojo.ModelReference");dojo.declare("mojo.ModelReference",null,{onNotify:function(){},constructor:function(key){if(key==null||typeof key=="undefined"){throw new Error("ERROR mojo.ModelReference - key parameter is required");}if(!dojo.isString(key)||key==""){throw new Error("ERROR mojo.ModelReference - key parameter must be a non-empty string");}this._key=key;__mojoModelReferences[key]=this;},_key:null,getKey:function(){return this._key;},getValue:function(){return mojo.Model.get(this._key);},setValue:function(_1c8){mojo.Model.set(this._key,_1c8);}});}if(!dojo._hasResource["mojo.query"]){dojo._hasResource["mojo.query"]=true;dojo.provide("mojo.query");mojo.query=function(_1c9,_1ca){if(_1ca&&(typeof _1ca=="string"||typeof _1ca=="object")){var _1cb=dojo.query(_1c9,_1ca);}else{if((new RegExp(/^\#[a-zA-Z0-9\-\_]*$/)).test(_1c9)){var _1cc=document.getElementById(_1c9.substring(1));if(_1cc){var _1cb=[_1cc];}else{var _1cb=[];}}else{var _1cb=dojo.query(_1c9);}}return _1cb;};mojo.queryFirst=function(_1cd,_1ce){var _1cf=mojo.query(_1cd,_1ce);if(_1cf.length>0){return _1cf[0];}return null;};mojo.distinct=function(_1d0){if(_1d0.length==0){return _1d0;}var _1d1=[],n;for(var i=0,l=_1d0.length;i<l;i++){if(!(n=_1d0[i])._counted){n._counted=true;_1d1.push(n);}}for(var i=0,node;node=_1d1[i];i++){node._counted=undefined;}return _1d1;};mojo.queryMatch=function(_1d6,_1d7,_1d8,_1d9){if(!_1d6||_1d6==_1d8){return null;}var _1da=false;var _1db=[];if((new RegExp(/^[\#|\.]?[a-zA-Z0-9\-\_]+$/)).test(_1d7)){_1da=true;}else{_1db=mojo.query(_1d7,_1d8);}while(_1d6&&_1d6!=_1d8){if(_1da){if((_1d7.indexOf("#")==0&&_1d6.id==_1d7.substring(1))||(_1d7.indexOf(".")==0&&dojo.hasClass(_1d6,_1d7.substring(1)))||(_1d6.tagName.toLowerCase()==_1d7.toLowerCase())){return _1d6;}}else{for(var i=0,len=_1db.length;i<len;i++){if(_1db[i]==_1d6){return _1d6;}}}if(_1d9){_1d6=_1d6.parentNode;}else{break;}}return null;};}if(!dojo._hasResource["sample.command.LoadHtmlCommand"]){dojo._hasResource["sample.command.LoadHtmlCommand"]=true;dojo.provide("mojo.command.Command");dojo.declare("mojo.command.Command",null,{_requestObj:null,getRequest:function(){if(!this._requestObj){throw new Error("ERROR mojo.command.Command.getRequest - requestObj is not set");}return this._requestObj;},_execute:function(_1de){this._requestObj=_1de;if(typeof (_1de.update)=="function"){_1de.update();}if(this._requestObj==null||(!this._requestObj)){throw new Error("ERROR mojo.command.Command._execute - requestObj is not set");}else{if(!(this._requestObj instanceof mojo.controller.Request)){throw new Error("ERROR mojo.command.Command._execute - requestObj is not type of mojo.controller.Request");}}return this.execute(_1de);},execute:function(_1df){throw new Error("ERROR mojo.command.Command.execute - execute() method is not implemented");},onResponse:function(data){throw new Error("ERROR mojo.command.Command.onResponse - onResponse() method is not implemented");},onError:function(_1e1){throw new Error("ERROR mojo.command.Command.onError - onError() method is not implemented");}});}if(!dojo._hasResource["sample.behavior.ClearFormBehavior"]){dojo._hasResource["sample.behavior.ClearFormBehavior"]=true;dojo.provide("mojo.command.Behavior");dojo.declare("mojo.command.Behavior",null,{_requestObj:null,getRequest:function(){if(!this._requestObj){throw new Error("ERROR mojo.command.Behavior.getRequest - requestObj is not set");}return this._requestObj;},_execute:function(_1e2){this._requestObj=_1e2;if(typeof (_1e2.update)=="function"){_1e2.update();}if(this._requestObj==null||(!this._requestObj)){throw new Error("ERROR mojo.command.Behavior._execute - requestObj is not set");}else{if(!(this._requestObj instanceof mojo.controller.Request)){throw new Error("ERROR mojo.command.Behavior._execute - requestObj is not type of mojo.controller.Request");}else{if(!this._requestObj.callerObj){throw new Error("ERROR mojo.command.Behavior._execute - callerObj is not set");}}}try{return this.execute(_1e2);}catch(ex){}},execute:function(_1e3){throw new Error("ERROR mojo.command.Behavior.execute - execute() method is not implemented");}});}if(!dojo._hasResource["sample.rule.MinimumAgeRule"]){dojo._hasResource["sample.rule.MinimumAgeRule"]=true;dojo.provide("mojo.command.Rule");dojo.declare("mojo.command.Rule",null,{_requestObj:null,getRequest:function(){if(!this._requestObj){throw new Error("ERROR mojo.command.Rule.getRequest -requestObj is not set");}return this._requestObj;},_execute:function(_1e4){this._requestObj=_1e4;if(typeof (_1e4.update)=="function"){_1e4.update();}if(this._requestObj==null||(!this._requestObj)){throw new Error("ERROR mojo.command.Rule._execute - requestObj is not set");}else{if(!(this._requestObj instanceof mojo.controller.Request)){throw new Error("ERROR mojo.command.Rule._execute - requestObj is not type of mojo.controller.Request");}else{if(!this._requestObj.callerObj){throw new Error("ERROR mojo.command.Rule._execute - callerObj is not set");}else{if(!this._requestObj.invocation){throw new Error("ERROR mojo.command.Rule._execute - invocation is not set");}}}}try{if(this.execute(_1e4)){return true;}return false;}catch(ex){}},execute:function(_1e5){if(this.condition(_1e5)){return _1e5.invocation.proceed();}},condition:function(_1e6){throw new Error("ERROR mojo.command.Rule.condition - condition() method is not implemented");}});}if(!dojo._hasResource["mojo.controller.Request"]){dojo._hasResource["mojo.controller.Request"]=true;dojo.provide("mojo.controller.Request");dojo.declare("mojo.controller.Request",null,{constructor:function(_1e7,_1e8,_1e9,_1ea,_1eb,_1ec){this._paramsFunc=null;this.paramsObj=null;this.callerObj=null;this.eventObj=null;this.commandName=null;this.controllerObj=null;this.invocation=null;if(typeof (_1e7)=="function"){this.paramsObj={};this._paramsFunc=_1e7;}else{if(typeof (_1e7)=="object"){this.paramsObj=_1e7;}}if(_1e8==null||typeof _1e8=="undefined"){throw new Error("ERROR mojo.controller.Request.constructor - callerObj is not set");}else{this.callerObj=_1e8;}this.eventObj=_1e9;if(_1ea==null||typeof _1ea=="undefined"){throw new Error("ERROR mojo.controller.Request.constructor - commandName is not set");}else{if(typeof _1ea!="string"){throw new Error("ERROR mojo.controller.Request.constructor - commandName is not type String");}else{this.commandName=_1ea;}}if(_1eb==null||typeof _1eb=="undefined"){throw new Error("ERROR mojo.controller.Request.constructor - controllerObj is not set");}else{if(!(_1eb instanceof mojo.controller.Controller)){throw new Error("ERROR mojo.controller.Request.constructor - controllerObj is not type mojo.controller.Controller");}else{this.controllerObj=_1eb;}}this.invocation=_1ec;},_paramsFunc:null,paramsObj:null,callerObj:null,eventObj:null,commandName:null,controllerObj:null,invocation:null,update:function(){if(this._paramsFunc&&typeof (this._paramsFunc)=="function"){var _1ed=this._paramsFunc(this.getContextElement(),this.getCaller(),this.getController());for(var key in _1ed){this.paramsObj[key]=_1ed[key];}}},getParams:function(){if(!this.paramsObj){this.update();}return this.paramsObj;},getCaller:function(){return this.callerObj;},getContextElement:function(){return this.getController().getContextElement();},getEvent:function(){return this.eventObj;},getCommandName:function(){return this.commandName;},getController:function(){return this.controllerObj;},getControllerName:function(){return this.getController().declaredClass;},getInvocation:function(){return this.invocation;}});}if(!dojo._hasResource["mojo.helper.Validation"]){dojo._hasResource["mojo.helper.Validation"]=true;dojo.provide("mojo.helper.Validation");var __mojoHelperValidation=null;dojo.declare("mojo.helper.Validation",null,{isRequired:function(_1ef){if(typeof _1ef=="undefined"||_1ef==null){return false;}if(dojo.isString(_1ef)){return dojo.string.trim(_1ef).length>0;}return true;},isType:function(_1f0,_1f1){switch(_1f1.type){case String:return (typeof _1f0=="string"||_1f0 instanceof String);break;case Number:return (typeof _1f0=="number"||_1f0 instanceof Number);break;case Boolean:return (typeof _1f0=="boolean"||_1f0 instanceof Boolean);break;default:return (_1f0 instanceof _1f1.type);}},isEmailAddress:function(_1f2){if(_1f2==null){throw new Error("ERROR mojo.helper.Validation.isEmailAddress - value parameter is required");}if(!dojo.isString(_1f2)){throw new Error("ERROR mojo.helper.Validation.isEmailAddress - value parameter must be a non-empty string");}if(!dojox.validate.isEmailAddress(_1f2,{})||_1f2.match(/[^\w-_@\.]/gi)){return false;}return true;},isEmailAddressList:function(_1f3){if(_1f3==null){throw new Error("ERROR mojo.helper.Validation.isEmailAddressList - value parameter is required");}if(!dojo.isString(_1f3)){throw new Error("ERROR mojo.helper.Validation.isEmailAddressList - value parameter must be a non-empty string");}if(!dojox.validate.isEmailAddressList(_1f3,{})){return false;}return true;},isUrl:function(_1f4){if(_1f4==null){throw new Error("ERROR mojo.helper.Validation.isUrl - value parameter is required");}if(!dojo.isString(_1f4)){throw new Error("ERROR mojo.helper.Validation.isUrl - value parameter must be a non-empty string");}return dojox.validate.isUrl(_1f4,{allowLocal:true});},isLength:function(_1f5,_1f6){if((_1f5==null)||(_1f5=="")){return true;}if(!dojo.isString(_1f5)){throw new Error("ERROR mojo.helper.Validation.isLength - value parameter must be a string");}if(_1f6){if(_1f6.min&&_1f6.min>_1f5.length){return false;}if(_1f6.max&&_1f6.max<_1f5.length){return false;}}return true;},isRange:function(_1f7,_1f8){if((_1f7==null)||(_1f7=="")){return true;}_1f7=parseInt(_1f7);if(isNaN(_1f7)){return false;}if(_1f8){if(typeof (_1f8.min)=="undefined"){_1f8.min=0;}if(_1f8.min>_1f7){return false;}if(typeof (_1f8.max)!="undefined"&&_1f8.max<_1f7){return false;}}return true;},isMatch:function(_1f9,_1fa){if((_1f9==null)||(_1f9=="")){return true;}if(_1fa){if(_1fa.refValue){_1fa.regex="^"+_1fa.refValue+"$";}if(!(new RegExp(_1fa.regex)).test(_1f9)){return false;}}return true;},isZipCode:function(_1fb){var _1fc="0123456789-";var _1fd=0;if((_1fb==null)||(_1fb=="")){return true;}if(_1fb.length!=5&&_1fb.length!=10){return false;}for(var i=0;i<_1fb.length;i++){temp=""+_1fb.substring(i,i+1);if(temp=="-"){_1fd++;}if(_1fc.indexOf(temp)=="-1"){return false;}if((_1fd>1)||((_1fb.length==10)&&""+_1fb.charAt(5)!="-")){return false;}}return true;},isPostalCode:function(_1ff){if(_1ff==null){throw new Error("ERROR mojo.helper.Validation.isPostalCode - value parameter is required");}if(!dojo.isString(_1ff)){throw new Error("ERROR mojo.helper.Validation.isPostalCode - value parameter must be a non-empty string");}if(typeof _1ff=="undefined"||_1ff==null){return false;}if(_1ff.length==6&&_1ff.search(/^[a-zA-Z]\d[a-zA-Z]\d[a-zA-Z]\d$/)!=-1){return true;}else{if(_1ff.length==7&&_1ff.search(/^[a-zA-Z]\d[a-zA-Z](-|\s)\d[a-zA-Z]\d$/)!=-1){return true;}else{return false;}}return true;},execute:function(_200,_201){if(typeof _200=="undefined"||_200==null){throw new Error("ERROR mojo.helper.Validation.execute - rulesObj parameter is required");}if(typeof _201=="undefined"||_201==null){throw new Error("ERROR mojo.helper.Validation.execute - domElmListObj parameter is required");}var _202=function(){throw new Error("ERROR mojo.helper.Validation.execute - rulesObj parameter must consist of rules in the format {\"inputName\": [{rule: testFunction[, errorMsg: \"msg\"]}[, ...]]}");};if(!dojo.isArray(_201)){_201=[_201];}for(rule in _200){if(!dojo.isArray(_200[rule])){_202();}for(var i=0,len=_200[rule].length;i<len;i++){if(typeof _200[rule][i].rule!="function"){_202();}if(typeof _200[rule][i].error!="undefined"&&!dojo.isString(_200[rule][i].error)){_202();}}}var _205=function(node,_207){if(!node){return null;}do{node=node.nextSibling;}while(node&&node.nodeType!=1);if(node&&_207&&_207.toLowerCase()!=node.tagName.toLowerCase()){return _205(node,_207);}return node;};var _208=new Array();var _209=_201.length;for(var i=0;i<_209;i++){var _20a=mojo.query("*[name]",_201[i]);if(_201[i].name){_20a.push(_201[i]);}var _20b=_20a.length;for(var j=0;j<_20b;j++){_208.push(_20a[j]);}_208=mojo.distinct(_208);var _20d=mojo.query(".mojoValidationError",_201[i]);var _20e=_205(_201[i],"SPAN");if(_20e!=null&&dojo.hasClass(_20e,"mojoValidationError")){_20d.push(_20e);}var _20f=_20d.length;for(var j=0;j<_20f;j++){dojo._destroyElement(_20d[j]);}}var _210=true;var _211=new Array();var _212=function(node){var _214=true;while(node!=null){if(dojo.style(node,"visibility")=="hidden"||dojo.style(node,"display")=="none"){_214=false;break;}node=(node.tagName=="BODY")?null:node.parentNode;}return _214;};var _215=_208.length;var _216={};for(var i=(_215-1);i>=0;i--){var elm=_208[i];if(elm.type=="radio"||elm.type=="checkbox"){elm.mojoValidationGroup=true;if(!_216[elm.name]){_216[elm.name]=new Array();}else{_208[i]=null;}if(elm.checked){_216[elm.name].push((elm.value)?elm.value:"checked");}}}for(var i=0;i<_215;i++){var elm=_208[i];if(elm){if(_200[elm.name]){var _218=_200[elm.name];var _219=_218.length;for(var j=0;j<_219;j++){var _21a=_218[j];if(_21a["force"]||(_212(elm)&&!elm.disabled)||(elm.type&&elm.type=="hidden")){if(_21a.params&&_21a.params.ref){var _21b=mojo.queryFirst("*[name=\""+_21a.params.ref+"\"]").value;if(_21b&&_21b.length>0){_21a.params.refValue=_21b;}}var _21c=elm.value;if(elm.mojoValidationGroup){_21c=_216[elm.name].toString();}if(!(_21a.rule(_21c,_21a.params))){var _21d={element:elm,message:_21a["errorMsg"]};_211.push(_21d);_210=false;break;}}}}}}return _211;}});mojo.helper.Validation.getInstance=function(){if(__mojoHelperValidation==null){__mojoHelperValidation=new mojo.helper.Validation();}return __mojoHelperValidation;};}if(!dojo._hasResource["mojo.controller.Param"]){dojo._hasResource["mojo.controller.Param"]=true;dojo.provide("mojo.controller.Param");dojo.declare("mojo.controller.Param",null,{constructor:function(name,_21f,_220,type,_222){this._value=null;this._defaultValue=null;this._params=null;this._type=null;this._name=name;this._defaultValue=_21f;if(type){this._type=type;}if(_222){this._params=_222;}this.setValue(this._defaultValue);if(typeof _220=="boolean"){this._required=_220;}},_name:null,_value:null,_defaultValue:null,_required:false,_type:null,_params:null,getName:function(){return this._name;},getValue:function(){return this._value;},setValue:function(_223){var _224=mojo.helper.Validation.getInstance();var _225=this.getRequired();var type=this.getType();if(_225&&!_224.isRequired(_223)){throw new Error("ERROR mojo.controller.Param.setValue - value parameter is required");}if(typeof _223=="undefined"){return;}if(type&&!_224.isType(_223,{type:type})){throw new Error("RROR mojo.controller.Param.setValue - value parameter is invalid type");}if(this.getValue()!=_223){this._value=_223;this.onChange();if(this._params!=null&&this._params["onChange"]){this._params.onChange();}}},getDefaultValue:function(){return this._defaultValue;},getRequired:function(){return this._required;},getType:function(){return this._type;},onChange:function(){}});}if(!dojo._hasResource["sample.controller.ProfileController"]){dojo._hasResource["sample.controller.ProfileController"]=true;dojo.provide("mojo.controller.Controller");dojo.declare("mojo.controller.Controller",null,{constructor:function(_227,_228){this._init(_227,_228);},_contextElementObj:null,_commands:new Array(),_connectHandles:new Array(),_queryCache:new Object(),_observers:new Object(),_tags:new Array(),_init:function(_229,_22a){if(this.params){var _22b={};_22b.onChange=function(){};var _22c=this._getBaseProperty("params");for(var _22d in _22c){if(typeof _22c[_22d]=="object"){var _22e=_22c[_22d];_22b[_22d]=new mojo.controller.Param(_22d,dojo.clone(_22e.defaultValue),_22e.required,_22e.type,_22b);if(_22a){_22b[_22d].setValue(_22a[_22d]);}}}for(var _22d in this.params){if(typeof this.params[_22d]=="object"){var _22e=this.params[_22d];_22b[_22d]=new mojo.controller.Param(_22d,dojo.clone(_22e.defaultValue),_22e.required,_22e.type,_22b);if(_22a){_22b[_22d].setValue(_22a[_22d]);}}}this.params=_22b;_22b=null;_22a=null;}this._contextElementObj=null;if(_229){this._contextElementObj=_229;}this._commands=new Array();this._tags=new Array();this._connectHandles=new Array();this._callBaseMethod("addCommands");this.addCommands();try{this._addObservers();}catch(err){this.addObservers();}try{this._callBaseMethod("addIntercepts");this.addIntercepts();}catch(err){}this.onInit();if(this.params){for(var _22d in this.params){if(typeof this.params[_22d]=="object"){var _22e=this.params[_22d];if(_22e.getValue()!=null){_22e.onChange();}}}}mojo.Messaging.subscribe("/mojo/controller/"+this.declaredClass+"/addObservers",this,"_addObservers");mojo.Messaging.subscribe("/mojo/controller/addObservers",this,"_addObservers");},getConfig:function(_22f){_22f=_22f.toLowerCase();switch(_22f){case "params":return this[_22f];break;}return null;},getValue:function(_230){return this.params[_230].getValue();},setValue:function(_231,_232){this.params[_231].setValue(_232);},getContextController:function(_233){if(this.getContextElement()&&this.getContextElement().mojoControllers[_233]){return this.getContextElement().mojoControllers[_233];}return null;},_getBaseProperty:function(_234){var _235=eval(this.declaredClass+".superclass");if(_235.declaredClass!="mojo.controller.Controller"&&_235[_234]){return _235[_234];}return null;},_callBaseMethod:function(_236){var _237=this._getBaseProperty(_236);if(_237){_237.call(this);}},getContextElement:function(){if(!this._contextElementObj){return null;}return this._contextElementObj;},onInit:function(){},_addObservers:function(){this._queryCache=new Object();this._observers=new Object();this._callBaseMethod("addObservers");this.addObservers();for(var key in this._queryCache){if(this._queryCache[key]["length"]){for(var func in this._observers[key]){if(this._observers[key][func]["length"]){var _23a=this._queryCache[key].length;for(var i=0;i<_23a;i++){this._addObserver(this._queryCache[key][i],func,this._observers[key][func]);}}}}}this._queryCache=new Object();this._observers=new Object();},addObservers:function(){throw new Error("ERROR mojo.controller.Controller.addObservers - addObservers() method is not implemented");},removeObservers:function(){var _23c=this._connectHandles.length;for(var i=0;i<_23c;i++){dojo.disconnect(this._connectHandles[i]);}},addObserver:function(_23e,_23f,_240,_241){var _242=function(_243){if(!dojo.isArray(_243)){return false;}for(var i=0,len=_243.length;i<len;i++){if(typeof (_243[i])!="string"){return false;}}return true;};if(typeof (_23e)=="undefined"){throw new Error("ERROR mojo.controller.Controller.addObserver - srcObj is undefined");}if(!_23f){throw new Error("ERROR mojo.controller.Controller.addObserver - srcFunc is not set");}if(typeof (_23f)!="string"){throw new Error("ERROR mojo.controller.Controller.addObserver - srcFunc is not type String");}if(!_240){throw new Error("ERROR mojo.controller.Controller.addObserver - cmdName is not set");}if(typeof (_240)!="string"&&_240!=null){throw new Error("ERROR mojo.controller.Controller.addObserver - cmdName is not type String");}if(typeof (_23e)=="string"||_242(_23e)){if(!dojo.isArray(_23e)){_23e=[_23e];}for(var i=0,len=_23e.length;i<len;i++){var _248=_23e[i];if(this.getContextElement()&&_23f.match(/^onclick|onmouse|onkey|onmove/)!=null){this._addObserver(this.getContextElement(),_23f,[{cmdName:_240,paramsObj:_241,eventDelegate:_248}]);}else{if(!this._queryCache[_248]){this._queryCache[_248]=mojo.query(_248,this.getContextElement());}if(!this._observers[_248]){this._observers[_248]=new Object();}if(!this._observers[_248][_23f]){this._observers[_248][_23f]=new Array();}var _249=this._observers[_248][_23f].length;this._observers[_248][_23f][_249]={cmdName:_240,paramsObj:_241};}}}else{if(!dojo.isArray(_23e)){_23e=[_23e];}for(var i=0,len=_23e.length;i<len;i++){this._addObserver(_23e[i],_23f,[{cmdName:_240,paramsObj:_241}]);}}if(!(this._commands[_240])||this._commands[_240]==null){throw new Error("ERROR mojo.controller.Controller.addObserver - cmdName does not reference a Command in the Controller");}},_addObserver:function(_24a,_24b,cmds){var _24d=new Array();var _24e=cmds.length;for(var i=0;i<_24e;i++){if(typeof (cmds[i].eventDelegate)=="undefined"){cmds[i].eventDelegate="";}if(!this._observerIsTagged(_24a,_24b+cmds[i].eventDelegate,cmds[i])){_24d.push(cmds[i]);this._tagObserver(_24a,_24b+cmds[i].eventDelegate,cmds[i]);}}if(!_24a.mojoObservers){_24a.mojoObservers=new Object();}if(!_24a.mojoObservers[_24b]){_24a.mojoObservers[_24b.toLowerCase()]=new Array();}if(_24d.length>0){var _250=this;var _251=function(e){var _253=function(e){var e=e||window.event;var _255=e.target||e.srcElement;if(_255.nodeType==3){_255=_255.parentNode;}return _255;};if(_250.getContextElement()&&_250.getContextElement().parentNode==null){_250.removeObservers();}else{var _256=_24d.length;for(var i=0;i<_256;i++){if(typeof (mojo)!="undefined"){var _258=_24a;if(_24d[i].eventDelegate.length>0){var _259=_253(e);_258=mojo.queryMatch(_259,_24d[i].eventDelegate,_250.getContextElement(),true);}if(_258!=null){var _25a=_250._setRequest(_24d[i].paramsObj,_258,e,_24d[i].cmdName);_250.fireCommandChain(_24d[i].cmdName,_25a);}}}}};var _25b=_24b.toLowerCase();if((_25b=="onmouseleave"||_25b=="onmouseenter")&&MooTools&&Element.Events.mouseleave&&Element.Events.mouseenter){$(_24a).addEvent(_24b.replace("on",""),_251);}else{var _25c=dojo.connect(_24a,_24b,_251);this._connectHandles.push(_25c);}_24a.mojoObservers[_24b.toLowerCase()].push(_251);}},_tagObserver:function(_25d,_25e,cmd){if(!_25d.mojoObserve){_25d.mojoObserve=new Object();}if(typeof _25d.mojoObserve[this.declaredClass]=="undefined"){var _260=this._tags.length;_25d.mojoObserve[this.declaredClass]=_260;this._tags[_260]=new Object();}var _261=_25d.mojoObserve[this.declaredClass];var _262=this._generateTagKey(_25e,cmd);if(this._tags[_261]&&!this._tags[_261][_262]){this._tags[_261][_262]=true;}},_generateTagKey:function(_263,cmd){var _265=_263+"_"+cmd.cmdName;if(cmd.paramsObj){var _266;if(typeof (cmd.paramsObj)=="function"){_266=cmd.paramsObj.toString();}else{if(typeof (cmd.paramsObj)=="object"){for(var key in cmd.paramsObj){if(cmd.paramsObj[key]){_266+=key+":"+cmd.paramsObj[key].toString()+",";}}}}_265+="_"+_266;}return _265;},_observerIsTagged:function(_268,_269,cmd){if(!_268.mojoObserve){_268.mojoObserve=new Object();}var _26b=false;var _26c=this._generateTagKey(_269,cmd);if(typeof _268.mojoObserve[this.declaredClass]!="undefined"&&this._tags[_268.mojoObserve[this.declaredClass]]&&this._tags[_268.mojoObserve[this.declaredClass]][_26c]){_26b=true;}return _26b;},addCommands:function(){throw new Error("ERROR mojo.controller.Controller.addCommands - addCommands() method is not implemented");},addCommand:function(_26d,_26e){if(!_26d){throw new Error("ERROR mojo.controller.Controller.addCommand - cmdName is not set");}if(typeof (_26d)!="string"){throw new Error("ERROR mojo.controller.Controller.addCommand - cmdName is not type String");}if(!_26e){throw new Error("ERROR mojo.controller.Controller.addCommand - cmdObjPath is not set");}if(typeof (_26e)!="string"){throw new Error("ERROR mojo.controller.Controller.addCommand - cmdObjPath is not type String");}if(!this._commands[_26d]){this._commands[_26d]=new Array();}var _26f=function(_270,_271,_272){dojo["require"](_271);var _273=eval("new "+_271+"()");if((_273 instanceof mojo.command.Command)||(_273 instanceof mojo.command.Rule||(_273 instanceof mojo.command.Behavior))){_272._commands[_270].push(_273);}else{throw new Error("ERROR mojo.controller.Controller.addCommand - Command object is not type mojo.command.Command or mojo.command.Behavior or mojo.command.Rule");}};_26f(_26d,_26e,this);},getCommand:function(_274){if(!_274){throw new Error("ERROR mojo.controller.Controller.getCommand - cmdName is not set");}if(typeof (_274)!="string"){throw new Error("ERROR mojo.controller.Controller.getCommand - cmdName is not type String");}if(this._commands[_274]){return this._commands[_274][0];}throw new Error("ERROR mojo.controller.Controller.getCommand - cmdName does not reference a Command in the Controller");},getCommandChain:function(_275){if(!_275){throw new Error("ERROR mojo.controller.Controller.getCommandChain - cmdName is not set");}if(typeof (_275)!="string"){throw new Error("ERROR mojo.controller.Controller.getCommandChain - cmdName is not type String");}if(!this._commands[_275]){throw new Error("ERROR mojo.controller.Controller.getCommandChain - cmdName does not reference a Command in the Controller");}if(this._commands[_275]){return this._commands[_275];}return null;},fireCommandChain:function(_276,_277){var _278=this._commands[_276].length;for(var i=0;i<_278;i++){this._commands[_276][i]._execute(_277);}},addIntercepts:function(){throw new Error("ERROR mojo.controller.Controller.addIntercepts - addIntercepts() method is not implemented");},addIntercept:function(_27a,_27b,_27c,_27d){if(!_27a){throw new Error("ERROR mojo.controller.Controller.addIntercept - interceptType is not set");}if(typeof (_27a)!="string"){throw new Error("ERROR mojo.controller.Controller.addIntercept - interceptType is not type String");}if(_27a=="before"||_27a=="after"||_27a=="around"){}else{throw new Error("ERROR mojo.controller.Controller.addIntercept - interceptType is not \"before\", \"after\", or \"around\"");}if(!_27b){throw new Error("ERROR mojo.controller.Controller.addIntercept - interceptCmdName is not set");}if(typeof (_27b)!="string"){throw new Error("ERROR mojo.controller.Controller.addIntercept - interceptCmdName is not type String");}if(!_27c){throw new Error("ERROR mojo.controller.Controller.addIntercept - cmdName is not set");}if(typeof (_27c)!="string"){throw new Error("ERROR mojo.controller.Controller.addIntercept - cmdName is not type String");}if(_27b.toString()==_27c.toString()){throw new Error("ERROR mojo.controller.Controller.addIntercept - a command cannot add advice to itself");}if(!this._commands[_27b]){throw new Error("ERROR mojo.controller.Controller.addIntercept - interceptCmdName does not reference a Command in the Controller");}if(!this._commands[_27c]){throw new Error("ERROR mojo.controller.Controller.addIntercept - cmdName does not reference a Command in the Controller");}var _27e=this;var _27f=this.getCommand(_27b)["_execute"];var _280=function(_281){if(typeof (mojo)!="undefined"){requestObj=_27e._setRequest(_27d,_281.args[0].callerObj,_281.args[0].eventObj,_27c,_281);_27e.fireCommandChain(_27c,requestObj);}};switch(_27a){case "before":this._commands[_27b][0]["_execute"]=function(){var _282={args:arguments,calleeObj:this};_280.apply(this,[_282]);return _27f.apply(this,arguments);};break;case "after":this._commands[_27b][0]["_execute"]=function(){var _283={args:arguments,calleeObj:this};_27f.apply(this,arguments);return _280.apply(this,[_283]);};break;case "around":this._commands[_27b][0]["_execute"]=function(){var _284={args:arguments,calleeObj:this};_284.proceed=function(){return _27f.apply(this.calleeObj,this.args);};return _280.apply(this,[_284]);};break;}},_setRequest:function(_285,_286,_287,_288,_289){var _28a=new mojo.controller.Request(_285,_286,_287,_288,this,_289);return _28a;}});mojo.controller.Controller.updateObservers=function(_28b){if(_28b){mojo.Messaging.publish("/mojo/controller/"+_28b+"/addObservers");}else{mojo.Messaging.publish("/mojo/controller/addObservers");}};}if(!dojo._hasResource["mojo.Model"]){dojo._hasResource["mojo.Model"]=true;dojo.provide("mojo.Model");__mojoModel=new Array();__mojoModelReferences=new Array();mojo.Model.set=function(key,_28d){if(key==null||typeof key=="undefined"){throw new Error("ERROR mojo.Model.set - key parameter is required");}if(!dojo.isString(key)||key==""){throw new Error("ERROR mojo.Model.set - key parameter must be a non-empty string");}__mojoModel[key]=_28d;mojo.Model.notify(key);};mojo.Model.add=function(key,_28f){if(key==null||typeof key=="undefined"){throw new Error("ERROR mojo.Model.add - key parameter is required");}if(!dojo.isString(key)||key==""){throw new Error("ERROR mojo.Model.add - key parameter must be a non-empty string");}if(_28f==null||typeof _28f=="undefined"){throw new Error("ERROR mojo.Model.add - valueObj parameter is required");}if(_28f==""){throw new Error("ERROR mojo.Model.add - valueObj parameter must be a non-empty string");}if(mojo.Model.contains(key)){if(!dojo.isArray(__mojoModel[key])){var _290=__mojoModel[key];__mojoModel[key]=new Array();__mojoModel[key].push(_290);}if(dojo.isArray(_28f)){for(var i=0;i<_28f.length;i++){__mojoModel[key].push(_28f[i]);}}else{__mojoModel[key].push(_28f);}mojo.Model.notify(key);}else{mojo.Model.set(key,_28f);}};mojo.Model.get=function(key){if(key==null||typeof key=="undefined"){throw new Error("ERROR mojo.Model.get - key parameter is required");}if(!dojo.isString(key)||key==""){throw new Error("ERROR mojo.Model.get - key parameter must be a non-empty string");}var tmp=__mojoModel[key];if(typeof tmp=="undefined"){tmp=null;}if((tmp==null)&&djConfig&&djConfig.isDebug){console.debug("WARNING mojo.Model - No entry found for \""+key+"\" key");}return tmp;};mojo.Model.getReference=function(key){if(key==null||typeof key=="undefined"){throw new Error("ERROR mojo.Model.getReference - key parameter is required");}if(!dojo.isString(key)||key==""){throw new Error("ERROR mojo.Model.getReference - key parameter must be a non-empty string");}if(!__mojoModelReferences[key]){__mojoModelReferences[key]=new mojo.ModelReference(key);}return __mojoModelReferences[key];};mojo.Model.remove=function(key){if(key==null||typeof key=="undefined"){throw new Error("ERROR mojo.Model.remove - key parameter is required");}if(!dojo.isString(key)||key==""){throw new Error("ERROR mojo.Model.remove - key parameter must be a non-empty string");}__mojoModel[key]=null;mojo.Model.notify(key);};mojo.Model.contains=function(key){if(key==null||typeof key=="undefined"){throw new Error("ERROR mojo.Model.contains - key parameter is required");}if(!dojo.isString(key)||key==""){throw new Error("ERROR mojo.Model.contains - key parameter must be a non-empty string");}var tmp=__mojoModel[key];if(tmp){return true;}return false;};mojo.Model.notify=function(key){if(key==null||typeof key=="undefined"){throw new Error("ERROR mojo.Model.notify - key parameter is required");}if(!dojo.isString(key)||key==""){throw new Error("ERROR mojo.Model.notify - key parameter must be a non-empty string");}__mojoModel["__mojoTemplateControllers"]=[];var ref=mojo.Model.getReference(key);ref.onNotify();mojo.Messaging.publish("/mojo/model/"+key);var _29a=__mojoModel["__mojoTemplateControllers"].length;for(var i=0;i<_29a;i++){var _29c=__mojoModel["__mojoTemplateControllers"][i];if(_29c&&_29c.updateController){_29c._addObservers();_29c.updateController=null;}}};mojo.Model.addObserver=function(key,_29e,_29f){if(key==null||typeof key=="undefined"){throw new Error("ERROR mojo.Model.addObserver - key parameter is required");}if(!dojo.isString(key)||key==""){throw new Error("ERROR mojo.Model.addObserver - key parameter must be a non-empty string");}if(_29e==null||typeof _29e=="undefined"){throw new Error("ERROR mojo.Model.addObserver - targetObj parameter is required");}if(!dojo.isObject(_29e)){throw new Error("ERROR mojo.Model.addObserver - targetObj parameter must be an object");}if(_29f==null||typeof _29f=="undefined"){throw new Error("ERROR mojo.Model.addObserver - targetFunc parameter is required");}if(!dojo.isString(_29f)||_29f==""){throw new Error("ERROR mojo.Model.addObserver - targetFunc parameter must be a function and is not of type string");}return mojo.Messaging.subscribe("/mojo/model/"+key,_29e,_29f);};mojo.Model.removeObserver=function(_2a0){if(_2a0==null||typeof _2a0!="object"){throw new Error("ERROR mojo.Model.removeObserver - handle parameter is required");}mojo.Messaging.unsubscribe(_2a0);};}if(!dojo._hasResource["mojo.widget.Logger"]){dojo._hasResource["mojo.widget.Logger"]=true;dojo.provide("mojo.widget.Logger");mojo.widget.Logger={_stack:[],_reader:null,_loader:false,_enabled:false,_categories:["info","warn","error"],_sources:["Controller","Command","Behavior","Rule","Service","Model","History","Template"]};mojo.widget.Logger._expandBox=function(el){var _2a2=el.nextSibling.nextSibling;if(_2a2.style.display=="block"){_2a2.style.display="none";}else{_2a2.style.display="block";}};mojo.widget.Logger._loadLogger=function(){var _2a3=mojo.widget.Logger.getSources();var _2a4=mojo.widget.Logger.getCategories();YAHOO.widget.Logger.sources=_2a3;YAHOO.widget.Logger.categories=_2a4;var div=document.createElement("div");div.id="mojo_logger_div_id";mojo.widget.Logger._reader=new YAHOO.widget.LogReader(document.body.appendChild(div),{verboseOutpt:false,newestOnTop:false,draggable:true});};mojo.widget.Logger.log=function(sMsg,_2a7,_2a8,_2a9){if(this._enabled){if(!_2a7){_2a7="info";}else{if(YAHOO.widget.Logger._isNewCategory(_2a7)){YAHOO.widget.Logger._createNewCategory(_2a7);}}var _2aa="global";var _2ab=null;if(_2a8){var _2ac=_2a8.indexOf(" ");if(_2ac>0){_2aa=_2a8.substring(0,_2ac);_2ab=_2a8.substring(_2ac,_2a8.length);}else{_2aa=_2a8;if(YAHOO.widget.Logger._isNewSource(_2aa)){YAHOO.widget.Logger._createNewSource(_2aa);}}}var _2ad=null;var walk=function(_obj){if(typeof _obj.toSource!=="undefined"&&typeof _obj.callee==="undefined"){return _obj.toSource();}switch(typeof _obj){case "number":case "boolean":case "function":return _obj;break;case "string":return "'"+_obj+"'";break;case "object":var str;if(_obj.constructor===Array||typeof _obj.callee!=="undefined"){str="[";var i,len=_obj.length;for(i=0;i<len-1;i++){str+=walk(_obj[i])+",";}str+=walk(_obj[i])+"]";}else{str="{";var key;for(key in _obj){str+=key+":"+walk(_obj[key])+",\n";}str=str.replace(/\,$/,"")+"}";}return str;break;default:return "UNKNOWN";break;}};try{if(_2a9){_2ad=walk(_2a9);_2ad=YAHOO.lang.JSON.stringify(_2ad);_2ad=_2ad.replace(/\{\}/gi,"Object");_2ad=_2ad.replace(/\\\"/gi,"\"");sMsg=sMsg+" [ (startanchor) href='#' onclick='mojo.widget.Logger._expandBox(this);return false;' (/startanchor) Toggle (endanchor) ] \n"+"((("+_2ad+")))";}}catch(err){}var _2b4=new Date();var _2b5=new YAHOO.widget.LogMsg({msg:sMsg,time:_2b4,category:_2a7,source:_2aa,sourceDetail:_2ab});var _2b6=YAHOO.widget.Logger._stack;var _2b7=YAHOO.widget.Logger.maxStackEntries;if(_2b7&&!isNaN(_2b7)&&(_2b6.length>=_2b7)){_2b6.shift();}_2b6.push(_2b5);YAHOO.widget.Logger.newLogEvent.fire(_2b5);if(YAHOO.widget.Logger._browserConsoleEnabled){YAHOO.widget.Logger._printToBrowserConsole(_2b5);}return true;}else{return false;}};mojo.widget.Logger.reset=function(){YAHOO.widget.Logger.reset();};mojo.widget.Logger.getReader=function(){return mojo.widget.Logger._reader;};mojo.widget.Logger.isEnabled=function(){return mojo.widget.Logger._enabled;};mojo.widget.Logger.enable=function(){if(!mojo.widget.Logger._loaded){mojo.widget.Logger._loaded=true;mojo.widget.Logger._enabled=true;mojo.widget.Logger._loadLogger();}};mojo.widget.Logger.disable=function(){};mojo.widget.Logger.getCategories=function(){return mojo.widget.Logger._categories;};mojo.widget.Logger.setCategories=function(_2b8){mojo.widget.Logger._categories=_2b8;};mojo.widget.Logger.getSources=function(){return mojo.widget.Logger._sources;};mojo.widget.Logger.setSources=function(_2b9){mojo.widget.Logger._sources=_2b9;};}if(!dojo._hasResource["mojo.log"]){dojo._hasResource["mojo.log"]=true;dojo.provide("mojo.log");mojo.log=function(msg,cat,src,obj){if(!mojo.widget.Logger._enabled){return false;}else{return mojo.widget.Logger.log(msg,cat,src,obj);}};}if(!dojo._hasResource["mojo.controller.Map"]){dojo._hasResource["mojo.controller.Map"]=true;dojo.provide("mojo.controller.Map");__mojoControllerMap=null;dojo.declare("mojo.controller.Map",null,{onComplete:function(){},constructor:function(){mojo.Messaging.subscribe("/mojo/controller/mapControllers",this,"mapControllers");},_controllers:new Array(),_siteMap:null,getSiteMap:function(){if(!this._siteMap){throw new Error("ERROR mojo.controller.Map - siteMap not set");}return this._siteMap;},setSiteMap:function(_2be){if(_2be==null||typeof _2be=="undefined"){throw new Error("ERROR mojo.controller.Map.setSiteMap - siteMapObj parameter is required");}var _2bf=function(){throw new Error("ERROR mojo.controller.Map.setSiteMap - siteMapObj parameter must consist of patterns in the format {pattern: \"pattern\", controllers: [{controller: \"controller.path\"}]}");};if(!dojo.isArray(_2be)){_2bf();}for(var i=0,len=_2be.length;i<len;i++){var _2c2=_2be[i];if(typeof _2c2.pattern=="undefined"||_2c2.pattern==null){_2bf();}if(!dojo.isArray(_2c2.controllers)){_2bf();}for(var j=0,len=_2c2.controllers.length;j<len;j++){if(typeof _2c2.controllers[j].controller=="undefined"||!dojo.isString(_2c2.controllers[j].controller)||_2c2.controllers[j].controller==""){_2bf();}}}for(pattern in _2be){}this._siteMap=_2be;},mapControllers:function(_2c4){var _2c5=this.getSiteMap();var _2c6=_2c5.length;for(var i=0;i<_2c6;i++){var _2c8=_2c5[i].pattern;if(typeof (_2c8)=="string"){var _2c9=[];if(_2c4&&typeof (_2c4)=="object"){_2c9=mojo.query(_2c8,_2c4);}else{_2c9=mojo.query(_2c8);}var _2ca=_2c9.length;for(var j=0;j<_2ca;j++){this._mapControllers(_2c5[i].controllers,_2c9[j]);}}else{if(typeof (_2c8)=="function"||typeof (_2c8)=="object"){if(_2c4&&typeof (_2c4)=="string"){var _2cc=new RegExp(_2c8);if(_2cc.test(_2c4)){this._mapControllers(_2c5[i].controllers);}}}else{alert(_2c8);throw new Error("ERROR mojo.controller.Map - siteMap contains invalid pattern");}}}this.onComplete();},_mapControllers:function(_2cd,_2ce){var _2cf=_2cd.length;for(var i=0;i<_2cf;i++){var _2d1=_2cd[i].controller;var _2d2=_2cd[i].params;if(djConfig&&djConfig.isDebug){try{this.mapController(_2d1,_2ce,_2d2);}catch(ex){console.debug("EXCEPTION: "+ex.message+" in mojo.controller.Map.mapController() for controller: "+_2d1);}}else{this.mapController(_2d1,_2ce,_2d2);}}},_contextElementObj:undefined,_controllerParams:undefined,mapController:function(_2d3,_2d4,_2d5){if(_2d3==null||typeof _2d3=="undefined"){throw new Error("ERROR mojo.controller.Map.mapController - controllerName parameter is required");}if(!dojo.isString(_2d3)||_2d3==""){throw new Error("ERROR mojo.controller.Map.mapController - controllerName parameter must be a non-empty string");}dojo["require"](_2d3);if(_2d4){if(!_2d4.mojoControllers){_2d4.mojoControllers={};}if(!_2d4.mojoControllers[_2d3]){this._contextElementObj=_2d4;this._controllerParams=_2d5;_2d4.mojoControllers[_2d3]=eval("new "+_2d3+"(this._contextElementObj, this._controllerParams)");if(!(_2d4.mojoControllers[_2d3] instanceof mojo.controller.Controller)){throw new Error("ERROR mojo.controller.Map.mapController - \""+_2d3+"\" must be an instance of mojo.controller.Controller");}}}else{if(!this._controllers[_2d3]){this._controllerParams=_2d5;this._controllers[_2d3]=eval("new "+_2d3+"(null, this._controllerParams)");if(!(this._controllers[_2d3] instanceof mojo.controller.Controller)){throw new Error("ERROR mojo.controller.Map.mapController - \""+_2d3+"\" must be an instance of mojo.controller.Controller");}}}}});mojo.controller.Map.mapControllers=function(_2d6){mojo.Messaging.publish("/mojo/controller/mapControllers",[_2d6]);};mojo.controller.Map.getInstance=function(){if(__mojoControllerMap==null){__mojoControllerMap=new mojo.controller.Map();}return __mojoControllerMap;};}if(!dojo._hasResource["mojo.component.Template"]){dojo._hasResource["mojo.component.Template"]=true;dojo.provide("mojo.component.Template");dojo.declare("mojo.component.Template",[dijit._Widget,dijit._Templated,dijit._Container],{initWithData:false,iterate:true,escapeHtml:false,escapeQuotes:false,modelSource:"",modelDependency:"",templateObj:[],templateConditions:[],_controllers:null,getModelSource:function(){if(!this.modelSource){return "";}return this.modelSource;},getModelDependency:function(){if(!this.modelDependency){return "";}return this.modelDependency;},_modelSourceHandle:null,_modelDependencyHandle:null,setModelSource:function(_2d7){if(!_2d7){throw new Error("ERROR mojo.component.Template.setModelSource - modelSource parameter is required");}if(typeof (_2d7)!="string"){throw new Error("ERROR mojo.component.Template.setModelSource - modelSource parameter is not type String");}if(this.getModelSource().length>0){if(this._modelSourceHandle){mojo.Model.removeObserver(this._modelSourceHandle);}this.modelSource=_2d7;this._modelSourceHandle=mojo.Model.addObserver(this.modelSource,this,"onModelUpdate");this.onModelUpdate();}},setModelDependency:function(_2d8){if(!_2d8&&_2d8!=""){throw new Error("ERROR mojo.component.Template.setModelDependency - modelDependency parameter is required");}if(typeof (_2d8)!="string"){throw new Error("ERROR mojo.component.Template.setModelDependency - modelDependency parameter is not type String");}this.modelDependency=_2d8;if(this._modelDependencyHandle){mojo.Model.removeObserver(this._modelDependencyHandle);}if(this.modelDependency){this._modelDependencyHandle=mojo.Model.addObserver(this.modelDependency,this,"onModelDependencyUpdate");}this.onModelDependencyUpdate();},_getTemplateControllers:function(){var _2d9=this.srcNodeRef.parentNode;var _2da=mojo.controller.Map.getInstance();var _2db=[];while(_2d9!=null){if(_2d9.mojoControllers){for(var _2dc in _2d9.mojoControllers){_2db.push(_2d9.mojoControllers[_2dc]);}}_2d9=_2d9.parentNode;}return _2db;},buildRendering:function(){var _2dd=mojo.query("*[dojoType=mojo.component.Template]",this.srcNodeRef);var _2de=_2dd.length;for(var i=0;i<_2de;i++){var _2e0=document.createTextNode("{cdata}");var _2e1=document.createTextNode("{/cdata}");dojo.place(_2e0,_2dd[i],"before");dojo.place(_2e1,_2dd[i],"after");}var _2e2=[];this.templateConditions=[];var a=mojo.query("> [prototype]",this.srcNodeRef);for(var i=0,sTag,_2e5;i<a.length;i++){this.templateConditions[i]=a[i].getAttribute("prototype");_2e2[i]=a[i].innerHTML;a[i].style.display="none";}if(_2e2.length==0){_2e2[0]=this.srcNodeRef.innerHTML;}for(var i=0,len=_2e2.length;i<len;i++){_2e2[i]=_2e2[i].replace(/&lt;/g,"<").replace(/&gt;/g,">");_2e2[i]=_2e2[i].replace(/\%21/g,"!").replace(/\%7B/g,"{").replace(/\%7D/g,"}");_2e2[i]=this._normalize(_2e2[i]);_2e2[i]=TrimPath.parseTemplate(_2e2[i],this.srcNodeRef.id+":"+i);}this.templateObj=_2e2;var b=this.srcNodeRef.childNodes;this.initWithData=((b.length>a.length)&&a.length>0);this.hide();this.setModelDependency(this.getModelDependency());this.setModelSource(this.getModelSource());},_bindToModel:function(){var _2e8={escapeQuotes:function(str){str=str.toString();str=str.replace(/\"/g,"&#34;");str=str.replace(/\'/g,"&#39;");return str;}};var _2ea=this.getModelSource();if(_2ea.length>0&&mojo.Model.contains(_2ea)&&this.srcNodeRef){var _2eb=mojo.Model.get(_2ea);var _2ec=new Array();if(!dojo.isArray(_2eb)){_2eb=[_2eb];}var _2ed=_2eb.length;if(!this.iterate&&_2ed>0){_2ed=1;}var _2ee=0;if(_2ed>0&&_2eb[0]!=null){with(_2eb[0]){for(var i=0,len=this.templateConditions.length;i<len;i++){try{if(this.templateConditions[i].toLowerCase()=="true"||eval(this.templateConditions[i])){_2ee=i;break;}}catch(e){}}}}for(var i=0,len=_2ed;i<len;i++){if(_2eb[i]){if(typeof (_2eb[i])!="object"){var _2f1=_2eb[i].toString();_2eb[i]=new Object();_2eb[i].data=_2f1;}_2eb[i].currentIndex=i;if(this.escapeQuotes){_2eb[i]._MODIFIERS=_2e8;_2eb[i].content=_2e8.escapeQuotes(_2eb[i].content);}_2ec.push(this.templateObj[_2ee].process(_2eb[i]));}}if(!this._controllers){this._controllers=this._getTemplateControllers();}var _2f2=this.srcNodeRef;var _2f3=_2ec.join("");_2f2.innerHTML="";_2f2.innerHTML=_2f3;var _2f4=mojo.query("*[dojoType='mojo.component.Template']",this.srcNodeRef);var _2f5=_2f4.length;var _2f6=["escapeHtml","escapeQuotes","modelSource","modelDependency"];var _2f7=_2f6.length;for(var i=0;i<_2f5;i++){var _2f8={};var _2f9;for(var j=0;j<_2f7;j++){if(_2f4[i].getAttribute(_2f6[j])){attributeValue=_2f4[i].getAttribute(_2f6[j]);if(/[\!|\$]\{[^\}]*\}/.test(attributeValue)){_2f9=this._normalize(attributeValue);_2f9=TrimPath.parseTemplate(_2f9);attributeValue=_2f9.process(_2eb[i]);}_2f8[_2f6[j]]=attributeValue;}}var _2fb=new mojo.component.Template(_2f8,_2f4[i]);}var _2fc=this.srcNodeRef.parentNode;while(_2fc!=null){if(_2fc.id&&dijit.byId(_2fc.id)){var _2fd=dijit.byId(_2fc.id);if(_2fd["sync"]&&typeof (_2fd["sync"])=="function"){_2fd.sync();}}_2fc=_2fc.parentNode;}if(!this._controllers){this._controllers=this._getTemplateControllers();}if(this._controllers&&mojo.Model.contains("__mojoTemplateControllers")){var _2fe=this._controllers.length;for(var i=0;i<_2fe;i++){this._controllers[i].updateController=true;mojo.Model.get("__mojoTemplateControllers").push(this._controllers[i]);}}this.show();}else{if(!this.initWithData){this.initWithData=false;this.hide();}}},hide:function(){if(this.srcNodeRef){dojo.style(this.srcNodeRef,"display","none");}},show:function(){if(this.srcNodeRef){dojo.style(this.srcNodeRef,"display","block");}},_replacedNode:null,_normalize:function(_2ff){var _300=/[\!|\$]\{[^\}]*\}/g;var _301=_2ff.match(_300);var _302=_2ff.split(_300);var _303=new Array();var _304=0;if(_301){_304=_301.length;}for(var i=0;i<_304;i++){_303.push(_302[i]);var _306="$"+_301[i].substring(1);var _307="";if(this.escapeHtml){_307+="|escape";}if(this.escapeQuotes){_307+="|escapeQuotes";}_306=_306.substring(0,_306.length-1)+_307+"}";_303.push(_306);}_303.push(_302[_304]);return _303.join("");},onModelUpdate:function(){if(this.getModelDependency().length==0||this._dependencyMet){this._bindToModel();}},_dependencyMet:false,onModelDependencyUpdate:function(){if(this.getModelDependency().length>0&&mojo.Model.contains(this.getModelDependency())){this._dependencyMet=true;this.onModelUpdate();}else{this._dependencyMet=false;}}});}if(!dojo._hasResource["mojo.helper.String"]){dojo._hasResource["mojo.helper.String"]=true;dojo.provide("mojo.helper.String");mojo.toSentenceCase=function(_308){return _308.charAt(0).toUpperCase()+_308.replace(/ \w/g,function(m){return m.toUpperCase();}).substring(1);};}if(!dojo._hasResource["mojo.helper.Inflector"]){dojo._hasResource["mojo.helper.Inflector"]=true;dojo.provide("mojo.helper.Inflector");var __mojoInflector=null;dojo.declare("mojo.helper.Inflector",null,{Inflections:{plural:[[/(quiz)$/i,"$1zes"],[/^(ox)$/i,"$1en"],[/([m|l])ouse$/i,"$1ice"],[/(matr|vert|ind)ix$|ex$/i,"$1ices"],[/(x|ch|ss|sh)$/i,"$1es"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/(hive)$/i,"$1s"],[/(?:([^f])fe|([lr])f)$/i,"$1$2ves"],[/sis$/i,"ses"],[/([ti])um$/i,"$1a"],[/(buffal|tomat)o$/i,"$1oes"],[/(bu)s$/i,"$1ses"],[/(alias|status)$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(ax|test)is$/i,"$1es"],[/s$/i,"s"],[/$/,"s"]],singular:[[/(quiz)zes$/i,"$1"],[/(matr)ices$/i,"$1ix"],[/(vert|ind)ices$/i,"$1ex"],[/^(ox)en/i,"$1"],[/(alias|status)es$/i,"$1"],[/(octop|vir)i$/i,"$1us"],[/(cris|ax|test)es$/i,"$1is"],[/(shoe)s$/i,"$1"],[/(o)es$/i,"$1"],[/(bus)es$/i,"$1"],[/([m|l])ice$/i,"$1ouse"],[/(x|ch|ss|sh)es$/i,"$1"],[/(m)ovies$/i,"$1ovie"],[/(s)eries$/i,"$1eries"],[/([^aeiouy]|qu)ies$/i,"$1y"],[/([lr])ves$/i,"$1f"],[/(tive)s$/i,"$1"],[/(hive)s$/i,"$1"],[/([^f])ves$/i,"$1fe"],[/(^analy)ses$/i,"$1sis"],[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i,"$1$2sis"],[/([ti])a$/i,"$1um"],[/(n)ews$/i,"$1ews"],[/s$/i,""]],irregular:[["move","moves"],["sex","sexes"],["child","children"],["man","men"],["person","people"],["cow","kine"]],uncountable:["sheep","fish","series","species","money","rice","information","equipment"]},ordinalize:function(_30a){if(11<=parseInt(_30a)%100&&parseInt(_30a)%100<=13){return _30a+"th";}else{switch(parseInt(_30a)%10){case 1:return _30a+"st";case 2:return _30a+"nd";case 3:return _30a+"rd";default:return _30a+"th";}}},pluralize:function(word){for(var i=0;i<this.Inflections.uncountable.length;i++){var _30d=this.Inflections.uncountable[i];if(word.toLowerCase()==_30d){return _30d;}}for(var i=0;i<this.Inflections.irregular.length;i++){var _30e=this.Inflections.irregular[i][0];var _30f=this.Inflections.irregular[i][1];var _310=new RegExp(_30e+"$");if(_310.test(word.toLowerCase())||word==_30f){return word.replace(_310,_30f);}}for(var i=0;i<this.Inflections.plural.length;i++){var _311=this.Inflections.plural[i][0];var _312=this.Inflections.plural[i][1];if(_311.test(word)){return word.replace(_311,_312);}}},singularize:function(word){for(var i=0;i<this.Inflections.uncountable.length;i++){var _315=this.Inflections.uncountable[i];if(word.toLowerCase==_315){return _315;}}for(var i=0;i<this.Inflections.irregular.length;i++){var _316=this.Inflections.irregular[i][0];var _317=this.Inflections.irregular[i][1];var _318=new RegExp(_317+"$");if((_318.test(word.toLowerCase()))||(word==_317)){return word.replace(_318,_316);}}for(var i=0;i<this.Inflections.singular.length;i++){var _319=this.Inflections.singular[i][0];var _31a=this.Inflections.singular[i][1];if(_319.test(word)){return word.replace(_319,_31a);}}return word;}});mojo.helper.Inflector.pluralize=function(_31b){var _31c=mojo.helper.Inflector.getInstance();return _31c.pluralize(_31b);};mojo.helper.Inflector.singularize=function(_31d){var _31e=mojo.helper.Inflector.getInstance();return _31e.singularize(_31d);};mojo.helper.Inflector.ordinalize=function(_31f){var _320=mojo.helper.Inflector.getInstance();return _320.ordinalize(_31f);};mojo.helper.Inflector.getInstance=function(){if(__mojoInflector==null){__mojoInflector=new mojo.helper.Inflector();}return __mojoInflector;};}if(!dojo._hasResource["mojo.helper.XML"]){dojo._hasResource["mojo.helper.XML"]=true;dojo.provide("mojo.helper.XML");dojo.declare("mojo.helper.XML",null,{constructor:function(xml,_322){if(typeof XMLDocument!="undefined"&&xml instanceof XMLDocument){this.xmlDocument=xml;}else{if(xml.readyState){this.xmlDocument=xml;}else{if(window.ActiveXObject){this.xmlDocument=new ActiveXObject("Microsoft.XMLDOM");this.xmlDocument.async="false";this.xmlDocument.loadXML(xml);}else{if(document.implementation&&document.implementation.createDocument){var _323=new DOMParser();this.xmlDocument=_323.parseFromString(xml,"text/xml");}else{throw new Error("ERROR mojo.helper.XML.constructor - This browser does not support XML parsing");}}}}this.params=new mojo.helper.XML.params();for(key in _322){this.params[key]=_322[key];}},toObject:function(){var _324={};var _325=this.xmlDocument.documentElement;var _326=this._parseNode(_325);_324[_325.nodeName]=_326;return _324;},_parseNode:function(node){var _328=null;var _329=true;var _32a=false;if(node.nodeType==7){return;}if(node.nodeType==3||node.nodeType==4){if(this._isWhiteSpace(node.nodeValue)){return;}return node.nodeValue;}if(node.attributes){var len=node.attributes.length;if(len){_32a=true;if(!_328){_328={};}for(var i=0;i<len;i++){_328["@"+node.attributes[i].nodeName]=this._toJavaScriptType(node.attributes[i].nodeValue);}}}if(node.childNodes){var len=node.childNodes.length;if(len){if(!_328){_328={};}for(var i=0;i<len;i++){var _32d=node.childNodes[i].nodeType;_329=(_32d==3&&!this._isWhiteSpace(node.childNodes[i].nodeValue));}if(_329&&!_32a){for(var i=0;i<len;i++){if(i==0){_328=this._nodeToString(node.childNodes[i]);}else{_328+=this._nodeToString(node.childNodes[i]);}}}else{for(var i=0;i<len;i++){var _32e=this._parseNode(node.childNodes[i]);if(typeof _32e=="undefined"){continue;}var _32f=node.childNodes[i].nodeName;if(_32f=="#cdata-section"){_32f="#cdata";}if(_328[_32f]){if(!(_328[_32f] instanceof Array)&&_32f!="#cdata"){_328[_32f]=[_328[_32f]];}if(_32f=="#cdata"){_328[_32f]+=_32e;}else{_328[_32f].push(_32e);}}else{if(this._shouldInferArrays(node,_328)){_328[_32f]=[_32e];}else{_328[_32f]=_32e;}}}}}else{if(this._shouldInferArrays(node,_328)){if(!_328){_328={};}_328[mojo.helper.Inflector.singularize(node.nodeName)]=[];}}}return _328;},_shouldInferArrays:function(node,_331){return (this.params.inferArrays&&((mojo.helper.Inflector.pluralize(mojo.helper.Inflector.singularize(node.nodeName))==node.nodeName)||(_331&&Number(_331["@total"]).toString()!="NaN")));},_isWhiteSpace:function(text){return !text.match(/[^\x00-\x20]/);},_nodeToString:function(node){var _334=node.nodeType;var _335=node.nodeName;switch(_334){case 1:str="<"+_335;if(node.attributes){var len=node.attributes.length;if(len){for(var i=0;i<len;i++){var key=node.attributes[i].nodeName;var _339=node.attributes[i].nodeValue||"";str+=" "+key+"=\""+_339+"\"";}}}if(node.childNodes){var len=node.childNodes.length;if(len){var _33a=true;str+=">";for(var i=0;i<len;i++){str+=this._nodeToString(node.childNodes[i]);}}}if(_33a){str+="</"+_335+">";}else{str+="/>";}break;case 3:str=this._toJavaScriptType(node.nodeValue);break;case 4:str="<![CDATA["+node.nodeValue+"]]>";break;}return str;},_toJavaScriptType:function(_33b){if(_33b.toLowerCase()=="false"){return false;}if(_33b.toLowerCase()=="true"){return true;}if(_33b.match("0[0-7]{3}")){var _33c=parseInt(_33b);return _33c;}var _33d=parseFloat(_33b);if(_33d==_33b){return _33d;}var _33e=parseInt(_33b);if(_33e==_33b){return _33e;}if(_33b.match(/^[0-9]+[\- ][0-9]+[\- ][0-9]+/)){var date=new Date(_33b.replace(/[\- ]/g,"/"));}else{var date=new Date(_33b);}if(date instanceof Date&&date.toString()!="Invalid Date"&&date.toString()!="NaN"){return date;}return _33b;}});mojo.helper.XML.toObject=function(xml,_341){var xml=new mojo.helper.XML(xml,_341);return xml.toObject();};dojo.declare("mojo.helper.XML.params",null,{inferArrays:true});}if(!dojo._hasResource["mojo.service.Service"]){dojo._hasResource["mojo.service.Service"]=true;dojo.provide("mojo.service.Service");dojo.declare("mojo.service.Service",null,{VALID_METHODS:["GET","POST","PUT","DELETE"],DEFAULT_PARAMS:{format:"json",method:"GET",cacheExpiry:0,cache:true,retry:1,hijax:false,inferArrays:true},constructor:function(name,uri,_344){if(name==null||typeof name=="undefined"){throw new Error("ERROR mojo.service.Service.constructor - name parameter is required");}if(!dojo.isString(name)||name==""){throw new Error("ERROR mojo.service.Service.constructor - name parameter must be a non-empty string");}if(uri==null||typeof uri=="undefined"){throw new Error("ERROR mojo.service.Service.constructor - uri parameter is required");}if(!dojo.isString(uri)||uri==""){throw new Error("ERROR mojo.service.Service.constructor - uri parameter must be a non-empty string");}var _345={};for(property in this.DEFAULT_PARAMS){_345[property]=this.DEFAULT_PARAMS[property];}if(name.toLowerCase().indexOf("add")==0){_345.method="POST";}else{if(name.toLowerCase().indexOf("update")==0){_345.method="PUT";}else{if(name.toLowerCase().indexOf("delete")==0){_345.method="DELETE";}}}if(_344){if(_344.method){if(_344.method!="GET"){_345.cache=false;}}else{if(_345.method!="GET"){_345.cache=false;}}if(_344.method){if(_344.method!="GET"){_345.retry=0;}}else{if(_345.method!="GET"){_345.retry=0;}}}if(_344){for(property in _344){_345[property]=_344[property];}}this.setName(name);this.setUri(uri);this.setParams(_345);this._expireCache(this.getName());},_name:"",_uri:"",_params:new Object(),getName:function(){return this._name;},setName:function(name){if(name==null||typeof name=="undefined"){throw new Error("ERROR mojo.service.Service.setName - name parameter is required");}if(!dojo.isString(name)||name==""){throw new Error("ERROR mojo.service.Service.setName - name parameter must be a non-empty string");}this._name=name;},getUri:function(){return this._uri;},setUri:function(uri){if(uri==null||typeof uri=="undefined"){throw new Error("ERROR mojo.service.Service.setUri - uri parameter is required");}if(!dojo.isString(uri)||uri==""){throw new Error("ERROR mojo.service.Service.setUri - uri parameter must be a non-empty string");}this._uri=uri;},getParams:function(){return this._paramsObj;},setParams:function(_348){if(!_348){throw new Error("ERROR mojo.service.Service.setParams - paramsObj parameter is required");}if(_348){for(property in _348){switch(property){case "hijax":case "cache":case "inferArrays":if(typeof _348[property]!="boolean"){throw new Error("ERROR mojo.service.Service.setParams - "+property+" property of paramsObj must be a boolean");}break;case "cacheExpiry":case "retry":if(typeof _348[property]!="number"){throw new Error("ERROR mojo.service.Service.setParams - "+property+" property of paramsObj must be a number");}break;case "format":if(typeof _348[property]!="string"){throw new Error("ERROR mojo.service.Service.setParams - "+property+" property of paramsObj must be a string");}break;case "method":var _349=false;for(var i=0,len=this.VALID_METHODS.length;i<len;i++){if(this.VALID_METHODS[i]==_348[property].toUpperCase()){_349=true;}}if(!_349){throw new Error("ERROR mojo.service.Service.setParams - method property of paramsObj must be one of \"GET\", \"POST\", \"PUT\", or \"DELETE\"");}break;}}}if(!this._paramsObj){this._paramsObj={};}if(_348.json==true){this._paramsObj.format="json";if(djConfig&&djConfig.isDebug){console.debug("WARNING mojo.service.Service.setParams - json parameter is DEPRECATED; use {format: 'json'} instead");}}if(_348.json==false){this._paramsObj.format="text";if(djConfig&&djConfig.isDebug){console.debug("WARNING mojo.service.Service.setParams - json parameter is DEPRECATED; use {format: 'json'} instead");}}for(property in _348){this._paramsObj[property]=_348[property];}},invoke:function(_34c,_34d){if(!_34d){throw new Error("ERROR mojo.service.Service.invoke - callerObj parameter is required");}if(!dojo.isObject(_34d)){throw new Error("ERROR mojo.service.Service.invoke - callerObj parameter must be an object");}if(typeof _34d.onResponse!="function"){throw new Error("ERROR mojo.service.Service.invoke - callerObj parameter must contain an object with an onResponse method");}if(typeof _34d.onError!="function"){throw new Error("ERROR mojo.service.Service.invoke - callerObj parameter must contain an object with an onError method");}var _34e=this.getParams();if(typeof TrimPath!="undefined"&&TrimPath.parseTemplate){var _34f=TrimPath.parseTemplate(this.getUri()).process(_34c);if(_34c&&_34c["_MODIFIERS"]&&_34c["defined"]){delete _34c["_MODIFIERS"];delete _34c["defined"];}}else{var _34f=this.getUri();}if(_34e.hijax&&_34d.getRequest()&&_34d.getRequest().callerObj&&_34d.getRequest().callerObj.tagName=="A"){_34f=_34d.getRequest().callerObj.href;}var _350=0;var _351=this.getName();var _352=new Array();for(var key in _34c){if(typeof (_34c[key])!="function"){_352.push(key+"_"+_34c[key]);}else{_352.push(key+"__function");}}if(_352.length>0){_351+="_"+_352.join("_");}var _354=function(_355,_356){var _357=new Array();if(_356){_355.code=_356.status;_357.push(_355);}if(typeof (_355)=="string"){var msg=_355;_355=new Object();_355.message=msg;}if(_355.name){_355.code=_355.name;_357.push(_355);}if(_355.errors){_357=_355.errors;}if(_355.error){_357.push(_355.error);}if(_357[0]["redirectUrl"]){window.location.replace(_357[0]["redirectUrl"]);}if(_356&&_34e.retry>=_350){_359();}else{_34d.onError(_357);}};var _35a=this;var _359=function(){return dojo["xhr"+mojo.toSentenceCase(_34e.method.toLowerCase())]({url:_34f,preventCache:(!_34e.cache&&_34e.method=="GET"),handleAs:_34e.format,content:_34c,load:function(_35b,_35c){_350++;if(_35c.handleAs=="json"){if(!dojo.isObject(_35b)){try{_35b=eval(_35b);}catch(ex){_354(ex);return;}}if(_35b.error||_35b.errors){_354(_35b);}else{if(_34e.cache){_35a._setCache(_351,_35b,_34e.cacheExpiry);}_34d.onResponse(_35b,_35c.args.content);}}else{if(_35c.handleAs=="xml"){try{var _35d={};if(typeof _34e.inferArrays!="undefined"){_35d.inferArrays=_34e.inferArrays;}_35b=mojo.helper.XML.toObject(_35b,_35d);}catch(ex){_354(ex);}if(_35b.error||_35b.errors){if(_35b.errors&&_35b.errors["error"]&&_35b.errors["error"] instanceof Array){_35b.errors=_35b.errors["error"];}_354(_35b);}else{if(_34e.cache){_35a._setCache(_351,_35b,_34e.cacheExpiry);}_34d.onResponse(_35b,_35c.args.content);}}else{if(_34e.cache){_35a._setCache(_351,_35b,_34e.cacheExpiry);}_34d.onResponse(_35b,_35c.args.content);}}},error:function(_35e,_35f){_350++;_354(_35e,_35f.xhr);}});};var _360;if(_34e.cache){_360=this._getCache(_351);}if(_360){_34d.onResponse(_360.data,_34c);}else{var _361=_359();}return _361;},_setCache:function(key,data,_364){var _365=0;if(_364>0){_365=(new Date()).getTime()+(_364*1000);}mojo.Model.set(key,{data:data,expiryTime:_365});},_getCache:function(key){var _367=null;if(mojo.Model.contains(key)){_367=mojo.Model.get(key);var now=(new Date()).getTime();if(_367.expiryTime>0&&now>_367.expiryTime){this._expireCache(key);_367=null;}}return _367;},_expireCache:function(key){mojo.Model.remove(key);}});}if(!dojo._hasResource["sample.service.Locator"]){dojo._hasResource["sample.service.Locator"]=true;dojo.provide("mojo.service.Locator");__mojoServiceRegistry=new Array();dojo.declare("mojo.service.Locator",null,{constructor:function(){if(__mojoServiceRegistry.length==0){this.addServices();}},addServices:function(){if(djConfig&&djConfig.isDebug){console.debug("ERROR mojo.service.Locator - addServices() not implemented");}},addService:function(_36a){if(_36a==null||typeof _36a=="undefined"){throw (new Error("ERROR mojo.service.Locator.addService - serviceObj parameter is required"));}if(!(_36a instanceof mojo.service.Service)){throw (new Error("ERROR mojo.service.Locator.addService - serviceObj parameter must be an instance of the mojo.service.Service class"));}var _36b=_36a.getName();if(!__mojoServiceRegistry[_36b]){__mojoServiceRegistry[_36b]=_36a;}else{throw (new Error("ERROR mojo.service.Locator.addService - service with the name \""+_36b+"\" already exists in the registry; service not added"));}},getService:function(name){if(name==null||typeof name=="undefined"){throw new Error("ERROR mojo.service.Locator.getService - name parameter is required");}if(!dojo.isString(name)||name==""){throw new Error("ERROR mojo.service.Locator.getService - name parameter must be a non-empty string");}return __mojoServiceRegistry[name]||null;}});}
