﻿$(document).ready(function () {
    $('#picturecarousel').jcarousel({
        scroll: 3,
        animation: "fast"
    });
    $("a.booking").fancybox({
        'hideOnContentClick': false,
        'zoomSpeedIn': 0,
        'zoomSpeedOut': 0,
        'overlayShow': true,
        'overlayColor': '#000',
        'overlayOpacity': 0.8,
        'width': 500,
        'height': 550
    });
    $("a.fancylink").fancybox({
        'hideOnContentClick': false,
        'zoomSpeedIn': 0,
        'zoomSpeedOut': 0,
        'overlayShow': true,
        'overlayColor': '#000',
        'overlayOpacity': 0.8,
        'titlePosition': 'over'
    });
    
    $("a.picturecarousel").fancybox({
        'hideOnContentClick': false,
        'zoomSpeedIn': 0,
        'zoomSpeedOut': 0,
        'overlayShow': true,
        'overlayColor': '#000',
        'overlayOpacity': 0.8,
        'titlePosition': 'over'
    });

    function getFlashVersion() {
        // ie
        try {
            try {
                // avoid fp6 minor version lookup issues
                var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
                try { axo.AllowScriptAccess = 'always'; }
                catch (e) { return '6,0,0'; }
            } catch (e) { }
            return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
            // other browsers
        } catch (e) {
            try {
                if (navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
                    return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
                }
            } catch (e) { }
        }
        return '0,0,0';
    }

    var version = getFlashVersion().split(',').shift();

    if (version == 0) {
        $(function () {
            $('#slideshow').empty();
            $('<img src="images/slideshow/1.jpg" alt="" width="986" height="388" /><img src="images/slideshow/2.jpg" alt="" width="986" height="388" /><img src="images/slideshow/3.jpg" alt="" width="986" height="388" />').appendTo("#slideshow");
            $('#slideshow').cycle({
                fx: 'fade',
                speed: '1400',
                continuous: 0,
                timeout: 4000
            });
        });
    } else if (version < 10) {
        $(function () {
            $("<div id='browserWarning'>You have an older version of Flash Player installed. Please <a href='http://get.adobe.com/flashplayer/' target='_blank'>update to the latest Flash Player</a> for the best experience. &nbsp;&nbsp;&nbsp;[<a href='#' id='warningClose'>close</a>] </div> ")
			.css({
			    'backgroundColor': '#feffd2',
			    'width': '100%',
			    'border-top': 'solid 1px #b8b990',
			    'border-bottom': 'solid 1px #b8b990',
			    'text-align': 'center',
			    'padding': '5px 0px 5px 0px',
			    'font-size': '12px',
			    'color': '#2e2e2e',
			    'position': 'absolute',
			    'font-family': 'Verdana',
			    'z-index': '200'
			})
			.prependTo("body").children("a").css({});

            $('#warningClose').click(function () {

                $('#browserWarning').slideUp('slow');
                return false;
            });
        });
    }
});

