﻿$(window).load(function () {
    $('#slider').nivoSlider({
        effect: 'fade', //Specify sets like: 'fold,fade,sliceDown'
        slices: 15,
        animSpeed: 1000, //Slide transition speed
        pauseTime: 4000,
        startSlide: 0, //Set starting Slide (0 index)
        directionNav: true, //Next &amp; Prev
        directionNavHide: true, //Only show on hover
        controlNav: false, //1,2,3...
        controlNavThumbs: false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel: false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav: false, //Use left &amp; right arrows
        pauseOnHover: true, //Stop animation while hovering
        manualAdvance: false, //Force manual transitions
        captionOpacity: 0.7, //Universal caption opacity
        beforeChange: function () { },
        afterChange: function () { },
        slideshowEnd: function () { } //Triggers after all slides have been shown
    });
});

    function AddNewsletterSubscription() {
        var email = $("#txt_email").attr("value");

        $.ajax(
    {
        type: "POST",
        url: "/NewsletterSub/CreateFromEmail",
        data: "email=" + email,
        dataType: "html",
        success: function (result) {
            var domElement = $(result); // create element from html
            $("#subscription_result").append(domElement); // append to end of list        
            $("#subscription_area").hide(); // append to end of list        
        }
    });
}

function ShowSubscription() {
    $("#subscription_area").show(); // append to end of list
    $("#subscription_result").hide();
    $("#txt_email").val('');
}

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18929605-1']);
_gaq.push(['_setDomainName', '.centrestagemusictheatre.co.uk']);
_gaq.push(['_trackPageview']);

(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


function __loadGoogleMap() {
    try {

        if (GBrowserIsCompatible()) {
            var map = new GMap2(document.getElementById("contact_map"));

            map.addControl(new GSmallMapControl());

            map.setCenter(new GLatLng(55.602107, -4.495377), 16);

            var point = new GLatLng(55.602107, -4.495377);
            var blueIcon = new GIcon(G_DEFAULT_ICON);

            var marker = new GMarker(point, { icon: blueIcon });
            map.addOverlay(marker);

        }
    } catch (e) { }
}




