function slides() {window.location.reload();}

function fade(id) {
	id = 'pic'+id;
	document.getElementById(id).className='show';
	changeOpac(0, id);
	shiftOpacity(id, 2000);	
	}

//below gratefully borrowed from http://www.brainerror.net/scripts_js_blendtrans.php
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 shiftOpacity(id, millisec) {
	//if an element is invisible, make it visible, else make it ivisible
	if(document.getElementById(id).style.opacity == 0) {
		opacity(id, 0, 100, millisec);
	} else {
		opacity(id, 100, 0, millisec);
	}
}

function currentOpac(id, opacEnd, millisec) {
	//standard opacity is 100
	var currentOpac = 100;
	
	//if the element has an opacity set, get it
	if(document.getElementById(id).style.opacity < 100) {
		currentOpac = document.getElementById(id).style.opacity * 100;
	}

	//call for the function that changes the opacity
	opacity(id, currentOpac, opacEnd, millisec)
}


var timeinc = 8000;
        var t2=setTimeout("fade('2'); document.getElementById('pic1').className='hide';", 1*timeinc);
        var t3=setTimeout("fade('3'); document.getElementById('pic2').className='hide';", 2*timeinc);
        var t4=setTimeout("fade('4'); document.getElementById('pic3').className='hide';", 3*timeinc);
        var t5=setTimeout("fade('5'); document.getElementById('pic4').className='hide';", 4*timeinc);
        var t6=setTimeout("fade('6'); document.getElementById('pic5').className='hide';", 5*timeinc);
        var t7=setTimeout("fade('7'); document.getElementById('pic6').className='hide';", 6*timeinc);
        var t8=setTimeout("fade('8'); document.getElementById('pic7').className='hide';", 7*timeinc);
        var t9=setTimeout("fade('9'); document.getElementById('pic8').className='hide';", 8*timeinc);		
        var t10=setTimeout("fade('10'); document.getElementById('pic9').className='hide';", 9*timeinc);
		var t11=setTimeout("fade('11'); document.getElementById('pic10').className='hide';", 10*timeinc);
		var t12=setTimeout("fade('12'); document.getElementById('pic11').className='hide';", 11*timeinc);
        var t13=setTimeout("fade('13'); document.getElementById('pic12').className='hide';", 12*timeinc);
        var t14=setTimeout("fade('14'); document.getElementById('pic13').className='hide';", 13*timeinc);
        var t15=setTimeout("fade('15'); document.getElementById('pic14').className='hide';", 14*timeinc);
        var t16=setTimeout("fade('16'); document.getElementById('pic15').className='hide';", 15*timeinc);
        var t17=setTimeout("fade('17'); document.getElementById('pic16').className='hide';", 16*timeinc);
        var t18=setTimeout("fade('18'); document.getElementById('pic17').className='hide';", 17*timeinc);
        var t19=setTimeout("fade('19'); document.getElementById('pic18').className='hide';", 18*timeinc);		
        var t20=setTimeout("fade('20'); document.getElementById('pic19').className='hide';", 19*timeinc);
		var t21=setTimeout("fade('21'); document.getElementById('pic20').className='hide';", 20*timeinc);		
        var t22=setTimeout("fade('22'); document.getElementById('pic21').className='hide';", 21*timeinc);
		var t23=setTimeout("fade('23'); document.getElementById('pic22').className='hide';", 22*timeinc);
		var t24=setTimeout("fade('24'); document.getElementById('pic23').className='hide';", 23*timeinc);		
        var t25=setTimeout("fade('25'); document.getElementById('pic24').className='hide';", 24*timeinc);
		var t26=setTimeout("fade('26'); document.getElementById('pic25').className='hide';", 25*timeinc);
		
		var t27=setTimeout("fade('27'); document.getElementById('pic26').className='hide';", 26*timeinc);
		var t28=setTimeout("fade('28'); document.getElementById('pic27').className='hide';", 27*timeinc);
		var t29=setTimeout("fade('29'); document.getElementById('pic28').className='hide';", 28*timeinc);
		var t30=setTimeout("fade('30'); document.getElementById('pic29').className='hide';", 29*timeinc);
		var t31=setTimeout("fade('31'); document.getElementById('pic30').className='hide';", 30*timeinc);
		var t32=setTimeout("fade('32'); document.getElementById('pic31').className='hide';", 31*timeinc);
		var t33=setTimeout("fade('33'); document.getElementById('pic32').className='hide';", 32*timeinc);
		var t34=setTimeout("fade('34'); document.getElementById('pic33').className='hide';", 33*timeinc);
		var t35=setTimeout("fade('35'); document.getElementById('pic34').className='hide';", 34*timeinc);
		var t36=setTimeout("fade('36'); document.getElementById('pic35').className='hide';", 35*timeinc);
		var t37=setTimeout("fade('37'); document.getElementById('pic36').className='hide';", 36*timeinc);
		var t38=setTimeout("fade('38'); document.getElementById('pic37').className='hide';", 37*timeinc);
		var t39=setTimeout("fade('39'); document.getElementById('pic38').className='hide';", 38*timeinc);
		var t40=setTimeout("fade('40'); document.getElementById('pic39').className='hide';", 39*timeinc);
		var t41=setTimeout("fade('41'); document.getElementById('pic40').className='hide';", 40*timeinc);
		

