// hotel.js - Used on the virtual hotel pages

// onload!
$(function() {

    // set tabs
    $("#tabs").tabs();
    
    // -- images
    $("a[rel='thumbnail']", "#thumbnails").colorbox({
        slideshow: true,
        slideshowSpeed: 4000,
        current: "{current} of {total}",
        width: "640",
        height: "480",
        opacity: 0.7,
        overlayClose: true,
        slideshowStart: "Start slideshow",
        slideshowStop: "Stop slideshow",
        previous: "Previous image",
        next: "Next image"
    });

    $(".media a").eq(0).click(function(e) {
        e.preventDefault();
        $("a[rel='thumbnail']", "#thumbnails").eq(0).trigger("click")
    });

    // -- virtual tours
    $("a[rel='vt']", "#threesixty").colorbox({
        iframe: true,
        width: 640,
        height: 480,
        opacity: 0.7,
        overlayClose: true,
        current: "{current} of {total}",
        previous: "Previous video",
        next: "Next video"
    });

    // -- view a video
    $("a[rel='video']", ".media").colorbox({
        iframe: true,
        width: 640,
        height: 480,
        opacity: 0.7,
        overlayClose: true,
        current: "{current} of {total}",
        previous: "Previous video",
        next: "Next video"
    });
    
    
    
    /*

    // -- map - clears links in info window
    $("#hotelMapInfoWindow_" + HOTEL_CODE + " a").each(function() {
        var that = $(this);
        var text = that.html();
        that.replaceWith(text);
    });

    $("#hotelMapInfoWindow_" + HOTEL_CODE + " p.link").remove();

    // -- trigger info window when location is clicked
    $('#tabs').bind('tabsselect', function(event, ui) { 
        if ( ui.tab.textContent === "Location" ) {
            GEvent.trigger(markers[0], "click");
        }
     })

  */
  
});
