function loading(container){
    document.getElementById(container).innerHTML  = '<div id=search_indicator_div style="position:absolute; left: 35%;"><img src ="/images/ajax-loader.gif" /></div>'
}

function loading_keyword_cuisine(container){
    document.getElementById(container).innerHTML  = '<div id=search_indicator_div style="position: absolute; margin: 50px 20px 20px 115px;"><img src ="/images/ajax-loader.gif" /></div>'
}

function mycarousel_initCallback(carousel) {
    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};
function search_carousel_initCallback(carousel) {
    jQuery('#srchcar-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#srchcar-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};
function search_carousel2_initCallback(carousel) {
    jQuery('#srchcar2-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#srchcar2-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

function mycarousel3_initCallback(carousel) {
    jQuery('#ug-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#ug-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};


jQuery(document).ready(function() {
    jQuery("#revamp-calendar-dates").jcarousel({
        scroll: 5,
        wrap: 'last',
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
    jQuery("#search-carousel").jcarousel({
        wrap: 'both',
        initCallback: search_carousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
    jQuery("#search-carousel2").jcarousel({
        wrap: 'both',
        initCallback: search_carousel2_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });

    jQuery("#photo-main").jcarousel({
        scroll: 1,
        wrap: 'last',
        initCallback: mycarousel3_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});

function toggle(obj) {
    var el = document.getElementById(obj);
    el.style.display = (el.style.display != 'none' ? 'none' : '' );
}
function show(obj) {
    var el = document.getElementById(obj);
    el.style.display = '';
    el.style.margin = 0;
    document.getElementById('btn-'+obj).className = obj+' on'
}
function hide(obj) {
    var el = document.getElementById(obj);
    el.style.display = 'none'
    document.getElementById('btn-'+obj).className = obj+ ' off'
}

var i =1
function toggle_h(obj) {
    var el = document.getElementById(obj+i);
    el.className = 'selected'
    i++;
    if (i > 5){
        i =1
        }
}

function toggle_j(obj) {
    j = i-2
    if (i == 1) {
        j = 4
        }
    else if (i == 2){
        j = 5
        }
    var el = document.getElementById(obj+j);
    el.className = ''
}
$(function() {
    $('#s5').cycle({
        fx:     'scrollLeft',
        speed:   1500,
        timeout: 4000,
        before:  onBefore
    //pager: '#revamp-carousel-info'
    //after:   onAfter
    });
});

function onBefore() {
    toggle_h('ftr')
    toggle_j('ftr')
//setTimeout('toggle_j(\'ftr\')', 0);
//$('#output').html("Scrolling image:<br>" + this.src);
//window.console.log(  $(this).parent().children().index(this) );
}
function onAfter() {

}
