﻿
$(document).ready(function(){

    /* REMOVE DISABLED TAG FROM RAD MENU */
    $("#mainNav a:disabled,#userTools a:disabled").removeAttr('disabled');

    /* set first and last classes for pods in sidebar */
    
    $("#sidebar .pod:first").addClass('firstPod');
    $("#sidebar .pod:last").addClass('lastPod');
    
    $("#cmsMenu").hide();
    $(".linkCMS a").click(function () {
      $("#cmsMenu").toggle().addClass('cmsOpened').removeClass('cmsClosed');
    });
    
    $("#whatsNewAccordian > li:not(.active) .section").hide();
    $("#whatsNewAccordian .showSection a").click(function () {
		/* remove all active classes and show for this link */
		$("#whatsNewAccordian .showSection a").parent().parent().removeClass('active').addClass('inactive');
		$(this).parent().parent().removeClass('inactive').addClass('active');
		/* hide all accordians and show the link's href */
		$("#whatsNewAccordian .section:visible").hide();
		var open = $(this).attr('href');
		$(open).show();
		return false;
    });


    $("#myClasses > li:not(.active) .section").hide();
    $("#myClasses .showSection a").click(function () {
		/* remove all active classes and show for this link */
		$("#myClasses .showSection a").parent().parent().removeClass('active').addClass('inactive');
		$(this).parent().parent().removeClass('inactive').addClass('active');
		/* hide all accordians and show the link's href */
		$("#myClasses .section:visible").hide();
		var open = $(this).attr('href');
		$(open).show();
		return false;
    });
    
    
    /* align the heights of Events and Other News Pods on Arts and Science community home */
    var left_height = $('.eventsContent').height(); 
    var right_height = $('.newsContent').height(); 
    
    if(right_height > left_height) { 
        $('.eventsContent').height(right_height); 
    } 
    else { 
        $('.newsContent').height(left_height); 
    }
    
    /* align the heights of Student Spotlight and Tips Pods on IT community home */
    var left_height2 = $('.studSpotlightContent').height(); 
    var right_height2 = $('.tipsContent').height(); 
    
    if(right_height2 > left_height2) { 
        $('.studSpotlightContent').height(right_height2); 
    } 
    else { 
        $('.tipsContent').height(left_height2); 
    }
    
    /* align the heights of Upcoming Events and Tips Pods on Business community home */
    var left_height3 = $('.eventsContent').height(); 
    var right_height3 = $('.tipsContent').height(); 
    
    if(right_height3 > left_height3) { 
        $('.eventsContent').height(right_height3); 
    } 
    else { 
        $('.tipsContent').height(left_height3); 
    }
    
    
    
    $(".featuredPod").prev().width('46%');
});	