﻿/*
Filename : /Scripts/Home/Home.js
Author   : Scott A. Mayfield (smayfield@growums.com)
*/

$(function () {
    $(".homepage_rotator").wtRotator({
        width: 630,
        height: 237,
        button_width: 24,
        button_height: 24,
        button_margin: 5,
        auto_start: true,
        delay: 5000,
        play_once: false,
        transition: "fade",
        transition_speed: 800,
        auto_center: true,
        easing: "",
        cpanel_position: "inside",
        cpanel_align: "BR",
        timer_align: "top",
        display_thumbs: false,
        display_dbuttons: true,
        display_playbutton: true,
        display_numbers: true,
        display_timer: true,
        mouseover_pause: false,
        cpanel_mouseover: false,
        text_mouseover: false,
        text_effect: "fade",
        text_sync: true,
        tooltip_type: "image",
        lock_tooltip: true,
        shuffle: false,
        block_size: 75,
        vert_size: 55,
        horz_size: 50,
        block_delay: 25,
        vstripe_delay: 75,
        hstripe_delay: 180
    });

    $('#get-started').hover(function () {
        $(this).attr('src', '/content/images/homepage/get-started-hover.png');
    }, function () {
        $(this).attr('src', '/content/images/homepage/get-started.png');
    });

    $('#register-bonnie').hover(function () {
        $(this).attr('src', '/content/images/homepage/register-bonnie-hover.png');
    }, function () {
        $(this).attr('src', '/content/images/homepage/register-bonnie.png');
    });


    $('#join').hover(function () {
        $(this).attr('src', '/content/images/homepage/signup-hover.png');
    }, function () {
        $(this).attr('src', '/content/images/homepage/signup.png');
    });

    $('#track').hover(function () {
        $(this).attr('src', '/content/images/homepage/school-hover.png');
    }, function () {
        $(this).attr('src', '/content/images/homepage/school.png');
    });

    $('#gardens').hover(function () {
        $(this).attr('src', '/content/images/homepage/gardens-hover.png');
    }, function () {
        $(this).attr('src', '/content/images/homepage/gardens.png');
    });

    $('#play-games').hover(function () {
        $(this).attr('src', '/content/images/homepage/games-hover.png');
    }, function () {
        $(this).attr('src', '/content/images/homepage/games.png');
    });

    $('#characters .more img').hover(function () {
        $(this).attr('src', '/content/images/homepage/meet-more-growums-hover.png');
    }, function () {
        $(this).attr('src', '/content/images/homepage/meet-more-growums.png');
    });


    $('#video-link').click(function () {
        var parent = $(this).parent();
        $(this).hide();
        parent.html('<iframe width="460" height="259" src="http://www.youtube.com/embed/WOQF75BEi6Q?rel=0&hd=1&autoplay=1" frameborder="0" allowfullscreen></iframe>');
        return false;
    });

    // HACK: fix the page height to adjust for the newly inserted content...
    $('#page_middle').css('height', parseInt($('#main_content').css('height')));

});

