﻿// *****************************************************************
// JQuery Scripts for the AACC Home Page Layout
// v1.0
// Terraping Systems terpsys.com
// *****************************************************************

$(document).ready(function() 
{
            $('.home-tabstrip a').click(function(){
                        switch_tabs($(this));
            });

            switch_tabs($('.defaulttab'));
          

	           /* Change format of the first article list */
            $("#WebPartWPQ2 tr:nth-child(1) tr a").addClass('home-feature-header'); 
            

            $('.home-tabs-jobs-list:eq(0)').css({'padding-top' : '10px'});
            $('.home-tabs-jobs-list:eq(0)').css({'background' : 'none'});

            $('.home-tabs-jobs-list:eq(5)').css({'padding-top' : '10px'});
            $('.home-tabs-jobs-list:eq(5)').css({'background' : 'none'});

            $('.home-tabs-jobs-list:eq(11)').css({'padding-top' : '10px'});
            $('.home-tabs-jobs-list:eq(11)').css({'background' : 'none'});

            /* add "..." to the end of the featured article summary" */
            $('.home-feature-sub-teaser').ThreeDots({max_rows:4,whole_word:true}); 
            
            /* set width of tabs */
            $('#JobsTab').parents('li').css('width', '120px');
            $('#MostReadTab').parents('li').css('width', '150px');
            $('#MostSharedTab').parents('li').css('width', '165px');

});

function switch_tabs(obj)
{
            $('.home-tabs-content-list').hide();
            $('.home-tabstrip a').removeClass("home-tab-selected");
            var id = obj.attr("rel");
            $('#'+id).show();
            obj.addClass("home-tab-selected");
}
