//simple calendar widget

function eXcell_scw(cell){
	try{
		this.cell = cell;
		this.grid = this.cell.parentNode.grid;
	}catch(er){}

	this.edit = function(e){
		scwShow (this, this.cell);	// Display the calendar.  First argument is dhtmlXgrid cell.
		this.cell._cediton=true;	// Mark cell as being edited
		this.val=this.cell.val;		// Save the cell value for later comparison
this.onclick = function(e){(e||event).cancelBubble = true}
	}
	this.getValue = function(){
		return this.cell.val;
	}

	this.detach = function(){
		if (! this.cell._cediton)
			return;
//alert('in detach');
		this.cell._cediton=false;
		var newDate=this.cell.innerHTML; // The calendar widget has already stuffed the value and hidden itself
		scwHide();
//		return true; // Force value change
		return this.val!=newDate;
	}
}
eXcell_scw.prototype = new eXcell;
eXcell_scw.prototype.setValue = function(val){
	if(!val || val.toString()._dhx_trim()=="")
		val="";
	this.cell.val=val;
	this.cell.innerHTML = val;
}
