function homeVehicleSlider(options)
{
	//Optional options object 	
	this.Options = {
		'slideInterval': 10,
		'innerWrapperName': 'innerModelBlock',
		'outerWrapperName': 'homeVehicleBlock',
		'pageWidth' : 980
	};
	
	//assign Options with custom or default values 
	if (options != null)
	{
		for (var index in this.Options)
		{
			this.Options[index] = (typeof options[index] != "undefined") ? options[index] : this.Options[index];
		}
	}
	
	//initial global vars
	var arrowLeft;	
	var arrowRight;	
	var modelBlock;
	var currentWidth;
	var isMoving = false;
	var newLeftOffset;
	var direction;
	var minY;
	var maxY;
	var slideTimeout;
	
	//constant for global 'this'
	var uberThis = this;
	
	this.init = function()
	{
		//create event handlers and init settings
		arrowLeft = $('arrowLeft');	
		arrowRight = $('arrowRight');	
		modelBlock = $('innerModelBlock');
		currentWidth = modelBlock.getWidth(); 
	
		//set minimum and maximum y values
		//minY = 980 - currentWidth;
		//maxY = 980;
		minY = this.Options.pageWidth - currentWidth;
		maxY = this.Options.pageWidth;
		
		
		//add mousedown event listeners for arrow buttons
		arrowLeft.observe("mousedown", function(){
			isMoving = true;
			direction = "left";
			uberThis.slideCars();
		});
		arrowRight.observe("mousedown", function(){
			isMoving = true;
			direction = "right";
			uberThis.slideCars();
		});
		
		//add mouseup event listeners for arrow buttons
		arrowLeft.observe("mouseup", this.stopSlide);
		arrowRight.observe("mouseup", this.stopSlide);
		
		//hide the right arrow by default
		arrowRight.hide();
		
		//if currentWidth is less than page width remove both arrows
		if(currentWidth <= this.Options.pageWidth)
		{
			arrowLeft.hide();	
		}
	}
	
	//slides the cars to the right or left
	this.slideCars = function()
	{
		var newOffset;
		
		//if not maxed out in either direction and the mousedown event is still occurring
		if(isMoving && direction == "left" && modelBlock.offsetLeft > minY)
		{
			newOffset = modelBlock.offsetLeft - uberThis.Options.slideInterval;	
		}
		
		//if not maxed out in either direction and the mousedown event is still occurring
		if(isMoving && direction == "right" && modelBlock.offsetLeft < 0)
		{
			newOffset = modelBlock.offsetLeft + uberThis.Options.slideInterval;
		}
		
		//move the modelBlock
		modelBlock.setStyle({left:newOffset + 'px'});
		
		//continue moving the modelBlock
		uberThis.resetslide();
		
		//hide the arrows if the slide has reached its min or max position
		uberThis.testPosition();
	}
	
	//set a timeout to move the modelBlock again
	this.resetslide = function()
	{
		slideTimeout = setTimeout(uberThis.slideCars, 10);
	}
	
	//stop the modelBlock from moving
	this.stopSlide = function()
	{
		isMoving = false;
		clearTimeout(slideTimeout);
	}
	
	//if the slide has reached its min or max position hide the corresponding arrow
	this.testPosition = function()
	{
		if(modelBlock.offsetLeft <= minY - 1){
			arrowLeft.hide();
		}
		else if(modelBlock.offsetLeft >= 0)
		{
			arrowRight.hide();
		}
		else
		{
			arrowLeft.show();
			arrowRight.show();
		}
	}	
}
	






