function ReturnDialog(retValue)
{
	// For each control update: we process only optional parameters
	if (retValue != null)
	{
		var iInit = 3;
		var iRet = 0;
		var sRetValues = '';
		var sId = null;
		var oControl = null;
		var sType = null;


		for (i = iInit;i < window.currentArgs.length; i++)
		{
			sId = window.currentArgs[i];

			oControl=BntGet(sId);
			if (typeof(oControl)=='object')
			{
			sType=oControl.tagName;
			
			sRetValues += retValue[iRet] + BNT_SEPARATOR;

			if (sType=='INPUT') // textbox
			{
				oControl.value = retValue[iRet];
			}
			else if (sType=='SPAN') // labels
			{
				oControl.innerText = retValue[iRet];
			}
			else
			{
				i++; oControl[window.currentArgs[i]] = retValue[iRet];
			}
		}
		iRet++;
	}
}

	// we make a postback if needed
	//if (eventTarget)
	if (window.evTarget)
	{
		__doPostBack(eventTarget,sRetValues);
	}
	
	window.evTarget = null;
		
	//Page_ValidationActive=True;
	SetCursor('');

}
// OpenModaldialog
// url: the url to load into the new window
// windowOptions: window options
// eventTarget: name (postback without validation) 
function OpenModalDialog(url, windowOptions, eventTarget)
{
    window.evTarget = eventTarget;
	window.currentArgs = arguments;

	//var oRetValue=window.showModalDialog(url, window, windowOptions);
	
	var oWnd = window.open (url, "calendar", "menubar=0,toolbar=0,resizable=0,width=250,height=150");
}

