/*
 * Title:   MRIProtocols Public Facing JavaScript
 * Author:  Daniel Marino
 * Revised: July 2010
 *
 */

/*global $ */

(function (MRI) {

    // Tooltips
    function toolTips() {
        $(".tooltip").each(function () {
            var ele = $(this).children("a"),
                txt = ele.attr("title"),
                tip = $("<span>").addClass("tip").text(txt),
                arr = $("<span>").addClass("arrow");
            $(this).append(tip).append(arr);
            ele.attr("title","");
        });
        $(".tooltip a").hover(
            function () { $(this).siblings().fadeIn(100); },
            function () { $(this).siblings().fadeOut(100); }
        );
    }

    // Initiate Coda Slider Effect for Tour
    function tourTabs() {
        $('#tour-slider').codaSlider({
            dynamicTabs: false
        });
    }

    $(document).ready(function () {
        toolTips();
        tourTabs();
    });

}());