
function ShowCalendar(field, url)
{
var sIDs;
var arr=document.all(field).value.split('-');
if (arr.length==3) 
{
	sIDs = '?ano=' + arr[0] + '&mes=' +  arr[1] + '&dia=' +  arr[2];
}
else
{
	sIDs = '?ano=&mes=dia=';
}
var sUrl = url + sIDs;
var sFeatures = 'dialogHeight: 300px; dialogWidth: 250px; center: Yes; help: No; resizable: No; status: No; toolbar= No;';				
var obj= window.showModalDialog(sUrl,window,sFeatures);
if (obj!=null)document.all(field).value= obj.date;
}

function fazReset(field)
{
	document.all(field).value='';
}

function valida()
{
	if(Page_ClientValidate())
	{
		return true;
	}
	else
	{
		span_erro.style.display="inline";
		return false;
	}
}

function DateChanged(year, month, day)
{
	var oRet = new Object;
	oRet.year = year;
	oRet.month = month;
	oRet.day = day;
	
	document.write(day);
	
	if ( (oRet.year == '') && (oRet.month == '') && (oRet.day == '') )
	{
		oRet.date = '';						
	}
	else				
		oRet.date = oRet.year + '-' + oRet.month + '-' + oRet.day;													
	
	window.returnValue = oRet;				
	
	window.close();
}
