 

/*function OpenCalendar(path,dayid,monthid,yearid, postBack)
{
	popUp = window.open(path + 'Calendar.aspx?formname=' + document.forms[0].name + 
		'&dayid=' + dayid + '&selected=' + document.forms[0].elements[dayid].value + 
		'&monthid=' + monthid + '&selected=' + document.forms[0].elements[monthid].value + 
		'&yearid=' + yearid + '&selected=' + document.forms[0].elements[yearid].value + 
		'&postBack=' + postBack, 
		'popupcal', 
		'width=200,height=250,left=500,top=220');
}*/
var popUp;
function OpenCalendar(path,dateid,dateid1,postBack,showtime,seldatetime,mintime,maxtime)
{
	var dt= document.getElementById(dateid1);
	seldatetime=dt.value;
	
	popUp = window.open(path + 'SelectDate.aspx?formname=' + document.forms[0].name + 
		'&dateid=' + dateid + '&dateid1=' + dateid1 + '&selected=' + document.forms[0].elements[dateid].value + 
		'&postBack=' + postBack + '&showtime=' + showtime + '&seldatetime=' + seldatetime + '&mintime=' + mintime + '&maxtime=' + maxtime,
		'popupcal', 
		'width=200,height=250,left=500,top=220');
		
}

function ClearText(dateid,dateid1)
{
	var ctl = document.getElementById(dateid);
	var ctl1 = document.getElementById(dateid1);
	ctl.value="";
	ctl1.value="";
}

/*function SetDate(formName, dayid, monthid, yearid, valday, valmonth, valyear, postBack)
{
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[dayid].value = valday;
	theform.elements[monthid].value = valmonth;
	theform.elements[yearid].value = valyear;
	//theform.elements[yearid].value=valmonth + '/' + valday + '/' + valyear;
	if (postBack)
		__doPostBack(id,'');
}*/
//function SetDate(formName, dateid, valday, valmonth, valyear, postBack)

function SetDate(formName, dateid,dt, postBack)
{
	eval('var theform = document.' + formName + ';');
	popUp.close();
	//theform.elements[dayid].value = valday;
	//theform.elements[monthid].value = valmonth;
	//theform.elements[yearid].value = valyear;
	//theform.elements[dateid].value=valmonth + '/' + valday + '/' + valyear;
	theform.elements[dateid].value=dt;
	if (postBack)
		__doPostBack(id,'');
}