
/******************************
 *   Diashow
 * 
 * This script is used to create
 * a diashow.
 * 
 * @file   diashow.js
 * @author Florian Haßmann <hassmann@flottix.com>
 * @crdate 02.11.2006
 * @id     9A5F5D2A7114568F94B1CD0A26DE53F3
 ******************************/

//______________________________________________________________________________
//STD LIB
function $(id){return document.getElementById(id);}
var g_aoContainer	=	new Array();
function $add(obj){var id=g_aoContainer.length;g_aoContainer[id]=obj; return id;}
function $get(id){return g_aoContainer[id];}
//______________________________________________________________________________
//class Diashow
function diashow()
{
	this.m_aImages		=	[];				//Array containing the images
	this.m_sID			=	"";				//The ID of the diashow image(CSS-ID)
	this.m_iActImage	=	0;				//The actual image
	this.m_iOID			=	$add(this);		//The object ID
	this.m_iInterval	=	-1;				//The interval ID
}
//______________________________________________________________________________
diashow.prototype.next	=	function()
{
	this.m_iActImage	=	(this.m_iActImage+1)%this.m_aImages.length;		//Next Image
	$(this.m_sID).src	=	this.m_aImages[this.m_iActImage];				//Set Image Source
	return true;
}
//______________________________________________________________________________
diashow.prototype.clearInt	=	function(interval)
{
	if(this.m_iInterval==-1)
		return;
	clearInterval(this.m_iInterval);
	this.m_iInterval	=	-1;
}
//______________________________________________________________________________
diashow.prototype.setInt	=	function(interval)
{
	this.m_iInterval	=	setInterval("$get("+this.m_iOID+").next();",interval);
}
//______________________________________________________________________________

