$(document).ready(function() {  

    // Get page ID from <body>
    var pageID = $('body').get(0).id;
    
    switch (pageID) {
        case 'page-home':    // Home page
            teaserObj.init('teaser');
            break;
        case 'blog':        // Blog
            setupZoom();
            break;
        default:
        
    }
    
}); 


var teaserObj = function() {

    var divTeaser;
    var liTeaserTabs;
    
    function addEventHandlers() {

        $('a', liTeaserTabs).click(clickTabAnchor);
        
    }
    
    function clickTabAnchor(e) {        
        var thisLi = $(e.target).parent();
        
        // Make new tab active
        liTeaserTabs.removeClass('teaser-topics-active');
        $(thisLi).addClass('teaser-topics-active');
        
        // Hide currently active content panel
        $('.teaser-content-active', divTeaser).removeClass('teaser-content-active').fadeOut('fast', function() {
            $(this).addClass('teaser-content-hidden');
        
            // Show new content panel
            var strContentDivId = thisLi.get(0).id + "-content";
            $('#' + strContentDivId).fadeIn('fast').removeClass('teaser-content-hidden').addClass('teaser-content-active');

        
        });
        
        
        
        e.preventDefault();
        return false;
    }
    
    return {
        // Public methods
        
        init: function(teaserID) {
            
            // Set properties
            divTeaser = $('#' + teaserID);
            liTeaserTabs = $('.teaser-topics ul li', divTeaser);
            
            addEventHandlers();
        }      
        
    };
    
}();




