



	var imgList=new Array();
	
	var i=0;
	
	var current=0;
	
	var toID=0;
	
	var done=true;
	
	// Set the order of the  rotation after the picture_frame

	imgList[i++]="saint_philomena_0001.jpg";
	imgList[i++]="saint_philomena_0003.jpg";
	imgList[i++]="saint_philomena_0004.jpg";
	imgList[i++]="saint_philomena_0005.jpg";
	imgList[i++]="saint_philomena_0006.jpg";
	imgList[i++]="saint_philomena_0007.jpg";
	imgList[i++]="saint_philomena_0008.jpg";
	imgList[i++]="saint_philomena_0002.jpg";
	imgList[i++]="saint_philomena_0009.jpg";
	imgList[i++]="saint_philomena_0010.jpg";
	imgList[i++]="saint_philomena_0011.jpg";
	imgList[i++]="saint_philomena_0012.jpg";
	imgList[i++]="saint_philomena_0013.jpg";
	imgList[i++]="saint_philomena_0014.jpg";
	imgList[i++]="saint_philomena_0015.jpg";
	imgList[i++]="saint_philomena_0016.jpg";
	imgList[i++]="saint_philomena_0017.jpg";
	imgList[i++]="saint_philomena_0018.jpg";
	imgList[i++]="saint_philomena_0019.jpg";
	imgList[i++]="saint_philomena_0020.jpg";
	imgList[i++]="saint_philomena_0021.jpg";
	imgList[i++]="saint_philomena_0022.jpg";
	imgList[i++]="saint_philomena_0023.jpg";
	imgList[i++]="saint_philomena_0024.jpg";
	imgList[i++]="saint_philomena_0025.jpg";
	imgList[i++]="saint_philomena_0026.jpg";
	imgList[i++]="saint_philomena_0027.jpg";
	imgList[i++]="saint_philomena_0028.jpg";
	imgList[i++]="saint_philomena_0029.jpg";
	imgList[i++]="saint_philomena_0030.jpg";
	imgList[i++]="saint_philomena_0031.jpg";
	imgList[i++]="saint_philomena_0032.jpg";
	imgList[i++]="saint_philomena_0033.jpg";
	imgList[i++]="saint_philomena_0034.jpg";
	imgList[i++]="saint_philomena_0035.jpg";
	imgList[i++]="saint_philomena_0036.jpg";
	imgList[i++]="saint_philomena_0037.jpg";
	imgList[i++]="saint_philomena_0038.jpg";
	imgList[i++]="saint_philomena_0039.jpg";
	imgList[i++]="saint_philomena_0040.jpg";
	imgList[i++]="saint_philomena_0041.jpg";
	imgList[i++]="saint_philomena_0042.jpg";
	imgList[i++]="saint_philomena_0043.jpg";
	imgList[i++]="saint_philomena_0044.jpg";
	imgList[i++]="saint_philomena_0045.jpg";
	imgList[i++]="saint_philomena_0046.jpg";
	imgList[i++]="saint_philomena_0047.jpg";
	imgList[i++]="saint_philomena_0048.jpg";
	imgList[i++]="saint_philomena_0049.jpg";
	imgList[i++]="saint_philomena_0050.jpg";
	imgList[i++]="saint_philomena_0051.jpg";
	imgList[i++]="saint_philomena_0052.jpg";
	imgList[i++]="saint_philomena_0053.jpg";
	imgList[i++]="saint_philomena_0054.jpg";
	imgList[i++]="saint_philomena_0055.jpg";
	imgList[i++]="saint_philomena_0056.jpg";
	imgList[i++]="saint_philomena_0057.jpg";
	imgList[i++]="saint_philomena_0058.jpg";
	imgList[i++]="saint_philomena_0059.jpg";
	imgList[i++]="saint_philomena_0060.jpg";
	imgList[i++]="saint_philomena_0061.jpg";
	imgList[i++]="saint_philomena_0062.jpg";
	imgList[i++]="saint_philomena_0063.jpg";
	imgList[i++]="saint_philomena_0064.jpg";
	imgList[i++]="saint_philomena_0065.jpg";
	imgList[i++]="saint_philomena_0066.jpg";
	imgList[i++]="saint_philomena_0067.jpg";
	imgList[i++]="saint_philomena_0068.jpg";
	imgList[i++]="saint_philomena_0069.jpg";
	imgList[i++]="saint_philomena_0070.jpg";
	imgList[i++]="saint_philomena_0071.jpg";
	imgList[i++]="saint_philomena_0072.jpg";
	imgList[i++]="saint_philomena_0073.jpg";
	imgList[i++]="saint_philomena_0074.jpg";
	imgList[i++]="saint_philomena_0075.jpg";
	imgList[i++]="saint_philomena_0076.jpg";
	imgList[i++]="saint_philomena_0077.jpg";
	imgList[i++]="saint_philomena_0078.jpg";
	imgList[i++]="saint_philomena_0079.jpg";
	imgList[i++]="saint_philomena_0080.jpg";
	imgList[i++]="saint_philomena_0081.jpg";
	imgList[i++]="saint_philomena_0082.jpg";
	imgList[i++]="saint_philomena_0001.jpg";
	
	// Set speed of fade and interval between fades
	
	var dissolvespeed=7000;
	var interval=13000;


function setCrossfade() {

	setTimeout("blendimage('main','picture_frame',0," + dissolvespeed + ")",interval);
		
}

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 + ")"; 
    
    if (opacity<99) {
		done=false;
	} else {
		done=true;
	}
}

function nextFade() {
	if (done==true) {
		clearTimeout(toID);
		blendimage('main', 'picture_frame', current, dissolvespeed);
	}
}


function blendimage(divid, imageid, imagefile, millisec) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
     
    //set the current image as background 
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; 
     
    //make image transparent 
    changeOpac(0, imageid); 
     
    //make new image 
    document.getElementById(imageid).src = "http://www.philomena.us/images/" + imgList[imagefile]; 

    //fade in image 
    for(i = 0; i <= 99; i++) { 
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
        timer++;
    } 
    
    //setTimeout('document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"',(timer*speed));
    
    if (imagefile==imgList.length-1) {
    	imagefile=-1;
    }
   
    
    
    toID=setTimeout("blendimage('main','picture_frame'," + ++imagefile + "," + dissolvespeed + ")",interval);
    
    current=imagefile;
}

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
