$(document).ready(function(){
    
    //Apply to all png images 
    $('img[@src$=.png]').ifixpng();
    
    //Background Opacity on Top Navigation Bar and Footer
    $(".footer").css("opacity","0.62");
    
    //Tabs: Master Control // AJAX
    var $tabs = $("ul#mainNav").tabs();
    
    //Tabs: 1st Tab-TDM Logo- Dynamically Removes Border From Selected Tab
    $("#mainNav li.main_TDM_Logo.ui-tabs-selected").css("border","0");
    
    //Tabs: Top Nav Dynamically Removes Borders
    $("#mainNav .ui-tabs-nav-item.navlist").css("border","0");
    
    //Tabs: Internal Links to Tabs via class name
    $(".retailerLink").click(function() { // bind click event to link
        $tabs.tabs("select", 1); // switch to 2 tab // uses index counter
        return false;
    });
    $(".advertisersLink").click(function() { // bind click event to link
        $tabs.tabs("select", 2); // switch to 3 tab // uses index counter
        return false;
    });
    $(".contactLink").click(function() { // bind click event to link
        $tabs.tabs("select", 9); // switch to 10 tab // uses index counter
        return false;
    });
//    $(".aboutLink").click(function() { // bind click event to link
//        $tabs.tabs("select", 4); // switch to 10 tab // uses index counter
//        var color = $(this).css("color","#00c9ff");
//        return false;
//    });
    $(".aboutLink").click(function() { // bind click event to link
        $tabs.tabs("select", 4); // switch to 10 tab // uses index counter
        return false;
    });
    $(".featuredLink").click(function() { // bind click event to link
        $tabs.tabs("select", 5); // switch to 10 tab // uses index counter
        return false;
    });
    $(".caseLink").click(function() { // bind click event to link
        $tabs.tabs("select", 6); // switch to 10 tab // uses index counter
        return false;
    });
    $(".testimonLink").click(function() { // bind click event to link
        $tabs.tabs("select", 7); // switch to 10 tab // uses index counter
        return false;
    });
    $(".carrersLink").click(function() { // bind click event to link
        $tabs.tabs("select", 8); // switch to 10 tab // uses index counter
        return false;
    });
    
    //Tabs: Flash Master Control for Movie
    $("#commLink1").click(function() { // bind click event to link
        $tabs.tabs("select", 1); // switch to 2 tab // uses index counter
        return false;
    });
    $("#commLink2").click(function() { // bind click event to link
        $tabs.tabs("select", 2); // switch to 3 tab
        return false;
    });	
    $("#commLink3").click(function() { // bind click event to link
        $tabs.tabs("select", 3); // switch to 4 tab
        return false;
    });
    $("#commLinkContact").click(function() { // bind click event to link
        $tabs.tabs("select", 9); // switch to 10 tab
        return false;
    });

//Toggle Careers Positions
    $("ul#careersList").idTabs(function(id,list,set){ 
        $("a",set).removeClass("selected").filter("[@href='"+id+"']",set).addClass("selected"); 
        for(i in list) 
            $(list[i]).hide(); 
        $(id).show(); 
        return false; 
    });
    //Toggle Testimonials
    $("ul#testList").idTabs(function(id,list,set){ 
        $("a",set).removeClass("selected").filter("[@href='"+id+"']",set).addClass("selected"); 
        for(i in list) 
            $(list[i]).hide(); 
        $(id).show(); 
        return false; 
    });  
    
    //External Links
    $('A[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	
});