var cvTimerID, bTimerID;
var cvSavedDmsPublishDate = '', bSavedDmsPublishDate = '';
function cvCheckDate () {
	if (cvSavedDmsPublishDate != document.getElementById('cvpd').value) {
		cvSavedDmsPublishDate = document.getElementById('cvpd').value;
		window.location = '/curs-valutar.html?dpd='+ cvSavedDmsPublishDate;
	}
	else {
		self.clearTimeout(cvTimerID);
		cvTimerID = self.setTimeout("cvCheckDate()", 500);
	}
}
function bCheckDate () {
	if (bSavedDmsPublishDate != document.getElementById('bpd').value) {
		bSavedDmsPublishDate = document.getElementById('bpd').value;
		window.location = '/bursa.html?dpd='+ bSavedDmsPublishDate;
	}
	else {
		self.clearTimeout(bTimerID);
		bTimerID = self.setTimeout("bCheckDate()", 500);
	}
}



/*
	DHTML Calendar Control - JavaScript Code
	Copyright (c) 2006, X Inc. All rights reserved.
	Version 1.0.0
*/
function DHTMLCalendar(ContainerId,LocaleId)
{
	/*
		Public members
	*/
	this.CoId = ContainerId;
	this.Lo =
	{
		en_US:
		{
			Months:
			{
				LongNames:	['January','February','March','April','May','June','July','August','September','October','November','December'],
				DaysNumber:	[31,28,31, 30,31,30, 31,31,30, 31,30,31]
			},
			WeekDays:
			{
				TwoCharsNames:	['Su','Mo','Tu','We','Th','Fr','Sa']
			}
		},
		ro_RO:
		{
			Months:
			{
				LongNames:	['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie','Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'],
				DaysNumber:	[31,28,31, 30,31,30, 31,31,30, 31,30,31]
			},
			WeekDays:
			{
				TwoCharsNames:	['Lu','Ma','Mi','Jo','Vi','S&#226;','Du']
			}
		}
	};
	this.LoId = this.Lo[LocaleId] ? LocaleId : 'en_US';
	this.CSS =
	{
		Container: 'DHTMLCalendarContainer',
		YearMonthTable: 'YearMonthTable',
		PreviousMonthTd: 'PreviousMonthTd',
		NextMonthTd: 'NextMonthTd',
		MonthTd: 'MonthTd',
		YearTd: 'YearTd',
		DaysTable: 'DaysTable',
		WeekDaysTr: 'WeekDaysTr',
		MonthDaysTr: 'MonthDaysTr',
		MonthDayTd: 'MonthDayTd',
		MonthDayHoverTd: 'MonthDayHoverTd',
		OtherMonthsDaysTd: 'OtherMonthsDaysTd',
		WeekendDays: 'WeekendDays',
		SelectedDay: 'SelectedDay'
	};
	this.DisabledIntervals = [];
	/*
		Public methods
	*/
	this.DisableInterval = function(BeginDate, EndDate)
	{
		this.DisabledIntervals[this.DisabledIntervals.length] = {BeginDate:BeginDate, EndDate:EndDate};
	}
	this.ShowDate = function(dt)
	{
		if(!this._Container) return;
		if(!dt) return;
		if(dt.getDate)
		{
			if(isNaN(dt))return;
		}
		else
		{
			return;
		}
		this._SDate = {y:dt.getFullYear(), m:dt.getMonth(), d:dt.getDate()};
		this._DDate	= {y:dt.getFullYear(), m:dt.getMonth(), d:dt.getDate()};
		this._Render();
	}
	this.AddEvent = function(EventName,CallbackFunctionRef)
	{
		switch(EventName.toLowerCase())
		{
			case 'selectdate':
				this._SelectDateCallbackFunctions[this._SelectDateCallbackFunctions.length] = CallbackFunctionRef;
				break;
			default:
				break;
		}
	}
	/*
		Private members
	*/
	this._Container = null;
	this._Rended	= false;
	this._RenderInProgress = false;
	var _dtToday = new Date();
	this._SDate	= {y:_dtToday.getFullYear(), m:_dtToday.getMonth(), d:_dtToday.getDate()};
	this._DDate	= {y:_dtToday.getFullYear(), m:_dtToday.getMonth(), d:_dtToday.getDate()};
	this._SelectDateCallbackFunctions = [];
	/*
		Private methods
	*/
	this._SelectDate = function(d)
	{
		this._SDate.y = this._DDate.y;
		this._SDate.m = this._DDate.m;
		this._SDate.d = d;
		this._Render();
		for(var i=0; i<this._SelectDateCallbackFunctions.length; i++)
		{
			if(typeof(this._SelectDateCallbackFunctions[i]) == 'function')
			{
				this._SelectDateCallbackFunctions[i](new Date(this._SDate.y, this._SDate.m, this._SDate.d, 0, 0, 0));
			}
		}
	}
	this._PreviousMonth = function()
	{
		this._DDate.m--;
		if(this._DDate.m<0)
		{
			this._DDate.m = 11;
			this._DDate.y--;
		}
		this._Render();
	}
	this._NextMonth = function()
	{
		this._DDate.m++;
		if(this._DDate.m>11)
		{
			this._DDate.m = 0;
			this._DDate.y++;
		}
		this._Render();
	}
	this._Render = function()
	{
		if(this._RenderInProgress)return;
		this._RenderInProgress = true;
		var oM = document.getElementById(this.CoId+'MonthTd');
		if(oM) oM.innerHTML = this.Lo[this.LoId].Months.LongNames[this._DDate.m];
		var oY = document.getElementById(this.CoId+'YearTd');
		if(oY) oY.innerHTML = this._DDate.y;
		var o, iTr, iTrPrev, iTd, vTr, vTd, oTr, oTd, oTable = document.getElementById(this.CoId+'DaysTable');
		if(oTable)
		{
			vTr = oTable.getElementsByTagName('TR');
			// Days of week
			for(iTr=0; iTr<vTr.length; iTr)
			{
				oTr = vTr[iTr];
				if( oTr && oTr.className == this.CSS.WeekDaysTr )
				{
					vTd = oTr.getElementsByTagName('TD');
					for(var iTd=0; iTd<vTd.length; iTd++)
					{
						vTd[iTd].innerHTML = this.Lo[this.LoId].WeekDays.TwoCharsNames[iTd];
					}
					break;
				}
			}
			var iFirstDayOfMonthAsWeekDay = (new Date(this._DDate.y,this._DDate.m,1)).getDay();
			var iMonthDaysNumber =
				this._DDate.m == 1 ?
					(((this._DDate.y % 4 == 0 && this._DDate.y % 100 != 0) || this._DDate.y % 400 == 0) ? 29 : 28)
					:
					this.Lo[this.LoId].Months.DaysNumber[this._DDate.m];
			var iMonthDay = 0;
			var iFirstDayOfWeekend = 0, iSecondDayOfWeekend = 6;
			if(this.LoId=="ro_RO")
			{
				iFirstDayOfMonthAsWeekDay = (iFirstDayOfMonthAsWeekDay + 6) % 7;
				iFirstDayOfWeekend = 5;
				iSecondDayOfWeekend = 6;
			}
			// First week of month
			for(iTr=0; iTr<vTr.length; iTr++)
			{
				oTr = vTr[iTr];
				if( oTr && oTr.className == this.CSS.MonthDaysTr )
				{
					vTd = oTr.getElementsByTagName('TD');
					for(var iTd=0; iTd<7; iTd++)
					{
						oTd = vTd[iTd];
						if(iMonthDay==0)
						{
							if(iTd==iFirstDayOfMonthAsWeekDay)
							{
								iMonthDay = 1;
								oTd.innerHTML = "1";
								if(iTd==iFirstDayOfWeekend || iTd==iSecondDayOfWeekend)
								{
									oTd.className = this._SDate.y == this._DDate.y && this._SDate.m == this._DDate.m && this._SDate.d == iMonthDay ?
													this.CSS.SelectedDay : this.CSS.WeekendDays;
									oTd.onmouseover = new Function('this.className = "'+ this.CSS.MonthDayHoverTd +'";');
									oTd.onmouseout = new Function('this.className = "'+ oTd.className +'";');
									oTd.onclick = new Function(this.CoId +'WinObj._SelectDate('+iMonthDay+');');
								}
								else
								{
									oTd.className = this._SDate.y == this._DDate.y && this._SDate.m == this._DDate.m && this._SDate.d == iMonthDay ?
													this.CSS.SelectedDay : this.CSS.MonthDayTd;
									oTd.onmouseover = new Function('this.className = "'+ this.CSS.MonthDayHoverTd +'";');
									oTd.onmouseout = new Function('this.className = "'+ oTd.className +'";');
									oTd.onclick = new Function(this.CoId +'WinObj._SelectDate('+iMonthDay+');');
								}
							}
							else
							{
								oTd.innerHTML = "&nbsp;";
								oTd.className = this.CSS.OtherMonthsDaysTd;
								oTd.onmouseover = null;
								oTd.onmouseout = null;
								oTd.onclick = null;
							}
						}
						else
						{
							iMonthDay++;
							oTd.innerHTML = iMonthDay;
							if(iTd==iFirstDayOfWeekend || iTd==iSecondDayOfWeekend)
							{
								oTd.className = this._SDate.y == this._DDate.y && this._SDate.m == this._DDate.m && this._SDate.d == iMonthDay ?
												this.CSS.SelectedDay : this.CSS.WeekendDays;
								oTd.onmouseover = new Function('this.className = "'+ this.CSS.MonthDayHoverTd +'";');
								oTd.onmouseout = new Function('this.className = "'+ oTd.className +'";');
								oTd.onclick = new Function(this.CoId +'WinObj._SelectDate('+iMonthDay+');');
							}
							else
							{
								oTd.className = this._SDate.y == this._DDate.y && this._SDate.m == this._DDate.m && this._SDate.d == iMonthDay ?
												this.CSS.SelectedDay : this.CSS.MonthDayTd;
								oTd.onmouseover = new Function('this.className = "'+ this.CSS.MonthDayHoverTd +'";');
								oTd.onmouseout = new Function('this.className = "'+ oTd.className +'";');
								oTd.onclick = new Function(this.CoId +'WinObj._SelectDate('+iMonthDay+');');
							}
						}
					}
					iTrPrev = iTr;
					break;
				}
			}
			// The other weeks of month
				for(var iTr=iTrPrev+1; iTr<vTr.length; iTr++)
				{
					oTr = vTr[iTr];
					if( oTr && oTr.className == this.CSS.MonthDaysTr )
					{
						vTd = oTr.getElementsByTagName('TD');
						for(var iTd=0; iTd<7; iTd++)
						{
							oTd = vTd[iTd];
							if(iMonthDay>=iMonthDaysNumber)
							{
								oTd.innerHTML = "&nbsp;";
								oTd.className = this.CSS.OtherMonthsDaysTd;
								oTd.onmouseover = null;
								oTd.onmouseout = null;
								oTd.onclick = null;
							}
							else
							{
								iMonthDay++;
								oTd.innerHTML = iMonthDay;
								if(iTd==iFirstDayOfWeekend || iTd==iSecondDayOfWeekend)
								{
									oTd.className = (this._SDate.y == this._DDate.y && this._SDate.m == this._DDate.m && this._SDate.d == iMonthDay) ?
													this.CSS.SelectedDay : this.CSS.WeekendDays;
									oTd.onmouseover = new Function('this.className = "'+ this.CSS.MonthDayHoverTd +'";');
									oTd.onmouseout = new Function('this.className = "'+ oTd.className +'";');
									oTd.onclick = new Function(this.CoId +'WinObj._SelectDate('+iMonthDay+');');
								}
								else
								{
									oTd.className = (this._SDate.y == this._DDate.y && this._SDate.m == this._DDate.m && this._SDate.d == iMonthDay) ?
													this.CSS.SelectedDay : this.CSS.MonthDayTd;
									oTd.onmouseover = new Function('this.className = "'+ this.CSS.MonthDayHoverTd +'";');
									oTd.onmouseout = new Function('this.className = "'+ oTd.className +'";');
									oTd.onclick = new Function(this.CoId +'WinObj._SelectDate('+iMonthDay+');');
								}
							}
						}
					}
				}
		}
		this._RenderInProgress = false;
	}
	/*
		Control init code
	*/
	if(!document.getElementById)return;
	if(window[ContainerId+'WinObj'])
	{
		alert
		(
			'Source: DHTMLCalendar.js \n\n' +
			'Warrning: "' + ContainerId + '" is already used by other instance of DHTML Calendar Control !!! Use other container id !!!'
		);
		return;
	}
	this._Container = document.getElementById(ContainerId);
	if(!this._Container)
	{
		alert
		(
			'Source: DHTMLCalendar.js \n\n' +
			'Fatal error: DHTML Calendar Control container is missing !!!'
		);
		return;
	}
	window[ContainerId+'WinObj'] = this;
	this._Container.innerHTML =
		'<table cellpadding="0" cellspacing="0" border="0">'+
			'<tr>'+
				'<td class="'+ this.CSS.Container +'">'+
					'<table cellpadding="0" cellspacing="0" border="0" class="'+ this.CSS.YearMonthTable +'">'+
						'<tr>'+
							'<td class="'+ this.CSS.PreviousMonthTd +'" onclick="'+ContainerId+'WinObj._PreviousMonth();"></td>'+
							'<td class="'+ this.CSS.MonthTd +'" id="'+ContainerId+'MonthTd">'+ this.Lo[this.LoId].Months.LongNames[this._DDate.m] +'</td>'+
							'<td class="'+ this.CSS.YearTd +'" id="'+ContainerId+'YearTd">'+ this._DDate.y +'</td>'+
							'<td class="'+ this.CSS.NextMonthTd +'" onclick="'+ContainerId+'WinObj._NextMonth();"></td>'+
						'</tr>'+
					'</table>'+
					'<table cellpadding="0" cellspacing="0" border="0" class="'+ this.CSS.DaysTable +'" id="'+ContainerId+'DaysTable">'+
						'<tr class="'+ this.CSS.WeekDaysTr	+'"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><tr>'+
						'<tr class="'+ this.CSS.MonthDaysTr +'"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><tr>'+
						'<tr class="'+ this.CSS.MonthDaysTr +'"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><tr>'+
						'<tr class="'+ this.CSS.MonthDaysTr +'"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><tr>'+
						'<tr class="'+ this.CSS.MonthDaysTr +'"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><tr>'+
						'<tr class="'+ this.CSS.MonthDaysTr +'"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><tr>'+
						'<tr class="'+ this.CSS.MonthDaysTr +'"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><tr>'+
					'</table>'+
				'</td>'+
			'</tr>'+
		'</table>'
	;
}
/*
	DHTML Select Control - JavaScript Code
	Copyright (c) 2006, X Inc. All rights reserved.
	Version 1.0.0
*/
function DHTMLSelect(ContainerId, ColumnsNumber)
{
	/*
		Public members
	*/
	this.CoId = ContainerId;
	this.ColsNo = ColumnsNumber;
	this.CSS =
	{
		Container: 'DHTMLSelectContainer',
		ContainerScrollableDiv: 'DHTMLSelectContainerScrollableDiv',
		RowsTable: 'RowsTable',
		RowTr: 'RowTr',
		RowHoverTr: 'RowHoverTr',
		RowSelectedTr: 'RowSelectedTr'
	};
	/*
		Public methods
	*/
	this.AddEvent = function(EventName,CallbackFunctionRef)
	{
		switch(EventName.toLowerCase())
		{
			case 'selectrow':
				this._SelectRowCallbackFunctions[this._SelectRowCallbackFunctions.length] = CallbackFunctionRef;
				break;
			default:
				break;
		}
	}
	this.AddRow = function(Value, ColsHtml, Selectable)
	{
		this._Rows[this._Rows.length] = {Value: Value, ColsHtml: ColsHtml, Selectable: Selectable};
	}
	this.SelectRowByValue = function(Name,Value)
	{
		var oV,o,oT,vRows,iTr;
		for(var iR=0; iR<this._Rows.length; iR++)
		{
			oV = this._Rows[iR].Value;
			if(oV&&oV[Name]&&oV[Name]==Value)
			{
				oT = document.getElementById(this.CoId +'Table');
				if(oT)
				{
					vRows = document.getElementsByTagName("TR");
					for(iTr=0; iTr<vRows.length; iTr++)
					{
						if(vRows[iTr].getAttribute("RowIndex") && vRows[iTr].getAttribute("RowIndex")==iR)
						{
							if(this._SelectedRowRef)this._SelectedRowRef.className = this.CSS.RowTr;
							vRows[iTr].className = this.CSS.RowSelectedTr;
							this._SelectedRowIndex = iR;
							this._SelectedRowRef = vRows[iTr];
						}
					}
				}
				return;
			}
		}
	}
	this.Render = function()
	{
		this._Render();
	}
	/*
		Private members
	*/
	this._Container = null;
	this._SelectRowCallbackFunctions = [];
	this._Rows = [];
	this._SelectedRowIndex = -1;
	this._SelectedRowRef = null;
	/*
		Private methods
	*/
	this._Render = function()
	{
		var iR;
		var sH =
			'<table cellpadding="0" cellspacing="0" border="0">'+
				'<tr>'+
					'<td class="'+ this.CSS.Container +'">'+
						'<div id="'+ this.CoId +'Div" style="overflow: auto;" class="' + this.CSS.ContainerScrollableDiv + '">'+
							'<table id="'+ this.CoId +'Table" cellpadding="0" cellspacing="0" border="0" class="'+ this.CSS.RowsTable +'">'
		;
		for(iR=0; iR<this._Rows.length; iR++)
		{
			if(this._Rows[iR].Selectable)
			{
				sH +=	this._Rows[iR].ColsHtml.replace
						(
							/\<tr /i,
							'<tr RowIndex="'+ iR +'" '+
							'onClick="'+ this.CoId +'WinObj._SelectRow(this,\''+ iR +'\');" '+
							'onMouseOver="this.className = \''+ this.CSS.RowHoverTr +'\';" '+
							'onMouseOut="'+ this.CoId +'WinObj._OnMouseOut(this,\''+ iR +'\');" '
						)
				;
			}
			else
			{
				sH += this._Rows[iR].ColsHtml;
			}
		}
		sH +=
							'</table>'+
						'</div>'+
					'</td>'+
				'</tr>'+
			'</table>'
		;
		this._Container.innerHTML = sH;
	}
	this._SelectRow = function(TrRef,RowIndex)
	{
		if(this._SelectedRowRef)this._SelectedRowRef.className = this.CSS.RowTr;
		this._SelectedRowIndex = RowIndex;
		this._SelectedRowRef = TrRef;
		for(var i=0; i<this._SelectRowCallbackFunctions.length; i++)
		{
			if(typeof(this._SelectRowCallbackFunctions[i]) == 'function')
			{
				this._SelectRowCallbackFunctions[i](this._Rows[RowIndex].Value);
			}
		}
	}
	this._OnMouseOut = function(TrRef,RowIndex)
	{
		TrRef.className = this._SelectedRowIndex == RowIndex ? this.CSS.RowSelectedTr : this.CSS.RowTr;
	}
	/*
		Control init code
	*/
	if(!document.getElementById)return;
	if(window[ContainerId+'WinObj'])
	{
		alert
		(
			'Source: DHTMLSelect.js \n\n' +
			'Warrning: "' + ContainerId + '" is already used by other instance of DHTML Select Control !!! Use other container id !!!'
		);
		return;
	}
	this._Container = document.getElementById(ContainerId);
	if(!this._Container)
	{
		alert
		(
			'Source: DHTMLSelect.js \n\n' +
			'Fatal error: DHTML Select Control container is missing !!!'
		);
		return;
	}
	window[ContainerId+'WinObj'] = this;
}
/*
		DHTML DateTime Autocomplete for HTML Input Text - Only config object
		Copyright 2007 X, All Rights Reserved.
*/
var DTAC_Config =
{
//	LoId: 'ro_RO',
	LoId: 'en_US',
	Date:
	{
		ClassName		:	'autocomplete_date',
		ZIndex			:	255,
		HTML			:	'<div id="DTAC_CalendarContainer" style="margin-top:5px;"></div>',
		DisplayFormat	:	'long',
		CloseOnSelect	:	true
	},
	Time:
	{
		ClassName		:	'autocomplete_time',
		ZIndex			:	255,
		HTML			:	'<div id="DTAC_HoursContainer" style="margin-top:5px;"></div>',
		DisplayFormat	:	'short',
		CloseOnSelect	:	true
	},
	Lo:
	{
		en_US:
		{
			Months:
			{
				LongNames:	['January','February','March','April','May','June','July','August','September','October','November','December'],
				ShortNames:	['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
			}
		},
		ro_RO:
		{
			Months:
			{
				LongNames:	['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie','Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'],
				ShortNames:	['Ian','Feb','Mar','Apr','Mai','Iun','Iul','Aug','Sep','Oct','Noi','Dec']
			}
		}
	},
	CSS:
	{
		StringIsNotAValidDate: 'DTAC_NotAValidDate'
	}
};
function DTAC_Custom_ParseDate(DateAsString)
{
	var vD = DateAsString.split('.');
	if(vD.length < 3) return null;
	var d = new Date(vD[2] * 1, (vD[1] * 1)-1, vD[0] * 1);
	if(typeof(d)=='object'&&d.getDate)
	{
		return isNaN(d) ? null : d;
	}
	else
		return null;
}
function DTAC_Custom_DateToLocaleString(DateAsJsDate)
{
	var d = DateAsJsDate.getDate(), m = DateAsJsDate.getMonth() + 1;
	return (d < 10 ? ("0" + d) : d) + "." + (m < 10 ? ("0" + m) : m) + "." + DateAsJsDate.getFullYear();
}
function DTAC_Custom_ParseTime(TimeAsString)
{
	if(typeof(TimeAsString)=='string'&&TimeAsString!='')
	{
		var dt = new Date(), s = (dt.getMonth() + 1) + "/" + dt.getDate() + "/" + dt.getYear() + " " + TimeAsString;
		dt = new Date(s)
		return isNaN(dt) ? null : dt;
	}
	return null;
}
function DTAC_Custom_TimeToLocaleString(DateAsJsDate)
{
	var h = DateAsJsDate.getHours(), m = DateAsJsDate.getMinutes();
	return (h < 10 ? "0" + h : h) + ":" + (m < 10 ? "0" + m : m);
}
/*
		DHTML DateTime Autocomplete for HTML Input Text
		Copyright 2007 X, All Rights Reserved.
*/
function DTAC_Init()
{
	if(!document.getElementById)return;
	var ag = navigator.userAgent;
	DTAC_Obj =
	{
		Browser:
		{
			OP:		ag.indexOf('Opera')>=0,
			IE50:	!this.OP&&ag.indexOf('MSIE 5.0')>=0,
			IE55:	!this.OP&&ag.indexOf('MSIE 5.5')>=0,
			IE60:	!this.OP&&ag.indexOf('MSIE 6.0')>=0,
			IE:		!this.OP&&ag.indexOf('MSIE')>=0,
			IE7up:	this.IE&&!(this.IE50||this.IE55||this.IE60)
		},
		Date:
		{
			Div: null
		},
		Time:
		{
			Div: null
		},
		SelectsMask: null,
		Inputs: {},
		CurrentInputId: null
	};
	DTAC_AddEvt(window,"load",DTAC_Create);
}
function DTAC_Create()
{
	var o, s;
	DTAC_InitInputs();
	o = document.createElement("DIV");
	if(o)
	{
		o.id = "DateDivId";
		s = o.style;
		s.position = "absolute";
		s.zIndex = DTAC_Config.Date.ZIndex;
		s.display = "none";
		s.left = '200px';
		s.top = '200px';
		DTAC_Obj.Date.Div = document.body.appendChild(o);
		o.innerHTML = DTAC_Config.Date.HTML;
	}
	o = document.createElement("DIV");
	if(o)
	{
		o.id = "TimeDivId";
		s = o.style;
		s.position = "absolute";
		s.zIndex = DTAC_Config.Date.ZIndex-1;
		s.display = "none";
		s.left = '100px';
		s.top = '100px';
		o.innerHTML = DTAC_Config.Time.HTML;
		DTAC_Obj.Time.Div = document.body.appendChild(o);
	}
	if(DTAC_Obj.Browser.IE && !DTAC_Obj.Browser.IE7up)
	{
		o = document.createElement('<IFRAME src="" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></IFRAME>');
		if(o)
		{
			o.id = "SelectsMaskIfr";
			s = o.style;
			s.position = "absolute";
			s.zIndex = 6;
			s.display = "none";
			s.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);";
			s.left = '100px';
			s.top = '100px';
			s.width = '400px';
			s.height = '400px';
			DTAC_Obj.SelectsMask = document.body.appendChild(o);
		}
	}
	DTAC_AddEvt(document,'Click',DTAC_Body_OnClick);
	var dtToday	= new Date();
	DTAC_Calendar = new DHTMLCalendar("DTAC_CalendarContainer", DTAC_Config.LoId);
	DTAC_Calendar.AddEvent('SelectDate', DTAC_OnSelectDate);
	DTAC_Calendar.ShowDate( new Date() );
	DTAC_HoursSelect = new DHTMLSelect("DTAC_HoursContainer", 1);
	DTAC_HoursSelect.AddEvent('SelectRow', DTAC_OnSelectTime);
	var trb = '<tr class="RowTr"><td>';
	var tre = '</td></tr>';
	if( DTAC_Config.LoId == 'ro_RO' )
	{
		DTAC_HoursSelect.AddRow( {v1:'00:00:00',v2:'00:00'},	trb + '00:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'01:00:00',v2:'01:00'},	trb + '01:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'02:00:00',v2:'02:00'},	trb + '02:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'03:00:00',v2:'03:00'},	trb + '03:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'04:00:00',v2:'04:00'},	trb + '04:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'05:00:00',v2:'05:00'},	trb + '05:00' + tre,	true);
//		DTAC_HoursSelect.AddRow( null,	trb + '' + tre,	false);
		DTAC_HoursSelect.AddRow( {v1:'06:00:00',v2:'06:00'},	trb + '06:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'07:00:00',v2:'07:00'},	trb + '07:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'08:00:00',v2:'08:00'},	trb + '08:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'09:00:00',v2:'09:00'},	trb + '09:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'10:00:00',v2:'10:00'},	trb + '10:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'11:00:00',v2:'11:00'},	trb + '11:00' + tre,	true);
