﻿// Load plugins, this can also be done on any page.
$("body").append("<script type='text/javascript' src='/_scripts/jQuery/plugins/plugin.hoverIntent.js'></script>");
$("body").append("<script type='text/javascript' src='/_scripts/jQuery/plugins/plugin.superfish.js'></script>");
$("body").append("<script type='text/javascript' src='/_scripts/jQuery/plugins/plugin.mosaic.1.0.1.min.js'></script>");
$("body").append("<script type='text/javascript' src='/_scripts/jQuery/plugins/plugin.quote_rotator.js'></script>");
$("body").append("<script type='text/javascript' src='/_scripts/jQuery/plugins/plugin.gmap.min.js'></script>");

$(document).ready(function () {

    // init superfish menu
    $('.navigation ul').superfish({
        delay: 300,
        animation: { opacity: 'show', height: 'show' },
        speed: 'fast',
        pathLevels: 1,
        autoArrows: false,
        pathClass: 'selected'
    });


    $('.fade').mosaic();

    $('.leftnavigation').find('.selected').parents("ul").show();
    $('.leftnavigation').find('li.selected').find("ul").show();



    (function ($) {
        $.fn.clearDefault = function () {
            return this.each(function () {
                var default_value = $(this).val();
                $(this).focus(function () {
                    if ($(this).val() == default_value) $(this).val("");
                });
                $(this).blur(function () {
                    if ($(this).val() == "") $(this).val(default_value);
                });
            });
        };
    })(jQuery);

    $('.contactformlarge .row input').clearDefault();
    $('.contactformlarge .row textarea').clearDefault();
    $('.contactform .row input').clearDefault();

    // stars quotes
    $('ul.quotes').quote_rotator({ rotation_speed: 7000 });

    //google maps contact page
    $("#map").gMap({
        markers: [{ address: "Emmastraat 4, 8011 AG Zwolle, The Netherlands",
            html: "Seven Stars <br />Emmastraat 4, 8011 AG Zwolle"
                  }],
            zoom: 13,
            controls: {
                panControl: false,
                zoomControl: true,
                mapTypeControl: false,
                scaleControl: false,
                streetViewControl: false,
                overviewMapControl: false
            },
            scrollwheel: false
    });
});

