var giIntervalHeight = 17;
var oSchedule = new schedule(giIntervalHeight, iMedica.CalendarTemplateSlots.Display24HoursView, iMedica.CalendarTemplateSlots.DefaultColorScheme);

function fnInit()
{
	iMedica.CalendarTemplateSlots.Init(myBody);
}

function SetCalendarAttribute(str)
{
	var strArr = str.split(';');
	oSchedule.setCalendarAttribute(parseInt(strArr[0], 10), parseInt(strArr[1], 10), iMedica.CalendarTemplateSlots.DisplayInterval);
}

function SetCalendarTemplate(str)
{
	oSchedule.setCalendarTemplate(str);
}

function LoadXmlDayObject(sXmlDay)
{
	oSchedule.drawDayCustomize(sXmlDay);	
}

function EditDayDetail(iDay)
{
    iMedica.CalendarTemplateSlots.EditDayDetail(iDay);
}

function ConfigureCalendarTemplateEmptySlot(iDay, iTimeSlot)
{
	var iHour = iTimeSlot * iMedica.DrawSchedule.DisplayInterval / 60;
	var iMinute = iTimeSlot * iMedica.DrawSchedule.DisplayInterval % 60;
	if (!iMedica.CalendarTemplateSlots.Display24HoursView)
		iHour += oSchedule.iStartHr;
	var dApptDateTime = new Date();
	dApptDateTime.setHours(Math.floor(iHour));
	dApptDateTime.setMinutes(iMinute);	

	iMedica.CalendarTemplateSlots.ConfigureCalendarTemplateEmptySlot(getXMLFormattedDateTime(dApptDateTime), iDay);
}

function ConfigureCalendarTemplateAppointmentSlot(sCalendarTemplateSlotUid)
{
	iMedica.CalendarTemplateSlots.ConfigureCalendarTemplateAppointmentSlot(sCalendarTemplateSlotUid);
}