$.noConflict();  jQuery(document).ready(function($) {  $('#news').innerfade({ animationtype: 'slide', speed: 750, timeout: 7000, type: 'random', containerheight: '1em' });/* 	$('#banners').innerfade({ animationtype: 'fade', speed: 750, timeout: 5500, type: 'random', containerheight: '229px' }); */	$('#sidebar h3').click(function(){ 		if ( $(this).is(":visible") ) { 			$(this).next().hide();		} $(this).next().show(); 	});		var customOptionsArray = [		"20hp Codes Tow - recommended for towing 15K or higher at sea level and altitude - no 1211, 1249, 0478 +$50.00",		"40hp Codes Tow - recommended for towing 13K to 15K at sea level and altitude - no 1211, 1249, 0478 +$50.00",		"60hp Codes Tow - recommended for towing 9K to 13K at sea level and altitude - no 1211, 1249, 0478 +$50.00",		"80hp Codes Tow - recommended for towing 5K to 9K at sea level and altitude - no 1211, 1249, 0478 +$50.00",		"60hp Codes Econo - Daily driving for mileage - no 1211, 1249, 0478 +$50.00",		"60hp Codes Econo Mountains - Daily driving for mileage - no 1211, 1249, 0478 +$50.00",		"80hp Codes Econo - Daily driving for mileage - no 1211, 1249, 0478 +$50.00",		"80hp Codes Econo Mountains - Daily driving for mileage - no 1211, 1249, 0478 +$50.00",		"100hp Codes Performance - no 1211, 1249, 0478 +$50.00",		"120hp Codes Race - no 1211, 1249, 0478 +$50.00",		"140hp Codes Extreme - no 1211, 1249, 0478 +$50.00",		"140hp Codes Aggressive - no 1211, 1249, 0478 +$50.00",		"20hp Codes Tow - recommended for towing 15K or higher at sea level and altitude - no 1211, 1249, 0478 +$75.00",		"40hp Codes Tow - recommended for towing 13K to 15K at sea level and altitude - no 1211, 1249, 0478 +$75.00",		"60hp Codes Tow - recommended for towing 9K to 13K at sea level and altitude - no 1211, 1249, 0478 +$75.00",		"80hp Codes Tow - recommended for towing 5K to 9K at sea level and altitude - no 1211, 1249, 0478 +$75.00",		"60hp Codes Econo - Daily driving for mileage - no 1211, 1249, 0478 +$75.00",		"60hp Codes Econo Mountains - Daily driving for mileage - no 1211, 1249, 0478 +$75.00",		"80hp Codes Econo - Daily driving for mileage - no 1211, 1249, 0478 +$75.00",		"80hp Codes Econo Mountains - Daily driving for mileage - no 1211, 1249, 0478 +$75.00",		"100hp Codes Performance - no 1211, 1249, 0478 +$75.00",		"120hp Codes Race - no 1211, 1249, 0478 +$75.00",		"140hp Codes Extreme - no 1211, 1249, 0478 +$75.00",		"140hp Codes Aggressive - no 1211, 1249, 0478 +$75.00",		"Decel - use of  EBV for an Exhaust brake +$45.00",		"Lope Idle +$45.00",		"Drive-thru - for a good quiet idle - especially single shots +$45.00",		"Low Fuel - very little smoke - modified injectors +$45.00",		"Low Fuel - very little smoke - modified injectors +$75.00",		"Custom Dyno +$80.00",		"Custom Truck Pull +$80.00",		"Custom Drag Race +$80.00",		"Stock +$45.00",		"Modified Stock - for Big Oil, Injectors, and Transmission upgrades +$75.00",		"20hp Codes Tow - recommended for towing 15K or higher at sea level and altitude - no 1211, 1249, 0478 +$80.00",		"40hp Codes Tow - recommended for towing 13K to 15K at sea level and altitude - no 1211, 1249, 0478 +$80.00",		"60hp Codes Tow - recommended for towing 9K to 13K at sea level and altitude - no 1211, 1249, 0478 +$80.00",		"80hp Codes Tow - recommended for towing 5K to 9K at sea level and altitude - no 1211, 1249, 0478 +$80.00",		"60hp Codes Econo - Daily driving for mileage - no 1211, 1249, 0478 +$80.00",		"60hp Codes Econo Mountains - Daily driving for mileage - no 1211, 1249, 0478 +$80.00",		"80hp Codes Econo - Daily driving for mileage - no 1211, 1249, 0478 +$80.00",		"80hp Codes Econo Mountains - Daily driving for mileage - no 1211, 1249, 0478 +$80.00",		"100hp Codes Performance - no 1211, 1249, 0478 +$80.00",		"120hp Codes Race - no 1211, 1249, 0478 +$80.00",		"140hp Codes Extreme - no 1211, 1249, 0478 +$80.00",		"140hp Codes Aggressive - no 1211, 1249, 0478 +$80.00",	];		$optionsList = $('.options-list');	$optionsList.parent().prev().hide();	$optionsList.parent().hide();	$('select.product-custom-option').change(function(){		selected = $(this).children(":selected").text();		$selParent = $(this).parent();		$customTuneInput = $selParent.next().next().find('input:checkbox');		if ($.inArray(selected, customOptionsArray) > -1)		{			$selParent.next().slideDown();			$selParent.next().next().slideDown();		}		else		{			if ($customTuneInput.is(":checkbox"))			{				if ($customTuneInput.is(":checked"))					$customTuneInput.click().change();				$selParent.next().slideUp();				$selParent.next().next().slideUp();				opConfig.reloadPrice();			}		}	});			$('ul.options-list').each(function(){		$(this).find('input:checkbox.product-custom-option:last').click(function(){			var sibCount = $(this).parent().siblings().size();			if (sibCount == 0 || sibCount == 1)			{				$withLabel = $(this).parent().parent().parent().next();				$withGroup = $(this).parent().parent().parent().next().next();				if ($withLabel.is(":visible") && $withGroup.is(":visible"))				{					$withGroup.find('input:checkbox:checked').each(function(){						$(this).click();					});					$withLabel.slideUp();					$withGroup.slideUp();				}				else				{					$withLabel.slideDown();					$withGroup.slideDown();				}			}		});	});			var $vehicleId = $('label:contains("vehicle_id")');	$vehicleId.parent().hide();	$vehicleId.parent().next().hide();		$('#vehicle_select').change(function(){		val = $(this).children(":selected").val();		$vehicleId.parent().next().children(0).val(val);	});		var switchesArray = [		"empty",		"EX Switcher Green +$40.00",		"EX Switcher Blue +$40.00",		"EX Switcher Red +$40.00",		"Gauge Switch Green Silver Bezel Black Face +$85.00",		"Gauge Switch Blue Silver Bezel Black Face +$85.00",		"Gauge Switch Red Silver Bezel Black Face +$85.00",		"Gauge Switch Green Black Bezel Black Face +$95.00",		"Gauge Switch Blue Black Bezel Black Face +$95.00",		"Gauge Switch Red Black Bezel Black Face +$95.00",		"Gauge Switch Green Silver Bezel White Face +$85.00",		"Gauge Switch Blue Silver Bezel White Face +$85.00",		"Gauge Switch Red Silver Bezel White Face +$85.00",		"Gauge Switch Green Black Bezel White Face +$95.00",		"Gauge Switch Blue Black Bezel White Face +$95.00",		"Gauge Switch Red Black Bezel White Face +$95.00",		"Gauge Switch Green Silver Bezel Silver Face +$85.00",		"Gauge Switch Blue Silver Bezel Silver Face +$85.00",		"Gauge Switch Red Silver Bezel Silver Face +$85.00",		"Gauge Switch Green Black Bezel Silver Face +$95.00",		"Gauge Switch Blue Black Bezel Silver Face +$95.00",		"Gauge Switch Red Black Bezel Silver Face +$95.00"	];	var switchesImages = [		"empty",		"dp-ex2g.jpg",		"dp-ex2b.jpg",		"dp-ex2r.jpg",		"dp-gx2g-sb-bf.jpg",		"dp-gx2b-sb-bf.jpg",		"dp-gx2r-sb-bf.jpg",		"dp-gx2g-bb-bf.jpg",		"dp-gx2b-bb-bf.jpg",		"dp-gx2r-bb-bf.jpg",		"dp-gx2g-sb-wf.jpg",		"dp-gx2b-sb-wf.jpg",		"dp-gx2r-sb-wf.jpg",		"dp-gx2g-bb-wf.jpg",		"dp-gx2b-bb-wf.jpg",		"dp-gx2r-bb-wf.jpg",		"dp-gx2b-bb-sf.jpg",		"dp-gx2g-bb-sf.jpg",		"dp-gx2r-bb-sf.jpg",		"dp-gx2b-sb-sf.jpg",		"dp-gx2r-sb-sf.jpg",		"dp-gx2g-sb-sf.jpg"	];	var mountArray = [		"empty",		"EX Switcher Mount Option +$14.95",		"JMS EX Switcher In-Dash Mount Option +$23.95"	];	var mountImages = [		"empty",		"dp-f5-sw-mount.jpg",		"jms-ex-switcher-in--dash-mount.jpg"	];	function inImageSwitcher(label, list, images)	{		$label = $('label:contains("'+label+'")');		$select = $label.parent().next().children(0);		$select.change(function(){			selector = $(this);			selected = selector.children(":selected").text();			index = $.inArray(selected, list);			if (index > -1)			{				image = images[index];				dir1 = image.substr(0, 1);				dir2 = image.substr(1, 1);				imageid = image.substr(0, image.length-4);				cachedImage = $('#'+imageid);				if (cachedImage.length > 0)				{					selector.siblings(":visible").fadeOut();					cachedImage.delay(400).fadeIn();				}				else				{					if (selector.siblings().length > 0)					{						selector.siblings(":visible").fadeOut();						selector.after("<img src='/media/catalog/product/"+dir1+"/"+dir2+"/"+image+"' id='"+imageid+"' width='100px' />");						$('#'+imageid).hide().delay(400).fadeIn();					}					else					{						selector.after("<img src='/media/catalog/product/"+dir1+"/"+dir2+"/"+image+"' id='"+imageid+"' width='100px' />");						$('#'+imageid).hide().fadeIn();					}				}			}			else				selector.siblings().fadeOut();		});		}		inImageSwitcher("Multi-Position Switch", switchesArray, switchesImages);	inImageSwitcher("EX Remote Switcher Mount", mountArray, mountImages);	//To kill the Remote if Gauge is selected	$select = $('label:contains("Multi-Position Switch")').parent().next().children(0);	$select.change(function(){		selected = $(this).children(":selected").text();		$remote = $(this).parent().next().next().children(0);		if (selected.substr(0, 5) == "Gauge")		{			$remote.children(0).attr('selected', 'selected');			$remote.attr('disabled', 'disabled');			$remote.next().fadeOut();		}		else		{			$remote.attr('disabled', false);		}	});		var max = 255;	$('h2.product-name + p').each(function(){		$link = $(this).find('a');		$link.remove();		$p = $(this);		text = $p.text();		if (text.length > max)		{			text = text.substr(0, max);			text = text.replace(/\w+$/, '');			text += '...';		}		$p.html(text+"<br />");		$p.append($link);	})});