function pause(num){
var pic = 'pic'+num;
clearTimeout(t2); clearTimeout(t3); clearTimeout(t4); clearTimeout(t5); clearTimeout(t6); clearTimeout(t7); clearTimeout(t8); clearTimeout(t9); clearTimeout(t10); clearTimeout(t11); clearTimeout(t12); clearTimeout(t13); clearTimeout(t14); clearTimeout(t15); clearTimeout(t16); clearTimeout(t17); clearTimeout(t18); clearTimeout(t19); clearTimeout(t20); clearTimeout(t21); clearTimeout(t22); clearTimeout(t23); clearTimeout(t24); clearTimeout(t25); clearTimeout(t26); clearTimeout(t27); clearTimeout(t28); clearTimeout(t29); clearTimeout(t30); clearTimeout(t31); clearTimeout(t32); clearTimeout(t33); clearTimeout(t34); clearTimeout(t35); clearTimeout(t36); clearTimeout(t37); clearTimeout(t38); clearTimeout(t39); clearTimeout(t40); clearTimeout(t41);
document.getElementById('pic1').className='hide';
document.getElementById('pic2').className='hide';
document.getElementById('pic3').className='hide';
document.getElementById('pic4').className='hide';
document.getElementById('pic5').className='hide';
document.getElementById('pic6').className='hide';
document.getElementById('pic7').className='hide';
document.getElementById('pic8').className='hide';
document.getElementById('pic9').className='hide';
document.getElementById('pic10').className='hide';
document.getElementById('pic11').className='hide';
document.getElementById('pic12').className='hide';
document.getElementById('pic13').className='hide';
document.getElementById('pic14').className='hide';
document.getElementById('pic15').className='hide';
document.getElementById('pic16').className='hide';
document.getElementById('pic17').className='hide';
document.getElementById('pic18').className='hide';
document.getElementById('pic19').className='hide';
document.getElementById('pic20').className='hide';
document.getElementById('pic21').className='hide';
document.getElementById('pic22').className='hide';
document.getElementById('pic23').className='hide';
document.getElementById('pic24').className='hide';
document.getElementById('pic25').className='hide';
document.getElementById('pic26').className='hide';

document.getElementById('pic27').className='hide';
document.getElementById('pic28').className='hide';
document.getElementById('pic29').className='hide';
document.getElementById('pic30').className='hide';
document.getElementById('pic31').className='hide';
document.getElementById('pic32').className='hide';
document.getElementById('pic33').className='hide';
document.getElementById('pic34').className='hide';
document.getElementById('pic35').className='hide';
document.getElementById('pic36').className='hide';
document.getElementById('pic37').className='hide';
document.getElementById('pic38').className='hide';
document.getElementById('pic39').className='hide';
document.getElementById('pic40').className='hide';
document.getElementById('pic41').className='hide';

document.getElementById(pic).className='show';
}