function favorito()
{
    var title = 'Bufete Romera';
    var url = 'http://www.bufeteromera.com';

    if (window.sidebar) {
        window.sidebar.addPanel(title, url,"");
    } else if( document.all ) {
        window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ){
        return true;
    }
}

function preparaAyuda(cab, capas)
{
	for(i=0;i<cab.length;i++)
	{
		var tmp = document.getElementById(cab[i]);
		tmp.style.background = "white url(../img/triangulo_marron.gif) left no-repeat";
		
	}
	for(i=0;i<capas.length;i++)
	{
		var tmp = document.getElementById(capas[i]);
		tmp.style.display = "none";
		tmp.style.visibility = "hidden";
	}
}


function mostrarOcultar(ObjetoT, ObjetoB)
{
	var oObjetoT = document.getElementById(ObjetoT);
	var oObjetoB = document.getElementById(ObjetoB);
	
	if( (oObjetoB.style.display == "none") || (oObjetoB.style.display == "") )
	{
		oObjetoT.style.background = "white url(../img/triangulo_marron_inv.gif) left no-repeat";
		oObjetoB.style.display = "inline";
		oObjetoB.style.visibility = "visible";
	}
	else
	{
		oObjetoT.style.background = "white url(../img/triangulo_marron.gif) left no-repeat";
		oObjetoB.style.visibility = "hidden";
		oObjetoB.style.display = "none";
	}
}


//ver detalle de consulta
function verDetalle(id)
{
		var alto = 500;
		var h = (screen.height - alto)/2; 
		var ancho = 400;
		var w = (screen.width - ancho)/2;
		window.open('../controles/detalleConsulta.aspx?id=' + id, '', 'top=' + h + ',left=' + w + ',width=' + ancho + ',height=' + alto + ',scrollbars=1,menubar=0,location=0,status=0,titlebar=0,toolbar=0');
}


//ver detalle contrato	
function verDetalleContrato(id)
{
	var alto = 500;
	var h = (screen.height - alto)/2; 
	var ancho = 600;
	var w = (screen.width - ancho)/2;
	window.open('../controles/detalleContrato.aspx?id=' + id, '', 'top=' + h + ',left=' + w + ',width=' + ancho + ',height=' + alto + ',scrollbars=1,menubar=0,location=0,status=0,titlebar=0,toolbar=0');
}
		
//ver detalle contratoMedida
function verDetalleRevision(id)
{
	var alto = 500;
	var h = (screen.height - alto)/2; 
	var ancho = 600;
	var w = (screen.width - ancho)/2;
	window.open('../controles/detalleRevision.aspx?id=' + id, '', 'top=' + h + ',left=' + w + ',width=' + ancho + ',height=' + alto + ',scrollbars=1,menubar=0,location=0,status=0,titlebar=0,toolbar=0');
}


//cambiar el estilo de un objeto
function setEstilo(objeto, estilo){objeto.className = estilo;}

function imprimeListado(capa,opts)
{
	/*
	var contenido = document.getElementById(capa);
	var popup = window.open('printlistado.htm','', 'top=100,left=250,width=630,height=600,scrollbars=1,menubar=0,location=0,status=0,titlebar=0');
	popup.body.innerHTML = contenido.innerHTML;
	*/
	alert('Cuando se cargue la nueva ventana, pulse la tecla F5 para imprimir');
	var win = window.open ("", "", opts);
	win.focus();
	with (win.document)
	{
		writeln ('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "hmpro6.dtd">');
		writeln ('<html>');
		writeln ('<head>');
		writeln ('<link rel="stylesheet" href="../css/biblioteca.css">');
		writeln ('<style>a{color:black;text-decoration:none;}</style>')
		writeln ('<style>table{font-size:11pt;}tr.cab_tabla{font-size:12pt;font-weight:bold;}</style>')
		writeln ('</head>');
		writeln ('<body topmargin="0" onload="window.print()">');
		writeln ( document.getElementById(capa).innerHTML );
		writeln ('</body></html>');
	}
}

function carga() 
{
	parent.location.href="_login.php";
}

function mostrarAyudaTienda(sObjeto, sMensaje) 
{
	document.getElementById(sObjeto).innerHTML = sMensaje;
}

//Abre una nueva ventana de pop up con el tamaņo que le indiquemos

function popUp(URL) 
{
	window.open(URL, '', 'toolbar=no,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=650,height=500,left = 140,top = 25');
}
