Можно ещё упростить:
function getFri(date) {
if(!date) date = new Date;
date.setMonth(date.getMonth() + 1, 0);
return date.getDate() + [-2, -3, -4, -5, -6, 0, -1][date.getDay()];
}
alert(getFri());
[-2, -3, -4, -5, -6, 0, -1][date.getDay()] можно ещё заменить на -(date.getDay() + 2)%7 но это не так наглядно.)