function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
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 muda_imagem_fade(id, tempo, imagem_f){
	opacity(id,100,0,tempo);
	setTimeout("document.getElementById('"+id+"').src='"+imagem_f+"'",tempo);
	setTimeout("opacity('"+id+"',0,100,"+tempo+")",tempo);
}
function load(path) {
var load = window.open( path ,'',"scrollbars=no,menubar=no,resizable=yes,toolbar=no,location=no,status=no,copyhistory=no,directories=no,height="+(document.im_galeria2.height+40)+",width="+(document.im_galeria2.width+40));
}
