﻿var animatingOut = false;
$(document).ready(function() {

    $("#segmentsRoll").mouseover(function() {
        clearTimeout(slideInTracker);
        if (!animatingOut) {

            animatingOut = true;
            $("#ST1").stop();
            $("#ST1").animate({
                marginLeft: "698px"
            }, 1200, function() { animatingOut = false; });
        }


    });


    $("#segmentsCont").mouseout(function() {
        slideIn();



    });

    $("#segmentsCont").mouseover(function() {

    clearTimeout(slideInTracker);
    });




    $("#segmentILinks li .fade").animate({ opacity: 0.5 });

    $("#segmentILinks li .fade").hover(function() {
        $(this).stop().animate({ opacity: 1.0 }, 500);
    },
           function() {
               $(this).stop().animate({ opacity: 0.5 }, 500);
           });


});

var slideInTracker = null;

function slideIn() {
    slideInTracker = setTimeout(function() {
        animatingOut = false;
        $("#ST1").stop();

        $("#ST1").animate({
            marginLeft: "0px"
        }, 1200);
    }, 500);
}
