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 LoadGallery(id){
	var powimg = document.getElementById("powimg");
/*	if (document.all){
		powimg.style.filter="blendTrans(duration=1)";
		powimg.filters.blendTrans.Apply();
  	}
	*/
  	powimg.src = pictures[id][0];
  	powimg.width = pictures[id][2];
  	powimg.height = pictures[id][1];
  	powimg.alt = "Picture of The Week " + pictures[id][4];;
/*
 	 if (document.all){
    	powimg.filters.blendTrans.Play();
  	}
*/
    powimg.style.opacity = (0); 
    powimg.style.MozOpacity = (0); 
    powimg.style.KhtmlOpacity = (0); 
     powimg.style.filter = "alpha(opacity=0)"; 
	opacity("powimg", 0, 100, 500)
  	document.getElementById("caption").style.width = pictures[id][2] + "px";
  	document.getElementById("caption").innerHTML = pictures[id][3];
  	document.getElementById("pagetitle").innerHTML = "Picture of The Week " + pictures[id][4];
	  
}