(function($) {
	var total_width = 0;
	$(function() {
		$("#slide-content").coinslider({ width: 740, delay: 7000, height: 350 });
		var offset = 0;
		$("#cs-buttons-slide-content a").each(function() {
			$(this).html($("#slide-content #slide-" + offset).find("p:first").html());
			$(this).find("img:first").attr("style", "display: block; width: 100%; height: 100%;");
			total_width += $(this).outerWidth(true);
			offset++;
		});
		$("#cs-buttons-slide-content").width(total_width);

		var content = $("#cs-buttons-slide-content");
		var wrapper = $("#coin-slider-slide-content");
		content.mousemove(function(e) {
			var wrapper_width = wrapper.width();
			var content_width = content.width();

			var tmp  = e.pageX * (content.outerWidth() - wrapper.outerWidth()) / wrapper.outerWidth();
				tmp -= 40;
			content.css({ 'margin-left': '-'+tmp+'px' });
		});
	});
})(jQuery);

