<!--

	/*
	 *
	 *           _________________
	 *          /                /\     klof  |  innovative web technologies
	 *         /  /\/|          /  \
	 *        /   \  |         /   /    most rights reserved 2002-2003, klof
	 *       /    /__|        /   /     certainly not free for commercial use
	 *      /        /\/|    /   /
	 *     /         \  |   /   /         script       :  image_rotator.js
	 *    /          /__|  /   /          date         :  August 19th - September 9th 2003
	 *   /                /   /           author       :  Rogier Spieker
	 *  /________________/   /            purpose      :  Rotate images at a certain interval
	 *  \                \  /             dependencies :  /
	 *   \________________\/              history      :  /
	 *
	 */

	function imageRoller( sImageName, nInterval )
	{
		this._buffer = new Array();
		this._image  = sImageName;
		this._index  = 0;
		this._timer  = null;
		this._interval = ( nInterval != null && nInterval != "" ) ? nInterval : 2;

		this.start = function()
		{
			this._timer = setTimeout( this._self + ".rotate();", this._interval * 1000 );
		}
		this.stop = function()
		{
			clearTimeout( this._timer );
			this._timer = null;
		}
		this.preload = function( sSource )
		{
			var nIndex                 = this._buffer.length;
			this._buffer[ nIndex ]     = new Image();
			this._buffer[ nIndex ].src = sSource;
		}
		this.rotate = function()
		{
			if ( this._index >= this._buffer.length )
				this._index = 0;
			document[ sImageName ].src = this._buffer[ this._index ].src;
			++this._index;
			this._timer = setTimeout( this._self + ".rotate();", this._interval * 1000 );
		}
		this._self = sImageName + "object";
		eval( this._self + "=this" );
		return this;
	}

	/**
	 *  initialisation
	 */
	function roll_init()
	{
		// object = new imageRoller( string imagename, number interval );
		oRotator1 = new imageRoller( "rotator1", 3 );
		oRotator1.preload( "../images/sm_topbar_image01.jpg" );
		oRotator1.preload( "../images/sm_topbar_image02.jpg" );
		oRotator1.preload( "../images/sm_topbar_image03.jpg" );
		oRotator1.preload( "../images/sm_topbar_image04.jpg" );
		oRotator1.preload( "../images/sm_topbar_image05.jpg" );
		oRotator1.preload( "../images/sm_topbar_image06.jpg" );
		oRotator1.start();
	}

	window.onload = roll_init;

// -->
