

var speed = 100;
var pic, numImgs, arrLeft, i, totalWidth, n, myInterval; 

jQuery(window).load(function(){

	// cloning pics
	jQuery('.partner_logo').clone().prependTo("#partner");
	jQuery('.partner_logo').clone().prependTo("#partner");
	
	pic = jQuery("#partner > a").children("img");
		
	numImgs = pic.length;
	arrLeft = new Array(numImgs);
	
	for (i=0;i<numImgs;i++){
		
		totalWidth=0;
		for(n=0;n<i;n++){
			totalWidth += jQuery(pic[n]).width();
			
		}
		
		arrLeft[i] = totalWidth;
		jQuery(pic[i]).css("left",totalWidth);
	}
	
	myInterval = setInterval("flexiScroll()",speed);
	
	jQuery(pic).show();	
});

function flexiScroll(){

	for (i=0;i<numImgs;i++){
		arrLeft[i] -= 3;		

		if (arrLeft[i] == -(jQuery(pic[i]).width())){	
			arrLeft[i] =  totalWidth;	
		}					
		jQuery(pic[i]).css("left",arrLeft[i]);
	}
}
