//altera a opacidade da imagem de acordo com o navegador
function changeOpac(opacity, id)
{
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function blendimage(divid, imageid, imagefile, millisec)
{

    var speed = Math.round(millisec / 100);
    var timer = 0;
    
    //seta a imagem como fundo da div
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
    
    //deixa a imagem transparente
    changeOpac(0, imageid);
    
    //cria uma nova imagem na div
    document.getElementById(imageid).src = imagefile;

    //dá o fade na imagem chamando a função de alterar opacidade
    for(i = 0; i <= 100; i++)
	 {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
}

function blendtext(text, imageid, millisec)
{

    var speed = Math.round(millisec / 100);
    var timer = 0;

    //dexa a div com opacidade 0
    changeOpac(0, imageid);
    
    //make new image
    document.getElementById(imageid).innerHTML = text;

    //vai aumentando a opacidade da div até chegar em 100%
    for(i = 0; i <= 100; i++)
	 {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
}  