﻿$(document).ready(function() {
    // JS Tooltips
    $('.hoverText').mousemove(function(e) {
        var mouseX = e.pageX;
        var mouseY = e.pageY;
        var thisWidth = $('.popoverHover').width();
        var thisHeight = $('.popoverHover').height();
        $('.popoverHover').css({ 'left': (mouseX - Math.floor(thisWidth / 2) - 10) + 'px', 'top': (mouseY - 20 - thisHeight) + 'px' });
    });

    $('.hoverText').mouseover(function() {
        $('.popoverHover').html($(this).attr('title'));
        $('.popoverHover').show();
    });

    $('.hoverText').mouseout(function() {
        $('.popoverHover').html('');
        $('.popoverHover').hide();
    });

    // Load the custom scrollbar with a delay to give facebook time to load first
    $(function() {
        var settings = {
            scrollbarWidth: 10,
            showArrows: true
        };
        // Apply normal custom scrollbars asap
        var pane = $('.customScroll')
        pane.jScrollPane(settings);
        
        // Delay facebook custome scrollbars
        var paneTwo = $('.customScrollDelay')
        setInterval(
		    function() {
                paneTwo.jScrollPane(settings);
		    },
		    5000
	    );
	});
	
	// Auto close the intro animation
	$(function() {
		//$('.introTarget').show();
		setInterval(
			function() {
				//$('.introTarget').hide();
			},
			10000
		);
	});
});

