/* Fade in Banner by Ray Yates */
function hide_eblasts(ndx) {
    for (j=0; j<blast_list.length; j++) {
        var el = document.getElementById("eblast" + blast_list[j]);
        if(blast_list[j]==blast_list[ndx]){
            el.style.display = "block";
        } else {
            setOpacity(el,0);
            el.style.display = "none";
        }
        el.style.zIndex = 0;
    }
}
function clear_t() {
    clearTimeout(t);
}
function nav_eblasts(dir) {
    // reset display and z-index on all except current. Make current image z-index 9
    hide_eblasts(ndx);
    // get previous or next image
    if(dir=="p"){
        ndx = ndx - 1;
        if(ndx<0) {
            ndx = blast_list.length - 1;
        }
    } else {
        ndx = ndx + 1;
        if(ndx>=blast_list.length) {
            ndx = 0;
        }
    }
    // get the new image and make it opaque
    el = document.getElementById("eblast" + blast_list[ndx]);
    setOpacity(el, 0);
    // move it to the top and fade in.
    el.style.zIndex = 1;
    el.style.display = "block";
    fadeIn('eblast'+blast_list[ndx],0)
    return false
}
function rotate_eblasts(dir) {
    nav_eblasts(dir);
    t = setTimeout("rotate_eblasts('n')",500 * delay);
}
function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}
function fadeIn(objId,opacity) {
	if (document.getElementById) {
	obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			opacity += 8;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 55);
		} else {
			document.getElementById("eblast" + blast_list[prev_ndx]).style.display="none";
			prev_ndx = ndx;
		}
	}
}


