function init_scroller(){
	if(document.getElementById("slider")){
		var slider = document.getElementById("slider");
		var imgArrayBrands = slider.getElementsByTagName("img");
		var i = 0;
		var width = 0;
		var margin = 9;
		var totalWidth = 0;
		
		for(i=0; i<imgArrayBrands.length;i++){
			width = parseInt(slider.getElementsByTagName("img")[i].getAttribute("width"));
			width = parseInt(margin)+parseInt(width);
			totalWidth = parseInt(totalWidth + width);
		}

		
		this.moved = 0;
		this.divLeft = 18;
		this.maxDivLeft = totalWidth-50;
		move('right',80);
	}
}

function move(direction,speed){
	clearTimeout(this.Brandtimer);
	if(direction=="left" && this.moved > 0){
		this.divLeft++;
		document.getElementById("slider").style.left = this.divLeft+"px";
		this.moved--;
		this.Brandtimer = setTimeout("move('left',"+speed+")",speed);
	}	
	else if(direction=="right" && this.moved < this.maxDivLeft){
		this.divLeft--;
		document.getElementById("slider").style.left = this.divLeft+"px";
		this.moved++;
		this.Brandtimer = setTimeout("move('right',"+speed+")",speed);
	}
	else if(speed==80){
		stopSlider();
	}
}

function stopSlider(){
	clearTimeout(this.Brandtimer);
	if(this.moved < this.maxDivLeft)
	{
		move('right',80);
	}
	else
	{
		move('left',80);
	}
}

