﻿$(document).ready(function() {

    // Image Rotator on the homepage
    $('#slider').nivoSlider({
        effect: 'fade',
        pauseTime: 4000,
        controlNav: false
    });

function showModels(make) {
        $("#chevycars-models").hide();
        $("#chevytrucks-models").hide();
        $("#chrysler-models").hide();
        $("#jeep-models").hide();
        $("#dodge-models").hide();
        $("#ram-models").hide();
        $(make).show();
    }

    // New Inventory Dropdown
    $('.drop-1 ul li').mouseenter(function() {
        $('.drop-2').show();
    });
    $('.drop-1').mouseleave(function() {
        $('.drop-2').hide();
    });
    $('#dd-chevycars').hover(function() {
        $('#vehicle-make').text('Chevrolet');
        showModels("#chevycars-models");
        $('#vehicle-style').text('Camaro');
        $('#vehicle-detail').text('Camaro was developed to be 21st century on every level - from its awe-inspiring design to its outstanding performance to its impressive efficiency and sophistication.');
        $('#vehicle-image').attr('src', '/Resources/Images/c-camaro.jpg');
        $('.drop-2 a').attr('href', '/Models/Chevrolet/Camaro.aspx');
    });

    $('#c-camaro').hover(function() {
        $('#vehicle-style').text('Camaro');
        $('#vehicle-detail').text("Camaro was developed to be 21st century on every level - from its awe-inspiring design to its outstanding performance to its impressive efficiency and sophistication.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-camaro.jpg');
        $('.drop-2 a').attr('href', '/Models/Chevrolet/Camaro.aspx');
    });
    $('#c-corvette').hover(function() {
        $('#vehicle-style').text('Corvette');
        $('#vehicle-detail').text("Corvette has carved a permanent niche into the global automotive landscape, defining freedom and state-of-the-art technology.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-corvette.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Corvette/All/All/List.aspx');
    });
    $('#c-cruze').hover(function() {
        $('#vehicle-style').text('Cruze');
        $('#vehicle-detail').text("Cruze challenges conventional compact wisdom with one simple word: more. Its cavernous, quiet interior and beautifully sculpted exterior feel like luxury.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-cruze.jpg');
        $('.drop-2 a').attr('href', '/Models/Chevrolet/Cruze.aspx');
    });
    $('#c-hhr').hover(function() {
        $('#vehicle-style').text('HHR');
        $('#vehicle-detail').text("Take to the road in the boldly styled multipurpose vehicle that caters to your spirit of adventure.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-hhr.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Corvette/All/All/List.aspx');
    });
    $('#c-impala').hover(function() {
        $('#vehicle-style').text('Impala');
        $('#vehicle-detail').text("For more than 50 years, Impala has delivered proven excellence in a car millions of people have come to rely on over the years.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-impala.jpg');
        $('.drop-2 a').attr('href', '/Models/Chevrolet/Impala.aspx');
    });
    $('#c-malibu').hover(function() {
        $('#vehicle-style').text('Malibu');
        $('#vehicle-detail').text("With more than 40 awards to its credit, the Chevrolet Malibu continues to command attention and acclaim.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-malibu.jpg');
        $('.drop-2 a').attr('href', '/Models/Chevrolet/Malibu.aspx');
    });
    $('#c-sonic').hover(function() {
        $('#vehicle-style').text('Sonic');
        $('#vehicle-detail').text("The Chevrolet Sonic is ready to turn a head or two. Its sleek appearance and sophisticated ride will command attention — the rest is up to you.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-sonic.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Corvette/All/All/List.aspx');
    });
    $('#c-volt').hover(function() {
        $('#vehicle-style').text('Volt');
        $('#vehicle-detail').text("Powered by electricity without being tethered to electrical outlets, the Volt does everything a great car does, better than any other.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-volt.jpg');
        $('.drop-2 a').attr('href', '/Models/Chevrolet/Volt.aspx');
    });
    $('#dd-chevytrucks').hover(function() {
        $('#vehicle-make').text('Chevrolet');
        showModels("#chevytrucks-models");
        $('#vehicle-style').text('Avalanche');
        $('#vehicle-detail').text('Avalanche is a perfect blend of flexibility and functionality for people who want to be ready for anything at a moment\'s notice.');
        $('#vehicle-image').attr('src', '/Resources/Images/c-avalanche.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Avalanche/All/All/List.aspx');
    });
    $('#c-avalanche').hover(function() {
        $('#vehicle-style').text('Avalanche');
        $('#vehicle-detail').text("Avalanche is a perfect blend of flexibility and functionality for people who want to be ready for anything at a moment's notice.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-avalanche.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Avalanche/All/All/List.aspx');
    });
    $('#c-colorado').hover(function() {
        $('#vehicle-style').text('Colorado');
        $('#vehicle-detail').text("Colorado is your partner when you're on the clock and your partner in crime when you're making the most of your downtime.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-colorado.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Colorado/All/All/List.aspx');
    });
    $('#c-equinox').hover(function() {
        $('#vehicle-style').text('Equinox');
        $('#vehicle-detail').text("Meticulous craftsmanship and upscale styling combined with a flexible interior and class-leading highway fuel economy sets Equinox apart from the rest.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-equinox.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Equinox/All/All/List.aspx');
    });
    $('#c-express').hover(function() {
        $('#vehicle-style').text('Express');
        $('#vehicle-detail').text("You can handle almost any job with the right tools, and Chevrolet Commercial Vans are those tools.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-express.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Express/All/All/List.aspx');
    });
    $('#c-silverado').hover(function() {
        $('#vehicle-style').text('Silverado 1500');
        $('#vehicle-detail').text("Sure, Silverado can help construct roads and bridges. Things that matter. Things that last. The most important thing we've built over the last 90 years is a bond with truck owners.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-silverado1500.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Silverado+1500/All/All/List.aspx');
    });
    $('#c-silverado2500HD').hover(function() {
        $('#vehicle-style').text('Silverado 2500HD');
        $('#vehicle-detail').text("You never have to back down from the big jobs with the power and performance of a Silverado 2500HD.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-silverado2500hd.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Silverado+2500HD/All/All/List.aspx');
    });
    $('#c-suburban').hover(function() {
        $('#vehicle-style').text('Suburban');
        $('#vehicle-detail').text("For more than 75 years, it has been the authentic American utility vehicle.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-suburban.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Suburban/All/All/List.aspx');
    });
    $('#c-tahoe').hover(function() {
        $('#vehicle-style').text('Tahoe');
        $('#vehicle-detail').text("The capable and fuel-efficient Chevrolet Tahoe has the power to handle the demands of the road and the interior amenities to make you feel right at home.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-tahoe.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Tahoe/All/All/List.aspx');
    });
    $('#c-traverse').hover(function() {
        $('#vehicle-style').text('Traverse');
        $('#vehicle-detail').text("Awarded an overall 5-star safety rating, the stylish, fuel-efficient Chevrolet Traverse helps protect you and your loved ones while adapting to your needs.");
        $('#vehicle-image').attr('src', '/Resources/Images/c-traverse.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chevrolet/Traverse/All/All/List.aspx');
    });
    $('#dd-chrysler').hover(function() {
        $('#vehicle-make').text('Chrysler');
        showModels("#chrysler-models");
        $('#vehicle-style').text('200');
        $('#vehicle-detail').text('The new Chrysler 200 radiates details of design all the way from its signature grille to its modern exhaust tips.');
        $('#vehicle-image').attr('src', '/Vehicle-Search/New/All/Chrysler/200/All/All/List.aspx');
        $('.drop-2 a').attr('href', '#');
    });
    $('#cy-200').hover(function() {
        $('#vehicle-style').text('200');
        $('#vehicle-detail').text("The new Chrysler 200 radiates details of design all the way from its signature grille to its modern exhaust tips. ");
        $('#vehicle-image').attr('src', '/Resources/Images/cy-200.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chrysler/200/All/All/List.aspx');
    });
    $('#cy-300').hover(function() {
        $('#vehicle-style').text('300');
        $('#vehicle-detail').text("The 2011 Chrysler 300 has been given a major overhaul that makes the luxury car it always aspired to be.");
        $('#vehicle-image').attr('src', '/Resources/Images/cy-300.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chrysler/300/All/All/List.aspx');
    });
    $('#cy-tnc').hover(function() {
        $('#vehicle-style').text('Town & Country');
        $('#vehicle-detail').text("We took the best-selling minivan and made it better.  We sculpted not only the styling, not only the new interiors, but the overall dynamics.");
        $('#vehicle-image').attr('src', '/Resources/Images/cy-tnc.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Chrysler/Town++and++Country/All/All/List.aspx');
    });
    $('#dd-jeep').hover(function() {
        $('#vehicle-make').text('Jeep');
        showModels("#jeep-models");
        $('#vehicle-style').text('Compass');
        $('#vehicle-detail').text('The New 2011 Jeep Compass is beautifully redesigned, reflecting the updated signature Jeep styling cues of the award-winning Grand Cherokee.');
        $('#vehicle-image').attr('src', '/Resources/Images/j-compass.jpg');
        $('.drop-2 a').attr('href', '#');
    });
    $('#j-compass').hover(function() {
        $('#vehicle-style').text('Compass');
        $('#vehicle-detail').text("The New 2011 Jeep Compass is beautifully redesigned, reflecting the updated signature Jeep styling cues of the award-winning Grand Cherokee.");
        $('#vehicle-image').attr('src', '/Resources/Images/j-compass.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Jeep/Compass/All/All/List.aspx');
    });
    $('#j-cherokee').hover(function() {
        $('#vehicle-style').text('Grand Cherokee');
        $('#vehicle-detail').text("The sculpted muscular appearance of the All-New 2011 Jeep Grand Cherokee is a masterful meld of classic styling cues and modern design.");
        $('#vehicle-image').attr('src', '/Resources/Images/j-cherokee.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Jeep/Grand+Cherokee/All/All/List.aspx');
    });
    $('#j-liberty').hover(function() {
        $('#vehicle-style').text('Liberty');
        $('#vehicle-detail').text("Jeep Liberty continues the rugged, capable and fun tradition of the Jeep brand, but updates it with a sleek, contemporary interior.");
        $('#vehicle-image').attr('src', '/Resources/Images/j-liberty.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Jeep/Liberty/All/All/List.aspx');
    });
    $('#j-patriot').hover(function() {
        $('#vehicle-style').text('Patriot');
        $('#vehicle-detail').text("Patriot's already classic, rugged Jeep styling is enhanced for 2011 with an aggressive new exterior.");
        $('#vehicle-image').attr('src', '/Resources/Images/j-patriot.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Jeep/Patriot/All/All/List.aspx');
    });
    $('#j-wrangler').hover(function() {
        $('#vehicle-style').text('Wrangler');
        $('#vehicle-detail').text("The 2011 Jeep Wrangler 4X4 offers the ultimate in capability without compromise. Wrangler comes standard with an authentic Jeep style of life as well.");
        $('#vehicle-image').attr('src', '/Resources/Images/j-wrangler.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Jeep/Wrangler/All/All/List.aspx');
    });
    $('#j-wrangleru').hover(function() {
        $('#vehicle-style').text('Wrangler Unlimited');
        $('#vehicle-detail').text("We added serious refinement to the vehicle that has defined \"rugged\" for generations.  The Jeep Wrangler Unlimited has made a dramatic upshift with an All-New interior.");
        $('#vehicle-image').attr('src', '/Resources/Images/j-wrangleru.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Jeep/Wrangler+Unlimited/All/All/List.aspx');
    });
    $('#dd-dodge').hover(function() {
        $('#vehicle-make').text('Dodge');
        showModels("#dodge-models");
        $('#vehicle-style').text('Avenger');
        $('#vehicle-detail').text("Dodge engineers infused Avenger with a proud American attitude seen in the redesigned exterior and features. Get all the style, technology and versatility that you need.");
        $('#vehicle-image').attr('src', '/Resources/Images/d-avenger.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Dodge/Avenger/All/All/List.aspx');
    });
    $('#d-avenger').hover(function() {
        $('#vehicle-style').text('Avenger');
        $('#vehicle-detail').text("Dodge engineers infused Avenger with a proud American attitude seen in the redesigned exterior and features. Get all the style, technology and versatility that you need.");
        $('#vehicle-image').attr('src', '/Resources/Images/d-avenger.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Dodge/Avenger/All/All/List.aspx');
    });
    $('#d-caliber').hover(function() {
        $('#vehicle-style').text('Caliber');
        $('#vehicle-detail').text("Caliber is marked by its signature Dodge crosshair grille, wide fender flares, aggressive stance and large wraparound quad halogen headlamps.");
        $('#vehicle-image').attr('src', '/Resources/Images/d-caliber.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Dodge/Caliber/All/All/List.aspx');
    });
    $('#d-challenger').hover(function() {
        $('#vehicle-style').text('Challenger');
        $('#vehicle-detail').text("The bold exterior design of the Challenger calls back to its legendary flawlessly sculpted design with modern proportions and cutting-edge technology.");
        $('#vehicle-image').attr('src', '/Resources/Images/d-challenger.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Dodge/Challenger/All/All/List.aspx');
    });
    $('#d-charger').hover(function() {
        $('#vehicle-style').text('Charger');
        $('#vehicle-detail').text("Imposing and inviting at the same time, the design of Charger is unmistakable and unforgettable.");
        $('#vehicle-image').attr('src', '/Resources/Images/d-charger.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Dodge/Charger/All/All/List.aspx');
    });
    $('#d-durango').hover(function() {
        $('#vehicle-style').text('Durango');
        $('#vehicle-detail').text("Daring, inventive, agile and affordable, the future of American driving is boldly apparent in the Dodge Durango — designed to perform.");
        $('#vehicle-image').attr('src', '/Resources/Images/d-durango.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Dodge/Durango/All/All/List.aspx');
    });
    $('#d-caravan').hover(function() {
        $('#vehicle-style').text('Grand Caravan');
        $('#vehicle-detail').text("Attention to detail is visible in every facet of the new Grand Caravan, inside and out. This fifth-generation minivan is a study in sophisticated style.");
        $('#vehicle-image').attr('src', '/Resources/Images/d-caravan.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Dodge/Grand+Caravan/All/All/List.aspx');
    });
    $('#d-journey').hover(function() {
        $('#vehicle-style').text('Journey');
        $('#vehicle-detail').text("Dodge engineers infused Journey with a proud American attitude seen in the redesigned exterior. It gives you all the style, technology and versatility that you need without sacrificing its identity.");
        $('#vehicle-image').attr('src', '/Resources/Images/d-journey.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Dodge/Journey/All/All/List.aspx');
    });
    $('#d-nitro').hover(function() {
        $('#vehicle-style').text('Nitro');
        $('#vehicle-detail').text("Nitro stands out as unapologetically Dodge.  It transcends style with smart storage solutions, innovative technology, sporty performance and overall comfort.");
        $('#vehicle-image').attr('src', '/Resources/Images/d-nitro.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Dodge/Nitro/All/All/List.aspx');
    });
    $('#dd-ram').hover(function() {
        $('#vehicle-make').text('Ram');
        showModels("#ram-models");
        $('#vehicle-style').text('1500');
        $('#vehicle-detail').text("You know what to bring and Ram 1500 was built to pack it. This pickup is more than a bed and cab; it's your road office and home on the road.");
        $('#vehicle-image').attr('src', '/Resources/Images/r-1500.jpg');
        $('.drop-2 a').attr('href', '#');
    });
    $('#r-1500').hover(function() {
        $('#vehicle-style').text('1500');
        $('#vehicle-detail').text("You know what to bring and Ram 1500 was built to pack it. This pickup is more than a bed and cab; it's your road office and home on the road.");
        $('#vehicle-image').attr('src', '/Resources/Images/r-1500.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Ram/1500/All/All/List.aspx');
    });
    $('#r-2500').hover(function() {
        $('#vehicle-style').text('2500');
        $('#vehicle-detail').text("We're not messing around when it comes to heavy duty trucks.  And neither should you.  The 2500 is a powerful truck that gets the job done and beg for more.");
        $('#vehicle-image').attr('src', '/Resources/Images/r-2500.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Ram/2500/All/All/List.aspx');
    });
    $('#r-3500').hover(function() {
        $('#vehicle-style').text('3500');
        $('#vehicle-detail').text("This truck will drive where you need 'em to drive, tow what you want 'em to tow and haul what you need hauled.  Oh, and they'll look terrific doing it.");
        $('#vehicle-image').attr('src', '/Resources/Images/r-3500.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Ram/3500/All/All/List.aspx');
    });
    $('#r-dakota').hover(function() {
        $('#vehicle-style').text('Dakota');
        $('#vehicle-detail').text("Bring your toys wherever you want with best-in-class maximum towing capacity and a best-in-class payload rating.  For work or play, the Dakota will get the job done.");
        $('#vehicle-image').attr('src', '/Resources/Images/r-dakota.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Ram/Dakota/All/All/List.aspx');
    });
    $('#r-laramie').hover(function() {
        $('#vehicle-style').text('Laramie');
        $('#vehicle-detail').text("Since the Laramie Longhorn is available, any task is handled with ease. Ram truck's famous HEMI® V8 or Cummins® Turbo Diesel engines still lie at the heart of this truck.");
        $('#vehicle-image').attr('src', '/Resources/Images/r-laramie.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Ram/Laramie/All/All/List.aspx');
    });
    $('#r-outdoorsman').hover(function() {
        $('#vehicle-style').text('Outdoorsman');
        $('#vehicle-detail').text("You don't have to park it in the garage because this animal lives outdoors. Exterior upgrades, interior luxuries and standard towing features make this the perfect truck.");
        $('#vehicle-image').attr('src', '/Resources/Images/r-outdoorsman.jpg');
        $('.drop-2 a').attr('href', '/Vehicle-Search/New/All/Ram/Outdoorsman/All/All/List.aspx');
    });

});

function DropDownChanged() {
    $("#<%= ddlYear.ClientID %>").attr("disabled", "disabled");
    $("#<%= ddlMake.ClientID %>").attr("disabled", "disabled");
    $("#<%= ddlModel.ClientID %>").attr("disabled", "disabled");
    $("#<%= ddlTrim.ClientID %>").attr("disabled", "disabled");
    $("#<%= ddlColor.ClientID %>").attr("disabled", "disabled");
}
