//>>built
define("dojox/date/hebrew",["dojox/main","dojo/_base/lang","dojo/date","./hebrew/Date"],function(m,n,p,k){var h=n.getObject("date.hebrew",!0,m);h.getDaysInMonth=function(a){return a.getDaysInHebrewMonth(a.getMonth(),a.getFullYear())};h.compare=function(a,b,c){a instanceof k&&(a=a.toGregorian());b instanceof k&&(b=b.toGregorian());return p.compare.apply(null,arguments)};h.add=function(a,b,c){var e=new k(a);switch(b){case "day":e.setDate(a.getDate()+c);break;case "weekday":b=a.getDay();var d=0;0>c&&
6==b&&(b=5,d=-1);if(5>b+c&&0<=b+c)e.setDate(a.getDate()+c+d);else{var f=0<c?5:-1,g=0<c?2:-2;0<c&&(5==b||6==b)&&(d=4-b,b=4);var l=b+c-f;c=parseInt(l/5);l%=5;e.setDate(a.getDate()-b+g+7*c+d+l+f)}break;case "year":e.setFullYear(a.getFullYear()+c);break;case "week":c*=7;e.setDate(a.getDate()+c);break;case "month":b=a.getMonth();d=b+c;a.isLeapYear(a.getFullYear())||(5>b&&5<=d?d++:5<b&&5>=d&&d--);e.setMonth(d);break;case "hour":e.setHours(a.getHours()+c);break;case "minute":e._addMinutes(c);break;case "second":e._addSeconds(c);
break;case "millisecond":e._addMilliseconds(c)}return e};h.difference=function(a,b,c){b=b||new k;c=c||"day";var e=b.getFullYear()-a.getFullYear(),d=1;switch(c){case "weekday":d=Math.round(h.difference(a,b,"day"));c=parseInt(h.difference(a,b,"week"));if(0==d%7)d=5*c;else{e=0;var f=a.getDay(),g=b.getDay();c=parseInt(d/7);b=d%7;a=new k(a);a.setDate(a.getDate()+7*c);a=a.getDay();if(0<d)switch(!0){case 5==f:e=-1;break;case 6==f:e=0;break;case 5==g:e=-1;break;case 6==g:e=-2;break;case 5<a+b:e=-2}else if(0>
d)switch(!0){case 5==f:e=0;break;case 6==f:e=1;break;case 5==g:e=2;break;case 6==g:e=1;break;case 0>a+b:e=2}d=d+e-2*c}break;case "year":d=e;break;case "month":f=b.toGregorian()>a.toGregorian()?b:a;c=b.toGregorian()>a.toGregorian()?a:b;g=f.getMonth();d=c.getMonth();if(0==e)d=!b.isLeapYear(b.getFullYear())&&5<f.getMonth()&&5>=c.getMonth()?f.getMonth()-c.getMonth()-1:f.getMonth()-c.getMonth();else for(d=!c.isLeapYear(c.getFullYear())&&6>d?13-d-1:13-d,d+=!f.isLeapYear(f.getFullYear())&&5<g?g-1:g,e=c.getFullYear()+
1,f=f.getFullYear(),e;e<f;e++)d+=c.isLeapYear(e)?13:12;b.toGregorian()<a.toGregorian()&&(d=-d);break;case "week":d=parseInt(h.difference(a,b,"day")/7);break;case "day":d/=24;case "hour":d/=60;case "minute":d/=60;case "second":d/=1E3;case "millisecond":d*=b.toGregorian().getTime()-a.toGregorian().getTime()}return Math.round(d)};return h});