function abrir(url,nombre,ancho,alto) {
	LeftPosition = (screen.width) ? (screen.width-ancho)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-alto)/2 : 0;
	window.open(url,nombre,
		'height='+alto+',width='+ancho+',top='+TopPosition+',left='+LeftPosition+',toolbar=no,directories=no,status=no,'
		+'menubar=no,scrollbars=yes,resizable=yes');
}

function abrirModal(url,nombre,ancho,alto) {
/*
 *	Fuente:
 *	 	http://javascript.about.com
 *	Modo de usar:
 *		<a href="xpopupex.htm" target="name"
 *		onclick="abrirVentanaModal(); return false;">click here</a> 
*/	
	LeftPosition = (screen.width) ? (screen.width-ancho)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-alto)/2 : 0;
	window.open(url,nombre,
		'height='+alto+',width='+ancho+',top='+TopPosition+',left='+LeftPosition+',toolbar=no,directories=no,status=no,'
		+'menubar=no,scrollbars=yes,resizable=no,modal=yes');
}

function cerrarModal(noRefrescar) {
	if(noRefrescar){
		window.close();
	}else{
		window.close();
		cmdClick(opener.document.forms[0],'actualizar');
//		opener.document.location.reload();
	}
}


function cmdClick(form,cmd) {
      form.cmd.value = cmd;
      form.submit();
} 

function mostrarOcultarObj(idObj){
	var obj = document.getElementById(idObj);
	obj.style.display = obj.style.display=="none"?"":"none";
}

function abrirArchivo(url){
	abrirModal(url,"",800,650);
}

function redondear(valor, nroDec) {
	var decimales = nroDec;
	var valor = parseFloat(valor);
	var decimales = parseFloat(decimales);
	decimales = (!decimales ? 2 : decimales);
	return Math.round(valor * Math.pow(10, decimales)) / Math.pow(10, decimales);
} 

function paginaInicio(url){
	this.style.behavior="url(#default#homepage)";
	this.setHomePage(url);	
}

function favoritos(url){
	window.external.AddFavorite(url);
}

var jza_backColor;
function scbg(objRef, color) {
	jza_backColor = objRef.style.backgroundColor;
	objRef.style.backgroundColor = color;
	return;
}

function unscbg(objRef){
	objRef.style.backgroundColor = jza_backColor;
	return;
}