// image CROSS-OVER fading slideshow written by paul@pioneerwebsites.com.au
	// -------- full file names in each pages head script
function imagefader() {
	randomise='no'; // yes or no
	if (window.top.location.href.indexOf('photos')==-1) {
		randomise='yes'; // yes or no
		document.getElementById('floater').style.visibility='visible';
	}
	spot=document.getElementById('splash'); // id of div
	wait=1000; // pause at full opacity in milliseconds
	blendfactor=70; // 1 to (100/blendbase)
	blendrate=80; // 1 to 100 (milliseconds inbetween frames)
// -----------------------------------------------------------------------------
blendbase=1; //
function randOrd(){return (Math.round(Math.random())-0.5);}
	aobr=blendfactor.toFixed(0); obr=(aobr/100).toFixed(2); z=0; if (randomise=='yes') {i.sort(randOrd)};
	for (y=0; y<i.length; y++) {
		extra=document.createElement('img'); 
		extra.setAttribute("src", i[y]); 
		extra.setAttribute("id", "fader"+y);
		if (y==0) {
			extra.style.cssText='opacity: 1.0; filter: alpha(opacity=100); position: absolute; top: 0; left: 0;'; 
		} else {
			extra.style.cssText='opacity: 0.0; filter: alpha(opacity=0); position: absolute; top: 0; left: 0;'; 
		}
		spot.appendChild(extra);
	}
	spot.style.cssText='position: relative;';
	count=0; ao=100; o=1; aonxt=0; onxt=0; 
	setTimeout('trans();',(wait*2))
}

function trans() {
	ao-=aobr; o-=obr; o=parseFloat(o).toFixed(2); aonxt=parseFloat(aonxt)+parseFloat(aobr); onxt=parseFloat(onxt)+parseFloat(obr); onxt=parseFloat(onxt).toFixed(2);
	document.getElementById('fader'+z).style.opacity=o; document.getElementById('fader'+z).style.filter='alpha(opacity='+ao+')';
	if (z==(i.length-1)) {
		znxt=0;
	} else {
		znxt=z+1;
	}
	document.getElementById('fader'+znxt).style.opacity=onxt; document.getElementById('fader'+znxt).style.filter='alpha(opacity='+aonxt+')';
	count++;
	if (count<(((100/blendbase+1)-blendfactor)*blendbase)) { // alert(z+'.  pic:'+znxt+'. ao, o: '+ao+','+o+'ao,onext: '+aonxt+','+onxt);
		setTimeout("trans();",blendrate)
	} else { // alert(z+'.  pic:'+znxt+'. ao, o: '+ao+','+o+'ao,onext: '+aonxt+','+onxt);
		setTimeout("count=0; ao=100; o=1; aonxt=0; onxt=0; z++; if (z==i.length) {z=0;}; trans();",wait);
	}
}
// end CROSS-OVER image fading slideshow



function hover(which) {
	old=which.src; old=old.split('.gif'); old[0]=old[0]+'-.gif'; which.src=old[0]+old[1];
}
function nohover(which) {
	old=which.src; old=old.split('-.gif'); old[0]=old[0]+'.gif'; which.src=old[0]+old[1];
}

// dynamic image centering
function ic(image,fullwidth,fullheight) {
	fromleft=0; fromtop=0;
	imgwidth=image.offsetWidth; imgheight=image.offsetHeight;
	if (imgwidth<fullwidth) {fromleft=((fullwidth-imgwidth)/2).toFixed(0);}; if (imgheight<fullheight) {fromtop=((fullheight-imgheight)/2).toFixed(0);}
	image.style.cssText='position: relative; left: '+fromleft+'px; bottom: '+fromtop+'px;';
}

function bigpic(thumb) {
	newsrc=thumb.src.split('thumbs/');
	document.getElementById('thebigpic').src=newsrc[0]+newsrc[1];
}




