/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */

function promociones_initCallback(carousel) {   
    $('#promociones-controlup').bind('click', function() {
        carousel.prev();
        return false;
    });

    $('#promociones-controldown').bind('click', function() {
        carousel.next();
        return false;
    });
};
function destacados_initCallback(carousel) {
    $('#destacados-controlnumerico a').bind('click', function() {        
        carousel.scroll(jQuery.jcarousel.intval($(this).text()));
        return false;
    });

    $('#destacados-next').bind('click', function() {
        carousel.next();
        return false;
    });

    $('#destacados-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

	$(document).ready(function() {	
		$("#novedades-vermas").bind('click', function() { 
			$("#novedades-desplegable").show('slow');
			$("#novedades").height("400px");
			$("#novedades-vermas").hide();
			return false;
		});
      

		
	    $("#carrusel-destacados").jcarousel({
			scroll:1,
			wrap:'circular',
			initCallback: destacados_initCallback,
			// This tells jCarousel NOT to autobuild prev/next buttons
			buttonNextHTML: null,
			buttonPrevHTML: null
		});
		
		
		$('#boton-login').bind('click', function() {
			$('#cuadrologin').show('slow');
			return false;
		});
		
	});
	
function getURLParameter(name) {
    return unescape(
        (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
    );
}


