function Class_ACTIVE()
{
	this.Step = 0
	this.delay = 15
	this.PageStep = 1
	this.Page = 1
	this.bTurned = false
	this.bMoving = false
	this.Interval = false
	this.accellerate = (document.all && document.getElementById ? 3 : 8)
	this.arrObjects = new Array()
	this.Move = 550
	this.v = 0
	this.vmax = 0
	this.a = 0
	this.x = 0
	this.t = 0 
	this.numObjects = 0
	var howmanyto = 4

	for(var i=0;i<120;i++)
	{
		this.t += this.accellerate
		this.x += this.t
		if ( this.x * 2 > this.Move && this.vmax == 0 )
		{
			this.vmax = this.t
			this.Factor = this.Move / (this.x*2)
		}
	}
	this.x = 0
	this.xLocation = 0

	this.Class_ACTIVEObject = function(number, Pic, SmallScreen, Name, Title, ImageName )
	{
		this.number = number
		this.Pic = Pic
		this.SmallScreen = SmallScreen
		this.Name = Name
		this.Title = Title
		this.ImageName = ImageName
		this.ImageLoaded = false
		this.onclick = this.Pic
		
		//alert(this.ImageName);
		this.bStatsRegistered = (number < howmanyto)
		
		this.LoadImage = function()
		{
			if ( this.ImageLoaded == false )
			{
				document.getElementById('Image' + this.number).src = this.ImageName_;
				this.ImageLoaded = true
			}
		}
		
		this.GetStatRegStr = function()
		{
			if ( this.bStatsRegistered == false )
			{
				this.bStatsRegistered = true
				return this.StatsString
			}
			else
			{
				return ''
			}
		}
		
		this.getHTML = function()
		{
			//alert( this.number);
			var sNameTemp = ( this.Name.length > 18 ? this.Name.substring(0,18) + '...' : this.Name )
			var s = ''
			sEnter = '\n'
			if ( navigator.userAgent.indexOf('Firefox') > -1 ) sEnter = ''
			s += '<span class="ACTIVE_Object" style="left:' + (this.number*138) + 'px;padding-top:10px;background: url(images/image_effect_130.gif) no-repeat;">'
			s += '<a href="' + this.onclick + '" class="ACTIVE" title="Grand Tools">'
			s += '		<img class="ACTIVEImage" id="Image' + this.number + '" border="0" align="absmiddle"'
			if ( this.number < 15 )
			{
				s += 'src="thumb.php?src='+this.ImageName+'&x=100&y=80&f=0&imf=product_images&tmf=product_images"'
				this.ImageLoaded = true
			}
			else
			{
				s += 'src="spacer.gif"'
			}
			s += '  alt="Screenshot ' + this.Name + '" title="'
			s += ' ' + sEnter + this.Name + ' &nbsp;" /><br>'
			
			
		//	s += '		<nobr><b>' + sNameTemp + '</b></nobr><br />'
			//s += '		&nbsp;' + this.Title + ''
			s += '	</a>'
			s += '</span>'
			return s
		}
		
		this.GetSmallScreen = function(sFormaat)
		{
			if ( sFormaat != '' ) sFormaat = '' + sFormaat
			s = this.SmallScreen
			if ( s.indexOf('http') == -1 ) s = '/' + s.replace('.gif', '') + sFormaat + '.gif'
			return s
		}
	}	
	
	this.AddObject = function(Pic, SmallScreen, Name, Title, ImageName )
	{
		var number = this.arrObjects.length
		this.arrObjects[number] = new this.Class_ACTIVEObject(number, Pic, SmallScreen, Name, Title, ImageName )
		}



	this.Start = function()
	{
		this.numObjects = this.arrObjects.length
		this.xMax = 0
		this.NumPages = Math.ceil(this.numObjects / howmanyto)
		this.xMin = - (this.NumPages-1) * (138 * howmanyto)
		var s = ''
		for ( var i=0; i<this.numObjects; i++ )
		{
			 s += this.arrObjects[i].getHTML(i)
		}
		document.getElementById('ACTIVESpan').innerHTML = s;
		this.SetButtons()
	}
	
	this.SetButtons = function()
	{
		if ( this.numObjects > howmanyto )
		{
			document.getElementById('ACTIVE_knop_rechts').style.display = ( this.Page < this.NumPages ? 'block' : 'none' )
			document.getElementById('ACTIVE_knop_links').style.display = ( this.Page > 1 ? 'block' : 'none' )
			var s = ''
			for ( var i=1; i<=this.NumPages; i++ ) s += '<a href="javascript:ACTIVE.GaNaarPage(' + i + ')"' + (this.Page == i ? ' class="sel"' : '') + '>&nbsp;' + i + '&nbsp;</a>'
			//document.getElementById('ACTIVE_pagenumber').innerHTML = s
		}
	}

	this.Mouseover = function(sDirection)
	{
		if ( document.getElementById('ACTIVE_img_' + sDirection) )
		{
			document.getElementById('ACTIVE_img_' + sDirection).src = '/' + sDirection + '_hover.gif'
		}
	}

	this.Mouseout = function(sDirection)
	{
		if ( document.getElementById('ACTIVE_img_' + sDirection) )
		{
			document.getElementById('ACTIVE_img_' + sDirection).src = '/' + sDirection + '.gif'
		}
	}
	
	this.MouseDown = function(_ax)
	{
		this.GaNaarPage(this.Page-_ax)
	}
	
	this.GaNaarPage = function(n)
	{
		if ( this.bMoving == false )
		{
			this.bMoving = true
			this.a = ( this.Page>n ? 1 : -1 ) * this.accellerate
			this.PageMove = ( this.Page>n ? this.Page - n : n - this.Page )
			this.Page = n
			if ( this.Page > this.NumPages ) this.Page = this.NumPages
			if ( this.Page < 1 ) this.Page = 1
			sStats = ''
			for ( var i=0; i<howmanyto; i++ )
			{
				xTemp2 = (this.Page * howmanyto ) + i - howmanyto
				if ( xTemp2 < this.numObjects )
				{
					this.arrObjects[xTemp2].LoadImage()
					s = this.arrObjects[xTemp2].GetStatRegStr()
					sStats += s + ( s == '' ? '' : ',' )
				}
			}
			
			if ( !this.Interval ) this.Interval = setInterval('ACTIVE.Move()',15)
		}
	}
	
	this.Move = function()
	{
		this.x += this.v * this.Factor * this.PageMove
		
		this.xLocation = Math.round(this.x)
		if ( this.x > this.xMax ) this.x = this.xMax
		if ( this.x < this.xMin ) this.x = this.xMin
		if ( this.bTurned == false && ( this.v >= this.vmax || this.v <= -this.vmax ))
		{
			this.a = -this.a
			this.bTurned = true
		}
		else
		{
			this.v += this.a
		}
		if ( this.v == 0 )
		{
			this.bTurned = false
			this.a = 0
			clearInterval(this.Interval)
			this.bMoving = false
			this.Interval = false
			this.SetButtons()
			this.PageStep = 1
		}
		document.getElementById('ACTIVESpan').style.left = this.xLocation + 'px'
	}


}


