if(!window.DHTMLSuite)var DHTMLSuite = new Object();
DHTMLSuite.calendarLanguageModel = function(languageCode){
var monthArray;							// An array of months.
var monthArrayShort;					// An array of the months, short version
var dayArray;							// An array of the days in a week
var weekString;							// String representation of the string "Week"
var todayString;						// String representatinon of the string "Today"
var todayIsString;						// String representation of the string "Today is"
var timeString;							// String representation of the string "Time"
this.monthArray = new Array();
this.monthArrayShort = new Array();
this.dayArray = new Array();
if(!languageCode)languageCode = 'en';
this.languageCode = languageCode;
this.__setCalendarProperties();
}
DHTMLSuite.calendarLanguageModel.prototype = {
__setCalendarProperties:function(){
switch(this.languageCode){
case "fi": /* Finnish */
this.monthArray =['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kes&auml;kuu','Hein&auml;kuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'];
this.monthArrayShort = ['Tam','Hel','Maa','Huh','Tou','Kes','Hei','Elo','Syy','Lok','Mar','Jou'];
this.dayArray = ['Maa','Tii','Kes','Tor','Per','Lau','Sun'];
this.weekString = 'Viikko';
this.todayIsString = 'T&auml;n&auml;&auml;n on';
this.todayString = 'T&auml;n&auml;&auml;n';
this.timeString = 'Kello';
break;
case "ge":	/* German */
this.monthArray = ['Januar','Februar','Mï¿½rz','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'];
this.monthArrayShort = ['Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'];
this.dayArray = ['Mon','Die','Mit','Don','Fre','Sam','Son'];
this.weekString = 'Woche';
this.todayIsString = 'Heute';
this.todayString = 'Heute';
this.timeString = '';
break;
case "no":	/* Norwegian */
this.monthArray = ['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'];
this.monthArrayShort = ['Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Des'];
this.dayArray = ['Man','Tir','Ons','Tor','Fre','L&oslash;r','S&oslash;n'];
this.weekString = 'Uke';
this.todayIsString = 'Dagen i dag er';
this.todayString = 'I dag';
this.timeString = 'Tid';
break;
case "nl":	/* Dutch */
this.monthArray = ['Januari','Februari','Maart','April','Mei','Juni','Juli','Augustus','September','Oktober','November','December'];
this.monthArrayShort = ['Jan','Feb','Mar','Apr','Mei','Jun','Jul','Aug','Sep','Okt','Nov','Dec'];
this.dayArray = ['Ma','Di','Wo','Do','Vr','Za','Zo'];
this.weekString = 'Week';
this.todayIsString = 'Vandaag';
this.todayString = 'Vandaag';
this.timeString = '';
break;
case "es": /* Spanish */
this.monthArray = ['Enero','Febrero','Marzo','April','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'];
this.monthArrayShort =['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
this.dayArray = ['Lun','Mar','Mie','Jue','Vie','Sab','Dom'];
this.weekString = 'Semana';
this.todayIsString = 'Hoy es';
this.todayString = 'Hoy';
this.timeString = '';
break;
case "pt-br":  /* Brazilian portuguese (pt-br) */
this.monthArray = ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'];
this.monthArrayShort = ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'];
this.dayArray = ['Seg','Ter','Qua','Qui','Sex','S&aacute;b','Dom'];
this.weekString = 'Sem.';
this.todayIsString = 'Hoje &eacute;';
this.todayString = 'Hoje';
this.timeString = '';
break;
case "fr":	  /* French */
this.monthArray = ['Janvier','Fï¿½vrier','Mars','Avril','Mai','Juin','Juillet','Aoï¿½t','Septembre','Octobre','Novembre','Dï¿½cembre'];
this.monthArrayShort = ['Jan','Fev','Mar','Avr','Mai','Jun','Jul','Aou','Sep','Oct','Nov','Dec'];
this.dayArray = ['Lun','Mar','Mer','Jeu','Ven','Sam','Dim'];
this.weekString = 'Sem';
this.todayIsString = "Aujourd'hui";
this.todayString = 'Aujourd';
this.timeString = '';
break;
case "da": /*Danish*/
this.monthArray = ['januar','februar','marts','april','maj','juni','juli','august','september','oktober','november','december'];
this.monthArrayShort = ['jan','feb','mar','apr','maj','jun','jul','aug','sep','okt','nov','dec'];
this.dayArray = ['man','tirs','ons','tors','fre','l&oslash;r','s&oslash;n'];
this.weekString = 'Uge';
this.todayIsString = 'I dag er den';
this.todayString = 'I dag';
this.timeString = 'Tid';
break;
case "it":	/* Italian*/
this.monthArray = ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'];
this.monthArrayShort = ['Gen','Feb','Mar','Apr','Mag','Giu','Lugl','Ago','Set','Ott','Nov','Dic'];
this.dayArray = ['Lun','Mar','Mer','Gio','Ven','Sab','Dom'];
this.weekString = 'Sett';
this.todayIsString = 'Oggi &egrave; il';
this.todayString = 'Oggi &egrave; il';
this.timeString = '';
break;
case "sv":	/* Swedish */
this.monthArray = ['Januari','Februari','Mars','April','Maj','Juni','Juli','Augusti','September','Oktober','November','December'];
this.monthArrayShort = ['Jan','Feb','Mar','Apr','Maj','Jun','Jul','Aug','Sep','Okt','Nov','Dec'];
this.dayArray = ['M&aring;n','Tis','Ons','Tor','Fre','L&ouml;r','S&ouml;n'];
this.weekString = 'Vecka';
this.todayIsString = 'Idag &auml;r det den';
this.todayString = 'Idag &auml;r det den';
this.timeString = '';
break;
case "tr":   /* Turkish */
this.monthArray=['Ocak','Þubat','Mart','Nisan','Mayýs','Haziran','Temmuz','Aðustos','Eylül','Ekim','Kasým','Aralýk'];
this.monthArrayShort=['Oca','Þub','Mar','Nis','May','Haz','Tem','Aðu','Eyl','Eki','Kas','Ara'];
this.dayArray=['Pts','Sal','Çar','Per','Cum','Cmt','Paz'];
this.weekString='Hafta';
this.todayIsString='';
this.todayString='Bugün';
this.timeString='Saat';
break;
default:	/* English */
this.monthArray = ['January','February','March','April','May','June','July','August','September','October','November','December'];
this.monthArrayShort = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
this.dayArray = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'];
this.weekString = 'Week';
this.todayIsString = '';
this.todayString = 'Today';
this.timeString = 'Time';
break;
}
}
}
DHTMLSuite.calendarModel = function(inputArray){
var initialDay;							// Initial day (i.e. day in month)
var initialMonth;						// Initial month(1-12)
var initialYear;						// Initial Year(4 digits)
var initialHour;						// Initial Hour(0-23)
var initialMinute;						// Initial Minute
var displayedDay;						// Currently displayed day
var displayedMonth;						// Currently displayed month
var displayedYear;						// Current displayed year
var displayedMinute;					// Currently displayed Minute
var displayedHour;						// Current displayed Hour
var languageCode;						// Current language code
var languageModel;						// Reference to object of class DHTMLSuite.calendarLanguageModel
var invalidDateRange;					// Array of invalid date ranges
var weekStartsOnMonday;					// Should the week start on monday?
this.weekStartsOnMonday = true;	// Default - start week on monday
this.languageCode = 'en';
this.invalidDateRange = new Array();
this.__createDefaultModel(inputArray);
}
DHTMLSuite.calendarModel.prototype =
{
setCallbackFunctionOnMonthChange:function(functionName){
this.callbackFunctionOnMonthChange = functionName;
}
,
addInvalidDateRange:function(fromDateAsArray,toDateAsArray){
var index = this.invalidDateRange.length;
this.invalidDateRange[index] = new Object();
if(fromDateAsArray){
fromDateAsArray.day = fromDateAsArray.day + '';
fromDateAsArray.month = fromDateAsArray.month + '';
fromDateAsArray.year = fromDateAsArray.year + '';
if(!fromDateAsArray.month)fromDateAsArray.month = fromDateAsArray.month='1';
if(!fromDateAsArray.day)fromDateAsArray.day = fromDateAsArray.day='1';
if(fromDateAsArray.day.length==1)fromDateAsArray.day = '0' + fromDateAsArray.day;
if(fromDateAsArray.month.length==1)fromDateAsArray.month = '0' + fromDateAsArray.month;
this.invalidDateRange[index].fromDate = fromDateAsArray.year + fromDateAsArray.month + fromDateAsArray.day;
}else{
this.invalidDateRange[index].fromDate = false;
}
if(toDateAsArray){
toDateAsArray.day = toDateAsArray.day + '';
toDateAsArray.month = toDateAsArray.month + '';
toDateAsArray.year = toDateAsArray.year + '';
if(!toDateAsArray.month)toDateAsArray.month = toDateAsArray.month='1';
if(!toDateAsArray.day)toDateAsArray.day = toDateAsArray.day='1';
if(toDateAsArray.day.length==1)toDateAsArray.day = '0' + toDateAsArray.day;
if(toDateAsArray.month.length==1)toDateAsArray.month = '0' + toDateAsArray.month;
this.invalidDateRange[index].toDate = toDateAsArray.year + toDateAsArray.month + toDateAsArray.day;
}else{
this.invalidDateRange[index].toDate = false;
}
}
,
isDateWithinValidRange:function(inputDate){
if(this.invalidDateRange.length==0)return true;
var month = inputDate.month+'';
if(month.length==1)month = '0' + month;
var day = inputDate.day+'';
if(day.length==1)day = '0' + day;
var dateToCheck = inputDate.year + month + day;
for(var no=0;no<this.invalidDateRange.length;no++){
if(!this.invalidDateRange[no].fromDate && this.invalidDateRange[no].toDate>=dateToCheck)return false;
if(!this.invalidDateRange[no].toDate && this.invalidDateRange[no].fromDate<=dateToCheck)return false;
if(this.invalidDateRange[no].fromDate<=dateToCheck && this.invalidDateRange[no].toDate>=dateToCheck)return false;
}
return true;
}
,
setInitialDateFromInput:function(inputReference,format){
if(inputReference.value.length>0){
if(!format.match(/^[0-9]*?$/gi)){
var items = inputReference.value.split(/[^0-9]/gi);
var positionArray = new Object();
positionArray.m = format.indexOf('mm');
if(positionArray.m==-1)positionArray.m = format.indexOf('m');
positionArray.d = format.indexOf('dd');
if(positionArray.d==-1)positionArray.d = format.indexOf('d');
positionArray.y = format.indexOf('yyyy');
positionArray.h = format.indexOf('hh');
positionArray.i = format.indexOf('ii');
var positionArrayNumeric = Array();
positionArrayNumeric[0] = positionArray.m;
positionArrayNumeric[1] = positionArray.d;
positionArrayNumeric[2] = positionArray.y;
positionArrayNumeric[3] = positionArray.h;
positionArrayNumeric[4] = positionArray.i;
positionArrayNumeric = positionArrayNumeric.sort(this.__calendarSortItems);
var itemIndex = -1;
this.initialHour = '00';
this.initialMinute = '00';
for(var no=0;no<positionArrayNumeric.length;no++){
if(positionArrayNumeric[no]==-1)continue;
itemIndex++;
if(positionArrayNumeric[no]==positionArray['m']){
this.initialMonth = items[itemIndex];
continue;
}
if(positionArrayNumeric[no]==positionArray['y']){
this.initialYear = items[itemIndex];
continue;
}
if(positionArrayNumeric[no]==positionArray['d']){
tmpDay = items[itemIndex];
continue;
}
if(positionArrayNumeric[no]==positionArray['h']){
this.initialHour = items[itemIndex];
continue;
}
if(positionArrayNumeric[no]==positionArray['i']){
this.initialMinute = items[itemIndex];
continue;
}
}
this.initialMonth = this.initialMonth / 1;
tmpDay = tmpDay / 1;
this.initialDay = tmpDay;
}else{
var monthPos = format.indexOf('mm');
this.initialMonth = inputReference.value.substr(monthPos,2)/1;
var yearPos = format.indexOf('yyyy');
this.initialYear = inputReference.value.substr(yearPos,4);
var dayPos = format.indexOf('dd');
tmpDay = inputReference.value.substr(dayPos,2);
this.initialDay = tmpDay;
var hourPos = format.indexOf('hh');
if(hourPos>=0){
tmpHour = inputReference.value.substr(hourPos,2);
this.initialHour = tmpHour;
}else{
this.initialHour = '00';
}
var minutePos = format.indexOf('ii');
if(minutePos>=0){
tmpMinute = inputReference.value.substr(minutePos,2);
this.initialMinute = tmpMinute;
}else{
this.initialMinute = '00';
}
}
}
this.__setDisplayedDateToInitialData();
}
,
__setDisplayedDateToInitialData:function(){
this.displayedYear = this.initialYear;
this.displayedMonth = this.initialMonth;
this.displayedDay = this.initialDay;
this.displayedHour = this.initialHour;
this.displayedMinute = this.initialMinute;
}
,
__calendarSortItems:function(a,b){
return a/1 - b/1;
}
,
setWeekStartsOnMonday:function(weekStartsOnMonday){
this.weekStartsOnMonday = weekStartsOnMonday;
}
,
setLanguageCode:function(languageCode){
this.languageModel = new DHTMLSuite.calendarLanguageModel(languageCode);	// Default english language model
}
,
__isLeapYear:function(inputYear){
if(inputYear%400==0||(inputYear%4==0&&inputYear%100!=0)) return true;
return false;
}
,
getWeekStartsOnMonday:function(){
return this.weekStartsOnMonday;
}
,
__createDefaultModel:function(inputArray){
var d = new Date();
this.initialYear = d.getFullYear();
this.initialMonth = d.getMonth() + 1;
this.initialDay = d.getDate();
this.initialHour = d.getHours();
if(inputArray){	/* Initial date data sent to the constructor ? */
if(inputArray.initialYear)this.initialYear = inputArray.initialYear;
if(inputArray.initialMonth)this.initialMonth = inputArray.initialMonth;
if(inputArray.initialDay)this.initialDay = inputArray.initialDay;
if(inputArray.initialHour)this.initialHour = inputArray.initialHour;
if(inputArray.initialMinute)this.initialMinute = inputArray.initialMinute;
if(inputArray.languageCode)this.languageCode = inputArray.languageCode;
}
this.displayedYear = this.initialYear;
this.displayedMonth = this.initialMonth;
this.displayedDay = this.initialDay;
this.displayedHour = this.initialHour;
this.displayedMinute = this.initialMinute;
this.languageModel = new DHTMLSuite.calendarLanguageModel();	// Default english language model
}
,
__getDisplayedDay:function(){
return this.displayedDay;
}
,
__getDisplayedHourWithLeadingZeros:function(){
var retVal = this.__getDisplayedHour()+'';
if(retVal.length==1)retVal = '0' + retVal;
return retVal;
}
,
__getDisplayedMinuteWithLeadingZeros:function(){
var retVal = this.__getDisplayedMinute()+'';
if(retVal.length==1)retVal = '0' + retVal;
return retVal;
}
,
__getDisplayedDayWithLeadingZeros:function(){
var retVal = this.__getDisplayedDay()+'';
if(retVal.length==1)retVal = '0' + retVal;
return retVal;
}
,
__getDisplayedMonthNumberWithLeadingZeros:function(){
var retVal = this.__getDisplayedMonthNumber()+'';
if(retVal.length==1)retVal = '0' + retVal;
return retVal;
}
,
__getDisplayedYear:function(){
return this.displayedYear;
}
,
__getDisplayedHour:function(){
if(!this.displayedHour)this.displayedHour = 0;
return this.displayedHour;
}
,
__getDisplayedMinute:function(){
if(!this.displayedMinute)this.displayedMinute = 0;
return this.displayedMinute;
}
,
__getDisplayedMonthNumber:function(){
return this.displayedMonth;
}	,
__getInitialDay:function(){
return this.initialDay;
}
,
__getInitialYear:function(){
return this.initialYear;
}
,
__getInitialMonthNumber:function(){
return this.initialMonth;
}
,
__getMonthNameByMonthNumber:function(monthNumber){
return this.languageModel.monthArray[monthNumber-1];
}
,
__moveOneYearBack:function(){
this.displayedYear--;
}
,
__moveOneYearForward:function(){
this.displayedYear++;
}
,
__moveOneMonthBack:function(){
this.displayedMonth--;
if(this.displayedMonth<1){
this.displayedMonth = 12;
this.displayedYear--;
}
}
,
__moveOneMonthForward:function(){
this.displayedMonth++;
if(this.displayedMonth>12){
this.displayedMonth=1;
this.displayedYear++;
}
}
,
__setDisplayedYear:function(year){
var success = year!=this.displayedYear;
this.displayedYear = year;
return success
}
,
__setDisplayedMonth:function(month){
var success = month!=this.displayedMonth;
this.displayedMonth = month;
return success;
}
,
__setDisplayedDay:function(day){
this.displayedDay = day;
}
,
__setDisplayedHour:function(hour){
this.displayedHour = hour/1;
}
,
__setDisplayedMinute:function(minute){
this.displayedMinute = minute/1;
}
,
__getPreviousYearAndMonthAsArray:function(){
var month = this.displayedMonth-1;
var year = this.displayedYear;
if(month==0){
month = 12;
year = year-1;
}
var retArray = [year,month];
return retArray;
}
,
__getNumberOfDaysInCurrentDisplayedMonth:function(){
return this.__getNumberOfDaysInAMonthByMonthAndYear(this.displayedYear,this.displayedMonth);
}
,
__getNumberOfDaysInAMonthByMonthAndYear:function(year,month){
var daysInMonthArray = [31,28,31,30,31,30,31,31,30,31,30,31];
var daysInMonth = daysInMonthArray[month-1];
if(daysInMonth==28){
if(this.__isLeapYear(year))daysInMonth=29;
}
return daysInMonth/1;
}
,
__getStringWeek:function(){
return this.languageModel.weekString;
}
,
__getDaysMondayToSunday:function(){
return this.languageModel.dayArray;
}
,
__getDaysSundayToSaturday:function(){
var retArray = this.languageModel.dayArray.concat();
var lastDay = new Array(retArray[retArray.length-1]);
retArray.pop();
return lastDay.concat(retArray);
}
,
__getWeekNumberFromDayMonthAndYear:function(year,month,day){
day = day/1;
year = year /1;
month = month/1;
if(!this.weekStartsOnMonday)return this.__getWeekNumberFromDayMonthAndYear_S(year,month,day);
var a = Math.floor((14-(month))/12);
var y = year+4800-a;
var m = (month)+(12*a)-3;
var jd = day + Math.floor(((153*m)+2)/5) +
(365*y) + Math.floor(y/4) - Math.floor(y/100) +
Math.floor(y/400) - 32045;	  // (gregorian calendar)
var d4 = (jd+31741-(jd%7))%146097%36524%1461;
var L = Math.floor(d4/1460);
var d1 = ((d4-L)%365)+L;
NumberOfWeek = Math.floor(d1/7) + 1;
return NumberOfWeek;
}
,
__getWeekNumberFromDayMonthAndYear_S:function(year,month,day){
month--;
now = Date.UTC(year,month,day+1,0,0,0);
var firstDay = new Date();
firstDay.setYear(year);
firstDay.setMonth(0);
firstDay.setDate(1);
then = Date.UTC(year,0,1,0,0,0);
var Compensation = firstDay.getDay();
if (Compensation > 3) Compensation -= 4;
else Compensation += 3;
NumberOfWeek =  Math.round((((now-then)/86400000)+Compensation)/7);
return NumberOfWeek;
}
,
__getDayNumberFirstDayInYear:function(year){
var d = new Date();
d.setFullYear(year);
d.setDate(1);
d.setMonth(0);
return d.getDay();
}
,
__getRemainingDaysInPreviousMonthAsArray:function(){
var d = new Date();
d.setFullYear(this.displayedYear);
d.setDate(1);
d.setMonth(this.displayedMonth-1);
var dayStartOfMonth = d.getDay();
if(this.weekStartsOnMonday){
if(dayStartOfMonth==0)dayStartOfMonth=7;
dayStartOfMonth--;
}
var previousMonthArray = this.__getPreviousYearAndMonthAsArray();
var daysInPreviousMonth = this.__getNumberOfDaysInAMonthByMonthAndYear(previousMonthArray[0],previousMonthArray[1]);
var returnArray = new Array();
for(var no=0;no<dayStartOfMonth;no++){
returnArray[returnArray.length] = daysInPreviousMonth-dayStartOfMonth+no+1;
}
return returnArray;
}
,
__getMonthNames:function(){
return this.languageModel.monthArray;
}
,
__getTodayAsString:function(){
return this.languageModel.todayString;
}
,
__getTimeAsString:function(){
return this.languageModel.timeString;
}
}
DHTMLSuite.calendar = function(propertyArray){
var id;								// Unique identifier - optional
var divElement;
var divElContent;	// Div element for the content inside the calendar
var divElHeading;
var divElNavBar;
var divElMonthView;			// Div for the main view - weeks, days, months etc.
var divElMonthNInHead;
var divElYearInHeading;
var divElBtnPreviousYear;		// Button - previous year
var divElBtnNextYear;			// Button - next year
var divElBtnPrvMonth;		// Button - previous Month
var divElBtnNextMonth;			// Button - next Month
var divElYearDropdown;			// Dropdown box - years
var divElYearDropdownParentYears;	// Inner div inside divElYearDropdown which is parent to all the small year divs.
var divElHourDropdownParentHours;	// Inner div inside divElYearDropdown which is parent to all the small year hours.
var divElHourDropdown;			// Drop down hours
var divElMinuteDropdownParent;	// Inner div inside divElYearDropdown which is parent to all the small year Minutes.
var divElMinuteDropdown;			// Drop down Minutes
var divElTodayInNavBar;	// Today in navigation bar.
var divElHrInTimeBar;		// Div for hour in timer bar
var divElMinInTimeBar;		// Div for minute in timer bar
var divElTimeStringInTimeBar;		// Div for "Time" string in timer bar
var iframeEl;
var iframeElDropDowns;
var calendarModelReference;			// Reference to object of class calendarModel
var objectIndex;
var targetReference;				// Where to insert the calendar.
var layoutCSS;
var isDragable;						// Is the calendar dragable - default = false
var referenceToDragDropObject;		// Reference to object of class DHTMLSuite.dragDropSimple
var scrollInYearDropDownActive;		// true when mouse is over up and down arrows in year dropdown
var scrollInHourDropDownActive;		// true when mouse is over up and down arrows in hour dropdown
var scrollInMinuteDropDownActive;		// true when mouse is over up and down arrows in minute dropdown
var yearDropDownOffsetInYear;		// Offset in year relative to current displayed year.
var hourDropDownOffsetInHour;		// Offset in hours relative to current displayed hour.
var minuteDropDownOffsetInHour;		// Offset in minute relative to current displayed minute.
var displayCloseButton;					// Display close button at the top right corner
var displayNavigationBar;				// Display the navigation bar ? ( default = true)
var displayTodaysDateInNavigationBar;	// Display the string "Today" in the navigation bar(default = true)
var displayTimeBar;					// Display timer bar - default = false;
var posRefToHtmlEl;	// reference to html element to position the calendar at
var positioningOffsetXInPixels;			// Offset in positioning when positioning calendar at a element
var positioningOffsetYInPixels;			// Offset in positioning when positioning calendar at a element
var htmlElementReferences;
var minuteDropDownInterval;				// Minute drop down interval(interval between each row in the minute drop down list)
var numberOfRowsInMinuteDropDown;		// Number of rows in minute drop down. (default = 10)
var numberOfRowsInHourDropDown;			// Number of rows in hour drop down. (default = 10)
var numberOfRowsInYearDropDown;			// Number of rows in year drop down. (default = 10)
this.displayTimeBar = false;
this.minuteDropDownInterval = 5;
this.htmlElementReferences = new Object();
this.posRefToHtmlEl = false;
this.displayCloseButton = true;		// Default value - close button visible at the top right corner.
this.displayNavigationBar = true;
this.displayTodaysDateInNavigationBar = true;
this.yearDropDownOffsetInYear = 0;
this.hourDropDownOffsetInHour = 0;
this.minuteDropDownOffsetInHour = 0;
this.minuteDropDownOffsetInMinute = 0;
this.layoutCSS = 'calendar.css';
this.isDragable = false;
this.scrollInYearDropDownActive = false;
this.scrollInHourDropDownActive = false;
this.scrollInMinuteDropDownActive = false;
this.numberOfRowsInMinuteDropDown = 10;
this.numberOfRowsInHourDropDown = 10;
this.numberOfRowsInYearDropDown = 10;
var callbackFunctionOnDayClick;			// Name of call back function to call when you click on a day
var callbackFunctionOnClose;			// Name of call back function to call when the calendar is closed.
var callbackFunctionOnMonthChange;		// Name of call back function to call when the month is changed in the view
var dateOfToday;
this.dateOfToday = new Date();
try{
if(!standardObjectsCreated)DHTMLSuite.createStandardObjects();	// This line starts all the init methods
}catch(e){
alert('You need to include the dhtmlSuite-common.js file');
}
this.objectIndex = DHTMLSuite.variableStorage.arrayDSObjects.length;
DHTMLSuite.variableStorage.arrayDSObjects[this.objectIndex] = this;
if(propertyArray)this.__setInitialData(propertyArray);
}
DHTMLSuite.calendar.prototype =
{
setCallbackFunctionOnDayClick:function(functionName){
this.callbackFunctionOnDayClick = functionName;
}
,
setCallbackFunctionOnMonthChange:function(functionName){
if(!this.calendarModelReference){
this.calendarModelReference = new DHTMLSuite.calendarModel();
}
this.callbackFunctionOnMonthChange = functionName;
}
,
setCallbackFunctionOnClose:function(functionName){
this.callbackFunctionOnClose = functionName;
}
,
setCalendarModelReference:function(calendarModelReference){
this.calendarModelReference = calendarModelReference;
}
,
setCalendarPositionByHTMLElement:function(refToHtmlEl,offsetXInPx,offsetYInPx){
refToHtmlEl = DHTMLSuite.commonObj.getEl(refToHtmlEl);
this.posRefToHtmlEl = refToHtmlEl;
if(!offsetXInPx)offsetXInPx = 0;
if(!offsetYInPx)offsetYInPx = 0;
this.positioningOffsetXInPixels = offsetXInPx;
this.positioningOffsetYInPixels = offsetYInPx;
}
,
addHtmlElementReference:function(key,referenceToHtmlEl){
referenceToHtmlEl = DHTMLSuite.commonObj.getEl(referenceToHtmlEl);
if(key){
this.htmlElementReferences[key] = referenceToHtmlEl;
}
}
,
getHtmlElementReferences:function(){
return this.htmlElementReferences;
}
,
setDisplayCloseButton:function(displayCloseButton){
this.displayCloseButton = displayCloseButton;
}
,
setTargetReference:function(targetRef){
targetRef = DHTMLSuite.commonObj.getEl(targetRef);
this.targetReference = targetRef;
}
,
setIsDragable:function(isDragable){
this.isDragable = isDragable;
}
,
resetViewDisplayedMonth:function(){
if(!this.divElement)return;
if(!this.calendarModelReference){
this.calendarModelReference = new DHTMLSuite.calendarModel();
}
this.calendarModelReference.__setDisplayedDateToInitialData();
this.__populateCalHeading();	// Populate heading with data
this.__populateMonthView();	// Populate month view with month data
}
,
setLayoutCss:function(nameOfCssFile){
this.layoutCSS = nameOfCssFile;
}
,
__init:function(){
if(!this.divElement){
DHTMLSuite.commonObj.loadCSS(this.layoutCSS);	// Load css
if(!this.calendarModelReference){
this.calendarModelReference = new DHTMLSuite.calendarModel();
}
this.__createMainHtmlEls();	// Create main html elements for the calendar
this.__createHeadingElements();	// Create html elements for the heading
this.__createNavigationBar();	// Create the navigation bar below the heading.
this.__populateNavigationBar();	// Fill navigation bar with todays date.
this.__populateCalHeading();	// Populate heading with data
this.__createCalMonthView();	// Create div element for the main view, i.e. days, weeks months, etc.
this.__populateMonthView();	// Populate month view with month data
this.__createTimeBar();				// Create div elements for the timer bar.
this.__populateTimeBar();			// Populate the timer bar
this.__createDropDownYears();
this.__populateDropDownYears();
this.__positionDropDownYears();
this.__createDropDownMonth();
this.__populateDropDownMonths();
this.__positionDropDownMonths();
this.__createDropDownHours();
this.__populateDropDownHours();
this.__positionDropDownHours();
this.__createDropDownMinutes();
this.__populateDropDownMinutes();
this.__positionDropDownMinutes();
this.__addEvents();
}else{
this.divElement.style.display = 'block';
this.__populateCalHeading();	// Populate heading with data
this.__populateMonthView();	// Populate month view with month data
}
this.__resizePrimaryiframeEl();
}
,
display:function(){
if(!this.divElement)this.__init();
this.__positionCalendar();
this.divElement.style.display='block';
this.__resizePrimaryiframeEl();
}
,
hide:function(){
if(this.__handleCalendarCallBack('calendarClose')===false)return false;
this.divElement.style.display='none';
this.divElYearDropdown.style.display='none';
this.divElMonthDropdown.style.display='none';
}
,
isVisible:function(){
if(!this.divElement)return false;
return this.divElement.style.display=='block'?true:false;
}
,
setInitialDateFromInput:function(inputReference,format){
if(!this.calendarModelReference){
this.calendarModelReference = new DHTMLSuite.calendarModel();
}
this.calendarModelReference.setInitialDateFromInput(inputReference,format);
}
,
setDisplayedYear:function(year){
var success = this.calendarModelReference.__setDisplayedYear(year);	// Year has actually changed
this.__populateCalHeading();
this.__populateMonthView();
if(success)this.__handleCalendarCallBack('monthChange');
}
,
setDisplayedMonth:function(month){
var success = this.calendarModelReference.__setDisplayedMonth(month);	// Month have actually changed
this.__populateCalHeading();
this.__populateMonthView();
if(success)this.__handleCalendarCallBack('monthChange');
}
,
setDisplayedHour:function(hour){
this.calendarModelReference.__setDisplayedHour(hour);	// Month have actually changed
this.__populateTimeBar();
}
,
setDisplayedMinute:function(minute){
this.calendarModelReference.__setDisplayedMinute(minute);	// Month have actually changed
this.__populateTimeBar();
}
,
__createDropDownMonth:function(){
this.divElMonthDropdown = document.createElement('DIV');
this.divElMonthDropdown.style.display='none';
this.divElMonthDropdown.className = 'DHTMLSuite_calendar_monthDropDown';
document.body.appendChild(this.divElMonthDropdown);
}
,
__populateDropDownMonths:function(){
this.divElMonthDropdown.innerHTML = '';	// Initially clearing drop down.
var ind = this.objectIndex;	// Get a reference to this object in the global object array.
var months = this.calendarModelReference.__getMonthNames();	// Get an array of month name according to current language settings
for(var no=0;no<months.length;no++){	// Loop through names
var div = document.createElement('DIV');	// Create div element
div.className = 'DHTMLSuite_calendar_dropDownAMonth';
if((no+1)==this.calendarModelReference.__getDisplayedMonthNumber())div.className = 'DHTMLSuite_calendar_yearDropDownCurrentMonth';	// Highlight current month.
div.innerHTML = months[no];	// Set text of div
div.id = 'DHTMLSuite_calendarMonthPicker' + (no+1);	// Set id of div. this is used inside the __setMonthFromDropdown in order to pick up the date.
div.onmouseover = this.__mouseoverMonthInDropDown;
div.onmouseout = this.__mouseoutMonthInDropDown;
div.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__setMonthFromDropdown(e); }
this.divElMonthDropdown.appendChild(div);
DHTMLSuite.commonObj.__addEventEl(div);
}
}
,
__createDropDownYears:function(){
this.divElYearDropdown = document.createElement('DIV');
this.divElYearDropdown.style.display='none';
this.divElYearDropdown.className = 'DHTMLSuite_calendar_yearDropDown';
document.body.appendChild(this.divElYearDropdown);
}
,
__createDropDownHours:function(){
this.divElHourDropdown = document.createElement('DIV');
this.divElHourDropdown.style.display='none';
this.divElHourDropdown.className = 'DHTMLSuite_calendar_hourDropDown';
document.body.appendChild(this.divElHourDropdown);
}
,
__createDropDownMinutes:function(){
this.divElMinuteDropdown = document.createElement('DIV');
this.divElMinuteDropdown.style.display='none';
this.divElMinuteDropdown.className = 'DHTMLSuite_calendar_minuteDropDown';
document.body.appendChild(this.divElMinuteDropdown);
}
,
__populateDropDownMinutes:function(){
var ind = this.objectIndex;
this.divElMinuteDropdown.innerHTML = '';
var divPrevious = document.createElement('DIV');
divPrevious.className = 'DHTMLSuite_calendar_dropDown_arrowUp';
divPrevious.onmouseover = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoverUpAndDownArrowsInDropDownMinutes(e); } ;
divPrevious.onmouseout =function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoutUpAndDownArrowsInDropDownMinutes(e); } ;
this.divElMinuteDropdown.appendChild(divPrevious);
DHTMLSuite.commonObj.__addEventEl(divPrevious);
this.divElMinuteDropdownParent = document.createElement('DIV');
this.divElMinuteDropdown.appendChild(this.divElMinuteDropdownParent);
this.__populateMinutesInsideDropDownMinutes(this.divElMinuteDropdownParent);
var divNext = document.createElement('DIV');
divNext.className = 'DHTMLSuite_calendar_dropDown_arrowDown';
divNext.innerHTML = '<span></span>';
divNext.onmouseover = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoverUpAndDownArrowsInDropDownMinutes(e); } ;
divNext.onmouseout =function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoutUpAndDownArrowsInDropDownMinutes(e); } ;
DHTMLSuite.commonObj.__addEventEl(divNext);
this.divElMinuteDropdown.appendChild(divNext);
if(60 / this.minuteDropDownInterval	< this.numberOfRowsInMinuteDropDown){
divPrevious.style.display='none';
divNext.style.display='none';
}
}
,
__populateMinutesInsideDropDownMinutes:function(){
var ind = this.objectIndex;
this.divElMinuteDropdownParent.innerHTML = '';
if(60 / this.minuteDropDownInterval	< this.numberOfRowsInMinuteDropDown){
startMinute=0;
}else{
var startMinute = Math.max(0,(this.calendarModelReference.__getDisplayedMinute()-Math.round(this.numberOfRowsInMinuteDropDown/2)));
startMinute+=(this.minuteDropDownOffsetInMinute*this.minuteDropDownInterval)
if(startMinute<0){	/* Start minute negative - adjust it and change offset value */
startMinute+=this.minuteDropDownInterval;
this.minuteDropDownOffsetInMinute++;
}
if(startMinute + (this.numberOfRowsInMinuteDropDown * this.minuteDropDownInterval) >60){	/* start minute in drop down + number of records shown * interval larger than 60 -> adjust it */
startMinute-=this.minuteDropDownInterval;
this.minuteDropDownOffsetInMinute--;
}
}
for(var no=startMinute;no<Math.min(60,startMinute+this.numberOfRowsInMinuteDropDown*(this.minuteDropDownInterval));no+=this.minuteDropDownInterval){
var div = document.createElement('DIV');
div.className = 'DHTMLSuite_calendar_dropDownAMinute';
if(no==this.calendarModelReference.__getDisplayedMinute())div.className = 'DHTMLSuite_calendar_minuteDropDownCurrentMinute';
var prefix = "";
if(no<10)prefix = "0";
div.innerHTML = prefix + no;
div.onmouseover = this.__mouseoverMinuteInDropDown;
div.onmouseout = this.__mouseoutMinuteInDropDown;
div.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__setMinuteFromDropdown(e); }
this.divElMinuteDropdownParent.appendChild(div);
DHTMLSuite.commonObj.__addEventEl(div);
}
}
,
__populateDropDownHours:function(){
var ind = this.objectIndex;
this.divElHourDropdown.innerHTML = '';
var div = document.createElement('DIV');
div.className = 'DHTMLSuite_calendar_dropDown_arrowUp';
div.onmouseover = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoverUpAndDownArrowsInDropDownHours(e); } ;
div.onmouseout =function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoutUpAndDownArrowsInDropDownHours(e); } ;
this.divElHourDropdown.appendChild(div);
DHTMLSuite.commonObj.__addEventEl(div);
this.divElHourDropdownParentHours = document.createElement('DIV');
this.divElHourDropdown.appendChild(this.divElHourDropdownParentHours);
this.__populateHoursInsideDropDownHours(this.divElHourDropdownParentHours);
var div = document.createElement('DIV');
div.className = 'DHTMLSuite_calendar_dropDown_arrowDown';
div.innerHTML = '<span></span>';
div.onmouseover = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoverUpAndDownArrowsInDropDownHours(e); } ;
div.onmouseout =function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoutUpAndDownArrowsInDropDownHours(e); } ;
DHTMLSuite.commonObj.__addEventEl(div);
this.divElHourDropdown.appendChild(div);
}
,
__populateHoursInsideDropDownHours:function(){
var ind = this.objectIndex;
this.divElHourDropdownParentHours.innerHTML = '';
var startHour = Math.max(0,(this.calendarModelReference.__getDisplayedHour()-Math.round(this.numberOfRowsInHourDropDown/2)));
startHour = Math.min(14,startHour);
if((startHour + this.hourDropDownOffsetInHour + this.numberOfRowsInHourDropDown)>24){
this.hourDropDownOffsetInHour = (24-startHour-this.numberOfRowsInHourDropDown);
}
if((startHour + this.hourDropDownOffsetInHour)<0){
this.hourDropDownOffsetInHour = startHour*-1;
}
startHour+=this.hourDropDownOffsetInHour;
if(startHour<0)startHour = 0;
if(startHour>(24-this.numberOfRowsInHourDropDown))startHour = (24-this.numberOfRowsInHourDropDown);
for(var no=startHour;no<startHour+this.numberOfRowsInHourDropDown;no++){
var div = document.createElement('DIV');
div.className = 'DHTMLSuite_calendar_dropDownAnHour';
if(no==this.calendarModelReference.__getDisplayedHour())div.className = 'DHTMLSuite_calendar_hourDropDownCurrentHour';
var prefix = "";
if(no<10)prefix = "0";
div.innerHTML = prefix + no;
div.onmouseover = this.__mouseoverHourInDropDown;
div.onmouseout = this.__mouseoutHourInDropDown;
div.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__setHourFromDropdown(e); }
this.divElHourDropdownParentHours.appendChild(div);
DHTMLSuite.commonObj.__addEventEl(div);
}
}
,
__populateDropDownYears:function(){
var ind = this.objectIndex;
this.divElYearDropdown.innerHTML = '';
var div = document.createElement('DIV');
div.className = 'DHTMLSuite_calendar_dropDown_arrowUp';
div.onmouseover = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoverUpAndDownArrowsInDropDownYears(e); } ;
div.onmouseout =function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoutUpAndDownArrowsInDropDownYears(e); } ;
this.divElYearDropdown.appendChild(div);
DHTMLSuite.commonObj.__addEventEl(div);
this.divElYearDropdownParentYears = document.createElement('DIV');
this.divElYearDropdown.appendChild(this.divElYearDropdownParentYears);
this.__populateYearsInsideDropDownYears(this.divElYearDropdownParentYears);
var div = document.createElement('DIV');
div.className = 'DHTMLSuite_calendar_dropDown_arrowDown';
div.innerHTML = '<span></span>';
div.onmouseover = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoverUpAndDownArrowsInDropDownYears(e); } ;
div.onmouseout =function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mouseoutUpAndDownArrowsInDropDownYears(e); } ;
DHTMLSuite.commonObj.__addEventEl(div);
this.divElYearDropdown.appendChild(div);
}
,
__populateYearsInsideDropDownYears:function(divElementToPopulate){
var ind = this.objectIndex;
this.divElYearDropdownParentYears.innerHTML = '';
var startYear = this.calendarModelReference.__getDisplayedYear()-5 + this.yearDropDownOffsetInYear;
for(var no=startYear;no<startYear+this.numberOfRowsInYearDropDown;no++){
var div = document.createElement('DIV');
div.className = 'DHTMLSuite_calendar_dropDownAYear';
if(no==this.calendarModelReference.__getDisplayedYear())div.className = 'DHTMLSuite_calendar_yearDropDownCurrentYear';
div.innerHTML = no;
div.onmouseover = this.__mouseoverYearInDropDown;
div.onmouseout = this.__mouseoutYearInDropDown;
div.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__setYearFromDropdown(e); }
this.divElYearDropdownParentYears.appendChild(div);
DHTMLSuite.commonObj.__addEventEl(div);
}
}
,
__positionDropDownMonths:function(){
this.divElMonthDropdown.style.left = DHTMLSuite.commonObj.getLeftPos(this.divElMonthNInHead) + 'px';
this.divElMonthDropdown.style.top = (DHTMLSuite.commonObj.getTopPos(this.divElMonthNInHead) + this.divElMonthNInHead.offsetHeight) + 'px';
if(this.iframeElDropDowns){
var st = this.iframeElDropDowns.style;
st.left = this.divElMonthDropdown.style.left;
st.top = this.divElMonthDropdown.style.top;
st.width = (this.divElMonthDropdown.clientWidth) + 'px';
st.height = this.divElMonthDropdown.clientHeight + 'px';
st.display = this.divElMonthDropdown.style.display;
}
}
,
__positionDropDownYears:function(){
this.divElYearDropdown.style.left = DHTMLSuite.commonObj.getLeftPos(this.divElYearInHeading) + 'px';
this.divElYearDropdown.style.top = (DHTMLSuite.commonObj.getTopPos(this.divElYearInHeading) + this.divElYearInHeading.offsetHeight) + 'px';
if(this.iframeElDropDowns){
var st = this.iframeElDropDowns.style;
st.left = this.divElYearDropdown.style.left;
st.top = this.divElYearDropdown.style.top;
st.width = (this.divElYearDropdown.clientWidth) + 'px';
st.height = this.divElYearDropdown.clientHeight + 'px';
st.display = this.divElYearDropdown.style.display;
}
}
,
__positionDropDownHours:function(){
this.divElHourDropdown.style.left = DHTMLSuite.commonObj.getLeftPos(this.divElHrInTimeBar) + 'px';
this.divElHourDropdown.style.top = (DHTMLSuite.commonObj.getTopPos(this.divElHrInTimeBar) + this.divElHrInTimeBar.offsetHeight) + 'px';
if(this.iframeElDropDowns){
var st = this.iframeElDropDowns.style;
st.left = this.divElHourDropdown.style.left;
st.top = this.divElHourDropdown.style.top;
st.width = (this.divElHourDropdown.clientWidth) + 'px';
st.height = this.divElHourDropdown.clientHeight + 'px';
st.display = this.divElHourDropdown.style.display;
}
}
,
__positionDropDownMinutes:function(){
this.divElMinuteDropdown.style.left = DHTMLSuite.commonObj.getLeftPos(this.divElMinInTimeBar) + 'px';
this.divElMinuteDropdown.style.top = (DHTMLSuite.commonObj.getTopPos(this.divElMinInTimeBar) + this.divElMinInTimeBar.offsetHeight) + 'px';
if(this.iframeElDropDowns){
var st = this.iframeElDropDowns.style;
st.left = this.divElMinuteDropdown.style.left;
st.top = this.divElMinuteDropdown.style.top;
st.width = (this.divElMinuteDropdown.clientWidth) + 'px';
st.height = this.divElMinuteDropdown.clientHeight + 'px';
st.display = this.divElMinuteDropdown.style.display;
}
}
,
__setMonthFromDropdown:function(e){
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
this.__showHideDropDownBoxMonth();
this.setDisplayedMonth(src.id.replace(/[^0-9]/gi,''));
}
,
__setYearFromDropdown:function(e){
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
this.__showHideDropDownBoxYear();
this.setDisplayedYear(src.innerHTML);
}
,
__setHourFromDropdown:function(e){
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
this.__showHideDropDownBoxHour();
this.setDisplayedHour(src.innerHTML);
}
,
__setMinuteFromDropdown:function(e){
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
this.__showHideDropDownBoxMinute();
this.setDisplayedMinute(src.innerHTML);
}
,
__autoHideDropDownBoxes:function(e){
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
if(src.className.indexOf('MonthAndYear')>=0 || src.className.indexOf('HourAndMinute')>=0){	// class name of element same as element triggering the dropdowns ?
if(DHTMLSuite.commonObj.isObjectClicked(this.divElement,e))return;	// if element clicked is a sub element of main calendar div - return
}
this.__showHideDropDownBoxMonth('none');
this.__showHideDropDownBoxYear('none');
this.__showHideDropDownBoxHour('none');
this.__showHideDropDownBoxMinute('none');
}
,
__showHideDropDownBoxMonth:function(forcedDisplayAttribute){
if(!forcedDisplayAttribute){
this.__showHideDropDownBoxYear('none');	// Hide year drop down.
this.__showHideDropDownBoxHour('none');	// Hide year drop down.
}
if(forcedDisplayAttribute){
this.divElMonthDropdown.style.display = forcedDisplayAttribute;
}else{
this.divElMonthDropdown.style.display=(this.divElMonthDropdown.style.display=='block'?'none':'block');
}
this.__populateDropDownMonths();
this.__positionDropDownMonths();
}
,
__showHideDropDownBoxYear:function(forcedDisplayAttribute){
if(!forcedDisplayAttribute){
this.__showHideDropDownBoxMonth('none');	// Hide year drop down.
this.__showHideDropDownBoxHour('none');	// Hide year drop down.
this.__showHideDropDownBoxMinute('none');	// Hide year drop down.
}
if(forcedDisplayAttribute){
this.divElYearDropdown.style.display = forcedDisplayAttribute;
}else{
this.divElYearDropdown.style.display=(this.divElYearDropdown.style.display=='block'?'none':'block');
}
if(this.divElYearDropdown.style.display=='none' ){
this.yearDropDownOffsetInYear = 0;
}else{
this.__populateDropDownYears();
}
this.__positionDropDownYears();
}
,
__showHideDropDownBoxHour:function(forcedDisplayAttribute){
if(!forcedDisplayAttribute){
this.__showHideDropDownBoxYear('none');	// Hide Hour drop down.
this.__showHideDropDownBoxMonth('none');	// Hide Hour drop down.
this.__showHideDropDownBoxMinute('none');	// Hide Hour drop down.
}
if(forcedDisplayAttribute){
this.divElHourDropdown.style.display = forcedDisplayAttribute;
}else{
this.divElHourDropdown.style.display=(this.divElHourDropdown.style.display=='block'?'none':'block');
}
if(this.divElHourDropdown.style.display=='none' ){
this.hourDropDownOffsetInHour = 0;
}else{
this.__populateDropDownHours();
}
this.__positionDropDownHours();
}
,
__showHideDropDownBoxMinute:function(forcedDisplayAttribute){
if(!forcedDisplayAttribute){
this.__showHideDropDownBoxYear('none');	// Hide Minute drop down.
this.__showHideDropDownBoxMonth('none');	// Hide Minute drop down.
this.__showHideDropDownBoxHour('none');	// Hide Minute drop down.
}
if(forcedDisplayAttribute){
this.divElMinuteDropdown.style.display = forcedDisplayAttribute;
}else{
this.divElMinuteDropdown.style.display=(this.divElMinuteDropdown.style.display=='block'?'none':'block');
}
if(this.divElMinuteDropdown.style.display=='none' ){
this.minuteDropDownOffsetInMinute = 0;
}else{
this.__populateDropDownMinutes();
}
this.__positionDropDownMinutes();
}
,
__createMainHtmlEls:function(){
this.divElement = document.createElement('DIV');
this.divElement.className = 'DHTMLSuite_calendar';
this.divElContent = document.createElement('DIV');
this.divElement.appendChild(this.divElContent);
this.divElContent.className = 'DHTMLSuite_calendarContent';
if(this.targetReference)this.targetReference.appendChild(this.divElement);else document.body.appendChild(this.divElement);
if(this.isDragable){
try{
this.referenceToDragDropObject = new DHTMLSuite.dragDropSimple({ elementReference: this.divElement });
}catch(e){
alert('You need to include DHTMLSuite-dragDropSimple.js for the drag feature');
}
}
if(DHTMLSuite.clientInfoObj.isMSIE && DHTMLSuite.clientInfoObj.navigatorVersion<8){
this.iframeEl = document.createElement('<iframe src="about:blank" frameborder="0">');
this.iframeEl.className = 'DHTMLSuite_calendar_iframe';
this.iframeEl.style.left = '0px';
this.iframeEl.style.top = '0px';
this.iframeEl.style.position = 'absolute';
this.divElement.appendChild(this.iframeEl);
this.iframeElDropDowns = document.createElement('<iframe src="about:blank" frameborder="0">');
this.iframeElDropDowns.className = 'DHTMLSuite_calendar_iframe';
this.iframeElDropDowns.style.display='none';
document.body.appendChild(this.iframeElDropDowns);
}
}
,
__createHeadingElements:function(){
this.divElHeading = document.createElement('DIV');
if(this.isDragable){	/* Calendar is dragable */
this.referenceToDragDropObject.addDragHandle(this.divElHeading);
this.divElHeading.style.cursor = 'move';
}
this.divElHeading.className='DHTMLSuite_calendarHeading';
this.divElContent.appendChild(this.divElHeading);
this.divElHeading.style.position = 'relative';
this.divElClose = document.createElement('DIV');
this.divElClose.innerHTML = '<span></span>';
this.divElClose.className = 'DHTMLSuite_calendarCloseButton';
this.divElHeading.appendChild(this.divElClose);
if(!this.displayCloseButton)this.divElClose.style.display='none';
this.divElHeadingTxt = document.createElement('DIV');
this.divElHeadingTxt.className = 'DHTMLSuite_calendarHeadingTxt';
if(DHTMLSuite.clientInfoObj.isMSIE){
var table = document.createElement('<TABLE cellpadding="0" cellspacing="0" border="0">');
}else{
var table = document.createElement('TABLE');
table.setAttribute('cellpadding',0);
table.setAttribute('cellspacing',0);
table.setAttribute('border',0);
}
table.style.margin = '0 auto';
var tbody = document.createElement('TBODY');
table.appendChild(tbody);
this.divElHeadingTxt.appendChild(table);
var row = tbody.insertRow(0);
var cell = row.insertCell(-1);
this.divElMonthNInHead = document.createElement('DIV');
this.divElMonthNInHead.className = 'DHTMLSuite_calendarHeaderMonthAndYear';
cell.appendChild(this.divElMonthNInHead);
var cell = row.insertCell(-1);
var span = document.createElement('SPAN');
span.innerHTML = ', ';
cell.appendChild(span);
var cell = row.insertCell(-1);
this.divElYearInHeading = document.createElement('DIV');
this.divElYearInHeading.className = 'DHTMLSuite_calendarHeaderMonthAndYear';
cell.appendChild(this.divElYearInHeading);
this.divElHeading.appendChild(this.divElHeadingTxt);
}
,
__createNavigationBar:function(){
this.divElNavBar = document.createElement('DIV');
this.divElNavBar.className='DHTMLSuite_calendar_navigationBar';
this.divElContent.appendChild(this.divElNavBar);
this.divElBtnPreviousYear = document.createElement('DIV');
this.divElBtnPreviousYear.className='DHTMLSuite_calendar_btnPreviousYear';
this.divElBtnPreviousYear.innerHTML = '<span></span>';
this.divElNavBar.appendChild(this.divElBtnPreviousYear);
this.divElBtnNextYear = document.createElement('DIV');
this.divElBtnNextYear.className='DHTMLSuite_calendar_btnNextYear';
this.divElBtnNextYear.innerHTML = '<span></span>';
this.divElNavBar.appendChild(this.divElBtnNextYear);
this.divElBtnPrvMonth = document.createElement('DIV');
this.divElBtnPrvMonth.className='DHTMLSuite_calendar_btnPreviousMonth';
this.divElBtnPrvMonth.innerHTML = '<span></span>';
this.divElNavBar.appendChild(this.divElBtnPrvMonth);
this.divElBtnNextMonth = document.createElement('DIV');
this.divElBtnNextMonth.className='DHTMLSuite_calendar_btnNextMonth';
this.divElBtnNextMonth.innerHTML = '<span></span>';
this.divElNavBar.appendChild(this.divElBtnNextMonth);
this.divElTodayInNavBar = document.createElement('DIV');
this.divElTodayInNavBar.className='DHTMLSuite_calendar_navigationBarToday';
this.divElNavBar.appendChild(this.divElTodayInNavBar);
if(!this.displayNavigationBar)this.divElNavBar.style.display='none';
if(!this.displayTodaysDateInNavigationBar)this.divElTodayInNavBar.style.display='none';
}
,
__populateNavigationBar:function(){
var ind = this.objectIndex;
this.divElTodayInNavBar.innerHTML = '';
var span = document.createElement('SPAN');
span.innerHTML = this.calendarModelReference.__getTodayAsString();
span.onclick = function(){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__displayMonthOfToday(); }
this.divElTodayInNavBar.appendChild(span);
DHTMLSuite.commonObj.__addEventEl(span);
}
,
__createCalMonthView:function(){
this.divElMonthView = document.createElement('DIV');
this.divElMonthView.className = 'DHTMLSuite_calendar_monthView';
this.divElContent.appendChild(this.divElMonthView);
}
,
__populateMonthView:function(){
var ind = this.objectIndex;
this.divElMonthView.innerHTML = '';
var modelRef = this.calendarModelReference;
if(DHTMLSuite.clientInfoObj.isMSIE){
var table = document.createElement('<TABLE cellpadding="1" cellspacing="0" border="0" width="100%">');
}else{
var table = document.createElement('TABLE');
table.setAttribute('cellpadding',1);
table.setAttribute('cellspacing',0);
table.setAttribute('border',0);
table.width = '100%';
}
var tbody = document.createElement('TBODY');
table.appendChild(tbody);
this.divElMonthView.appendChild(table);
var row = tbody.insertRow(-1);	// Insert a new row at the end of the table
row.className = 'DHTMLSuite_calendar_monthView_headerRow';
var cell = row.insertCell(-1);
cell.className = 'DHTMLSuite_calendar_monthView_firstColumn';
cell.innerHTML = modelRef.__getStringWeek();
if(modelRef.getWeekStartsOnMonday()){
var days = modelRef.__getDaysMondayToSunday();
}else{
var days = modelRef.__getDaysSundayToSaturday();
}
for(var no=0;no<days.length;no++){
var cell = row.insertCell(-1);
cell.innerHTML = days[no];
cell.className = 'DHTMLSuite_calendar_monthView_headerCell';
if(modelRef.getWeekStartsOnMonday() && no==6){
cell.className = 'DHTMLSuite_calendar_monthView_headerSunday';
}
if(!modelRef.getWeekStartsOnMonday() && no==0){
cell.className = 'DHTMLSuite_calendar_monthView_headerSunday';
}
}
var row = tbody.insertRow(-1);
var cell = row.insertCell(-1);
cell.className = 'DHTMLSuite_calendar_monthView_firstColumn';
var week = modelRef.__getWeekNumberFromDayMonthAndYear(modelRef.__getDisplayedYear(),modelRef.__getDisplayedMonthNumber(),1);
cell.innerHTML = week>0?week:53;
var daysRemainingInPreviousMonth = modelRef.__getRemainingDaysInPreviousMonthAsArray();
for(var no=0;no<daysRemainingInPreviousMonth.length;no++){
var cell = row.insertCell(-1);
cell.innerHTML = daysRemainingInPreviousMonth[no];
cell.className = 'DHTMLSuite_calendar_monthView_daysInOtherMonths';
}
var daysInCurrentMonth = modelRef.__getNumberOfDaysInCurrentDisplayedMonth();
var cellCounter = daysRemainingInPreviousMonth.length+1;
for(var no=1;no<=daysInCurrentMonth;no++){
var cell = row.insertCell(-1);
cell.innerHTML = no;
cell.className = 'DHTMLSuite_calendar_monthView_daysInThisMonth';
DHTMLSuite.commonObj.__addEventEl(cell);
if(cellCounter%7==0 && modelRef.getWeekStartsOnMonday()){
cell.className = 'DHTMLSuite_calendar_monthView_sundayInThisMonth';
}
if(cellCounter%7==1 && !modelRef.getWeekStartsOnMonday()){
cell.className = 'DHTMLSuite_calendar_monthView_sundayInThisMonth';
}
if(no==modelRef.__getInitialDay() && modelRef.__getDisplayedYear() == modelRef.__getInitialYear() && modelRef.__getDisplayedMonthNumber()==modelRef.__getInitialMonthNumber()){
cell.className = 'DHTMLSuite_calendar_monthView_initialDate';
}
if(!modelRef.isDateWithinValidRange({year:modelRef.__getDisplayedYear(),month:modelRef.__getDisplayedMonthNumber(),day:no})){
cell.className = 'DHTMLSuite_calendar_monthView_invalidDate';
}else{
cell.onmousedown = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__mousedownOnDayInCalendar(e); }
cell.onmouseover = this.__mouseoverCalendarDay;
cell.onmouseout = this.__mouseoutCalendarDay;
DHTMLSuite.commonObj.__addEventEl(cell);
}
if(no==this.dateOfToday.getDate() && modelRef.__getDisplayedYear() == this.dateOfToday.getFullYear() && modelRef.__getDisplayedMonthNumber()==(this.dateOfToday.getMonth()+1)){
cell.className = 'DHTMLSuite_calendar_monthView_currentDate';
}
if(cellCounter%7==0 && no<daysInCurrentMonth){
var row = tbody.insertRow(-1);
var cell = row.insertCell(-1)
cell.className = 'DHTMLSuite_calendar_monthView_firstColumn';
week++
cell.innerHTML = week;
}
cellCounter++;
}
if((cellCounter-1)%7>0){
var dayCounter = 1;
for(var no=(cellCounter-1)%7;no<7;no++){
var cell = row.insertCell(-1);
cell.innerHTML = dayCounter;
cell.className = 'DHTMLSuite_calendar_monthView_daysInOtherMonths';
dayCounter++;
}
}
}
,
__createTimeBar:function(){
this.divElTimeBar = document.createElement('DIV');
this.divElTimeBar.className = 'DHTMLSuite_calendar_timeBar';
this.divElContent.appendChild(this.divElTimeBar);
if(DHTMLSuite.clientInfoObj.isMSIE){
var table = document.createElement('<TABLE cellpadding="0" cellspacing="0" border="0">');
}else{
var table = document.createElement('TABLE');
table.setAttribute('cellpadding',0);
table.setAttribute('cellspacing',0);
table.setAttribute('border',0);
}
table.style.margin = '0 auto';
this.divElTimeBar.appendChild(table);
var row = table.insertRow(0);
var cell = row.insertCell(-1);
this.divElHrInTimeBar = document.createElement('DIV');
this.divElHrInTimeBar.className = 'DHTMLSuite_calendar_timeBarHourAndMinute';
cell.appendChild(this.divElHrInTimeBar);
var cell = row.insertCell(-1);
var span = document.createElement('SPAN');
span.innerHTML = ':';
cell.appendChild(span);
var cell = row.insertCell(-1);
this.divElMinInTimeBar = document.createElement('DIV');
this.divElMinInTimeBar.className = 'DHTMLSuite_calendar_timeBarHourAndMinute';
cell.appendChild(this.divElMinInTimeBar);
this.divElTimeStringInTimeBar = document.createElement('DIV');
this.divElTimeStringInTimeBar.className = 'DHTMLSuite_calendarTimeBarTimeString';
this.divElTimeBar.appendChild(this.divElTimeStringInTimeBar);
if(!this.displayTimeBar)this.divElTimeBar.style.display='none';
}
,
__populateTimeBar:function(){
this.divElHrInTimeBar.innerHTML = this.calendarModelReference.__getDisplayedHourWithLeadingZeros();
this.divElMinInTimeBar.innerHTML = this.calendarModelReference.__getDisplayedMinuteWithLeadingZeros();
this.divElTimeStringInTimeBar.innerHTML = this.calendarModelReference.__getTimeAsString() + ':';
}
,
__populateCalHeading:function(){
this.divElMonthNInHead.innerHTML = this.calendarModelReference.__getMonthNameByMonthNumber(this.calendarModelReference.__getDisplayedMonthNumber());
this.divElYearInHeading.innerHTML = this.calendarModelReference.__getDisplayedYear();
}
,
__mousedownOnDayInCalendar:function(e){
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
this.calendarModelReference.__setDisplayedDay(src.innerHTML);
this.__handleCalendarCallBack('dayClick');
}
,
__handleCalendarCallBack:function(action){
var callbackString = '';
switch(action){
case 'dayClick':
if(this.callbackFunctionOnDayClick)callbackString = this.callbackFunctionOnDayClick;
break;
case "monthChange":
if(this.callbackFunctionOnMonthChange)callbackString = this.callbackFunctionOnMonthChange;
break;
case "calendarClose":
if(this.callbackFunctionOnClose)callbackString = this.callbackFunctionOnClose;
break;
}
if(callbackString){
callbackString = callbackString +
'({'
+ ' year:' + this.calendarModelReference.__getDisplayedYear()
+ ',month:"' + this.calendarModelReference.__getDisplayedMonthNumberWithLeadingZeros() + '"'
+ ',day:"' + this.calendarModelReference.__getDisplayedDayWithLeadingZeros() + '"'
+ ',hour:"' + this.calendarModelReference.__getDisplayedHourWithLeadingZeros() + '"'
+ ',minute:"' + this.calendarModelReference.__getDisplayedMinuteWithLeadingZeros() + '"'
+ ',calendarRef:this'
callbackString = callbackString + '})';
}
if(callbackString)return this.__evaluateCallBackString(callbackString);
}
,
__evaluateCallBackString:function(callbackString){
try{
return eval(callbackString);
}catch(e){
alert('Could not excute call back function ' + callbackString + '\n' + e.message);
}
}
,
__displayMonthOfToday:function(){
var d = new Date();
var month = d.getMonth()+1;
var year = d.getFullYear();
this.setDisplayedYear(year);
this.setDisplayedMonth(month);
}
,
__moveOneYearBack:function(){
this.calendarModelReference.__moveOneYearBack();
this.__populateCalHeading();
this.__populateMonthView();
this.__handleCalendarCallBack('monthChange');
}
,
__moveOneYearForward:function(){
this.calendarModelReference.__moveOneYearForward();
this.__populateCalHeading();
this.__populateMonthView();
this.__handleCalendarCallBack('monthChange');
}
,
__moveOneMonthBack:function(){
this.calendarModelReference.__moveOneMonthBack();
this.__populateCalHeading();
this.__populateMonthView();
this.__handleCalendarCallBack('monthChange');
}
,
__moveOneMonthForward:function(){
this.calendarModelReference.__moveOneMonthForward();
this.__populateCalHeading();
this.__populateMonthView();
this.__handleCalendarCallBack('monthChange');
}
,
__addEvents:function(){
var ind = this.objectIndex;
this.divElClose.onmouseover = this.__mouseoverCalendarButton;
this.divElClose.onmouseout = this.__mouseoutCalendarButton;
this.divElClose.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].hide(); }
DHTMLSuite.commonObj.__addEventEl(this.divElClose);
this.divElBtnPreviousYear.onmouseover = this.__mouseoverCalendarButton;
this.divElBtnPreviousYear.onmouseout = this.__mouseoutCalendarButton;
this.divElBtnPreviousYear.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__moveOneYearBack(); }
DHTMLSuite.commonObj.__addEventEl(this.divElBtnPreviousYear);
this.divElBtnNextYear.onmouseover = this.__mouseoverCalendarButton;
this.divElBtnNextYear.onmouseout = this.__mouseoutCalendarButton;
this.divElBtnNextYear.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__moveOneYearForward(); }
DHTMLSuite.commonObj.__addEventEl(this.divElBtnNextYear);
this.divElBtnPrvMonth.onmouseover = this.__mouseoverCalendarButton;
this.divElBtnPrvMonth.onmouseout = this.__mouseoutCalendarButton;
this.divElBtnPrvMonth.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__moveOneMonthBack(); }
DHTMLSuite.commonObj.__addEventEl(this.divElBtnPrvMonth);
this.divElBtnNextMonth.onmouseover = this.__mouseoverCalendarButton;
this.divElBtnNextMonth.onmouseout = this.__mouseoutCalendarButton;
this.divElBtnNextMonth.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__moveOneMonthForward(); }
DHTMLSuite.commonObj.__addEventEl(this.divElBtnNextMonth);
this.divElYearInHeading.onmouseover = this.__mouseoverMonthAndYear;
this.divElYearInHeading.onmouseout = this.__mouseoutMonthAndYear;
this.divElYearInHeading.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__showHideDropDownBoxYear(); }
DHTMLSuite.commonObj.__addEventEl(this.divElYearInHeading);
this.divElMonthNInHead.onmouseover = this.__mouseoverMonthAndYear;
this.divElMonthNInHead.onmouseout = this.__mouseoutMonthAndYear;
this.divElMonthNInHead.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__showHideDropDownBoxMonth(); }
DHTMLSuite.commonObj.__addEventEl(this.divElMonthNInHead);
this.divElHrInTimeBar.onmouseover = this.__mouseoverHourAndMinute;
this.divElHrInTimeBar.onmouseout = this.__mouseoutHourAndMinute;
this.divElHrInTimeBar.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__showHideDropDownBoxHour(); }
DHTMLSuite.commonObj.__addEventEl(this.divElHrInTimeBar);
this.divElMinInTimeBar.onmouseover = this.__mouseoverHourAndMinute;
this.divElMinInTimeBar.onmouseout = this.__mouseoutHourAndMinute;
this.divElMinInTimeBar.onclick = function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__showHideDropDownBoxMinute(); }
DHTMLSuite.commonObj.__addEventEl(this.divElMinInTimeBar);
this.divElHeading.onselectstart = function(){ return false; };
DHTMLSuite.commonObj.__addEventEl(this.divElHeading);
DHTMLSuite.commonObj.addEvent(document.documentElement,'click',function(e){ DHTMLSuite.variableStorage.arrayDSObjects[ind].__autoHideDropDownBoxes(e); },ind+'');
}
,
__resizePrimaryiframeEl:function(){
if(!this.iframeEl)return;
this.iframeEl.style.width = this.divElement.clientWidth + 'px';
this.iframeEl.style.height = this.divElement.clientHeight + 'px';
}
,
__scrollInYearDropDown:function(scrollDirection){
if(!this.scrollInYearDropDownActive)return;
var ind = this.objectIndex;
this.yearDropDownOffsetInYear+=scrollDirection;
this.__populateYearsInsideDropDownYears();
setTimeout('DHTMLSuite.variableStorage.arrayDSObjects[' + ind + '].__scrollInYearDropDown(' + scrollDirection + ')',150);
}
,
__mouseoverUpAndDownArrowsInDropDownYears:function(e){
var ind = this.objectIndex;
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
var scrollDirection = (src.className.toLowerCase().indexOf('up')>=0?-1:1);
src.className = src.className + ' DHTMLSuite_calendarDropDown_dropDownArrowOver';
this.scrollInYearDropDownActive = true;
setTimeout('DHTMLSuite.variableStorage.arrayDSObjects[' + ind + '].__scrollInYearDropDown(' + scrollDirection + ')',100);
}
,
__mouseoutUpAndDownArrowsInDropDownYears:function(e){
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
src.className = src.className.replace(' DHTMLSuite_calendarDropDown_dropDownArrowOver','');
this.scrollInYearDropDownActive = false;
}
,
__scrollInHourDropDown:function(scrollDirection){
if(!this.scrollInHourDropDownActive)return;
var ind = this.objectIndex;
this.hourDropDownOffsetInHour+=scrollDirection;
this.__populateHoursInsideDropDownHours();
setTimeout('DHTMLSuite.variableStorage.arrayDSObjects[' + ind + '].__scrollInHourDropDown(' + scrollDirection + ')',150);
}
,
__mouseoverUpAndDownArrowsInDropDownHours:function(e){
var ind = this.objectIndex;
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
var scrollDirection = (src.className.toLowerCase().indexOf('up')>=0?-1:1);
src.className = src.className + ' DHTMLSuite_calendarDropDown_dropDownArrowOver';
this.scrollInHourDropDownActive = true;
setTimeout('DHTMLSuite.variableStorage.arrayDSObjects[' + ind + '].__scrollInHourDropDown(' + scrollDirection + ')',100);
}
,
__mouseoutUpAndDownArrowsInDropDownHours:function(e){
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
src.className = src.className.replace(' DHTMLSuite_calendarDropDown_dropDownArrowOver','');
this.scrollInHourDropDownActive = false;
}
,
__scrollInMinuteDropDown:function(scrollDirection){
if(!this.scrollInMinuteDropDownActive)return;
var ind = this.objectIndex;
this.minuteDropDownOffsetInMinute+=scrollDirection;
this.__populateMinutesInsideDropDownMinutes();
setTimeout('DHTMLSuite.variableStorage.arrayDSObjects[' + ind + '].__scrollInMinuteDropDown(' + scrollDirection + ')',150);
}
,
__mouseoverUpAndDownArrowsInDropDownMinutes:function(e){
var ind = this.objectIndex;
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
var scrollDirection = (src.className.toLowerCase().indexOf('up')>=0?-1:1);
src.className = src.className + ' DHTMLSuite_calendarDropDown_dropDownArrowOver';
this.scrollInMinuteDropDownActive = true;
setTimeout('DHTMLSuite.variableStorage.arrayDSObjects[' + ind + '].__scrollInMinuteDropDown(' + scrollDirection + ')',100);
}
,
__mouseoutUpAndDownArrowsInDropDownMinutes:function(e){
if(document.all)e = event;
var src = DHTMLSuite.commonObj.getSrcElement(e);
src.className = src.className.replace(' DHTMLSuite_calendarDropDown_dropDownArrowOver','');
this.scrollInMinuteDropDownActive = false;
}
,
__mouseoverYearInDropDown:function(){
this.className = this.className + ' DHTMLSuite_calendar_dropdownAYearOver';
}
,
__mouseoutYearInDropDown:function(){
this.className = this.className.replace(' DHTMLSuite_calendar_dropdownAYearOver','');
}
,
__mouseoverHourInDropDown:function(){
this.className = this.className + ' DHTMLSuite_calendar_dropdownAnHourOver';
}
,
__mouseoutHourInDropDown:function(){
this.className = this.className.replace(' DHTMLSuite_calendar_dropdownAnHourOver','');
}
,
__mouseoverMinuteInDropDown:function(){
this.className = this.className + ' DHTMLSuite_calendar_dropdownAMinuteOver';
}
,
__mouseoutMinuteInDropDown:function(){
this.className = this.className.replace(' DHTMLSuite_calendar_dropdownAMinuteOver','');
}
,
__mouseoverMonthInDropDown:function(){
this.className = this.className + ' DHTMLSuite_calendar_dropdownAMonthOver';
}
,
__mouseoutMonthInDropDown:function(){
this.className = this.className.replace(' DHTMLSuite_calendar_dropdownAMonthOver','');
}
,
__mouseoverCalendarDay:function(){
this.className = this.className + ' DHTMLSuite_calendarDayOver';
}
,
__mouseoutCalendarDay:function(){
this.className = this.className.replace(' DHTMLSuite_calendarDayOver','');
}
,
__mouseoverCalendarButton:function(){
this.className = this.className + ' DHTMLSuite_calendarButtonOver';
}
,
__mouseoutCalendarButton:function(){
this.className = this.className.replace(' DHTMLSuite_calendarButtonOver','');
}
,
__mouseoverMonthAndYear:function(){
this.className = this.className + ' DHTMLSuite_calendarHeaderMonthAndYearOver';
}
,
__mouseoutMonthAndYear:function(){
this.className = this.className.replace(' DHTMLSuite_calendarHeaderMonthAndYearOver','');
}	,
__mouseoverHourAndMinute:function(){
this.className = this.className + ' DHTMLSuite_calendarTimeBarHourAndMinuteOver';
}
,
__mouseoutHourAndMinute:function(){
this.className = this.className.replace(' DHTMLSuite_calendarTimeBarHourAndMinuteOver','');
}
,
__positionCalendar:function(){
if(!this.posRefToHtmlEl)return;
if(this.divElement.parentNode!=document.body)document.body.appendChild(this.divElement);
this.divElement.style.position='absolute';
this.divElement.style.left = (DHTMLSuite.commonObj.getLeftPos(this.posRefToHtmlEl) + this.positioningOffsetXInPixels) + 'px';
this.divElement.style.top = (DHTMLSuite.commonObj.getTopPos(this.posRefToHtmlEl) + this.positioningOffsetYInPixels) + 'px';
}
,
__setInitialData:function(props){
if(props.id)this.id = props.id;
if(props.targetReference)this.targetReference = props.targetReference;
if(props.calendarModelReference)this.calendarModelReference = props.calendarModelReference;
if(props.callbackFunctionOnDayClick)this.callbackFunctionOnDayClick = props.callbackFunctionOnDayClick;
if(props.callbackFunctionOnMonthChange)this.callbackFunctionOnMonthChange = props.callbackFunctionOnMonthChange;
if(props.callbackFunctionOnClose)this.callbackFunctionOnClose = props.callbackFunctionOnClose;
if(props.displayCloseButton || props.displayCloseButton===false)this.displayCloseButton = props.displayCloseButton;
if(props.displayNavigationBar || props.displayNavigationBar===false)this.displayNavigationBar = props.displayNavigationBar;
if(props.displayTodaysDateInNavigationBar || props.displayTodaysDateInNavigationBar===false)this.displayTodaysDateInNavigationBar = props.displayTodaysDateInNavigationBar;
if(props.minuteDropDownInterval)this.minuteDropDownInterval = props.minuteDropDownInterval;
if(props.numberOfRowsInHourDropDown)this.numberOfRowsInHourDropDown = props.numberOfRowsInHourDropDown;
if(props.numberOfRowsInMinuteDropDown)this.numberOfRowsInHourDropDown = props.numberOfRowsInMinuteDropDown;
if(props.numberOfRowsInYearDropDown)this.numberOfRowsInYearDropDown = props.numberOfRowsInYearDropDown;
if(props.isDragable || props.isDragable===false)this.isDragable = props.isDragable;
if(props.displayTimeBar || props.displayTimeBar===false)this.displayTimeBar = props.displayTimeBar;
}
}

