<!--
function cambiacss(id){
  var targetElement = document.getElementById(id);
  
  if(targetElement.href.indexOf('-print') == -1) {
		targetElement.href="/styleprint.css";
  }else{
		targetElement.href="/style.css";
  }
}

function vista_previa(miurl, ancho, alto) {
	var izquierda = (screen.width) ? (screen.width-ancho)/2:100;
	var arriba = (screen.height) ? (screen.height-alto)/2:100;
	var opciones = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+ancho+",height="+alto+",left="+izquierda+",top="+arriba;
	miurl = "/extras/print.php?doc=.."+miurl;
	var partes_url = miurl.split("?");
	miurl=partes_url[0]+"?"+partes_url[1];
	if (partes_url[2]){
		var intIndexOfMatch = partes_url[2].indexOf("&");
		while (intIndexOfMatch != -1){
			partes_url[2] = partes_url[2].replace("&","**");
	  	intIndexOfMatch = partes_url[2].indexOf("&");
 		}
		miurl=miurl+"{}"+partes_url[2];
	}
	
	window.open(miurl, 'vprevia', opciones );
}

function printConvenio(){
	
	//printpage()
	var url = location.href;
	var host = location.host;
	url = url.replace("http://"+host, '');
	var ancho;
	var alto;
	
	ancho = screen.width-20;
	alto = screen.height-40;
	vista_previa(url,ancho,alto);
}

function printpage() {
	window.print();
}

function imprimir(){
	//Ocultamos el menu
  document.getElementById('menuimprimir').style.display = 'none';
  document.getElementById('menuimprimir').style.visibility = 'hidden';
	window.print();
	//Volvemos a mostrar el menú
	document.getElementById('menuimprimir').style.display = 'block';
  document.getElementById('menuimprimir').style.visibility = 'visible';
}

//-->