//		DTAC_HoursSelect.AddRow( null,	trb + '' + tre,	false);
		DTAC_HoursSelect.AddRow( {v1:'12:00:00',v2:'12:00'},	trb + '12:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'13:00:00',v2:'13:00'},	trb + '13:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'14:00:00',v2:'14:00'},	trb + '14:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'15:00:00',v2:'15:00'},	trb + '15:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'16:00:00',v2:'16:00'},	trb + '16:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'17:00:00',v2:'17:00'},	trb + '17:00' + tre,	true);
//		DTAC_HoursSelect.AddRow( null,	trb + '' + tre,	false);
		DTAC_HoursSelect.AddRow( {v1:'18:00:00',v2:'18:00'},	trb + '18:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'19:00:00',v2:'19:00'},	trb + '19:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'20:00:00',v2:'20:00'},	trb + '20:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'21:00:00',v2:'21:00'},	trb + '21:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'22:00:00',v2:'22:00'},	trb + '22:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'23:00:00',v2:'23:00'},	trb + '23:00' + tre,	true);
	}
	else
	{
		DTAC_HoursSelect.AddRow( {v1:'00:00:00',v2:'00:00'},	trb + '00:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'01:00:00',v2:'01:00'},	trb + '01:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'02:00:00',v2:'02:00'},	trb + '02:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'03:00:00',v2:'03:00'},	trb + '03:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'04:00:00',v2:'04:00'},	trb + '04:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'05:00:00',v2:'05:00'},	trb + '05:00' + tre,	true);
