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 slideShowBob(imagefile, whatIndexOfthirdPartyArrayAmI){
	//setTimeout("nothing()",100);
	setTimeout("blendimage('position"+whatIndexOfthirdPartyArrayAmI+"','image"+whatIndexOfthirdPartyArrayAmI+"','"+imagefile+"','1000', "+whatIndexOfthirdPartyArrayAmI+", '"+j+"' )", 6000+(whatIndexOfthirdPartyArrayAmI*10));
	//window.console.log("blendimage('position"+whatIndexOfthirdPartyArrayAmI+"','image"+whatIndexOfthirdPartyArrayAmI+"','"+imagefile+thirdPartyImageArray[j]+"','1000', '"+whatIndexOfthirdPartyArrayAmI+"', '"+j+"' )", 6000+whatIndexOfthirdPartyArrayAmI);
	//window.console.log("I am doing position"+whatIndexOfthirdPartyArrayAmI+", which is id "+thirdPartyImageArray[j]);
	j = j + 1;
	if (j > p-4) j = 0;
	setTimeout("slideShowBob('"+imagefile+"','"+whatIndexOfthirdPartyArrayAmI+"')",6000+(whatIndexOfthirdPartyArrayAmI*10));
	//alert(myNextImageName);
}

function nothing(){

}
currentlyShowing = new Array();

function startitup(rootimagefile){
	for(i=0;i<4;i++){
		slideShowBob(rootimagefile,i);
	}
}

function blendimage(divid, imageid, imagefile, millisec, whatIndexOfthirdPartyArrayAmI, whatjWasJustThen) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    
    //alert(whatjWasJustThen);
    
    var linktochange=document.getElementById("link"+whatIndexOfthirdPartyArrayAmI);
    //alert('linktochange = '+linktochange);
    //window.console.log("changing Image "+imageid+" and link "+whatIndexOfthirdPartyArrayAmI);
    
 //   alert(thirdPartyLinksArray);
     
   // if(((imageid=='image0')&&(thirdPartySizesArray[whatjWasJustThen]==468))||(thirdPartySizesArray[whatjWasJustThen]==153)){
		linktochange.href=thirdPartyLinksArray[whatjWasJustThen];
		linktochange.title=thirdPartyImageArray[whatjWasJustThen]+" "+imageid+" "+whatjWasJustThen;
   		
   		 //set the current image as background 
   		 document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; 
   		 //window.console.log("let's see what is null - is it divid - "+divid);
   		 
   		 //make image transparent 
   		 changeOpac(0, imageid); 
   		
   		/*
   		var ranNum= Math.floor(Math.random()*(76-69));
   		
   		if(currentlyShowing.length <= 3)
   		{
   			currentlyShowing[currentlyShowing.length] = ranNum;
   		}
 		*/
 		
 		//alert(currentlyShowing);
 		
   		 //make new image 
   		 document.getElementById(imageid).src = imagefile + thirdPartyImageArray[whatjWasJustThen]+'.gif'; 
   		 document.getElementById(imageid).width = thirdPartySizesArray[whatjWasJustThen]; 
	//}	
   		 //fade in image 
   		
   		 for(i = 0; i <= 100; i++) { 
   		     setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
   		     timer++; 
   		 } 
   		 

    //document.links[2].href
}