$(function(){
// ==========================================================================
	$("#sb_next").click( function(){
		$("#sbc").hide("slide", { direction: "left", mode:"hide" }, 500);
		$.ajax({
			type: "POST",
			data: {
				action:"slideBox.next",
				pos:document.getElementById("slide-pos").value
			},
			dataType: "json",
	        url: "/service/ajax/",
			cache: false,
			success: function(data) {
				if (data["success"]=="Y") {
					$("#slide-text").html(data["text"]);
					document.getElementById("slide-pos").value=data["pos"];
					document.getElementById("slide-logo").src="/img/brands/"+data["logo"];
					document.getElementById("sbc").href="/brands/show/"+data["url"];
					$("#sbc").show("slide", { direction: "right", mode:"show" }, 500);
				}
			},
			error: function() {
				$("#sbc").show("slide", { direction: "right", mode:"show" }, 500);
			}
		});

	});
// ==========================================================================
	$("#sb_prev").click( function(){
		$("#sbc").hide("slide", { direction: "right", mode:"hide" }, 500);
		$.ajax({
			type: "POST",
			data: {
				action:"slideBox.prev",
				pos:document.getElementById("slide-pos").value
			},
			dataType: "json",
	        url: "/service/ajax/",
			cache: false,
			success: function(data) {
				if (data["success"]=="Y") {
					$("#slide-text").html(data["text"]);
					document.getElementById("slide-pos").value=data["pos"];
					document.getElementById("slide-logo").src="/img/brands/"+data["logo"];
					document.getElementById("sbc").href="/brands/show/"+data["url"];
					$("#sbc").show("slide", { direction: "left", mode:"show" }, 500);
				}
			},
			error: function() {
				$("#sbc").show("slide", { direction: "left", mode:"show" }, 500);
			}
		});

	});
	  // ==========================================================================
	  //$("#stat").ajaxStart(function(){
	  //$(this).html("Идет обмен данными...");
	  //});
	  //$("#stat").ajaxStop(function(){
	  //$(this).html("&nbsp;");
	  //});
});

