var hirsCalendar=mlCalendar;

// Overwrite writeDate() function of mlCalendar
hirsCalendar.prototype.writeDate=function(){
	$('monthDatBox').innerHTML=this.monthNameArr[datePart('m',this.currDat)-1]+'&nbsp;'+datePart('yyyy',this.currDat);
	$('weekDatBox').innerHTML=dateFormat(this.firstDate,'dd.mm.yyyy')+'-'+dateFormat(this.lastDate,'dd.mm.yyyy');
	$('dayDatBox').innerHTML=dateFormat(this.firstDate,'dd.mm.yyyy');
}
hirsCalendar.prototype.initDateFilter=function(){
	this.dateFilters=[];
	this.dateFilters['row']=[];
	this.dateFilters['val']=[];
	this.dateFilters['type']=[];
	this.dateFilters['fct']=[];
}
hirsCalendar.prototype.initDataset=function(){
	this.dsDatesLoaded=false;
	this.dsDates=new Spry.Data.XMLDataSet(this.getDatesUrl(),this.datesXMLPath,{useCache: false,async: false});
	this.initDateFilter();
	var self=this;
	dsObserver={onPostLoad: function(){if(self.debug)self.debugDataset();self.initDayFieldArr();self.reFillDates();}};
	this.dsDates.addObserver(dsObserver);
	this.dsDates.loadData();
	this.dsDatesLoaded=true;
	this.eleDlgContRequest=null;
}
hirsCalendar.prototype.getDatesUrl=function(){
	var deli=this.datesXMLUrl.indexOf('?')>-1?'&':'?';
	var u=this.datesXMLUrl+deli+'fromDate='+dateFormat(this.firstDate,'yyyy-mm-dd')+'&toDate='+dateFormat(this.lastDate,'yyyy-mm-dd')+'&ts='+new Date();
	return u;
}
hirsCalendar.prototype.getSettingsUrl=function(){
	var deli=this.settingsXMLUrl.indexOf('?')>-1?'&':'?';
	var u=this.settingsXMLUrl+deli+'fromDate='+dateFormat(this.firstDate,'yyyy-mm-dd')+'&toDate='+dateFormat(this.lastDate,'yyyy-mm-dd')+'&ts='+new Date();
	return u;
}
hirsCalendar.prototype.initSettings=function(){
	this.dsSettingsLoaded=false;
	this.dsSettings=new Spry.Data.XMLDataSet(this.getSettingsUrl(),this.settingsXMLPath,{useCache: false,async: false});
	var self=this;
	dsObserver={
			onPostLoad: function(){
							if(!self.dsSettingsLoaded) self.applySettings(); 
							else self.applyMensDates(); 
							self.loadDates();}
	};
	this.dsSettings.addObserver(dsObserver);
	this.dsSettings.loadData();
}
hirsCalendar.prototype.reloadSettings=function(){
	this.dsSettings.setURL(this.getSettingsUrl());
	this.dsSettings.loadData();
}
hirsCalendar.prototype.applyMensDates=function(){
	var r=this.dsSettings.getData();
	for(var cname in r[0]) {
		switch(cname){
			case 'isPregnant':{this.userSettings['isPregnant']=r[0][cname]=='true'?true:false;break;}
			case 'showFertDates':{this.userSettings['showFertDates']=r[0][cname]=='true'?true:false;break;}
			case 'birthDueDate':{this.userSettings['birthDueDate']=parseDate(r[0][cname]);break;}
			case 'lastMensDat':{this.userSettings['lastMensDat']=parseDate(r[0][cname]);break;}
			default:{try{this.userSettings[cname]=r[0][cname];}catch(err){/* */}break;}
		}
	}
	if(this.userSettings['isPregnant']&&this.userSettings['birthDueDate']<this.firstDate) {
		this.userSettings['isPregnant']=false;
		if(this.userSettings['lastMensDat']<this.userSettings['birthDueDate']) this.userSettings['lastMensDat']='';
	}
}
hirsCalendar.prototype.applySettings=function(){
	var isReload=this.dsSettingsLoaded?true:false;
	this.dsSettingsLoaded=false;
	this.userSettings=[];
	var r=this.dsSettings.getData();
	/*for(var cname in r[0]) {
		switch(cname){
			case 'isPregnant':{this.userSettings['isPregnant']=r[0][cname]=='true'?true:false;break;}
			case 'showFertDates':{this.userSettings['showFertDates']=r[0][cname]=='true'?true:false;break;}
			case 'birthDueDate':{this.userSettings['birthDueDate']=parseDate(r[0][cname]);break;}
			case 'lastMensDat':{this.userSettings['lastMensDat']=parseDate(r[0][cname]);break;}
			default:{try{this.userSettings[cname]=r[0][cname];}catch(err){}break;}
		}
	}
	if(this.userSettings['isPregnant']&&this.userSettings['birthDueDate']<this.firstDate) {
		this.userSettings['isPregnant']=false;
		if(this.userSettings['lastMensDat']<this.userSettings['birthDueDate']) this.userSettings['lastMensDat']='';
	}*/
	this.mensCycle=[];
	this.mensCycle['days']=[0,2,4,13,14,15,16,17,18,19];
	this.mensCycle['value']=['','','','Lo','Hi','Hi','Med','Med','Lo','Lo'];
	this.mensCycle['ico']=['mens.gif','yellowDrop.gif','bloodTest.gif','','ovulation.gif','','','','',''];
	this.mensCycle['bgColor']=['','','','#C4F2D9','#7FCF94','#7FCF94','#9BE5AE','#9BE5AE','#C4F2D9','#C4F2D9'];
	this.mensCycle['title']=[this.lng.mensdattitle,this.lng.urintesttitle,this.lng.blooddattitle,'',this.lng.ovaldattitle,'','','','',''];
	this.mensCycle['content']=[this.lng.mensdatinfo,this.lng.urintestinfo,this.lng.blooddatinfo,'',this.lng.ovaldatinfo,'','','','',''];
	this.mensCycle['className']=[];
	this.mensCycle['className']['month']=['','','','calMonthGridColMensLo','calMonthGridColMensHi','calMonthGridColMensHi','calMonthGridColMensMed','calMonthGridColMensMed','calMonthGridColMensLo','calMonthGridColMensLo'];
	this.mensCycle['className']['week']=['','','','calWeekGridColMensLo','calWeekGridColMensHi','calWeekGridColMensHi','calWeekGridColMensMed','calWeekGridColMensMed','calWeekGridColMensLo','calWeekGridColMensLo'];
	this.mensCycle['className']['day']=['','','','calDayGridColMensLo','calDayGridColMensHi','calDayGridColMensHi','calDayGridColMensMed','calDayGridColMensMed','calDayGridColMensLo','calDayGridColMensLo'];
	this.dsSettingsLoaded=true;
	if(this.userSettings['date'] && this.userSettings['date']!='' && this.userSettings['view'] && this.userSettings['view']!=''){
		this.calContainer.showPanel(this.userSettings['view']+'View');
		this.activeView=this.calContainer.getCurrentTabIndex();
		mlSelect.onOptionClick(this.calContainer.getCurrentTabIndex(),true);
		this.setDate(parseDate(this.userSettings['date']),true);
	} else this.setDate(new Date(),true);
	//alert(dateFormat(this.currDat, 'dd.mm.yyyy')+'\n'+this.getActiveViewName());
	var self=this;
	//setTimeout(function(){self.loadDates()},1);
}
hirsCalendar.prototype.loadDates=function(){
	if(typeof this.onPreLoadDates=='function') this.onPreLoadDates();
	this.dsDatesLoaded=false;
	if(typeof this.dsDates=='undefined') this.initDataset();
	else {
		this.dsDates.setURL(this.getDatesUrl());
		this.dsDates.loadData();
		this.dsDatesLoaded=true;
	}
	if(typeof this.onPostLoadDates=='function') setTimeout(this.onPostLoadDates,0);
}
hirsCalendar.prototype.addDateFilter=function(pRow_s,pVal_s,pType_s){
	if(typeof this.onPreAddDateFilter=='function') this.onPreAddDateFilter();
	if(this.checkDateFilter(pRow_s,pVal_s,pType_s)) {alert('Filter already exists.');return;}
	if(pType_s=='show') var f=function(ds,row,index){return row[pRow_s]==pVal_s?row:null;};
	else if(pType_s=='hide') var f=function(ds,row,index){return row[pRow_s]!=pVal_s?row:null;};
	this.dateFilters['row'].push(pRow_s);
	this.dateFilters['val'].push(pVal_s);
	this.dateFilters['type'].push(pType_s);
	this.dateFilters['fct'].push(f);
	this.dsDates.addFilter(f, true);
	if(this.debug) this.debugDataset();
	if(typeof this.onPostAddDateFilter=='function') setTimeout(this.onPostAddDateFilter,0);
	if(typeof this.onPostChangeDateFilter=='function') setTimeout(this.onPostChangeDateFilter,0);
}
hirsCalendar.prototype.removeDateFilter=function(pRow_s,pVal_s,pType_s){
	if(typeof this.onPreRemoveDateFilter=='function') this.onPreRemoveDateFilter();
	if(!this.checkDateFilter(pRow_s,pVal_s,pType_s)) {alert('Filter does not exists.');return;}
	var fPos=this.searchDateFilter(pRow_s,pVal_s,pType_s);
	this.dsDates.removeFilter(this.dateFilters['fct'][fPos], true);
	this.dateFilters['row'].splice(fPos,1);
	this.dateFilters['val'].splice(fPos,1);
	this.dateFilters['type'].splice(fPos,1);
	this.dateFilters['fct'].splice(fPos,1);
	if(this.debug) this.debugDataset();
	if(typeof this.onPostRemoveDateFilter=='function') setTimeout(this.onPostRemoveDateFilter,0);
	if(typeof this.onPostChangeDateFilter=='function') setTimeout(this.onPostChangeDateFilter,0);
}
hirsCalendar.prototype.removeAllDateFilter=function(){
	if(typeof this.onPreRemoveAllDateFilter=='function') this.onPreRemoveAllDateFilter();
	this.dsDates.removeAllFilters(true);
	this.initDateFilter();
	if(this.debug) this.debugDataset();
	if(typeof this.onPostRemoveAllDateFilter=='function') setTimeout(this.onPostRemoveAllDateFilter,0);
	if(typeof this.onPostChangeDateFilter=='function') setTimeout(this.onPostChangeDateFilter,0);
}
hirsCalendar.prototype.checkDateFilter=function(pRow_s,pVal_s,pType_s){
	var fPos=this.searchDateFilter(pRow_s,pVal_s,pType_s);
	if(fPos==-1) return false;
	else return true;
}
hirsCalendar.prototype.searchDateFilter=function(pRow_s,pVal_s,pType_s){
	var f=this.dateFilters;
	for(var i=0;i<f['row'].length;i++) 
		if(f['row'][i]==pRow_s && f['val'][i]==pVal_s && f['type'][i]==pType_s) return i;
	return -1;
}
hirsCalendar.prototype.debugDataset=function(){
	if(this.dsDates.getRowCount()==0) return;
	var oDsCont=$('dsCont');
	var rows=this.dsDates.getData();
	var str='<table border="1"><tr>';
	var colNames=[];
	// Generate the header row:
	for(var cname in rows[0]){
		str+='<th>'+cname+'</th>';
		colNames.push(cname);
	}
	str+='</tr>';
	// Now write out a table row for every data set row.
	for(var i=0;i<rows.length;i++){
		str+='<tr>';
		for(var j=0;j<colNames.length;j++){
			str+='<td>'+Spry.Utils.encodeEntities(''+rows[i][colNames[j]])+'</td>';
		}
		str += '</tr>';
	}
	str+='</table>';
	oDsCont.innerHTML=str;
}
hirsCalendar.prototype.clearDates=function(){
	for(var i in this.views){
		var a=this.views[i]['dateElementArr'];
		if(a && a.length && a.length>0) for(var ii=0;ii<a.length;ii++) {
			try{
				a[ii].parentNode.removeChild(a[ii]);
			}catch(err){}
		}
		a=[];
		var g=this.views[i]['gridElement'];
		switch(this.views[i]['name']){
			case 'month':{
				for(var ri=1;ri<g.rows.length;ri++){
					var r=g.rows[ri];
					for(var ci=1;ci<r.cells.length;ci++) {
						var c=r.cells[ci];
						if(c.getAttribute('mlDate')&&this.gridClassNames['month']['td_dat']) c.className=this.gridClassNames['month']['td_dat'];
						else c.className=this.gridClassNames['month']['td'];
					}
				}
				break;
			}
			case 'week':{
				var r=g.rows[1];
				for(var ci=0;ci<r.cells.length;ci++){
					var c=r.cells[ci];
					if(c.getAttribute('mlDate')&&this.gridClassNames['week']['td_dat']) c.className=this.gridClassNames['week']['td_dat'];
					else c.className=this.gridClassNames['week']['td'];
				}
				break;
			}
			case 'day':{
				var c=$('calDayGrid');
				c.className=this.gridClassNames['day']['td'];
				break;
			}
		}
	}
}
hirsCalendar.prototype.fillDates=function(){
	if(!this.dsDatesLoaded) return;
	var r=this.dsDates.getData();
	var a=this.views[this.getActiveViewName()]['dateElementArr'];
	if(this.userSettings['isPregnant']) this.showPregDates();
	else if(this.userSettings['lastMensDat']!=''&&this.userSettings['showFertDates']) this.calcMensDates();
	if(!r || !r.length || r.length==1) {
		this.setCursor(this.cursor['default']);
		return;
	}
	for(var i=0;i<r.length;i++){
		var d=parseDate(r[i]['date']);
		var oDayField=this.getDayField(d);
		if(r[i]['title']=='dummy'||dateFormat(this.getFieldDate(oDayField),'yyyy-mm-dd')!=dateFormat(d,'yyyy-mm-dd')) continue;			// abort iteration through dummy column (which is required because Spry can not deal with empty recordsets
		var id=r[i]['id'];
		var ne=this.appendElement('div',id,oDayField,this.gridClassNames[this.getActiveViewName()]['icoBox'],'');
		var ico=r[i]['icon'];
		if(this.getActiveViewName()=='month'){
			if(ico!='') var oIco=this.appendElement('img','ico_'+id,ne,'calDateIco','');
		} else {
			var tbl=this.appendElement('table','tbl_'+id,ne,'calDateItemTbl','');
			var tr=tbl.insertRow();
			var tc=tr.insertCell();
			if(ico!='') var oIco=this.appendElement('img','ico_'+id,tc,'calDateIco','');
			tc.style.verticalAlign='top';
			tc=tr.insertCell();
			tc.innerHTML='<span class="calDateItemTitle" id="title_'+id+'">'+r[i]['title']+'</span>';
		}
		if(ico!=''){
			oIco.src=this.icoPath+ico;
			oIco.style.cursor='pointer';
		}
		ne.setAttribute('mlName','dateItem');
		ne.setAttribute('mlDate',dateFormat(d,'dd.mm.yyyy'));
		ne.setAttribute('mlTime',r[i]['time']);
		ne.setAttribute('mlTitle',r[i]['title']);
		ne.setAttribute('mlPrevContType',r[i]['prevContType']);
		ne.setAttribute('mlPrevCont',r[i]['prevCont']);
		ne.setAttribute('mlContentType',r[i]['contentType']);
		ne.setAttribute('mlContent',r[i]['content']);
		ne.setAttribute('mlCanEdit',r[i]['canEdit']);
		ne.setAttribute('mlEditUrl',r[i]['editUrl']);
		ne.setAttribute('mlCanDelete',r[i]['canDelete']);
		ne.setAttribute('mlDeleteUrl',r[i]['deleteUrl']);
		ne.style.cursor='pointer';
		var self=this;
		Spry.Utils.addEventListener(ne,'mouseover',function(e){self.onDateMoveover(e);},false);
		Spry.Utils.addEventListener(ne,'mouseout',function(e){self.onDateMoveout(e);},false);
		Spry.Utils.addEventListener(ne,'dblclick',function(e){self.onDateDblClick(e);},false);
		Spry.Utils.addEventListener(ne,'click',function(e){self.onDateClick(e);},false);
		a.push(ne);
	}
	this.setCursor(this.cursor['default']);
}
hirsCalendar.prototype.reFillDates=function(){
	this.setCursor(this.cursor['busy']);
	if(!this.monthGridState) return;
	this.setDateRange();
	this.writeDate();
	this.refillGrids();
	if(this.dateFilters && this.dateFilters['row'].length>0) this.removeAllDateFilter();
	this.setPregWeekFilterVisible();
	this.fillDates();
}
hirsCalendar.prototype.setPregWeekFilterVisible=function(){
	if(!$('filterRow_pregWeek')) return;
	if(this.userSettings['isPregnant']) $('filterRow_pregWeek').style.display='block';
	else $('filterRow_pregWeek').style.display='none';
}
hirsCalendar.prototype.cleanDateEleArr=function(){
	this.views['month']['dateElementArr']=[];
	this.views['week']['dateElementArr']=[];
	this.views['day']['dateElementArr']=[];
}
hirsCalendar.prototype.showPregDates=function(){
	var self=this;
	var a=this.views[this.getActiveViewName()]['dateElementArr'];
	var d=this.userSettings['birthDueDate'];
	if(d>=this.firstDate && d<=this.lastDate){
		var oDayField=this.getDayField(d);
		if(this.gridClassNames[this.getActiveViewName()]['td_dueDat']) oDayField.className=this.gridClassNames[this.getActiveViewName()]['td_dueDat'];
		var ne=this.appendElement('div','f_'+d,oDayField,this.gridClassNames[this.getActiveViewName()]['icoBox'],'');
		if(this.getActiveViewName()=='month'){
			var oIco=this.appendElement('img','ico_f_'+d,ne,'calDateIco','');
		} else {
			var tbl=this.appendElement('table','tbl_f_'+d,ne,'calDateItemTbl','');
			var tr=tbl.insertRow();
			var tc=tr.insertCell();
			var oIco=this.appendElement('img','ico_f_'+d,tc,'calDateIco','');
			tc.style.verticalAlign='top';
			tc=tr.insertCell();
			this.appendElement('span','ico_f_'+d,tc,'calDateItemTitle',this.lng.duedateboxtitle);
		}
		oIco.src=this.icoPath+this.pregDueDatIco;
		Spry.Utils.addEventListener(ne,'mouseover',function(e){self.onDateMoveover(e);},false);
		Spry.Utils.addEventListener(ne,'mouseout',function(e){self.onDateMoveout(e);},false);
		ne.setAttribute('mlName','birthDueDate');
		ne.setAttribute('mlDate',dateFormat(d,'dd.mm.yyyy'));
		ne.setAttribute('mlTitle',this.lng.duedateboxtitle);
		ne.setAttribute('mlPrevCont',this.lng.duedateboxcontent);
		ne.setAttribute('mlContent','');
		a.push(ne);
	}
}
hirsCalendar.prototype.calcMensDates=function(){
	var refDat=dateAdd('d',this.userSettings['mensCycleLength'],this.userSettings['lastMensDat']);
	var diff=dateDiff('d',this.userSettings['lastMensDat'],this.firstDate)-1;
	var addD=(Math.floor(diff/this.userSettings['mensCycleLength'])+2)*this.userSettings['mensCycleLength'];
	var refDat=dateAdd('d',addD,this.userSettings['lastMensDat']);
	this.fillMensDates(refDat);
	if(dateAdd('d',-this.userSettings['mensCycleLength'],refDat)>=this.firstDate) this.fillMensDates(dateAdd('d',-this.userSettings['mensCycleLength'],refDat));
	this.fillMensDates(dateAdd('d',this.userSettings['mensCycleLength'],refDat));
}
hirsCalendar.prototype.fillMensDates=function(pRefDat_d){
	var self=this;
	var a=this.views[this.getActiveViewName()]['dateElementArr'];
	var refDat=pRefDat_d;
	for(var i=0;i<this.mensCycle['days'].length;i++){
		var d=this.mensCycle['days'][i];
		var dat=dateAdd('d',-d,refDat);
		var oDayField=this.getDayField(dat);
		if(dateFormat(this.getFieldDate(oDayField),'yyyy-mm-dd')!=dateFormat(dat,'yyyy-mm-dd')) continue;
		if(this.mensCycle['className'][this.getActiveViewName()][i]!='') {
			if(this.getActiveViewName()=='week'&&(datePart('w',dat)>5||datePart('w',dat)==0)) oDayField.className=this.mensCycle['className'][this.getActiveViewName()][i]+'We';
			else oDayField.className=this.mensCycle['className'][this.getActiveViewName()][i];
		}
		if(this.mensCycle['title'][i]!=''||this.mensCycle['ico'][i]!=''){
			var ne=this.appendElement('div','f_'+d,oDayField,this.gridClassNames[this.getActiveViewName()]['icoBox'],'');
			if(this.getActiveViewName()=='month'){
				var oIco=this.appendElement('img','ico_f_'+d,ne,'calDateIco','');
			} else {
				var tbl=this.appendElement('table','tbl_f_'+d,ne,'calDateItemTbl','');
				var tr=tbl.insertRow();
				var tc=tr.insertCell();
				var oIco=this.appendElement('img','ico_f_'+d,tc,'calDateIco','');
				tc.style.verticalAlign='top';
				tc=tr.insertCell();
				this.appendElement('span','txt_f_'+d,tc,'calDateItemTitle',this.mensCycle['title'][i])
			}
			oIco.src=this.icoPath+this.mensCycle['ico'][i];
			Spry.Utils.addEventListener(ne,'mouseover',function(e){self.onDateMoveover(e);},false);
			Spry.Utils.addEventListener(ne,'mouseout',function(e){self.onDateMoveout(e);},false);
			ne.setAttribute('mlName','mensDate');
			ne.setAttribute('mlDate',dateFormat(dat,'dd.mm.yyyy'));
			ne.setAttribute('mlTitle',this.mensCycle['title'][i]);
			ne.setAttribute('mlPrevCont',this.mensCycle['content'][i]);
			ne.setAttribute('mlContent',this.mensCycle['content'][i]);
			a.push(ne);
		}
	}
}
hirsCalendar.prototype.applyFilterOnElements=function(){
	var a=this.views[this.getActiveViewName()]['dateElementArr'];
	var r=this.dsDates.getData();
	if(!a || !a.length || a.length==0) return;
	for(var i=0;i<a.length;i++){
		if(a[i].getAttribute('mlName')=='mensDate'||!r||!r.length||r.length==0) continue;
		for(var ii=0;ii<r.length;ii++){
			if(r[ii]['id']==a[i].id) {
				a[i].style.display=this.calItemDisplayType;
				break;
			}
			a[i].style.display='none';
		}
	}
}
hirsCalendar.prototype.onViewChange=function(){
	var self=this;
	this.setCursor(this.cursor['busy']);
	this.cleanDateEleArr();
	this.activeView=this.calContainer.getCurrentTabIndex();
	if(this.getActiveViewName()=='day') mlSelect.onOptionClick(2,true);
	this.setDateRange();
	setTimeout(function(){self.saveUserSettings()},1);
	setTimeout(function(){self.reloadSettings();},1);
	//setTimeout(function(){self.loadDates();},1);
}
hirsCalendar.prototype.getEventTarget=function(e){return e.srcElement?e.srcElement:e.target;}
hirsCalendar.prototype.getMouseEventTarget=function(e){
	var ele=this.getEventTarget(e);
	if(ele.id.indexOf('ico_')>-1||ele.id.indexOf('title_')>-1||ele.id.indexOf('txt_')>-1||ele.tagName.toLowerCase()=='td'||ele.tagName.toLowerCase()=='tr') {
		if(this.getActiveViewName()=='month'){
			ele=ele.parentNode;
		} else if(ele.tagName.toLowerCase()=='tr') {
			ele=ele.parentNode.parentNode.parentNode;
		} else if(ele.tagName.toLowerCase()=='td') {
			ele=ele.parentNode.parentNode.parentNode.parentNode;
		} else {
			ele=ele.parentNode.parentNode.parentNode.parentNode.parentNode;
		}
	}
	return ele;
}
hirsCalendar.prototype.onDateMoveover=function(e){
	var ele=this.getMouseEventTarget(e);
	if(ele.getAttribute('mlTime')&&ele.getAttribute('mlTime')!='') var t=dateFormat(parseDateTime(ele.getAttribute('mlDate')+' '+ele.getAttribute('mlTime')),'dd.mm.yyyy, hh:nn')+' '+this.lng.timesymbol+': '+ele.getAttribute('mlTitle');
	else var t=ele.getAttribute('mlDate')+': '+ele.getAttribute('mlTitle');
	var c=ele.getAttribute('mlPrevCont');
	this.showDatInfoBox(t,c,this.calcEventPos(e));
	e.cancelBubble=true;
	return false;
}
hirsCalendar.prototype.onDateMoveout=function(e){
	this.hideDatInfoBox();
	e.cancelBubble=true;
	return false;
}
hirsCalendar.prototype.onDateClick=function(e){
	var ele=this.getMouseEventTarget(e);
	var h='100%';
	var calTitle=ele.getAttribute('mlDate')+': '+ele.getAttribute('mlTitle');
	var canEdit=ele.getAttribute('mlCanEdit')&&ele.getAttribute('mlCanEdit')=='true'?true:false;
	var canDelete=ele.getAttribute('mlCanDelete')&&ele.getAttribute('mlCanDelete')=='true'?true:false;
	var contType=ele.getAttribute('mlContentType');
	switch(contType){
		case 'text': {var tmpCont=ele.getAttribute('mlContent');break;}
		case 'http': {var tmpCont='Loading';break;}
		default: {var tmpCont=ele.getAttribute('mlContent');break;}
	}
	var calCont='<div id="calDlgContInner" class="calDlgContInner" style="height: {innerHeight};">'+tmpCont+'</div>';
	if(canEdit||canDelete){
		h='340px';
		var btnRow=this.calDlgBtnRow.toString();			// use toSting() method here to prevent the original variable from being overwritten
		var regEx=new RegExp('\{editBtn\}','gi');
		if(canEdit){
			var editBtn=this.calDlgEditBtn.toString();
			var u=ele.getAttribute('mlEditUrl');
			var ev='';
			if(u.substr(0,u.indexOf(':'))=='jsCmd') ev=u.replace(new RegExp('jsCmd:','i'),'');
			else if(u.substr(0,u.indexOf(':'))=='url') ev='document.location=\''+u.replace(new RegExp('url:','i'),'')+'\'';
			else if(u.substr(0,u.indexOf(':'))=='urlBlank') ev='window.open(\''+u.replace(new RegExp('url:','i'),'')+'\')';
			btnRow=btnRow.replace(regEx,editBtn.replace(new RegExp('\{onClickEvent\}','gi'),ev));
		} else btnRow=btnRow.replace(regEx,'');
		var regEx=new RegExp('\{delBtn\}','gi');
		if(canDelete){
			var delBtn=this.calDlgDelBtn.toString();
			var u=ele.getAttribute('mlDeleteUrl');
			var ev='';
			if(u.substr(0,u.indexOf(':'))=='jsCmd') ev=u.replace(new RegExp('jsCmd:','i'),'');
			else if(u.substr(0,u.indexOf(':'))=='url') ev='window.open(\''+u.replace(new RegExp('url:','i'),'')+'\')';
			btnRow=btnRow.replace(regEx,delBtn.replace(new RegExp('\{onClickEvent\}','gi'),ev));
		} else btnRow=btnRow.replace(regEx,'');
		calCont=calCont+btnRow;
	}
	calCont=calCont.replace(new RegExp('\{innerHeight\}','gi'),h);
	this.openCalDlg(calTitle,calCont);
	if(contType=='http') this.getEleDlgCont(ele.getAttribute('mlContent'));
	e.cancelBubble=true;
	return false;
}
hirsCalendar.prototype.onDateDblClick=function(e){
	var ele=this.getMouseEventTarget(e);
	var canEdit=ele.getAttribute('mlCanEdit')&&ele.getAttribute('mlCanEdit')=='true'?true:false;
	if(canEdit){
		alert(ele.getAttribute('mlEditUrl'));
	}
	e.cancelBubble=true;
	return false;
}
hirsCalendar.prototype.getEleDlgCont=function(pUrl_s){
	Spry.Utils.updateContent($('calDlgContInner'), pUrl_s, null, {useCache: false,async: true})
}
hirsCalendar.prototype.showDatInfoBox=function(pTitle_s,pContent_s,pPos_a){
	if(!this.datInfoBoxInit) this.initDatInfoBox();
	this.datInfoBox.childNodes[0].innerHTML=pTitle_s;
	this.datInfoBox.childNodes[1].innerHTML=pContent_s;
	this.datInfoBox.style.top=pPos_a['y'];
	this.datInfoBox.style.left=pPos_a['x'];
	this.datInfoBox.style.display='block';
}
hirsCalendar.prototype.hideDatInfoBox=function(){
	this.datInfoBox.style.display='none';
}
hirsCalendar.prototype.openCalDlg=function(pTitle_s,pContent_s,pWidth_i,pHeight_i){
	if(!pWidth_i)pWidth_i='500px';
	if(!pHeight_i)pHeight_i='400px';
	var d=$('dlg_calDlg');
	d.style.width=pWidth_i;
	d.style.height=pHeight_i;
	d.childNodes[1].style.height=parseInt(pHeight_i)-25;
	this.calDlg.open(pTitle_s,pContent_s);
}
hirsCalendar.prototype.closeCalDlg=function(){
	this.calDlg.close();
}
hirsCalendar.prototype.initDatInfoBox=function(){
	var ne=document.createElement('div');
	document.body.appendChild(ne);
	ne.id='datInfoBox';
	ne.className='datInfoBox';
	this.appendElement('div','datInfoBoxTitle',ne,'datInfoBoxTitle','');
	this.appendElement('div','datInfoBoxCont',ne,'datInfoBoxCont','');
	this.datInfoBox=ne;
	this.datInfoBoxInit=true;
}
hirsCalendar.prototype.calcEventPos=function(e){
	var ele=this.getEventTarget(e);
	var parent=ele.parentNode;
	var event=e;
	if(e.x){					// Internet Explorer (Mozilla based browser don't support e.x)
		var x=parseInt(e.clientX,10)+parseInt(window.document.body.scrollLeft,10);
		var y=parseInt(e.clientY,10)+parseInt(window.document.body.scrollTop,10);
		var w=parseInt(window.document.body.offsetWidth,10);
		var h=parseInt(window.document.body.offsetHeight,10);
		var sx=parseInt(window.document.body.scrollLeft,10);
		var sy=parseInt(window.document.body.scrollTop,10);
	} else {					// Mozilla based browsers (Firefox, Netscape)
		var x=parseInt(event.clientX,10);
		var y=parseInt(event.clientY,10);
		var w=parseInt(window.innerWidth,10);
		var h=parseInt(window.innerHeight,10);
		var sx=parseInt(window.scrollX,10);
		var sy=parseInt(window.scrollY,10);
	}
	var retVal=[];
	retVal['x']=x+265<w+sx?x+15:x-265;
	retVal['y']=y-15>sy?y-15:y;
	return retVal;
}

