if (window.attachEvent) {
	window.attachEvent("onload", startEffex);
}
var widths = new Array();
var lastShell = 11; var nPairs = 3; 

function startEffex() {
	saveWidths ();
	setTimeout ( 'hidetext (4000)', 4000);
	var waveSize = 2;
	var index = lastShell+1;
	wave (index, waveSize, 300);// fix - sequential calls otherwise often out of sequence 
}
function wave (i, s, delay) { 
	adjustImage (document.images[i],s);
	adjustImage (document.images[i+nPairs],s);
	
	var i2 = i+1; var s2 = s;  var delay2 = delay; 
	if( i == lastShell+nPairs ) {
		i2 = lastShell+1;
		s2 = -s;
		if (s2 > 0) delay2 = 8*delay;
	}
	setTimeout ( 'wave('+ i2 +','+ s2 +','+ delay +')', delay2);
}
function adjustImage (img,size) {
	img.style.width = (img.width + size) + "px";
	img.style.height = (img.height + size) + "px";
}
function saveWidths () {
	for (var j = 0; j <= lastShell; j++) {
		widths[j] = document.images[j].width ;
	}
	widths[lastShell-1] = 50; //hack here to keep shell hidden in older browsers that don't support effex
	widths[lastShell] = 80; //hack here to keep shell hidden in older browsers that don't support effex
}
function hidetext (delay) { 
	for (var j = lastShell; j >= 0; j--) {
		document.images[j].style.width = "0px";// squeeze pics 
	}
	var index = 0; // unhide first letter
	setTimeout ( 'unhideText('+ index +', '+ lastShell +', '+ (lastShell-1) +', '+ delay +')', delay);
}
function unhideText (n, shelltoUnhide, shelltoHide, delay) { //unhide text with zero widths - alternate shells
	document.images[n].style.width = widths[n] + "px";
	if (n < lastShell-1) {
		document.images[shelltoHide].style.width = 0 + "px";
		document.images[shelltoUnhide].style.width = widths[shelltoUnhide] + "px";
		setTimeout ( 'unhideText('+ (n+1) +', '+  shelltoHide +', '+ shelltoUnhide +', '+ delay +')', 200);
		}
	else setTimeout ( 'hidetext(' + delay + ')', 5*delay);
}