var popUp;

function OpenCalendar(idname, postBack)
{
	popUp = window.open('Modulos/Calendario/Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=165,height=230,left=200,top=250');
}

function SetDate(formName, id, newDate, postBack)
{
	eval('var theform = document.' + formName + ';');
	if (popUp!=null){
		popUp.close();
		theform.elements[id].value = newDate;
		if (postBack)
			__doPostBack(id,'');
	}
}		

function OpenBusqueda(idname,ValorInicial, oBusqueda,postBack)
{
	popUp = window.open('PagBusqueda.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + ValorInicial + '&oBusqueda='+ oBusqueda + '&postBack=' + postBack, 
		'popupcal', 
		'width=650,height=400,left=75,top=75');
}

function SetBusquedaValue(formName, id, newVal, postBack)
{
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[id].value = newVal;
	if (postBack)
		__doPostBack(id,'');
}	


function OpenCalendargrid(idname,ValorInicial, postBack)
{
	popUp = window.open('Modulos/Calendario/Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + ValorInicial + '&postBack=' + postBack, 
		'popupcal', 
		'width=165,height=230,left=200,top=250');
}


