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