hirsCalendar.prototype.initCalViewSelector=function(){
	if(!mlSelect) mlSelect=new mlSelect();
	var self=this;
	var calSelProps={
		container: $('calViewSelect'),
		className: 'mlSelect',
		dropDownIco: this.monthSelIco['dropdown']
	};
	mlSelect.create('calViewSel',calSelProps);
	mlSelect.addOption('month',lng.viewtabmonth);
	mlSelect.addOption('week',lng.viewtabweek);
	mlSelect.addOption('day',lng.viewtabday);
	mlSelect.onChange=function(){self.calContainer.showPanel(mlSelect.value+'View');self.onViewChange();};
}
hirsCalendar.prototype.initMonthSelecor=function(){
	var self=this;
	var oContainer=$('monthSelContainer');
	var monthSelOuter=this.appendElement('div','monthSelOuter',oContainer,'monthSelOuter','');
	var selIco=this.appendElement('img','monthSelIco',monthSelOuter,'monthSelIco','');
	var datBox=this.appendElement('div','monthDatBox',monthSelOuter,'monthSelDatBox',this.monthNameArr[datePart('m',this.currDat)-1]+'&nbsp;'+datePart('yyyy',this.currDat));
	var selBox=this.appendElement('div','monthSel',monthSelOuter,'monthSel','');
	selIco.src=this.monthSelIco['dropdown'];
	Spry.Utils.addEventListener(datBox,'click',function(e){if($('monthSel').style.display=='block') self.hideMonthSel();else self.showMonthSel();e.cancelBubble=true;return false;},false);
	Spry.Utils.addEventListener(selIco,'click',function(e){if($('monthSel').style.display=='block') self.hideMonthSel();else self.showMonthSel();e.cancelBubble=true;return false;},false);
	Spry.Utils.addEventListener(selBox,'click',function(e){e.cancelBubble=true;return false;},false);
	var selYear=this.appendElement('table','monthSelY',selBox,'monthSelYearTbl','');
	var r=selYear.insertRow(0);
	var c=r.insertCell(0);
	c.className='monthSelYearRow';
	c.style.textAlign='left';
	var ne=this.appendElement('img','msSelPrevYear',c,'','');
	ne.src=this.monthSelIco['prev'];
	ne.style.cursor='pointer';
	Spry.Utils.addEventListener(ne,'click',function(e){var o=$('msCurrYear');o.innerHTML=parseInt(o.innerHTML)-1;e.cancelBubble=true;return false;},false);
	var c=r.insertCell(1);
	c.className='monthSelYearRow';
	c.style.textAlign='center';
	var ne=this.appendElement('div','msCurrYear',c,'yearField',datePart('yyyy',this.currDat));
	var c=r.insertCell(2);
	c.className='monthSelYearRow';
	c.style.textAlign='right';
	var ne=this.appendElement('img','msSelNextYear',c,'','');
	ne.src=this.monthSelIco['next'];
	ne.style.cursor='pointer';
	Spry.Utils.addEventListener(ne,'click',function(e){var o=$('msCurrYear');o.innerHTML=parseInt(o.innerHTML)+1;e.cancelBubble=true;return false;},false);
	var selList=this.appendElement('ul','monthSelList',selBox,'monthSelList','');
	for(var i=0;i<12;i++){
		var ne=this.appendElement('li','monthSelListItem_'+i,selList,'monthSelListItem',this.monthNameArr[i]);
		ne.setAttribute('mlMonth',i);
		Spry.Utils.addEventListener(ne,'click',function(e){self.selectMonth(self.getEventTarget(e).getAttribute('mlMonth'));},false);
		Spry.Utils.addEventListener(ne,'mouseover',function(e){self.getEventTarget(e).className='monthSelListItemOver';},false);
		Spry.Utils.addEventListener(ne,'mouseout',function(e){self.getEventTarget(e).className='monthSelListItem';},false);
	}
	Spry.Utils.addEventListener(document.body,'click',function(){self.hideMonthSel();},false);
}
hirsCalendar.prototype.showMonthSel=function(){
	$('msCurrYear').innerHTML=datePart('yyyy',this.currDat);
	$('monthSel').style.display='block';
}
hirsCalendar.prototype.hideMonthSel=function(){$('monthSel').style.display='none';}
hirsCalendar.prototype.selectMonth=function(pMonth_i){
	var add=pMonth_i-datePart('m',this.currDat)+1;
	var y=parseInt($('msCurrYear').innerHTML);
	if(y!=datePart('yyyy',this.currDat)) add+=(y-datePart('yyyy',this.currDat))*12;
	this.hideMonthSel();
	this.skipDat('m',add);
}
hirsCalendar.prototype.initFilterBox=function(){
	var self=this;
	var oContainer=$('filterBoxOuter');
	if(!filters) return;
	var rows=Math.ceil(this.filters.length/3);
	var fTbl=this.appendElement('table','filterTbl',oContainer,'filterTbl','');
	var c=-1;
	for(var i in this.filters){
		c++;
		if(c%3==0) var r=fTbl.insertRow(fTbl.rows.length);
		var f=this.filters[i];
		var fBox=r.insertCell(c%3);
		fBox.id='filterBox_'+f['name'];
		fBox.className='filterBox';
		var fIco=this.appendElement('img','filterChkIco_'+f['name'],fBox,'filterChkIco','');
		var fTxt=this.appendElement('div','filterTxt_'+f['name'],fBox,'filterTxt',f['title']);
		fIco.src=this.icoPath+this.filterChkIco;
		fBox.setAttribute('title',f['hint']);
		fBox.setAttribute('mlFilterName',f['name']);
		Spry.Utils.addEventListener(fBox,'click',function(e){self.onFilterBoxClick(e);e.cancelBubble=true;return false;},false);
	}
}
// this function is required because of changes requested by hirslanden
hirsCalendar.prototype.initFilterBox_V2=function(){
	var self=this;
	var oContainer=$('filterBoxOuter');
	if(!filters) return;
	var fTblCol=['ico','title','name','linkText','fct'];
	var fTbl=$('filterTbl');
	for(var i in this.filters){
		var r=fTbl.insertRow(fTbl.rows.length);
		var f=this.filters[i];
		var icoCell=r.insertCell(r.cells.length).innerHTML=f['ico']!=''?'<img src="'+f['ico']+'">':'';
		var titleCell=r.insertCell(r.cells.length).innerHTML=f['title'];
		var chkCell=r.insertCell(r.cells.length);
		chkCell.style.textAlign='center';
		var fIco=this.appendElement('img','filterChkIco_'+f['name'],chkCell,'filterChkIco','');
		fIco.src=this.icoPath+this.filterChkIco;
		fIco.className='filterIco';
		var linkCell=r.insertCell(r.cells.length);
		if(f['linkText'] && f['linkText']!=''){
			var fLnk=this.appendElement('a','filterLink_'+f['name'],linkCell,'','');
			fLnk.innerHTML=f['linkText'];
			fLnk.href='#';
			Spry.Utils.addEventListener(fLnk,'click',f['fct'],false);
		}
		//linkCell=r.insertCell().innerHTML=f['link']!=''?'<a href="#">'+f['link']+'</a>':'';
		fBox=chkCell;
		fBox.id='filterBox_'+f['name'];
		fBox.setAttribute('title',f['hint']);
		fBox.setAttribute('mlFilterName',f['name']);
		Spry.Utils.addEventListener(fBox,'click',function(e){self.onFilterBoxClick(e);e.cancelBubble=true;return false;},false);
		r.id='filterRow_'+f['name'];
	}
}
hirsCalendar.prototype.onFilterBoxClick=function(e){
	var self=this;
	var ele=self.getEventTarget(e);
	if(!ele.getAttribute('mlFilterName')) ele=ele.parentNode;
	var f=this.filters[ele.getAttribute('mlFilterName')];
	if(this.checkDateFilter(f['col'],f['val'],f['type'])){
		self.removeDateFilter(f['col'],f['val'],f['type']);
		ele.childNodes[0].src=this.icoPath+this.filterChkIco;
	} else {
		self.addDateFilter(f['col'],f['val'],f['type']);
		ele.childNodes[0].src=this.icoPath+this.filterUnChkIco;
	}
}
hirsCalendar.prototype.initToolbox=function(){
	var self=this;
	var oContainer=$('calToolboxRow');
	var tbBox=this.appendElement('div','calToolboxOuter',oContainer,'calToolboxOuter','');
	var tbIco=this.appendElement('img','calToolboxIco',tbBox,'calToolboxIco','');
	var tbBox=this.appendElement('div','toolboxBox',tbBox,'toolboxBox','');
	tbIco.src=this.toolboxIco;
	Spry.Utils.addEventListener(tbIco,'click',function(e){if($('toolboxBox').style.display=='block') self.hideToolbox();else self.showToolbox();e.cancelBubble=true;return false;},false);
	Spry.Utils.addEventListener(tbBox,'click',function(e){e.cancelBubble=true;return false;},false);
	for(var i in this.toolboxItems){
		var t=this.toolboxItems[i];
		var ne=this.appendElement('div','toolboxItem_'+t['name'],tbBox,'toolboxListItem','');
		if(t['ico']!=''){
			var oIco=this.appendElement('img','toolboxIco_'+t['name'],ne,'toolboxListIco','');
			oIco.src=t['ico'];
		}
		var oTxt=this.appendElement('div','toolboxTxt_'+t['name'],ne,'toolboxListTxt',t['title']);
		ne.setAttribute('title',t['hint']);
		Spry.Utils.addEventListener(ne,'click',t['fct'],false);
		Spry.Utils.addEventListener(ne,'mouseover',function(e){var ele=self.getEventTarget(e);if(ele.id.indexOf('toolboxItem_')==-1)ele=ele.parentNode; ele.className='toolboxListItemOver';},false);
		Spry.Utils.addEventListener(ne,'mouseout',function(e){var ele=self.getEventTarget(e);if(ele.id.indexOf('toolboxItem_')==-1)ele=ele.parentNode; ele.className='toolboxListItem';},false);
		Spry.Utils.addEventListener(ne,'click',function(){self.hideToolbox();},false);
	}
	Spry.Utils.addEventListener(document.body,'click',function(){self.hideToolbox();},false);
	this.legendRequest=Spry.Utils.loadURL('GET',this.legendURL,false);
	this.helpRequest=Spry.Utils.loadURL('GET',this.helpURL,false);
}
hirsCalendar.prototype.showToolbox=function(){$('toolboxBox').style.display='block';}
hirsCalendar.prototype.hideToolbox=function(){$('toolboxBox').style.display='none';}
hirsCalendar.prototype.openSettingsDlg=function(){
	if(!this.settingsDlgCont){
		this.settingsDlgCont=$('settingsDlgCont').innerHTML;
		$('settingsDlgCont').innerHTML='';
	}
	this.openCalDlg(this.lng.settingsdlgtitle,'<div class="calDlgContInner" id="settingsInnerDlg">'+this.settingsDlgCont+'</div>','375px','300px');
	//this.openCalDlg(this.lng.settingsdlgtitle,'<div class="calDlgContInner" id="settingsInnerDlg">'+this.settingsDlgCont+'</div>','275px','200px');
}
hirsCalendar.prototype.saveSettings=function(){
	this.dsSettingsLoaded=false;
	var delPreg=this.userSettings['isPregnant']&&!$('imPregnant').checked?true:false;
	this.settingsDlgCont=$('settingsInnerDlg').innerHTML;
	this.userSettings['showFertDates']=$('hideFertDates').checked;
	if($('imPregnant')) this.userSettings['isPregnant']=$('imPregnant').checked;
	else this.userSettings['isPregnant']=false;
	if(this.userSettings['isPregnant']) this.userSettings['birthDueDate']=parseDate($('birthDueDate').value);
	else this.userSettings['birthDueDate']='';
	this.userSettings['lastMensDat']=parseDate($('lastMensDate').value);
	this.userSettings['mensCycleLength']=$('mensCycleLen').value;
	this.dsSettingsLoaded=true;
	this.closeSettingsDlg();
	var u=this.saveSettingsUrl+'&isPregnant='+this.userSettings['isPregnant']
														+'&dueDate='+dateFormat(this.userSettings['birthDueDate'],'yyyy-mm-dd')
														+'&showFertDates='+this.userSettings['showFertDates']
														+'&lastMensDate='+dateFormat(this.userSettings['lastMensDat'],'yyyy-mm-dd')
														+'&cycleLen='+this.userSettings['mensCycleLength']
														+'&delPreg='+delPreg;
	var dummyReq=Spry.Utils.loadURL('GET',u,true);
	var self=this;
	if(this.isMyBaby) setTimeout(function(){self.reloadSettings();},1);
	else setTimeout(function(){self.loadDates();},1);
}
hirsCalendar.prototype.closeSettingsDlg=function(){this.calDlg.close();}
hirsCalendar.prototype.showLegend=function(){
	var cont='<div class="calDlgContInner">'+this.legendRequest['xhRequest'].responseText+'</div>';
	this.openCalDlg(this.lng.legenddlgtitle,cont);
}
hirsCalendar.prototype.showHelp=function(){
	var cont='<div class="calDlgContInner">'+this.helpRequest['xhRequest'].responseText+'</div>';
	this.openCalDlg(this.lng.helpdlgtitle,cont);
}
hirsCalendar.prototype.editDate=function(pId_i,pDateTime_d,pTitle_s,pContent_s,pIco_i){
	if(!this.editDateDlgCont){
		this.editDateDlgCont=$('editDateDlgCont').innerHTML;
		$('editDateDlgCont').innerHTML='';
	}
	this.openCalDlg(this.lng.editdatedlgtitle,'<div class="calDlgContInner" id="editDateInnerDlg">'+this.editDateDlgCont+'</div>','350px','325px');
	$('fldDateId').value=pId_i;
	$('fldDateDate').value=dateFormat(pDateTime_d,'dd.mm.yyyy');
	$('fldDateTime').value=dateFormat(pDateTime_d,'hh:nn');
	$('fldDateTitle').value=pTitle_s;
	$('fldDateContent').value=pContent_s;
	var iBox=$('dateIcoBox');
	for(var i in iBox.childNodes){
		var r=iBox.childNodes[i];
		if(r.tagName&&r.tagName.toLowerCase()=='input'&&r.value==pIco_i){
			r.checked=true;
		}
	}
}
hirsCalendar.prototype.saveDate=function(){
	var self=this;
	var iBox=$('dateIcoBox');
	for(var i in iBox.childNodes){
		var r=iBox.childNodes[i];
		if(r.tagName&&r.tagName.toLowerCase()=='input'&&r.checked){
			var icoId=r.value;
			break;
		}
	}
	var u=this.saveDateUrl+'&dateId='+$('fldDateId').value
												+'&date='+$('fldDateDate').value
												+'&time='+$('fldDateTime').value
												+'&title='+$('fldDateTitle').value
												+'&content='+$('fldDateContent').value
												+'&ico='+icoId;
	this.calDlg.close();
	var fct=function(){setTimeout(function(){self.onPostSaveDate();},1);};
	var dummyReq=Spry.Utils.loadURL('POST',u,true,fct);
}
hirsCalendar.prototype.onPostSaveDate=function(){
	var self=this;
	setTimeout(function(){self.loadDates();},1);
	//alert(lng.datesavedmsg);
}
hirsCalendar.prototype.deleteDate=function(pDateId_i){
	if(!confirm(this.lng.deldateconfmsg)) return;
	var self=this;
	var u=this.delDateUrl+'&dateId='+pDateId_i;
	var dummyReq=Spry.Utils.loadURL('GET',u,true);
	this.calDlg.close();
	setTimeout(function(){self.loadDates();},0);
	alert(this.lng.deldatemsg);
}	
hirsCalendar.prototype.editWeight=function(pDate_d,pWeight_i,pTbl_i){
	if(!this.editWeightDlgCont){
		this.editWeightDlgCont=$('editWeightDlgCont').innerHTML;
		$('editWeightDlgCont').innerHTML='';
	}
	this.openCalDlg(this.lng.editweightdlgtitle,'<div class="calDlgContInner" id="editWeightInnerDlg">'+this.editWeightDlgCont+'</div>','310px','140px');
	this.oldWeight=pWeight_i;
	this.oldWeightDate=pDate_d;
	this.oldWeightTbl=pTbl_i;
	$('weightDate').value=dateFormat(pDate_d,'dd.mm.yyyy');
	$('fldWeight').value=pWeight_i==0?'':pWeight_i;
	var so=$('weightTable');
	for(var i=1;i<so.options.length;i++){
		if(so.options[i].value==pTbl_i){
			so.selectedIndex=i;
			break;
		}
	}
}
hirsCalendar.prototype.deleteWeight=function(pDate_d,pTbl_i){
	if(!confirm(this.lng.delweightconfmsg)) return;
	var self=this;
	var u=this.delWeightUrl+'&tbl='+pTbl_i
												 +'&date='+dateFormat(pDate_d,'yyyy-mm-dd');
	var dummyReq=Spry.Utils.loadURL('GET',u,true);
	this.closeWeightDlg();
	setTimeout(function(){self.loadDates();},1);
	alert(this.lng.delweightmsg);
}
hirsCalendar.prototype.saveWeight=function(){
	var self=this;
	var u=this.saveWeightUrl+'&tbl='+$('weightTable').value
													+'&weight='+$('fldWeight').value
													+'&date='+dateFormat(parseDate($('weightDate').value),'yyyy-mm-dd')
													+'&oldTbl='+this.oldWeightTbl
													+'&oldWeight='+this.oldWeight
													+'&oldDate='+dateFormat(this.oldWeightDate,'yyyy-mm-dd');
	//window.open(u);
	var dummyReq=Spry.Utils.loadURL('GET',u,true);
	this.closeWeightDlg();
	setTimeout(function(){self.loadDates();},1);
}
hirsCalendar.prototype.closeWeightDlg=function(){this.calDlg.close();}
hirsCalendar.prototype.editDiary=function(pId_i,pRedirect_s){
	if(!pRedirect_s) pRedirect_s = 'http://www.hirslanden-baby.ch';
	var u=this.editDiaryUrl+'?editEntry='+pId_i+'&redirectUrl='+pRedirect_s;
	//window.open(u);
	document.location=u;
}
hirsCalendar.prototype.deleteDiary=function(pId_i,pRedirect_s){
	if(!pRedirect_s) pRedirect_s = 'http://www.hirslanden-baby.ch';
	if(!confirm(this.lng.deldiaryconfmsg)) return;
	var self=this;
	var u=this.editDiaryUrl+'?editEntry='+pId_i+'&delete=true&redirectUrl='+pRedirect_s;
	var dummyReq=Spry.Utils.loadURL('GET',u,true);
	this.calDlg.close();
	setTimeout(function(){self.loadDates();},1);
	alert(this.lng.deldiarymsg);
}	
hirsCalendar.prototype.saveUserSettings=function(){
	var u=this.saveUserSettingsUrl+'&date='+dateFormat(this.currDat,'yyyy-mm-dd')+'&view='+this.getActiveViewName();
	var dummyReq=Spry.Utils.loadURL('GET',u,true);
}

