$(document).ready(function () {
	$("div#auxiliaryNavigation").minWidth();

	if (jQuery("input[type=radio][value=hummer]").length > 0) {
		jQuery("input[type=radio][value=hummer]").parent().find("span:eq(0)").click(); // This should autoselect Hummer Services under Locate a Dealer
	}

	$("#hummer_vehicles .calltoaction_1 .actionContainer a, #hummer_vehicles .calltoaction_2 .actionContainer a").html("<img src='/etc/designs/hummer/images/explore_new_gm_vehicles_standard.png' alt='Explore New GM Vehicles'><img src='/etc/designs/hummer/images/explore_new_gm_vehicles_rollover.png' alt='Explore New GM Vehicles'>").live("mouseover mouseout", function (e) {
		if (e.type == "mouseover") $(this).find("img:eq(1)").show().end().find("img:eq(0)").hide();
		else $(this).find("img:eq(1)").hide().end().find("img:eq(0)").show();
	}).find("img+img").hide();

	$("#hummer_vehicles .calltoaction_0 .actionContainer a, #hummer_vehicles .calltoaction .actionContainer a").html("<img src='/etc/designs/hummer/images/see_similar_gm_vehicles_standard.png' alt='See Similar GM Vehicles'><img src='/etc/designs/hummer/images/see_similar_gm_vehicles_rollover.png' alt='See Similar GM Vehicles'>").live("mouseover mouseout", function (e) {
		if (e.type == "mouseover") $(this).find("img:eq(1)").show().end().find("img:eq(0)").hide();
		else $(this).find("img:eq(1)").hide().end().find("img:eq(0)").show();
	}).find("img+img").hide();

	$("#owner_resources a[class^=miniShadedLink][href^=http]").append(" <img src='/etc/designs/saturn/images/saturn_external_red.png'>");
	$("#owner_resources a[class^=miniShadedLink]").filter(":not([href^=http])").append(" <img src='/etc/designs/saturn/images/red_arrow.png'>");
	
	/*** Top Nav Dropdown icons ****/
	
	$("div#primaryNavigation ul li ul li:last-child").addClass("lastChild");
	
	$("div#primaryNavigation ul li ul a[href$=browse_all_brands.html]").append("<img src='/etc/designs/saturn/images/saturn_external_white.png'><img src='/etc/designs/saturn/images/saturn_external_red.png'>");
	$("div#primaryNavigation ul li ul a[href$=current_offers.html]").append("<img src='/etc/designs/saturn/images/saturn_external_white.png'><img src='/etc/designs/saturn/images/saturn_external_red.png'>");
	$("div#primaryNavigation ul li ul a[href$=owner_center.html]").append("<img src='/etc/designs/saturn/images/saturn_external_white.png'><img src='/etc/designs/saturn/images/saturn_external_red.png'>");
	
	
	
	
	$("div#primaryNavigation ul li ul a[href$=owner_center.html],div#primaryNavigation ul li ul a[href$=browse_all_brands.html], div#primaryNavigation ul li ul a[href$=current_offers.html]").hover(function () {
		$(this).find("img:eq(2)").show();
		$(this).find("img:eq(1)").hide();
	}, function () {
		$(this).find("img:eq(2)").hide();
		$(this).find("img:eq(1)").show();
	});
	
	$("div#primaryNavigation ul li ul a img + img").hide();
	
	
	/************************/
	if ($("#accessories").length > 0) {
		$("#accessories .button:eq(4)").html("<img src='/etc/designs/saturn/images/personalize_your_vehicle_standard.png'><img src='/etc/designs/saturn/images/personalize_your_vehicle_rollover.png'>");
		$("#accessories .button:eq(3)").html("<img src='/etc/designs/saturn/images/find_gm_performance_standard.png'><img src='/etc/designs/saturn/images/find_gm_performance_rollover.png'>");
		$("#accessories .button:eq(2)").html("<img src='/etc/designs/saturn/images/visit_acdelco_techconnect_standard.png'><img src='/etc/designs/saturn/images/visit_acdelco_techconnect_rollover.png'>");
		$("#accessories .button:eq(1)").html("<img src='/etc/designs/saturn/images/go_to_acdelco_standard.png'><img src='/etc/designs/saturn/images/go_to_acdelco_rollover.png'>");
		$("#accessories .button:eq(0)").html("<img src='/etc/designs/saturn/images/get_genuine_gm_parts_standard.png'><img src='/etc/designs/saturn/images/get_genuine_gm_parts_rollover.png'>");
	}

	$("#on_star .button:eq(0)").html("<img src='/etc/designs/saturn/images/visit_onstar_standard.png'><img src='/etc/designs/saturn/images/visit_onstar_rollover.png'>");

	$("#warranty .button").html('<img src="/etc/designs/saturn/images/learn_more_standard.png"><img src="/etc/designs/saturn/images/learn_more_rollover.png">');

	$("#manuals .button").html('<img src="/etc/designs/saturn/images/manual_view_the_manual_cta_standard.png"><img src="/etc/designs/saturn/images/manual_view_the_manual_cta_rollover.png">');
	
	$("#manuals .button img+img, #on_star .button img+img, #accessories .button img+img, #warranty .button img+img").hide();

	$(".socialIconsList img[src*=facebook]").after("<img src='/etc/designs/hummer/images/facebookHover.png'>").siblings("img").hide();

	$("#manuals .button,.socialIconsList li a, #on_star .button, .manual_select-container a, #accessories .button, #warranty .button").hover(function () {
		$(this).find("img:eq(1)").show();
		$(this).find("img:eq(0)").hide();
	}, function () {
		$(this).find("img:eq(1)").hide();
		$(this).find("img:eq(0)").show();
	});

	$("#primaryNavigation .arrow").html("");

	if ( $("body#dealer_locator").get(0) != undefined ) { 
		$("body").append("<script src='http://www.gm.com/bypass/dealerlocator/js/dealer_search_package.min.js'>");
		applyGrid9("opacity70");
		$(window).load( function() { $("#dealerSearchForm_chosenBrandsaturn+span").click(); });
		$( '#loading_progress img' ).attr( 'src', '/etc/designs/saturn/images/loadingResults.gif' );
	}

	/**** Dealer Locater Correction ****/
	if( $( '.dealerSearchGeneral' ).length > 0 ){
		$( '.dealerSearchGeneral .upperMid' ).append( '<div class="line top"></div><div class="line top"></div>' );
		$( '.dealerSearchGeneral .lowerMid' ).append( '<div class="line bottom"></div><div class="line bottom"></div>' );
		$( '.dealerSearchGeneral .midLeft' ).append( '<div class="line left"></div>' );
		$( '.dealerSearchGeneral .midRight' ).append( '<div class="line right"></div>' );
	}
});

