var $j = jQuery.noConflict();

$j(function() {
	
	// some vars
	var marg_to_move = 120;
	var divee = $j('div.divee');
	var pauza = false;
	
	// adjust margin and elements on the start
	divee.css('left', -marg_to_move);
	$j('div.divee div:first').before($j('div.divee div:last'));
	
	// interval
	function turn_on_ivl () { ivl = setTimeout(slidethem_l, 1); }
	
	
	
	function slidethem_l() {
		slidethem("left");
		animated = true;
	}
	
	function slidethem(where_to) {
		if (!pauza) {
			var marg_to_animate = -(marg_to_move*2);
			divee.animate({'left': marg_to_animate}, 2500, 'linear', function () {
				// callback
				
					$j('div.divee div:last').after($j('div.divee div:first'));
					divee.css('left', -(marg_to_move));
				
				slidethem_l();
			});
		}
	}
	    
    //$j('div.img_wrapper').mouseenter(function () { pauza = true; });
    //$j('div.img_wrapper').mouseleave(function () { pauza = false; turn_on_ivl(); });
    
    // start animating
    turn_on_ivl();

});

