function createSmallCalendar(){		var dateEndOfMonth = new Date(dateStartOfSmall.getFullYear(), dateStartOfSmall.getMonth()+1, 0);		startowy = new Date();		start = dateStartOfSmall.getTime() - ((7+dateStartOfSmall.getDay()-1) * (1000*60*60*24));		startowy.setTime(start);		var calendar = ''
		+'<table cols="7" cellspacing="0" cellpadding="3" style="-moz-user-select: none; cursor: pointer;" class="DP_monthtable" id="dp_0_tbl">'
		+'<tbody>'
		+'<tr id="dp_0_header" class="DP_heading">'
		+'<td class="DP_prev" id="dp_0_mhl" onmousedown="displayPreviousSmall()" unselectable="on" colspan="1">«</td>'
		+'<td class="DP_cur" id="dp_0_mhc" unselectable="on" colspan="5">'
		+'<span onmousedown="initMonthScheduler()">'+monthname[dateStartOfSmall.getMonth()]+' '+dateStartOfSmall.getFullYear()+'</span></td>'
		+'<td class="DP_next" id="dp_0_mhr" onmousedown="displayNextSmall()" unselectable="on" colspan="1">»</td></tr>';

		calendar += '<tr id="dp_0_dow" class="DP_days">'
		+'<td id="dp_0_day_0" class="DP_dayh" unselectable="on">P</td>'
		+'<td id="dp_0_day_1" class="DP_dayh" unselectable="on">W</td>'
		+'<td id="dp_0_day_2" class="DP_dayh" unselectable="on">S</td>'
		+'<td id="dp_0_day_3" class="DP_dayh" unselectable="on">C</td>'
		+'<td id="dp_0_day_4" class="DP_dayh" unselectable="on">P</td>'
		+'<td id="dp_0_day_5" class="DP_dayh" unselectable="on">S</td>'
		+'<td id="dp_0_day_6" class="DP_dayh" unselectable="on">N</td>'
		+'</tr>';

for(var i = 0; i<7; i++){
calendar +='<tr id="dp_0_week_'+i+'">';
for(var j = 0; j<7; j++){

var tmpDate = new Date();
var day = dateStartOfSmall.getDay();
if(day==0)day=7;
if(day>1){
	var time = dateStartOfSmall.getTime();
	time = time - (1000*60*60*24) * (day-1);
	tmpDate.setTime(time);
}

var dateStartOfWeek = new Date(tmpDate);

var dateEndOfWeek = new Date();
dateEndOfWeek.setTime(dateStartOfWeek.getTime()+(1000*60*60*24*6));


if(startowy.getMonth() == dateStartOfSmall.getMonth()){
	klasa = 'DP_onmonth';
}else{
	klasa ='DP_offmonth';
}

if(startowy.getDay() == 0 || startowy.getDay() == 6){
	if(startowy.getTime() >= dateStartOfWeek.getTime() && startowy.getTime() <= dateEndOfWeek.getTime()){
	klasa = klasa+' DP_weekend_selected';
	}else{
	klasa = klasa+' DP_weekend';
	}
}else{
	if(startowy.getTime() >= dateStartOfWeek.getTime() && startowy.getTime() <= dateEndOfWeek.getTime()){
	klasa = klasa+' DP_weekday_selected';
	}else{
	klasa = klasa+' DP_weekday';
	}
}

if(startowy.getTime() == dateStartOfSmall.getTime()){
	if(startowy.getTime() >= dateStartOfWeek.getTime() && startowy.getTime() <= dateEndOfWeek.getTime()){
	klasa = klasa+' DP_today_selected';
	}else{
	klasa = klasa+' DP_today';
	}
}else{
	klasa = klasa+'';
}



calendar +='<td unselectable="on" onclick="displayDaySmall(this)" class="'+klasa+'" id="dp_0_day_'+i+'_'+j+'">'+startowy.getDate()+'</td>';
time = startowy.getTime() + (1000*60*60*24);
startowy.setTime(time);
}
calendar +='</tr>';
}
calendar +='</tbody>';
calendar +='</table>';

smallScheduler_container.innerHTML = calendar;
}

function displayDaySmall(object){alert(object.id);}function initSmallScheduler(){smallScheduler_container = document.getElementById('dp_0');var tmpDate = new Date();var dateItems = initDateToShow.split(/\-/g);tmpDate.setFullYear(dateItems[0]);tmpDate.setDate(1);tmpDate.setMonth(dateItems[1]/1-1);tmpDate.setHours(0);tmpDate.setMinutes(0);tmpDate.setSeconds(0);dateStartOfSmall = new Date(tmpDate);createSmallCalendar();

}
function displayPreviousSmall(){dateStartOfSmall = new Date(dateStartOfSmall.getFullYear(), dateStartOfSmall.getMonth()-1, 1);createSmallCalendar();}function displayNextSmall() {dateStartOfSmall = new Date(dateStartOfSmall.getFullYear(), dateStartOfSmall.getMonth()+1, 1);createSmallCalendar();}function displayTodaySmall(){var tmpDate = new Date();var dateItems = initDateToShow.split(/\-/g);tmpDate.setFullYear(dateItems[0]);tmpDate.setDate(dateItems[2]/1);tmpDate.setMonth(dateItems[1]/1-1);tmpDate.setHours(1);tmpDate.setMinutes(0);tmpDate.setSeconds(0);var day = tmpDate.getDay();if(day==0)day=7;if(day>1){var time = tmpDate.getTime();time = time - (1000*60*60*24) * (day-1);tmpDate.setTime(time);}dateStartOfSmall = new Date(tmpDate);createSmallCalendar();}

