var progress = new Array();
function getFilenames()
{
	var count = 28;
	var path  = "content/intro/";
	
	for( i=0; i < count; i++ )
		progress[i] = (path + (( i < 10 ) ? "0" : "") + (i+1) + ".jpg");	
}

var x;
function preload()
{
	getFilenames();
	p = new Array();
	x = 0;

	for( i = 0; i < progress.length; i ++ )
	{
		p[i]			= new Image();
		p[i].onabort 	= update;
		p[i].onerror 	= update;
		p[i].onload  	= update;
		p[i].src		= progress[i];
	}
}

function update()
{
	x ++;
	pro = Math.floor((x / progress.length) * 100);
	( document.all ) ? dom = document.all["progress"] : dom = document.getElementById("progress");
	dom.innerHTML = pro + " % loaded";

	if( pro == 100 ) 
		location.href = "slide.php";
}

function startSlideshow()
{
	var obj = 
	{
		wait: 20,
		effect: 'fade',
		duration: 20,
		loop: true,
		thumbnails: true,
		backgroundSlider: false,
		onClick: function()
		{
			window.location = "./gallery.php";
		}
	}
	
	show = new SlideShow('slideshowContainer', 'slideshowThumbnail', obj);
	show.play();
}

