var styleSheet = "css/estilopopup.css";

function mostrarImagen(imgPopup, pie, titulo)
{
	var ventana = window.open("about:blank",null,"height=100px, width=100px, titlebar=no, status=no, menubar=no, location=no, scrollbars=no")
	var doc = ventana.document;
	var str = "<html><head><title>" + (titulo!=null?titulo:"") +"</title>" +
			  (styleSheet!=null? "<link rel='stylesheet' type='text/css' href='" + styleSheet + "' />" : "") +
			  "</head>" +
			  "<body topmargin=\"0\" leftmargin=\"0\" onload=\"document.getElementById('contenedor').style.width=document.getElementById('imagen').width;window.resizeTo(document.getElementById('contenedor').offsetWidth, document.getElementById('contenedor').offsetHeight+ (document.all? 36 : 53))\">" +
			  "<table id='contenedor' cellpadding=\"0\" cellspacing=\"0\">" +
			  "<tr><td><img id='imagen' src='" + imgPopup + "'/></td></tr>" +
			  (pie!=null ? "<tr><td align=\"center\">" + pie + "</td></tr>" : "") +
			  "</table>" +
			  "</body></html>"
	doc.write(str);
	doc.close();
}

function ImagenConPie(obj, pie, tituloVentana)
{
	if(typeof(obj)=="string")
		this.obj = document.getElementById(obj);
	else
		this.obj = obj;
	this.obj.target="_self";
	this.obj.style.cursor="pointer";
	this.obj.setAttribute("imagenGrande", this.obj.href);
	this.obj.setAttribute("tituloVentana", tituloVentana);
	this.obj.href="#";
	this.obj.setAttribute("pie",pie);
	this.obj.onclick = function()
	{
		mostrarImagen(this.getAttribute("imagenGrande"), this.getAttribute("pie"), this.getAttribute("tituloVentana"));
		return false;
	}
}

function ClasePopup(pie, titulo)
{
	this.pie = pie;
	this.titulo = titulo;
}

var ptWindowOnLoad = window.onload;
window.onload = function()
{
	if(ptWindowOnLoad!=null) ptWindowOnLoad();
	var enlaces = document.body.getElementsByTagName("a");
	var numEnlaces = enlaces.length;
	for(var i=0;i<numEnlaces;i++)
	{
		var enlace = enlaces[i];
		if(enlace.className!=null && enlace.className!="" && clases[enlace.className]!=null)
		{
			var clase = clases[enlace.className];
			ImagenConPie(enlace, clase.pie, clase.titulo);
		}
	}
}

var clases = function(){}
clases['popup1'] = new ClasePopup( null, "Instrucciones de  preparaci&oacute;n de unos Canelones F&aacute;cil El Pavo")
clases['popup2'] = new ClasePopup( null, "Pasos de preparaci&oacute;n del pack de canelones")

