
    var arrExperiences = new Array();
    $(document).ready(function() {

        // this is the function that creates the slideout options using the content defined in data.js
        loadSlideoutOptions();

        // this function shows in the slideout the selected options
        loadSelectedOptions();

        $(".scrollable").scrollable({ circular: true, next: '.next', prev: '.prev', keyboard: true, size: 1, speed: 700 }); //.autoscroll({ autoplay: true, interval: 1000 });

        $("#experiences").click(function() {
            if ($("#slideout").css('display') == 'none')
                showChooseExperience();
            else
                hideChooseExperience();
        });

        $("#slideout li a").click(function() {
            var selId = $(this).attr('id');
            var position = $.inArray(selId, arrExperiences);
            if (position != -1) { // the selection is in the array
                removeSelection(selId, position);
            } else {
                addSelection(selId);
            }

            setSubmitButtonStatus();

            setCookie('selectedExperiences',arrExperiences, 365);
            return false;
        });

        $("#submit-button").click(function() {
            selection = getCookie('selectedExperiences');
            if ($(this).hasClass('active') && (selection != "")) {
                window.location.href = 'custom.html?p=' + selection;
            }
        });

    });
    
