/*jslint strict:true, evil: true, onevar: true, nomen: false  */ /*global $, jQuery, console, hbx, window, ndm, document, escape */

"use strict";

var addthis_pub="carsguide", addthis_brand = "Carsguide", addthis_options = "myspace, facebook, digg, delicious, fark, newsvine, technorati, favorites, google, live, yahoobkm", addthis_offset_top = -17, addthis_offset_left = 2;

function getTweetThisHref(vtext) {
    var pageTitle = vtext,
        pageTitleLim = pageTitle.substring(0, 80);
    return "http://twitter.com/home?status="+escape(pageTitleLim + " @Carsguide " + window.location.href);
}

$(document).ready(function() {
    $("#CG_tabs_media li").each(function(){
        $(this).click(function(){
            $(".CG_tab_media_active").removeClass("CG_tab_media_active");
            $(this).addClass("CG_tab_media_active");
            $(this).parent("ul").css("height",$(this).height());
        });

        $(this).hover(
            function(){
                $(this).find("h3").addClass("CG_tab_media_hover");
            },
            function(){
                $(this).find("h3").removeClass("CG_tab_media_hover");
            }
        );
    });

    $("#CG_tabs_media").css("height",$(".CG_tab_media_active").eq(0).height());
});