﻿
/// <reference path="jquery-1.4.1.js" />

var floatMenu = "#floatMenu";

var shaneName = "#floatShaneXXX";
var shaneimage = "#shaneImageXXX";

var talkName = "#floatTalk";
var talkBorderName = "#floatTalkBorder";

var menuTextName = "#menutext";


$(document).ready(function () {

    $(window).scroll(function () {

        //menu
        if ($(document).scrollTop() > 310) {
            $(floatMenu).css({ position: 'fixed', top: 0, marginBottom: 0 });
        }
        if ($(document).scrollTop() <= 310) {
            $(floatMenu).css({ position: 'absolute', top: 310 });
        }

        //menu text
        if ($(document).scrollTop() > 203) {
            $(menuTextName).css({ opacity: ($(document).scrollTop() - 203) / 1000 });
        }
        if ($(document).scrollTop() <= 203) {
            $(menuTextName).css({ opacity: 0 });
        }
        if ($(document).scrollTop() > 400) {
            $(menuTextName).css({ opacity: 1 });
        }

        //shane
        if ($(document).scrollTop() > 40) {
            $(shaneName).css({ position: 'fixed', top: 0, marginBottom: 0 });
        }
        if ($(document).scrollTop() <= 40) {
            $(shaneName).css({ position: 'absolute', top: 40 });
        }


        //talk
        if ($(document).scrollTop() > 203) {
            $(talkName).css({ position: 'fixed', top: 7, marginBottom: 0 });
            $(talkBorderName).css({ position: 'fixed', top: 7, marginBottom: 0 });
        }
        if ($(document).scrollTop() <= 203) {
            $(talkName).css({ position: 'absolute', top: 240 });
            $(talkBorderName).css({ position: 'absolute', top: 240 });
        }
        //talk border
        if ($(document).scrollTop() > 233) {
            $(talkBorderName).css({ opacity: 1 - ($(document).scrollTop() - 233) / 100 });
        }
        if ($(document).scrollTop() <= 233) {
            $(talkBorderName).css({ opacity: 1 });
        }


        //shane resize
        if ($(document).scrollTop() < 300 && $(document).scrollTop() < 500) {

            //if ($(shaneName).width() >= 100) {
            $(shaneName).width(138 - (Math.round($(document).scrollTop() - 200) / 4));
            //}
            //if ($(shaneName).height() >= 100) {
            $(shaneName).height(150 - (Math.round($(document).scrollTop() - 200) / 2.5));
            //}
            //if ($(shaneimage).width() >= 75) {
            $(shaneimage).width(115 - (Math.round($(document).scrollTop() - 200) / 4));
            //}
            //if ($(shaneimage).height() >= 75) {
            $(shaneimage).height(147 - (Math.round($(document).scrollTop() - 200) / 2.5));
            //}
        }

        if ($(document).scrollTop() < 200) {
            $(shaneName).width(138);
            $(shaneName).height(150);
            $(shaneimage).width(115);
            $(shaneimage).height(147);
        }
        if ($(document).scrollTop() >= 500) {
            $(shaneName).width(115.25);
            $(shaneName).height(113.6);

            $(shaneimage).width(92.25);
            $(shaneimage).height(110.6);
        }




    });


    $(function () {
        $("#itboxtext,.itimage").hover(function () {
            $("#itboxblack").animate({ 'height': '124px', 'top': '0px' }, { queue: false, duration: 500, easing: 'easeOutBounce' });
            $("#itboxtext").animate({ 'height': '130px', 'top': '100px' }, { queue: false, duration: 500, easing: 'easeOutBounce' });
            $("#itboxpara").animate({ color: '#FFFFFF', opacity: 1 }, { queue: false, duration: 100 });
        }, function () {
            $("#itboxblack").animate({ 'height': '30px', 'top': '94px' }, { queue: false, duration: 500, easing: 'easeOutBounce' });
            $("#itboxtext").animate({ 'height': '35px', 'top': '200px' }, { queue: false, duration: 500, easing: 'easeOutBounce' });
            $("#itboxpara").animate({ color: '#C0C0C0', opacity: 0 }, { queue: false, duration: 100 });
        });
    });

    $(function () {
        $("#webboxtext,.webimage").hover(function () {
            $("#webboxblack").animate({ 'height': '124px', 'top': '0px' }, { queue: false, duration: 500, easing: 'easeOutBounce' });
            $("#webboxtext").animate({ 'height': '130px', 'top': '100px' }, { queue: false, duration: 500, easing: 'easeOutBounce' });
            $("#webboxpara").animate({ color: '#FFFFFF', opacity: 1 }, { queue: false, duration: 100 });

        }, function () {
            $("#webboxblack").animate({ 'height': '30px', 'top': '94px' }, { queue: false, duration: 500, easing: 'easeOutBounce' });
            $("#webboxtext").animate({ 'height': '35px', 'top': '200px' }, { queue: false, duration: 500, easing: 'easeOutBounce' });
            $("#webboxpara").animate({ color: '#C0C0C0', opacity: 0 }, { queue: false, duration: 100 });
        });
    });



});
