if (typeof(IABP) == 'undefined') {
	IABP		= {};
	IABP.UI	= {};
}


IABP.UI.FeatureSlides	= function()
{
	var duration	= 4000;
	var startduration	= 3000;
	var timer;
	var items=[];	
	var image1 = [];

/////////////////////////////////  Initialise ///////////////////////////////////////////////////////////////////////////////////////////////////	
	var init	= function() 
		{
		image1[0] = document.getElementById('image1a'); 
		image1[1] = document.getElementById('image1b'); 
		image1[2] = document.getElementById('image1c'); 

		var i1, l1;
		for(i1=0, l1=image1.length; i1<l1; i1++)
			{
			var item	= {
					visible: false,
					index: i1
			            };
			items.push(item);
			}
		items[0].visible	= true;

		timer	= setTimeout(IABP.UI.FeatureSlides.roll, startduration);
		}
	
////////////////////////////////  Show Slides  ////////////////////////////////////////////////////////////////////////////////////////////////	
	var roll	= function() 
	{
	var i, l;
	for (i=0, l=image1.length; i<l; i++) 
	{
		if (items[i].visible)
		{
			if (typeof(items[i+1]) == 'undefined')
					{var nextitem	= items[0];
					var nextimg		= image1[0];
					}else{var nextitem	= items[i+1];
					var nextimg		= image1[i+1];
					}
		var outgoing1	= new YAHOO.util.Anim(image1[i], {opacity: {to: 0}}, 1);
		var incoming1	= new YAHOO.util.Anim(nextimg, {opacity: {to: 1}}, 1);
		outgoing1.animate();
		incoming1.animate();
		items[i].visible	= false;
		nextitem.visible	= true;
		timer	= setTimeout(IABP.UI.FeatureSlides.roll, duration);
		break;
		}
	}
// end of roll
	}
	
return {
		init: init,
		roll: roll
	}
}();


