/*
	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.date.islamic"],["require","dojox.date.islamic.Date"],["require","dojo.date"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.date.islamic"]){_4._hasResource["dojox.date.islamic"]=true;_4.provide("dojox.date.islamic");_4.require("dojox.date.islamic.Date");_4.require("dojo.date");_6.date.islamic.getDaysInMonth=function(_7){return _7.getDaysInIslamicMonth(_7.getMonth(),_7.getFullYear());};_6.date.islamic.compare=function(_8,_9,_a){if(_8 instanceof _6.date.islamic.Date){_8=_8.toGregorian();}if(_9 instanceof _6.date.islamic.Date){_9=_9.toGregorian();}return _4.date.compare.apply(null,arguments);};_6.date.islamic.add=function(_b,_c,_d){var _e=new _6.date.islamic.Date(_b);switch(_c){case "day":_e.setDate(_b.getDate()+_d);break;case "weekday":var _f=_b.getDay();if(((_f+_d)<5)&&((_f+_d)>0)){_e.setDate(_b.getDate()+_d);}else{var _10=0,_11=0;if(_f==5){_f=4;_11=(_d>0)?-1:1;}else{if(_f==6){_f=4;_11=(_d>0)?-2:2;}}var add=(_d>0)?(5-_f-1):-_f;var _12=_d-add;var div=parseInt(_12/5);if(_12%5!=0){_10=(_d>0)?2:-2;}_10=_10+div*7+_12%5+add;_e.setDate(_b.getDate()+_10+_11);}break;case "year":_e.setFullYear(_b.getFullYear()+_d);break;case "week":_d*=7;_e.setDate(_b.getDate()+_d);break;case "month":var _13=_b.getMonth();_e.setMonth(_13+_d);break;case "hour":_e.setHours(_b.getHours()+_d);break;case "minute":_e.setMinutes(_b.getMinutes()+_d);break;case "second":_e.setSeconds(_b.getSeconds()+_d);break;case "millisecond":_e.setMilliseconds(_b.getMilliseconds()+_d);break;}return _e;};_6.date.islamic.difference=function(_14,_15,_16){_15=_15||new _6.date.islamic.Date();_16=_16||"day";var _17=_14.getFullYear()-_15.getFullYear();var _18=1;switch(_16){case "weekday":var _19=Math.round(_6.date.islamic.difference(_14,_15,"day"));var _1a=parseInt(_6.date.islamic.difference(_14,_15,"week"));var mod=_19%7;if(mod==0){_19=_1a*5;}else{var adj=0;var _1b=_15.getDay();var _1c=_14.getDay();_1a=parseInt(_19/7);mod=_19%7;var _1d=new _6.date.islamic.Date(_15);_1d.setDate(_1d.getDate()+(_1a*7));var _1e=_1d.getDay();if(_19>0){switch(true){case _1b==5:adj=-1;break;case _1b==6:adj=0;break;case _1c==5:adj=-1;break;case _1c==6:adj=-2;break;case (_1e+mod)>5:adj=-2;}}else{if(_19<0){switch(true){case _1b==5:adj=0;break;case _1b==6:adj=1;break;case _1c==5:adj=2;break;case _1c==6:adj=1;break;case (_1e+mod)<0:adj=2;}}}_19+=adj;_19-=(_1a*2);}_18=_19;break;case "year":_18=_17;break;case "month":var _1f=(_14.toGregorian()>_15.toGregorian())?_14:_15;var _20=(_14.toGregorian()>_15.toGregorian())?_15:_14;var _21=_1f.getMonth();var _22=_20.getMonth();if(_17==0){_18=_1f.getMonth()-_20.getMonth();}else{_18=12-_22;_18+=_21;var i=_20.getFullYear()+1;var e=_1f.getFullYear();for(i;i<e;i++){_18+=12;}}if(_14.toGregorian()<_15.toGregorian()){_18=-_18;}break;case "week":_18=parseInt(_6.date.islamic.difference(_14,_15,"day")/7);break;case "day":_18/=24;case "hour":_18/=60;case "minute":_18/=60;case "second":_18/=1000;case "millisecond":_18*=_14.toGregorian().getTime()-_15.toGregorian().getTime();}return Math.round(_18);};}}};});