
var IE = document.all?true:false;

function ChangeLabelHtml(lbl, html)
{
    if(lbl != undefined && null != lbl)
    {
        if(IE)
            lbl.innerHTML = html;
        else
        {
            var r = lbl.ownerDocument.createRange();
            r.selectNodeContents(lbl);
            r.deleteContents();
            var df = r.createContextualFragment(html);
            lbl.appendChild(df);
        }
    }
}


function cambiarContenido(nuevoTitulo, nuevoResumen, nuevafoto, tipo, idRedireccion, idSec)
{
	//alert("Entro");
	
	var urlAux = location.href;
	urlAux = urlAux.substring(0, urlAux.indexOf('aspx')+4);	
	if(tipo == '1') //Pasarela
	{
		var titulo = document.getElementById('lblTitulo');
		ChangeLabelHtml(titulo, nuevoTitulo);
		
		var resumen = document.getElementById('lblResumen');
		ChangeLabelHtml(resumen , nuevoResumen);	
		
		var divFoto_perfil = document.getElementById('imgPrincipal');
		divFoto_perfil.src = nuevafoto;
	}
	if(tipo == '2') //Perfil
	{
		window.location="wf_Perfil.aspx?IdArt="+idRedireccion;
	}
	if(tipo == '3') //Guia de compras
	{
		//alert("1. "+urlAux);
		
		window.location=urlAux+"?IdArt="+idRedireccion;
		//alert("2");
	}
	if(tipo == '4') // Top 10
	{
		
		window.location="http://www.revistafucsia.com/wf_InfoSeccion.aspx?IdSec="+idSec+"&IdMlt="+idRedireccion;
	}
	if(tipo == '5') // Recomendado
	{
		window.location="wf_InfoArticulo.aspx?IdArt="+idRedireccion;
	}
	return false;
}

function mostrarPanel(numeroPanel)
{
	var panel = document.getElementById('item' + numeroPanel);
	if (panel != null && panel != undefined)
	{
		sp.showPanel('item' + numeroPanel); 
	}

	return false;
}
