/*
	Copyright (c) 2004-2011, 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
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.grid.enhanced.plugins.filter._FilterExpr"],["require","dojox.grid.enhanced.plugins.filter._DataExprs"],["require","dojo.date"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.grid.enhanced.plugins.filter._FilterExpr"]){_4._hasResource["dojox.grid.enhanced.plugins.filter._FilterExpr"]=true;_4.provide("dojox.grid.enhanced.plugins.filter._FilterExpr");_4.require("dojox.grid.enhanced.plugins.filter._DataExprs");_4.require("dojo.date");(function(){var _7=_6.grid.enhanced.plugins.filter;_4.declare("dojox.grid.enhanced.plugins.filter.LogicAND",_7._BiOpExpr,{_name:"and",_calculate:function(_8,_9,_a,_b){var _c=_8.applyRow(_a,_b).getValue()&&_9.applyRow(_a,_b).getValue();return new _7.BooleanExpr(_c);}});_4.declare("dojox.grid.enhanced.plugins.filter.LogicOR",_7._BiOpExpr,{_name:"or",_calculate:function(_d,_e,_f,_10){var res=_d.applyRow(_f,_10).getValue()||_e.applyRow(_f,_10).getValue();return new _7.BooleanExpr(res);}});_4.declare("dojox.grid.enhanced.plugins.filter.LogicXOR",_7._BiOpExpr,{_name:"xor",_calculate:function(_11,_12,_13,_14){var _15=_11.applyRow(_13,_14).getValue();var _16=_12.applyRow(_13,_14).getValue();return new _7.BooleanExpr((!!_15)!=(!!_16));}});_4.declare("dojox.grid.enhanced.plugins.filter.LogicNOT",_7._UniOpExpr,{_name:"not",_calculate:function(_17,_18,_19){return new _7.BooleanExpr(!_17.applyRow(_18,_19).getValue());}});_4.declare("dojox.grid.enhanced.plugins.filter.LogicALL",_7._OperatorExpr,{_name:"all",applyRow:function(_1a,_1b){for(var i=0,res=true;res&&(this._operands[i] instanceof _7._ConditionExpr);++i){res=this._operands[i].applyRow(_1a,_1b).getValue();}return new _7.BooleanExpr(res);}});_4.declare("dojox.grid.enhanced.plugins.filter.LogicANY",_7._OperatorExpr,{_name:"any",applyRow:function(_1c,_1d){for(var i=0,res=false;!res&&(this._operands[i] instanceof _7._ConditionExpr);++i){res=this._operands[i].applyRow(_1c,_1d).getValue();}return new _7.BooleanExpr(res);}});function _1e(_1f,_20,row,_21){_1f=_1f.applyRow(row,_21);_20=_20.applyRow(row,_21);var _22=_1f.getValue();var _23=_20.getValue();if(_1f instanceof _7.TimeExpr){return _4.date.compare(_22,_23,"time");}else{if(_1f instanceof _7.DateExpr){return _4.date.compare(_22,_23,"date");}else{if(_1f instanceof _7.StringExpr){_22=_22.toLowerCase();_23=String(_23).toLowerCase();}return _22==_23?0:(_22<_23?-1:1);}}};_4.declare("dojox.grid.enhanced.plugins.filter.EqualTo",_7._BiOpExpr,{_name:"equal",_calculate:function(_24,_25,_26,_27){var res=_1e(_24,_25,_26,_27);return new _7.BooleanExpr(res===0);}});_4.declare("dojox.grid.enhanced.plugins.filter.LessThan",_7._BiOpExpr,{_name:"less",_calculate:function(_28,_29,_2a,_2b){var res=_1e(_28,_29,_2a,_2b);return new _7.BooleanExpr(res<0);}});_4.declare("dojox.grid.enhanced.plugins.filter.LessThanOrEqualTo",_7._BiOpExpr,{_name:"lessEqual",_calculate:function(_2c,_2d,_2e,_2f){var res=_1e(_2c,_2d,_2e,_2f);return new _7.BooleanExpr(res<=0);}});_4.declare("dojox.grid.enhanced.plugins.filter.LargerThan",_7._BiOpExpr,{_name:"larger",_calculate:function(_30,_31,_32,_33){var res=_1e(_30,_31,_32,_33);return new _7.BooleanExpr(res>0);}});_4.declare("dojox.grid.enhanced.plugins.filter.LargerThanOrEqualTo",_7._BiOpExpr,{_name:"largerEqual",_calculate:function(_34,_35,_36,_37){var res=_1e(_34,_35,_36,_37);return new _7.BooleanExpr(res>=0);}});_4.declare("dojox.grid.enhanced.plugins.filter.Contains",_7._BiOpExpr,{_name:"contains",_calculate:function(_38,_39,_3a,_3b){var _3c=String(_38.applyRow(_3a,_3b).getValue()).toLowerCase();var _3d=String(_39.applyRow(_3a,_3b).getValue()).toLowerCase();return new _7.BooleanExpr(_3c.indexOf(_3d)>=0);}});_4.declare("dojox.grid.enhanced.plugins.filter.StartsWith",_7._BiOpExpr,{_name:"startsWith",_calculate:function(_3e,_3f,_40,_41){var _42=String(_3e.applyRow(_40,_41).getValue()).toLowerCase();var _43=String(_3f.applyRow(_40,_41).getValue()).toLowerCase();return new _7.BooleanExpr(_42.substring(0,_43.length)==_43);}});_4.declare("dojox.grid.enhanced.plugins.filter.EndsWith",_7._BiOpExpr,{_name:"endsWith",_calculate:function(_44,_45,_46,_47){var _48=String(_44.applyRow(_46,_47).getValue()).toLowerCase();var _49=String(_45.applyRow(_46,_47).getValue()).toLowerCase();return new _7.BooleanExpr(_48.substring(_48.length-_49.length)==_49);}});_4.declare("dojox.grid.enhanced.plugins.filter.Matches",_7._BiOpExpr,{_name:"matches",_calculate:function(_4a,_4b,_4c,_4d){var _4e=String(_4a.applyRow(_4c,_4d).getValue());var _4f=new RegExp(_4b.applyRow(_4c,_4d).getValue());return new _7.BooleanExpr(_4e.search(_4f)>=0);}});_4.declare("dojox.grid.enhanced.plugins.filter.IsEmpty",_7._UniOpExpr,{_name:"isEmpty",_calculate:function(_50,_51,_52){var res=_50.applyRow(_51,_52).getValue();return new _7.BooleanExpr(res===""||res==null);}});})();}}};});