   $(document).ready(function() {
							  
		 // Use the each() method to gain access to each elements attributes
		   $('#changeVehicle a[rel]').each(function()
		   {
			  $(this).qtip(
			  {
				 content: {
					// Set the text to an image HTML string with the correct src URL to the loading image you want to use
					text: '<img class="throbber" src="http://www.slickcar.com/images/throbber.gif" alt="Loading..." />',
					url: $(this).attr('rel'), // Use the rel attribute of each element for the url to load
					title: {
					   text: 'Change Your Vehicle', // Give the tooltip a title using each elements text
					   button: 'Close' // Show a close link in the title
					}
				 },
				 position: {
					corner: {
					   target: 'bottomMiddle', // Position the tooltip above the link
					   tooltip: 'topMiddle'
					},
					adjust: {
					   screen: true, // Keep the tooltip on-screen at all times
					    x: 380, 
						y: -30 // Keep the tooltip on-screen at all times
					}
				 },
				 show: { 
					when: 'click', 
					solo: true // Only show one tooltip at a time
				 },
				 hide: 'unfocus',
				 style: {
					tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
					border: {
					   width: 0,
					   radius: 4
					},
					name: 'light', // Use the default light style
					width: 650 // Set the tooltip width
				 }
			  })
		   });
	
      }); 

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function formButtonFever(formName,action){
	var myString = "document."+formName+"."+action+"();";
	eval(myString);
	}

function toggleLayer( whichLayer )

{

var elem, vis;

if( document.getElementById ) // this is the way the standards work

	elem = document.getElementById( whichLayer );
	
	else if( document.all ) // this is the way old msie versions work
	
	elem = document.all[whichLayer];
	
	else if( document.layers ) // this is the way nn4 works
	
	elem = document.layers[whichLayer];
	
	vis = elem.style;
	
	// if the style.display value is blank we try to figure it out here
	
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	
	vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	
	vis.display = (vis.display==''||vis.display=='block')?'none':'block';
	
}

function removeTerm() {
	if (document.getElementById('Search').value == "Search...") { 
		document.getElementById('Search').value = '';
		document.getElementById('Search').style.color = "#000000";
	}
}

function addTerm() {
	if (document.getElementById('Search').value == "" || document.getElementById('Search').value == null) { 
		document.getElementById('Search').value = 'Search...';
		document.getElementById('Search').style.color = "#CCCCCC";
	}
}
function submitSearch()
{
    document.forms["SearchForm"].submit();
}

function comparePID(valuea) {
document.getElementById('compareHidden').value= document.getElementById('compareHidden').value + "," + valuea;
}

function compareGO() {
	var comparePID = document.getElementById('compareHidden').value;
	comparePID = comparePID.replace(/,/,"");
	var checkSize = comparePID.split(",");
	var checkSizeLength = checkSize.length;
	if (checkSizeLength > 1) {
		 var compareURL = "http://www.slickcar.com/compare-12v-specific.asp?pid=" + comparePID;
		 var width  = 980;
		 var height = 630;
		 var left   = (screen.width  - width)/2;
		 var top    = (screen.height - height)/2;
		 var params = 'width='+width+', height='+height;
		 params += ', top='+top+', left='+left;
		 params += ', directories=no';
		 params += ', location=no';
		 params += ', menubar=no';
		 params += ', resizable=yes';
		 params += ', scrollbars=yes';
		 params += ', status=no';
		 params += ', toolbar=no';
		 newwin=window.open(compareURL,'compareSpecific', params);
		 	if (window.focus) {newwin.focus()}
		 return false;
	}else{
		alert("Please select atleast 2 products to compare.");
		return false;
	}
}
