Your first issue is to get a date object in the correct time. The timezone "EST" is used in at least 3 different parts of the world for different time zones, but I'll assume you want the US EST of UTC-05:00.
Javascript date objects have a UTC timevalue at their heart, so you can get a local date object, subtract 5 hrs, then use the UTC methods to get values for the equivalent US EST timezone. Once you have that date object, you just need to get the week number per the answer here except that you should use UTC methods instead of plain date methods (e.g. getUTCFullYear rather than getFullYear).
Note that this will ignore daylight saving time at the client location and that EST does not indicate whether daylight saving is in force or not. It's usually given a different time zone designator (e.g. places that use US EST and also daylight saving call their timezone EDT, which will be UTC-04:00).
Here is some code that should do the job, note that it's only lightly tested. I decided to include the local timezone offset to make it consistent and probably easier to understand.
// Returns true or false if current date is
// an even week of the year in timezone UTC-5:00
// Adjust local date object to be UTC-5:00 object
// Provide a date object to test, or undefined for
// current date
function isPayWeek(d) {
d = d? new Date(d) : new Date();
// Adjust for local timezone and US EST in minutes
d.setMinutes(d.getMinutes() + d.getTimezoneOffset() - 300);
// return true if week number is even (note: zero is even)
return !(getWeekNumber(d)[1] % 2)
}
function getWeekNumber(d) {
d = new Date(d);
d.setHours(0,0,0);
d.setDate(d.getDate() + 4 - (d.getDay()||7));
var yearStart = new Date(d.getFullYear(),0,1);
var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7)
// Return array of year and week number
return [d.getFullYear(), weekNo];
}
var d = new Date(2013,0,20,20,0,0); // 2013-01-20T10:00:00Z
var w = getWeekNumber(d); // week 3, 2013
alert(d + '\n' + 'week: ' + w + '\n' + isPayWeek(d)); // false
var d = new Date(2012,11,31,20,0,0); // 2012-12-31T10:00:00Z
var w = getWeekNumber(d); // week 1, 2013
alert(d + '\n' + 'week: ' + w + '\n' + isPayWeek(d)); // false
var d = new Date(2013,0,7,20,0,0); // 2013-01-07T10:00:00Z
var w = getWeekNumber(d); // week 2, 2013
alert(d + '\n' + 'week: ' + w + '\n' + isPayWeek(d)); // true