
function panel_muestraFondo(){

		
	divpanelfondo = document.createElement('div');
	divpanelfondo.id='divpanelfondo';
	
	document.body.appendChild(divpanelfondo); 
	
	if(gTamanoVentana()[0] > gTamanoBody()[0]){
	
		gId('divpanelfondo').style.width = gTamanoVentana()[0] + "px";
		
	}else{
		
		gId('divpanelfondo').style.width = gTamanoBody()[0] + "px";		
		
	}
	
	if(gTamanoVentana()[1] > gTamanoBody()[1]){
	
		gId('divpanelfondo').style.height = gTamanoVentana()[1] + "px";
		
	}else{
		
		gId('divpanelfondo').style.height = gTamanoBody()[1] + "px";		
		
	}	
	
}


function panel_ocultaFondo(){
		
	document.body.removeChild(gId('divpanelfondo'));
	
}


function panel_ocultaPanelCarta(){
		
	document.body.removeChild(gId('divpanelcentrallacarta'));
	
}

function panel_muestraPanelCarta(src, ancho, alto, titulo){	
	
	var margen = 15;
	var espacioExtraVertical = 25;
	var anchoTotal = gTamanoVentana()[0]/2 + gScroll()[0];
	var altoTotal = gTamanoVentana()[1]/2 + gScroll()[1];
	var strTabla = "<table cellspacing=\"0\" cellpadding=\"0\">";
	
	divpanelcentrallacarta = document.createElement('div');
	divpanelcentrallacarta.id='divpanelcentrallacarta';
	divpanelcentrallacarta.style.width = Number(2*margen+Number(ancho))+"px";
	divpanelcentrallacarta.style.height = Number(2*margen+Number(alto))+"px";

	divpanelcentrallacarta.style.left = Number(anchoTotal - Number(2*margen+Number(ancho))/2) + "px";
	divpanelcentrallacarta.style.top = Number(altoTotal - Number(2*margen+Number(alto))/2) + "px";	
	
	strTabla += "<tr>";
	strTabla += "<td><img src=\"../_recurso/images/popesqsupizq.gif\" /></td><td class=\"blanco\"></td><td><img src=\"../_recurso/images/popesqsupder.gif\" /></td>";
	strTabla += "</tr>";
	strTabla += "<tr>";
	strTabla += "<td class=\"blanco\"></td><td><img src=\"" + src + "\"></td><td class=\"blanco\"></td>";
	strTabla += "</tr>";
	strTabla += "<tr>";
	strTabla += "<td class=\"blanco\"></td><td class=\"blanco\" align=\"left\"><table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\"><tr><td>"+titulo+"</td><td align=\"right\"><img style=\"cursor:pointer;cursor:hand;\" src=\"../_recurso/images/cerrarpanel.gif\" onclick=\"panel_ocultaPanelCarta();panel_ocultaFondo();\" /></td></tr></table></td><td class=\"blanco\"></td>";
	strTabla += "</tr>";
	strTabla += "<tr>";
	strTabla += "<td><img src=\"../_recurso/images/popesqinfizq.gif\" /></td><td class=\"blanco\"></td><td><img src=\"../_recurso/images/popesqinfder.gif\" /></td>";
	strTabla += "</tr>";
	strTabla += "</table>";

	divpanelcentrallacarta.innerHTML=strTabla;

	document.body.appendChild(divpanelcentrallacarta); 

}

