$(document).ready(function () {

    $('#slideshow-blog').hover(

    function () {
        $('#controls').fadeIn();
    }, function () {
        $('#controls').fadeOut();
    });

    $('#slideshow, #slideshow-work').hover(

    function () {
        $('#controls, #slides-title').fadeIn();
    }, function () {
        $('#controls, #slides-title').fadeOut();
    });

    $('#slides').cycle({
        fx: 'scrollHorz',
        speed: 1000,
        timeout: 4000,
        next: '#next',
        prev: '#previous',
        pause: 1,
        after: onAfter,
        before: function () {
            $('#box-quote').hide().html(this.title).fadeIn(1500);
            $('#box-source').hide().html(this.rel).fadeIn(1500);
        }
    });

    function onAfter(curr, next, opts) {
        var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount;
        $('#slideshowCurrent').html(caption);
    }

    $('#slides-blog').cycle({
        fx: 'scrollHorz',
        speed: 1000,
        timeout: 4000,
        next: '#next',
        prev: '#previous',
        pause: 1
    });

    $('#slides-work').cycle({
        fx: 'scrollHorz',
        speed: 1000,
        timeout: 4000,
        next: '#next',
        prev: '#previous',
        pause: 1,
        after: onAfter,
        before: function () {
            $('#slides-title').hide().html(this.alt).fadeIn(1500);
        }
    });

    function onAfter(curr, next, opts) {
        var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount;
        $('#slideshowCurrent').html(caption);
    }


    $('.calendar-hover', this).hide();

    $('#backstage li', this).hover(

    function () {
        $('.calendar-hover', this).fadeIn();
    }, function () {
        $('.calendar-hover', this).fadeOut();
    });

    $(".boxes li a", this).hover(

    function () {
        $(".box-hover", this).fadeIn(400);
    }, function () {
        $(".box-hover", this).fadeOut(400);
    });

	$("#notification").slideDown(400).delay(1500).slideUp(400);


});

function initialize() {
    var latlng = new google.maps.LatLng(53.518114184985, -2.5046682357788086);
    var settings = {
        zoom: 15,
        center: latlng,
        mapTypeControl: false,
        mapTypeControlOptions: {
            style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
        },
        navigationControl: true,
        navigationControlOptions: {
            style: google.maps.NavigationControlStyle.SMALL
        },
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("google-map"), settings);
    var contentString = '<div id="content">' + '<div id="siteNotice">' + '</div>' + '<h1 id="firstHeading" class="firstHeading">Paratec</h1>';
    var infowindow = new google.maps.InfoWindow({
        content: contentString
    });

    var companyImage = new google.maps.MarkerImage('http://www.madebyshape.co.uk/images/map-logo.png', new google.maps.Size(100, 50), new google.maps.Point(0, 0), new google.maps.Point(50, 50));

    var companyShadow = new google.maps.MarkerImage('http://www.madebyshape.co.uk/images/map-logo-shadow.png', new google.maps.Size(130, 50), new google.maps.Point(0, 0), new google.maps.Point(65, 50));

    var companyPos = new google.maps.LatLng(53.53024536138684, -2.5047755241394043);

    var companyMarker = new google.maps.Marker({
        position: companyPos,
        map: map,
        icon: companyImage,
        shadow: companyShadow,
        title: "MadeByShape",
        zIndex: 3
    });

}