//		DTAC_HoursSelect.AddRow( null,	trb + '' + tre,	false);
		DTAC_HoursSelect.AddRow( {v1:'06:00:00',v2:'06:00'},	trb + '06:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'07:00:00',v2:'07:00'},	trb + '07:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'08:00:00',v2:'08:00'},	trb + '08:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'09:00:00',v2:'09:00'},	trb + '09:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'10:00:00',v2:'10:00'},	trb + '10:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'11:00:00',v2:'11:00'},	trb + '11:00' + tre,	true);
//		DTAC_HoursSelect.AddRow( null,	trb + '' + tre,	false);
		DTAC_HoursSelect.AddRow( {v1:'12:00:00',v2:'12:00'},	trb + '12:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'13:00:00',v2:'13:00'},	trb + '13:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'14:00:00',v2:'14:00'},	trb + '14:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'15:00:00',v2:'15:00'},	trb + '15:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'16:00:00',v2:'16:00'},	trb + '16:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'17:00:00',v2:'17:00'},	trb + '17:00' + tre,	true);
//		DTAC_HoursSelect.AddRow( null,	trb + '' + tre,	false);
		DTAC_HoursSelect.AddRow( {v1:'18:00:00',v2:'18:00'},	trb + '18:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'19:00:00',v2:'19:00'},	trb + '19:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'20:00:00',v2:'20:00'},	trb + '20:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'21:00:00',v2:'21:00'},	trb + '21:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'22:00:00',v2:'22:00'},	trb + '22:00' + tre,	true);
		DTAC_HoursSelect.AddRow( {v1:'23:00:00',v2:'23:00'},	trb + '23:00' + tre,	true);
	}
	DTAC_HoursSelect.Render();
}
function DTAC_InitInputs()
{
	DTAC_Obj.Inputs = null;
	DTAC_Obj.Inputs = {};
	var i,o,v=document.getElementsByTagName('INPUT'), oHid, vHid, dt;
	for(i=0;i<v.length;i++)
	{
		o=v[i];
		if(!(o&&o.type=='text'&&o.className))continue;
		switch(o.className.toLowerCase())
		{
			case DTAC_Config.Date.ClassName.toLowerCase():
				DTAC_Obj.Inputs[o.id] = o;
				DTAC_AddEvt(o,'Focus',new Function('DTAC_Date_OnFocus("'+o.id+'");'));
				DTAC_AddEvt(o,'KeyUp',new Function('DTAC_Date_OnKeyUp("'+o.id+'");'));
				oHid = document.getElementById(o.id.substr(0,o.id.length-2))
				if(oHid)
				{
					dt = DTAC_ParseXmlDate(oHid.value);
					if(dt)
					{
						o.value =  DTAC_DateToLocaleString(dt);
					}
				}
				break;
			case DTAC_Config.Time.ClassName.toLowerCase():
				DTAC_Obj.Inputs[o.id] = o;
				DTAC_AddEvt(o,'Focus',new Function('DTAC_Time_OnFocus("'+o.id+'");'));
				DTAC_AddEvt(o,'KeyUp',new Function('DTAC_Time_OnKeyUp("'+o.id+'");'));
				oHid = document.getElementById(o.id.substr(0,o.id.length-2))
				if(oHid)
				{
					dt = DTAC_ParseXmlDate(oHid.value);
					if(dt)
					{
						o.value = DTAC_TimeToLocaleString(dt);
					}
				}
				break;
			default:
				break;
		}
	}
}
function DTAC_Date_OnFocus(id)
{
	if(DTAC_Obj.CurrentInputId == id) return;
	DTAC_Time_Close();
	DTAC_Obj.CurrentInputId = id;
	var o = document.getElementById(id), oM, oD;
	if(o)
	{
		if((oD=DTAC_Obj.Date.Div))
		{
			if(DTAC_Calendar)
			{
				var dt;
				if(o.value) dt = DTAC_ParseDate(o.value);
				if(!dt) dt = new Date();
				DTAC_Calendar.ShowDate(dt);
			}
			var XY = DTAC_GetXY(o), WH = DTAC_GetWH(o);
			oD.style.left = XY.x + 'px';
			oD.style.top = (XY.y + WH.h + 5) + 'px';
			oD.style.display = "";
			if((oM=DTAC_Obj.SelectsMask))
			{
				oM.style.left = XY.x + 'px';
				oM.style.top = (XY.y + WH.h + 5) + 'px';
				WH = DTAC_GetWH(oD);
				oM.style.width = (WH.w + 2) + 'px';
				oM.style.height = (WH.h + 2) + 'px';
				oM.style.display = "";
			}
		}
	}
}
function DTAC_Date_Close()
{
	DTAC_Obj.CurrentInputId = null;
	var o;
	if((o=DTAC_Obj.Date.Div))
	{
		o.style.display = "none";
	}
	if((o=DTAC_Obj.SelectsMask))
	{
		o.style.display = "none";
	}
}
function DTAC_Date_OnKeyUp(id)
{
	var o = document.getElementById(id);
	if(o)
	{
		var dt = o.value ? DTAC_ParseDate(o.value) : new Date();
		if(dt)
		{
			if(o.classNameBeforeError)
			{
				o.className = o.classNameBeforeError;
			}
			if(DTAC_Calendar)DTAC_Calendar.ShowDate(dt);
			var oHidden = document.getElementById(o.id.substr(0,o.id.length-2))
			if(oHidden)
			{
				var sOldValue = oHidden.value;
				var vH = oHidden.value.split("T");
				if(vH.length>1)
					oHidden.value = DTAC_DateToXmlString(dt) + "T" + vH[1];
				else
					oHidden.value = DTAC_DateToXmlString(dt) + "T00:00:00";
				if(sOldValue != oHidden.value) DTAC_CallAnyChangeFor(oHidden.id, sOldValue, oHidden.value);
			}
		}
		else
		{
			if(o.classNameBeforeError)
			{
				if( o.className != DTAC_Config.CSS.StringIsNotAValidDate )
					o.classNameBeforeError = o.className;
				o.className = DTAC_Config.CSS.StringIsNotAValidDate;
			}
			else
			{
				o.classNameBeforeError = o.className;
				o.className = DTAC_Config.CSS.StringIsNotAValidDate;
			}
		}
	}
}
function DTAC_Time_OnFocus(id)
{
	if(DTAC_Obj.CurrentInputId == id) return;
	DTAC_Date_Close();
	DTAC_Obj.CurrentInputId = id;
	var o = document.getElementById(id), oM, oD;
	if(o)
	{
		if((oD=DTAC_Obj.Time.Div))
		{
			if(DTAC_HoursSelect)
			{
				var dt = o.value ? DTAC_ParseTime(o.value) : new Date();
				if(dt)
				{
					var sHour = dt.getHours() < 10 ? "0" + dt.getHours() : dt.getHours();
					DTAC_HoursSelect.SelectRowByValue("v1", sHour + ":00:00" );
				}
			}
			var XY = DTAC_GetXY(o), WH = DTAC_GetWH(o);
			oD.style.left = XY.x + 'px';
			oD.style.top = (XY.y + WH.h + 5) + 'px';
			oD.style.display = "";
			if((oM=DTAC_Obj.SelectsMask))
			{
				oM.style.left = XY.x + 'px';
				oM.style.top = (XY.y + WH.h + 5) + 'px';
				WH = DTAC_GetWH(oD);
				oM.style.width = (WH.w + 2) + 'px';
				oM.style.height = (WH.h + 2) + 'px';
				oM.style.display = "";
			}
		}
	}
}
function DTAC_Time_Close()
{
	DTAC_Obj.CurrentInputId = null;
	var o;
	if((o=DTAC_Obj.Time.Div))
	{
		o.style.display = "none";
	}
	if((o=DTAC_Obj.SelectsMask))
	{
		o.style.display = "none";
	}
}
function DTAC_Time_OnKeyUp(id)
{
	var o = document.getElementById(id);
	if(o)
	{
		var dt = o.value ? DTAC_ParseTime(o.value) : new Date();
		if(dt)
		{
			if(o.classNameBeforeError)
			{
				o.className = o.classNameBeforeError;
			}
			var sHour = dt.getHours() < 10 ? "0" + dt.getHours() : dt.getHours();
			var sMin = dt.getMinutes() < 10 ? "0" + dt.getMinutes() : dt.getMinutes();
			if(DTAC_HoursSelect)DTAC_HoursSelect.SelectRowByValue("v1", sHour + ":00:00" );
			var oHidden = document.getElementById(o.id.substr(0,o.id.length-2))
			if(oHidden)
			{
				var sOldValue = oHidden.value;
				var vH = oHidden.value.split("T");
				if(vH.length>1)
					oHidden.value = vH[0] + "T" + (sHour + ":" + sMin + ":00");
				else
					oHidden.value = DTAC_DateToXmlString(new Date()) + "T" + (sHour + ":00:00");
				if(sOldValue != oHidden.value) DTAC_CallAnyChangeFor(oHidden.id, sOldValue, oHidden.value);
			}
		}
		else
		{
			if(o.classNameBeforeError)
			{
				if( o.className != DTAC_Config.CSS.StringIsNotAValidDate )
					o.classNameBeforeError = o.className;
				o.className = DTAC_Config.CSS.StringIsNotAValidDate;
			}
			else
			{
				o.classNameBeforeError = o.className;
				o.className = DTAC_Config.CSS.StringIsNotAValidDate;
			}
		}
	}
}
function DTAC_Body_OnClick(e)
{
	var o, oI;
	if(e&&e.target) o = e.target;
	else if(window.event&&window.event.srcElement) o = window.event.srcElement;
	if(!o)return;
	if(DTAC_Obj.Inputs[o.id])return;
	while(o)
	{
		if(o.id=='DateDivId'||o.id=='TimeDivId')
		{
			if(DTAC_Obj.CurrentInputId)
			{
				oI = document.getElementById(DTAC_Obj.CurrentInputId);
				if(oI)
					oI.focus();
			}
			return;
		}
		o = o.parentElement ? o.parentElement : o.offsetParent;
	}
	DTAC_Date_Close();
	DTAC_Time_Close();
}
function DTAC_GetXY(ObjRef)
{
	var x=0,y=0;
	if(ObjRef)
	{
		if(ObjRef.getBoundingClientRect)
		{
			var o=ObjRef.getBoundingClientRect();
			x=document.documentElement.scrollLeft||document.body.scrollLeft;
			y=document.documentElement.scrollTop||document.body.scrollTop;
			x=o.left+x-2;
			y=o.top+y-2;
		}
		else
		{
			if(document.getBoxObjectFor)
			{
				var o=document.getBoxObjectFor(ObjRef);
				x=o.x-2;
				y=o.y-2;
			}
			else
			{
				var o=ObjRef;	for(;o&&o.tagName!='BODY';o=o.offsetParent){x+=o.offsetLeft;y+=o.offsetTop;}
			}
		}
	}
	return {x:x,y:y};
}
function DTAC_GetWH(ObjRef)
{
	var w=0,h=0;
	if(ObjRef)
	{
		w = ObjRef.clientWidth;
		h = ObjRef.clientHeight;
	}
	return {w:w,h:h};
}
function DTAC_AddEvt(ObjRef,EvtName,FncRef)
{
	if(!ObjRef)return;
	if(window.attachEvent)ObjRef.attachEvent("on"+EvtName.toLowerCase(),FncRef);
	else if(window.addEventListener)ObjRef.addEventListener(EvtName.toLowerCase(),FncRef, false);
}
function DTAC_DateToLocaleString(d)
{
	if(typeof(DTAC_Custom_DateToLocaleString)=='function')
		return DTAC_Custom_DateToLocaleString(d);
	var sR;
	switch(DTAC_Config.Date.DisplayFormat.toLowerCase())
	{
		case 'long':
			sR =  DTAC_DateToLocaleLongString(d);
			break;
		default:
			sR =  DTAC_DateToLocaleShortString(d);
			break;
	}
	return sR;
}
function DTAC_DateToLocaleLongString(d)
{
	if(typeof(DTAC_Custom_DateToLocaleLongString)=='function')
		return DTAC_Custom_DateToLocaleLongString(d);
	var s = "";
	switch(DTAC_Config.LoId)
	{
		case "en_US":
			s = DTAC_Config.Lo[DTAC_Config.LoId].Months.LongNames[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
			break;
		case "ro_RO":
			s = d.getDate() + " " + DTAC_Config.Lo[DTAC_Config.LoId].Months.LongNames[d.getMonth()] + " " + d.getFullYear();
			break;
		default:
			s = DTAC_DateToXmlString(d);
			break;
	}
	return s;
}
function DTAC_DateToLocaleShortString(d)
{
	if(typeof(DTAC_Custom_DateToLocaleShortString)=='function')
		return DTAC_Custom_DateToLocaleShortString(d);
	var s = "";
	switch(DTAC_Config.LoId)
	{
		case "en_US":
			s = DTAC_Config.Lo[DTAC_Config.LoId].Months.ShortNames[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
			break;
		case "ro_RO":
			s = d.getDate() + " " + DTAC_Config.Lo[DTAC_Config.LoId].Months.ShortNames[d.getMonth()] + " " + d.getFullYear();
			break;
		default:
			s = DTAC_DateToXmlString(d);
			break;
	}
	return s;
}
function DTAC_DateToXmlString(d)
{
	return d.getFullYear() + "-" + (d.getMonth() < 9 ? "0" + (d.getMonth() + 1) : (d.getMonth() + 1)) + "-" + (d.getDate() < 10 ? "0" + d.getDate() : d.getDate());
}
function DTAC_TimeToLocaleString(d)
{
	if(typeof(DTAC_Custom_TimeToLocaleString)=='function')
		return DTAC_Custom_TimeToLocaleString(d);
	var sR;
	switch(DTAC_Config.Time.DisplayFormat.toLowerCase())
	{
		case 'long':
			sR =  DTAC_TimeToLocaleLongString(d);
			break;
		default:
			sR =  DTAC_TimeToLocaleShortString(d);
			break;
	}
	return sR;
}
function DTAC_TimeToLocaleLongString(d)
{
	if(typeof(DTAC_Custom_TimeToLocaleLongString)=='function')
		return DTAC_Custom_TimeToLocaleLongString(d);
	var s = "", h, m, s;
	switch(DTAC_Config.LoId)
	{
		case "en_US":
			h = d.getHours();
			m = (d.getMinutes() < 10 ? "0" + d.getMinutes() : d.getMinutes());
			s = (d.getSeconds() < 10 ? "0" + d.getSeconds() : d.getSeconds());
			if(h == 0)
			{
				s = "12:" + m + ":" + s + " am";
			}
			else if(h < 12)
			{
				s = h + ":" + m + ":" + s + " am";
			}
			else if(h == 12)
			{
				s = "12:" + m + ":" + s + " pm";
			}
			else
			{
				s = (h % 12) + ":" + m + ":" + s + " pm";
			}
			break;
		case "ro_RO":
			s =
				(d.getHours() < 10 ? "0" + d.getHours() : d.getHours())
				+ ":" +
				(d.getMinutes() < 10 ? "0" + d.getMinutes() : d.getMinutes())
				+ ":" +
				(d.getSeconds() < 10 ? "0" + d.getSeconds() : d.getSeconds())
			;
			break;
		default:
			s =
				(d.getHours() < 10 ? "0" + d.getHours() : d.getHours())
				+ ":" +
				(d.getMinutes() < 10 ? "0" + d.getMinutes() : d.getMinutes())
				+ ":" +
				(d.getSeconds() < 10 ? "0" + d.getSeconds() : d.getSeconds())
			;
			break;
	}
	return s;
}
function DTAC_TimeToLocaleShortString(d)
{
	if(typeof(DTAC_Custom_TimeToLocaleShortString)=='function')
		return DTAC_Custom_TimeToLocaleShortString(d);
	var s = "", h, m, s;
	switch(DTAC_Config.LoId)
	{
		case "en_US":
			h = d.getHours();
			m = (d.getMinutes() < 10 ? "0" + d.getMinutes() : d.getMinutes());
			s = (d.getSeconds() < 10 ? "0" + d.getSeconds() : d.getSeconds());
			if(h == 0)
			{
				s = "12:" + m + " am";
			}
			else if(h < 12)
			{
				s = h + ":" + m + " am";
			}
			else if(h == 12)
			{
				s = "12:" + m + " pm";
			}
			else
			{
				s = (h % 12) + ":" + m + " pm";
			}
			break;
		case "ro_RO":
			s =
				(d.getHours() < 10 ? "0" + d.getHours() : d.getHours())
				+ ":" +
				(d.getMinutes() < 10 ? "0" + d.getMinutes() : d.getMinutes())
			;
			break;
		default:
			s =
				(d.getHours() < 10 ? "0" + d.getHours() : d.getHours())
				+ ":" +
				(d.getMinutes() < 10 ? "0" + d.getMinutes() : d.getMinutes())
			;
			break;
	}
	return s;
}
function DTAC_ParseDate(d)
{
	if(typeof(DTAC_Custom_ParseDate)=='function')
		return DTAC_Custom_ParseDate(d);
	var i, oRO = DTAC_Config.Lo.ro_RO.Months.LongNames, oEN = DTAC_Config.Lo.en_US.Months.LongNames;
	if(typeof(d)=='string'&&d!='')
	{
		d = d.toLowerCase();
		for(i=0; i<oRO.length; i++)
		{
			d = d.replace(oRO[i].toLowerCase(),oEN[i]);
		}
		oRO = DTAC_Config.Lo.ro_RO.Months.ShortNames; oEN = DTAC_Config.Lo.en_US.Months.ShortNames;
		for(i=0; i<oRO.length; i++)
		{
			d = d.replace(oRO[i].toLowerCase(),oEN[i]);
		}
		d = d.replace(/-/g,"/");
		d = new Date(d);
		if(typeof(d)=='object'&&d.getDate)
		{
			return isNaN(d) ? null : d;
		}
		else
			return null;
	}
	return null;
}
function DTAC_ParseXmlDate(d)
{
	if(typeof(d)=='string'&&d!='')
	{
		d = d.replace(/-/g,"/").replace(/T/," ");
		d = new Date(d);
		if(typeof(d)=='object'&&d.getDate)
		{
			return isNaN(d) ? null : d;
		}
		else
			return null;
	}
	return null;
}
function DTAC_ParseTime(t)
{
	if(typeof(DTAC_Custom_ParseTime)=='function')
		return DTAC_Custom_ParseTime(t);
	if(typeof(t)=='string'&&t!='')
	{
		var dt = new Date(), s = (dt.getMonth() + 1) + "/" + dt.getDate() + "/" + dt.getYear() + " " + t;
		dt = new Date(s)
		return isNaN(dt) ? null : dt;
	}
	return null;
}
function DTAC_OnSelectDate(SDateAsJsDate)
{
	if(DTAC_Obj.CurrentInputId)
	{
		var o = document.getElementById(DTAC_Obj.CurrentInputId);
		if(o)
		{
			if(o.classNameBeforeError)
			{
				o.className = o.classNameBeforeError;
			}
			o.value = DTAC_DateToLocaleString(SDateAsJsDate);
			var oHidden = document.getElementById(o.id.substr(0,o.id.length-2))
			if(oHidden)
			{
				var sOldValue = oHidden.value;
				var vH = oHidden.value.split("T");
				if(vH.length>1)
					oHidden.value = DTAC_DateToXmlString(SDateAsJsDate) + "T" + vH[1];
				else
					oHidden.value = DTAC_DateToXmlString(SDateAsJsDate) + "T00:00:00";
				if(sOldValue != oHidden.value) DTAC_CallAnyChangeFor(oHidden.id, sOldValue, oHidden.value);
			}
			if(DTAC_Config.Date.CloseOnSelect) DTAC_Date_Close();
		}
	}
}
function DTAC_OnSelectTime(Value)
{
	if(DTAC_Obj.CurrentInputId)
	{
		var o = document.getElementById(DTAC_Obj.CurrentInputId);
		if(o)
		{
			if(o.classNameBeforeError)
			{
				o.className = o.classNameBeforeError;
			}
			o.value = Value.v2;
			var oHidden = document.getElementById(o.id.substr(0,o.id.length-2))
			if(oHidden)
			{
				var sOldValue = oHidden.value;
				if(oHidden.value)
				{
					var vH = oHidden.value.split("T");
					oHidden.value = vH[0] + "T" + Value.v1;
				}
				else
				{
					oHidden.value = DTAC_DateToXmlString(new Date()) + "T" + Value.v1;
				}
				if(sOldValue != oHidden.value) DTAC_CallAnyChangeFor(oHidden.id, sOldValue, oHidden.value);
			}
			if(DTAC_Config.Time.CloseOnSelect) DTAC_Time_Close();
		}
	}
}
/*
var DTAC_Obj_ChangeListeners = {};
function DTAC_RegisterForChange(InputElementId, CallbackFunctionRef, ParameterObject)
{
	if( !DTAC_Obj_ChangeListeners[InputElementId] )
		DTAC_Obj_ChangeListeners[InputElementId] = [];
	var o = DTAC_Obj_ChangeListeners[InputElementId];
	if(o)
	{
		o[o.length] = {InputElementId: InputElementId, CallbackFunctionRef: CallbackFunctionRef, ParameterObject: ParameterObject};
	}
}
function DTAC_CallChangeFor(InputElementId, OldValue, NewValue)
{
	var oElementListners = DTAC_Obj_ChangeListeners[InputElementId], oEvLst;
	if(oElementListners)
	{
		for(var i=0; i<oElementListners.length; i++)
		{
			oEvLst = oElementListners[i];
			if(oEvLst)
			{
				if(typeof(oEvLst.CallbackFunctionRef) == 'function')
				{
					oEvLst.CallbackFunctionRef(InputElementId, OldValue, NewValue, oEvLst.ParameterObject);
				}
				else
				{
					var fnc = eval(oEvLst.CallbackFunctionRef);
					if(typeof(fnc) == 'function')
					{
						fnc(InputElementId, OldValue, NewValue, oEvLst.ParameterObject);
					}
				}
			}
		}
	}
}
*/
var DTAC_Obj_AnyChangeListeners = [];
function DTAC_RegisterForAnyChange(CallbackFunctionRef)
{
	DTAC_Obj_AnyChangeListeners[DTAC_Obj_AnyChangeListeners.length] = {CallbackFunctionRef: CallbackFunctionRef};
}
function DTAC_CallAnyChangeFor(InputElementId, OldValue, NewValue)
{
	var oEvLst;
	for(var i=0; i<DTAC_Obj_AnyChangeListeners.length; i++)
	{
		oEvLst = DTAC_Obj_AnyChangeListeners[i];
		if(oEvLst)
		{
			if(typeof(oEvLst.CallbackFunctionRef) == 'function')
			{
				oEvLst.CallbackFunctionRef(InputElementId, OldValue, NewValue);
			}
			else
			{
				var fnc = eval(oEvLst.CallbackFunctionRef);
				if(typeof(fnc) == 'function')
				{
					fnc(InputElementId, OldValue, NewValue);
				}
			}
		}
	}
}
DTAC_Init();
