NS=(navigator.appName == "Netscape")?true:false; 

// AbrirVentana: Abre una nueva ventana de navegador
function AbrirVentana(url,poswidth,posheigth)  {
	(NS)? PosX="screenX=" : PosX="left=";
	(NS)? PosY=",screenY=" : PosY=",top=";
	factorancho=parseInt((poswidth/10)+0.5);
	factoralto=parseInt((posheigth/10)+0.5);
	var alto=100+factoralto;
	var ancho=100+factorancho;
	var CVentana='ventana=window.open("","","'+PosX+parseInt((screen.width - poswidth)/2)+PosY+parseInt((screen.height - posheigth)/2)+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+ancho+',height='+alto+'")';
	eval(CVentana);
	ventana.document.write("<br><div class='c'><strong><font color='#18188C'><font size='+1'>CARGANDO. . .</font></font></strong></div>")
	do {
		((ancho+factorancho)<poswidth) ? ancho=ancho+factorancho: ancho=poswidth;
		((alto+factoralto)<posheigth) ? alto=alto+factoralto: alto=posheigth;
		ventana.resizeTo(ancho,alto);
	}
	while ((ancho<poswidth) || (alto<posheigth))
		ventana.location=url;
}

//---------------------------------------------------------------------
// FUNCIÓN: BCompruebaRequerido
// CARACTERÍSTICAS: Comprueba que el objeto tenga algún valor relleno.
//		Si no es así genera el error adecuado y da el foco al elemento.
// PARÁMETROS: - obj: Objeto que queremos comprobar.
//            - str: Mensaje a mostrar
// DEVUELVE: Si el objeto tiene algo devuelve true. Sino false.
//---------------------------------------------------------------------
function BCompruebaRequerido(obj, str) {
	
	// Si el objeto no tiene ningún valor...
	if (obj.value == "") {
		// Damos el mensaje y el foco al elemento
		alert(str);
		obj.focus();
		return false;
	}
	return true;
}
