﻿$(function() {

    dropdownIE6("#mainNav");
    dropdownIE6("#mainNav ul");

    tweets();

//    $("#homepagetabs").tinyTabs();

    $(".updated").timeago();

    $('#jsprint').click(function() { window.print(); return false; });

    $('#splashbanner').scrollable({ clickable: false, size: 1, loop: true }).autoscroll(8000).navigator();

    $('.aggregator').scrollable({ clickable: false, size: 5, vertical: true });

    $('.banner').scrollable({clickable:false,  size: 1, vertical: true }).autoscroll(8000);
	
    $('#keyfindings').scrollable({items: '.colsayHolder', next: '#keyfindings .next', size: 3, loop: true});
});

$(function () {
    $("#mainNav li a").each(function () {
        if (window.location.pathname == $(this).attr("href")) {
            $(this).parents('li').addClass("selected");
            return;
        }
    });
});


dropdownIE6 = function(element) {
    $(element)
        .children('li')
        .each(function() {
                $(this)
                    .hover(
                    function() {
                        $(this).addClass('sfhover');
                    },
                    function() {
                        $(this).removeClass('sfhover');
                    });
            });
};

tweets = function() {
    var opts = {
        join_text: "auto",
        username: "friendslifetalk",
        tag: "vob",
        count: 2,
        auto_join_text_default: "",
        auto_join_text_ed: "",
        auto_join_text_ing: "",
        auto_join_text_reply: "",
        auto_join_text_url: "",
        loading_text: "loading tweets..."
    };
    $(".tweet1").tweet2(opts);
    opts["count"] = 3;
    $(".tweet5").tweet2(opts);
    
    $(document).ready(function() {
        $('.toggleList').hide();
        $('.hideList').hide();
        $('.showList').click(function () {
            $(this).toggle();
            $(this).siblings('.toggleList').show('slow');
            $(this).siblings('.hideList').toggle();
        return false;
        });
        $('.hideList').click(function () {
            $(this).toggle();
            $(this).siblings('.toggleList').hide('slow');
            $(this).siblings('.showList').toggle();
        return false;
        });
    });
};


