function abrir(newurl)
{
	var poswidth = 700;
	var posheight = 600;
	var posleft = (window.top.screen.availWidth - poswidth) / 2;
	var postop = (window.top.screen.availHeight - posheight) / 2;
	var posinfo = "status=yes,resizable=no,width=" + poswidth + ",height=" + posheight + ",top=" + postop + ",left=" + posleft + ",scrollbars=no";
    ventana = window.open(newurl,'Nueva', posinfo);
    ventana.focus();
}

function abrirVentana(url, poswidth, posheight, Nombre)
{
	var posleft = (window.top.screen.availWidth - poswidth) / 2;
	var postop = (window.top.screen.availHeight - posheight) / 2;
	var posinfo = "status=yes,resizable=yes,width=" + poswidth + ",height=" + posheight + ",top=" + postop + ",left=" + posleft + ",scrollbars=no";
	var ventana = window.open(url, Nombre, posinfo);
	ventana.focus();
}

function abrirVentanaScrolls(url, poswidth, posheight, Nombre)
{
	var posleft = (window.top.screen.availWidth - poswidth) / 2;
	var postop = (window.top.screen.availHeight - posheight) / 2;
	var posinfo = "status=yes,resizable=yes,width=" + poswidth + ",height=" + posheight + ",top=" + postop + ",left=" + posleft + ",scrollbars=yes";
	var ventana = window.open(url, Nombre, posinfo);
	ventana.focus();
}

function postBack(valor)
{
	var controller = opener ? opener : parent;
    if (controller.Callback != null) 
    {
        controller.Callback(valor);
        window.close();
    }
}

function postBackForm(theForm)
{
	var ind;
	var str = '?';
	for (ind=0; ind < theForm.elements.length; ind++)
	{
		var item = theForm.elements[ind];
		if ( item.name != '')
		{
			str += item.name + '=' + item.value + '&';
		} 
	}
	postBack(str);
}


function resizeWindow(item)
{
	var poswidth = 700; // window.top.screen.availWidth / 2;
	var posheight = 600; // window.top.screen.availHeight / 2;
	var posleft = (window.top.screen.availWidth - poswidth) / 2;
	var postop = (window.top.screen.availHeight - posheight) / 2;
	window.blur();
	window.moveTo(posleft, postop);
	window.resizeTo(poswidth,posheight);
	window.focus();
}
