/********************************************************
Name: Caraselle
Author: Terence Jefferies
Business: Glow Creative
Version: 3.0
Comments: This product was created by Terence Jefferies
for carraselle image viewing
********************************************************/

	$(function() {
		var orig_pos2 = parseInt($('#spons_innerbox').css('left'));
		var width2 = parseInt($('#spons_box').width());
		var elem2 = $('#spons_innerbox > a').length;
		var img_width2 = 0;
		var img_mar2 = 25;
		//$('#spons_innerbox > a').each(function() { img_width = parseInt($(this).width()); img_mar = parseInt($(this).css('margin-right')); }); Did not work in IE
		img_width2 = parseInt($('#spons_inner_img').width());
		var distance2 = (img_width2 * elem2 - width2 + (img_mar2 * elem2));
		distance2 = ( distance2 < 0 ) ? 0 : (distance2);
		var time2 = ( img_width2 * width2 - 130000 );
		var dir2 = 0;
		var browser = navigator.appName;
		
		
		function init2() 
		{
			var distancetmp2 = 0;
			var move2 = (dir2 == 0) ? '-' : null;
			distancetmp2 = (dir2 == 0) ? (distance2) : orig_pos2;
			$('#spons_innerbox').animate({ left:move2 + distancetmp2 + "px" },time2,'linear',function() 
			{ 
				if(browser != "Microsoft Internet Explorer") { test(); }
			});
		}
		
		function test(){
		
			if(dir2 == 0) { dir2 = 1; } else { dir2 = 0; }
			init2(); 
		
		}
		
		init2();
			
	});
