/*
 * Script to animate the swirlled DEBUGGED logo on the home page.
 *
 * Written by Stephen Battey    July 1997
 * (taken from debugged page)
 * See  http://www.lucidviews.net/software/debugged
 *
 * Script may be copied and modified, but the original author notice must remain
 * and the modification & author noted below.
 */


var SwirlNo=1;
var SwirlOff=true;
var SwirlDir=1;

function LogoSwirl() {
//			Procedure to animate the main logo

	SwirlNo += SwirlDir;

	if ( SwirlNo>6 )
		SwirlNo=1;
	if ( SwirlNo<1 )
		SwirlNo=6;

	SwirlOff=true;
	document.logo.src="BugLogo"+SwirlNo.toString()+".gif";
}

function NextSwirl() {

	if ( SwirlOff ) {
		SwirlTimer=window.setTimeout('LogoSwirl()',100);
		SwirlOff=false;
	}
}

function reverse_swirl() {
//			Procedure to reverse the swirl of the logo

	SwirlDir *= -1;
}

function InitSwirl()
// 	Procedure to check for the logo image and then initialise the swirl process.
{
	if (document.logo)
	{
		document.logo.onload = NextSwirl;
		NextSwirl();
	}
	else
	{
		// wait for the page to load and the logo image to become available
		window.setTimeout( "InitSwirl();", 300 );
	}
}

InitSwirl();