// user defined onchange handler
function cal_on_change_dummy(cal, object_code) {
	if (object_code == 'day') {
	    var org_formatted_date = cal.get_formatted_date() ;
// gperry: this is the formatted_date		1-29-2010
//		alert('gperry. move to url: ' + cal.get_formatted_date());
        var array_formatted_date = new Array();
        array_formatted_date = org_formatted_date.split('-');
		//my_formatted_date = 'http://haipo.co.il/forum/calendar.php?view=day&calD='+array_formatted_date[1]+'&calM='+array_formatted_date[0]+'&calY='+array_formatted_date[2] ;
	    my_formatted_date = 'http://haipo.co.il/events.php?mode=day&cat_id=1&calD='+array_formatted_date[1]+'&calM='+array_formatted_date[0]+'&calY='+array_formatted_date[2] ;
		
		http://haipo.co.il/golan/events_by_day.html?mode=cat&cat_id=4&calD=9&calM=2&calY=2010
		// gperry this is an example of required date: http://haipo.co.il/forum/calendar.php?view=day&calD=12&calM=2&calY=2010

      //  alert('gperry. move to url: ' + my_formatted_date);
		window.location = my_formatted_date ;
// gperry this will prevent the calendar to mark the selected date instead of the real date		cal.show_date();
	}
}


var cal_obj2 = null;

var format = '%j %M %Y %H:%i';

// user defined onclose handler
function cal3_on_close(cal) {
}


// embed calendars in page when page is loaded as otherwise IE could fail
// loading the page
function rc_body_onload() {

var div_cal1 = document.getElementById("cal1_div");
var div_cal1_pos = RichCalendar.get_obj_pos(div_cal1);

var cal_obj = new RichCalendar();
	cal_obj.auto_close = false;
	cal_obj.user_onchange_handler = cal_on_change_dummy;
// gperry	cal_obj.show(div_cal1_pos[0]+20, div_cal1_pos[1]);


var cal3_td = document.getElementById('cal3_td');

var cal_obj3 = new RichCalendar();
	cal_obj3.auto_close = false;
	cal_obj3.user_onchange_handler = cal_on_change_dummy;
	cal_obj3.user_onclose_handler = cal3_on_close;
    cal_obj3.show_at_element(cal3_td, "child");

}

//window.onload = rc_body_onload;
DOMReady.onDOMReadyHandler = rc_body_onload;
DOMReady.listenDOMReady();
