function highlightDays(date) {
    for (var i = 0; i < disabledDays.length; i++) {
    
       if($.inArray((m+1) + '-' + d + '-' + y,disabledDays) != -1 || new Date() > date) {
            return [true, 'specialDay'];
        }
    }
    return [true, ''];
}
function noWeekendsOrHolidays(date) {
  var noWeekend = jQuery.datepicker.noWeekends(date);
  return noWeekend[0] ? highlightDays(date) : noWeekend;
}


(function($) {
	$.datepick.regional['he'] = {
		monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני',
		'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],
		monthNamesShort: ['1','2','3','4','5','6',
		'7','8','9','10','11','12'],
		dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'],
		dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
		dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
		dateFormat: 'dd/mm/yyyy', firstDay: 0,
		renderer: $.datepick.defaultRenderer,
		prevText: '&#x3c;הקודם', prevStatus: '',
		prevJumpText: '&#x3c;&#x3c;', prevJumpStatus: '',
		nextText: 'הבא&#x3e;', nextStatus: '',
		nextJumpText: '&#x3e;&#x3e;', nextJumpStatus: '',
		currentText: 'היום', currentStatus: '',
		todayText: 'היום', todayStatus: '',
		clearText: 'נקה', clearStatus: '',
		closeText: 'סגור', closeStatus: '',
		yearStatus: '', monthStatus: '',
		weekText: 'Wk', weekStatus: '',
		dayStatus: 'DD, M d', defaultStatus: '',
		isRTL: true
	};
	$.datepick.setDefaults($.datepick.regional['he']);
})(jQuery);
$(function() {
	$('#popupDatepicker').datepick({ onDate: highlightDays,onSelect: showDate});
});
function highlightDays(date) { 
	var fulldate=(date.getDate())+'-'+(date.getMonth()+1)+'-'+date.getFullYear();
    return {selectable: true, dateClass: 'date'+fulldate, title: 'tooltip'};
}
function showDate(date){
	date=""+date;
	var datechars=date.split(" ");
	var month=datechars[1];
	var day=datechars[2];
	var browser=$('.currentbrowser').html();
	if(browser=='ie7')
	var year=datechars[5]; else
	var year=datechars[3];
if(month=='Jan') month=1;
if(month == 'Feb') month = '2';
if(month == 'Mar') month = '3';
if(month == 'Apr') month = '4';
if(month == 'May') month = '5';
if(month == 'Jun') month = '6';
if(month == 'Jul') month = '7';
if(month == 'Aug') month = '8';
if(month == 'Sep') month = '9';
if(month == 'Oct') month = '10';
if(month == 'Nov') month = '11';
if(month == 'Dec') month = '12';

var fulldater=day+'/'+month+'/'+year;
var found=false;

}
