// Tabs Script
$(document).ready(function(){
    makeTabs('#weather');
    makeTabs('#tabs');
    makeTabs('#tabs2');
    makeTabs('#tabs3');
    makeTabs('#tabs4');
    makeTabs('#tabs5');
    makeTabs('#tabs6');
    makeTabs('#tabs7');
    makeTabs('#tabs8');
    makeTabs('#tabs9');
    makeTabs('#tabs10');
    makeTabs('#tabs11');
});


function makeTabs(id){
    $(id+' .tab').hide(); // Hide all divs
    $(id+' .tab:first').show(); // Show the first div
    $(id+' ul li:first').addClass('active'); // Set the class of the first link to active
    $(id+' ul:first li a').click(function(){ //When any link is clicked
        $(id+' ul li').removeClass('active'); // Remove active class from all links
        $(this).parent().addClass('active'); //Set clicked link class to active
        var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
        $(id+' .tab').hide(); // Hide all divs
        $(id+' '+currentTab).show(); // Show div with id equal to variable currentTab
        return false;
    });

}
