// JavaScript Document

function fadeIn(tag, choice)
{
	var image = window.document.getElementById(tag);
	var nextimage = window.document.getElementById('nextimg');
	image.src = nextimage.value;
	nextimage.value = choice;
	setTimeout("Effect.Appear(tag)", 1000); //make the new image appear
	preload_image = new Image(); //preload the next image
	preload_image.src=choice;
}

function fadeOut()
{
	tag = 'test_img';
	var image = document.getElementById(tag);
	var ary = new Array('hpanim/15yrs.gif','hpanim/250ass.gif','hpanim/20startups.gif','hpanim/6client.gif','hpanim/1mclient.gif','hpanim/2mclient.gif','hpanim/200jobs.gif','hpanim/2000train.gif');
	
	var choicestr = window.document.getElementById("next_index").value;
	var choice = parseInt(choicestr) + 1;
	
	if(choice > ary.length - 1 || choice < 0)
	{
		choice = 0;
	}
	
	//alert(choicestr + " " + choice + " " + ary[choice]);
	
	window.document.getElementById("next_index").value = String(choice);
	
	Effect.Fade(tag);
	execstr = "fadeIn('"+tag+"', '"+ary[choice]+"')";
	setTimeout(execstr, 1000);

	return false;
}