﻿$(document).ready(function () {

    //Santa Marina Plaza Global
    $("a#hlSantaMarinaPlaza").hover(
        function () {
            $("#hmpSantaMarinaPlaza").stop(false, true).fadeIn(300);
        }, function () {
            $("#hmpSantaMarinaPlaza").stop(false, true).fadeOut(600);
        }
    );
    //Cavo Spada  Global
    $("#hlCavoSpada").hover(
        function () {
            $("#hmpCavoSpada").stop(false, true).fadeIn(300);
        }, function () {
            $("#hmpCavoSpada").stop(false, true).fadeOut(600);
        }
    );
    //Grand Bay  Global
    $("#hlGrandBay").hover(
        function () {
            $("#hmpGrandBay").stop(false, true).fadeIn(300);
        }, function () {
            $("#hmpGrandBay").stop(false, true).fadeOut(600);
        }
    );
    //Santa Marina  Global
    $("#hlSantaMarina").hover(
        function () {
            $("#hmpSantaMarina").stop(false, true).fadeIn(300);
        }, function () {
            $("#hmpSantaMarina").stop(false, true).fadeOut(600);
        }
    );
    //Almyra  Global
    $("#hlAlmyra").hover(
        function () {
            $("#hmpAlmyra").stop(false, true).fadeIn(300);
        }, function () {
            $("#hmpAlmyra").stop(false, true).fadeOut(600);
        }
    );

    //hlBookNowGlobal  Global
    $("#hlBookNowGlobal").hover(
        function ()
        {
            $("#imgBookNowGlobal").stop(false, true).fadeIn(300);
        }, function ()
        {
            $("#imgBookNowGlobal").stop(false, true).fadeOut(600);
        }
    );

    //Grand Bay Hover
    $('a[id$="rptHotelLinkItem_hlHotelItem_0"]').hover(
        function () {
            $('img[id$="rptHotelLinkItem_imgHotelItem_0"]').stop(false, true).fadeIn(300);
        }, function () {
            $('img[id$="rptHotelLinkItem_imgHotelItem_0"]').stop(false, true).fadeOut(600);
        }
    );
    //Santa Marina Plaza Hover
    $('a[id$="rptHotelLinkItem_hlHotelItem_1"]').hover(
        function () {
            $('img[id$="rptHotelLinkItem_imgHotelItem_1"]').stop(false, true).fadeIn(300);
        }, function () {
            $('img[id$="rptHotelLinkItem_imgHotelItem_1"]').stop(false, true).fadeOut(600);
        }
    );
    // Santa Marina Hover
    $('a[id$="rptHotelLinkItem_hlHotelItem_2"]').hover(
        function () {
            $('img[id$="rptHotelLinkItem_imgHotelItem_2"]').stop(false, true).fadeIn(300);
        }, function () {
            $('img[id$="rptHotelLinkItem_imgHotelItem_2"]').stop(false, true).fadeOut(600);
        }
    );
    //Cavo Spada Hover
    $('a[id$="rptHotelLinkItem_hlHotelItem_3"]').hover(
        function () {
            $('img[id$="rptHotelLinkItem_imgHotelItem_3"]').stop(false, true).fadeIn(300);
        }, function () {
            $('img[id$="rptHotelLinkItem_imgHotelItem_3"]').stop(false, true).fadeOut(600);
        }
    );

    //RoomsControl H2 Hover
    $("div.roomItem > h2 > a.thumb").hover(
        function () {
            $(this).closest("div.roomItem").find("div.roomMagnifier").css({ 'background': 'url(../Images/magnifier.png) no-repeat left top' });
        },
        function () {
            $(this).closest("div.roomItem").find("div.roomMagnifier").removeAttr("style");
        }
    );
    //RoomsControl Magnifier Hover
    $("div.roomItem > a.thumb").hover(
        function () {
            $(this).parent().find("h2 > a.thumb").css({ 'color': '#225391' });
        },
        function () {
            $(this).parent().find("h2 > a.thumb").removeAttr("style");
        }
    );

    //Almyra Hover
    $("#hlAlmyra").hover(
        function () {
            $("#imgAlmyra").stop(false, true).fadeIn(300);
        }, function () {
            $("#imgAlmyra").stop(false, true).fadeOut(600);
        }
    );

    //Offer Scrolling
    try {
        $('#rightOffers').cycle({
            fx: 'fade',
            speed: 1000,
            timeout: 4000
        });
    } catch (e) { }

    //Google Map Links
    try {
        $("a.googlemaplink").fancybox({
            'frameWidth': 700, 'frameHeight': 500,
            'hideOnContentClick': false,
            'scrolling': 'no',
            'callbackOnClose': function () {
                $("#fancy_content").empty();
            }
        });
    } catch (e) { }

    //Room Photos
    try {
        $("a.thumb").fancybox(
        {
//            'showNavArrows': true,
//            'transitionIn': 'elastic',
//            'transitionOut': 'elastic',
//            'hideOnContentClick': true,
//            'scrolling': 'no'
        
                closeBtn: true,
                modal: false,
                padding: 0,
                openEffect: 'fade',
                openSpeed: 'slow',
                closeEffect: 'fade',
                closeSpeed: 'fast',
                fitToView: false,
                wrapCSS: 'fancybox-custom',
                helpers: {
                    title: {
                        type: 'inside'
                    },
                    overlay: {
                        css: {
                            'background-color': '#eee'
                        }
                    }
                }
            }
        );
    } catch (e) { }

    //Drop Down Menu
    try {
        $("a.menuItem").parent().hover(
            function () {
                $(this).find("ul.ulSubMenu").stop(true, true);
                $(this).find("ul.ulSubMenu").slideDown('fast').show();
            },
            function () {
                $(this).find("ul.ulSubMenu").stop(true, true);
                $(this).find("ul.ulSubMenu").slideUp('fast');
            }
        );
    } catch (e) { }

    try {
        var pikaSlideshow = $("#pikame");
        if (pikaSlideshow.length > 0) {
            pikaSlideshow.PikaChoose({ carousel: true });
        }
    } catch (e) { }


//    //Facebook Fancybox
//    var fancyOptions = {
//        closeBtn: false,
//        modal: true,
//        padding: 0,
//        openEffect: 'fade',
//        openSpeed: 'slow',
//        closeEffect: 'fade',
//        closeSpeed: 'fast',
//        fitToView: false,
//        wrapCSS: 'fancybox-custom',
//        helpers: {
//            title: {
//                type: 'inside'
//            },
//            overlay: {
//                css: {
//                    'background-color': '#eee'
//                }
//            }
//        }
//    }
//    $('#hlBookNow').fancybox();

});


//function ShowQuickReservation() {
//    var fancyOptions = {
//        closeBtn: false,
//        modal: false,
//        padding: 0,
//        openEffect: 'fade',
//        openSpeed: 'slow',
//        closeEffect: 'fade',
//        closeSpeed: 'fast',
//        fitToView: false,
//        wrapCSS: 'fancybox-custom',
//        helpers: {
//            title: {
//                type: 'inside'
//            },
//            overlay: {
//                css: {
//                    'background-color': '#eee'
//                }
//            }
//        }
//    }
//    $.fancybox.open($('#fbQuickReservation'), fancyOptions);
//            
//}
