 // Brows Inventory

 if ($('BrowseInventoryWidget')) {
  var bin,biu;
	bin=1;
	biu=1;
  
  $('browseInventoryNew').observe('click', function() {
   if (bin==1){
    trackWidget('12','browseNew');  
    bin=0;
    }
    return false;
   });
    $('browseInventoryUsed').observe('click', function() {
    if (biu==1){
		  trackWidget('12','browseUsed'); 
			biu=0;
    }
    return false;
   });
  }

//VVC
 if ($('vVehicleCenterWidget')) {
		var vvcg,vvcm,vvci,vvce;
		vvcg=1;
		vvcm=1;
		vvci=1;
		vvce=1;

    $('vvc_more').observe('click',function() {
 		 if (vvcm==1){
    	 trackWidget('16','MoreInfo'); 
 			 vvcm=0;
			}
			return false;
		});
	   $('vvc_exterior').observe('click',function() {
			if (vvce==1){
	     trackWidget('16','Exterior'); 
			vvce=0;
			}
			return false;
		});
	   $('vvc_interior').observe('click',function() {
			if (vvci==1){
	     trackWidget('16','interior'); 
			vvci=0;
			}
			return false;
		});
	   $('vvc_gallery').observe('click',function() {
			if (vvcg==1){
	     trackWidget('16','Gallery');
		 	vvcg=0;
			}
			return false;
		});
  }

// Quick Navigation
  if($('quicknavigation'))  {    
  $$('a[href^=/showroom]').each(function(element){
  Event.observe(element, 'click',function() {
	    trackWidget('15','showroom'); return false;
    });
   });
  $$('a[href^=/preapproved]').each(function(element){
  Event.observe(element, 'click',function() {
	    trackWidget('15','preapproved'); return false;
    });
   });
  $$('a[href^=/quote]').each(function(element){
  Event.observe(element, 'click',function() {
	    trackWidget('15','quote'); return false;
    });
   });
  $$('a[href^=/testdrive]').each(function(element){
  Event.observe(element, 'click',function() {
	    trackWidget('15','testdrive'); return false;
    });
   });
  $$('a[href^=/specials]').each(function(element){
  Event.observe(element, 'click',function() {
	    trackWidget('15','specials'); return false;
    });
   });
  $$('a[href^=/build]').each(function(element){
  Event.observe(element, 'click',function() {
	    trackWidget('15','build'); return false;
    });
   });
 }
//Special Scroller
  if($('scrollarea')) {
 	   $('scrollarea').observe('click',function() {
	   trackWidget('8',''); return false;
    });
	 }
//Special Ticker
  if($('specialTickerWidget')) {
 	   $('highlights').observe('click',function() {
	   trackWidget('25',''); return false;
    });
	 }

//VVC 3.0
 if ($('virtualVehicleCenter3Widget'))
 {

var vvc3Poi;

    $('vvc3_video').observe('click',function() {
 		 if (vvc3Poi==1){
    	 trackWidget('29','Video'); 
				trackMultiM('29','VVC3');
 			 vvc3Poi=0;
			}
			return false;
		});
	   $('vvc3_gallery').observe('click',function() {
			if (vvc3Poi==1){
	     trackWidget('29','Gallery'); 
			 trackMultiM('29','VVC3');
			vvc3Poi=0;
			}
			return false;
		});
	   $('vvc3_exterior').observe('click',function() {
			if (vvc3Poi==1){
	     trackWidget('29','Exterior'); 
			 trackMultiM('29','VVC3');
			vvc3Poi=0;
			}
			return false;
		});
	   $('vvc3_interior').observe('click',function() {
			if (vvc3Poi==1){
	     trackWidget('29','Interior');
			 trackMultiM('29','VVC3');
		 	vvc3Poi=0;
			}
			return false;
		});
	   $('vvc3_color').observe('click',function() {
			if (vvc3Poi==1){
	     trackWidget('29','VehicleColor');
			 trackMultiM('29','VVC3');
		 	vvc3Poi=0;
			}
			return false;
		});

	   $('vvc3_more').observe('click',function() {
			if (vvc3Poi==1){
	     trackWidget('29','MoreInfo');
			 trackMultiM('29','VVC3');
		 	vvc3Poi=0;
			}
			return false;
		});
	   $('infoBar').observe('click',function() {
			if (vvc3Poi==1){
	     trackWidget('29','MoreInfoBar');
       trackMultiM('29','VVC3');
		 	vvc3Poi=0;
			}
			return false;
		});

 }

//______________________________________________________________________________________

// Special Page  

function trackSpecial(specialId,info) {
  var url;
  url='/poi-ajax.aspx?fa=poi_special&sid=' + specialId+ '&inf=' + info;
  new Ajax.Request(url, { method:'post' });
	return true;
  }

//_____________________________________________________________________________________

  //Home Widgets, Widget Name

function trackWidget(wName,info) {
  var url;
  url='/poi-ajax.aspx?fa=poi_widget&wid=' + wName + '&inf=' + info;
  new Ajax.Request(url, { method:'post' });
	return true;
   }


//______________________________________________________________________________________

// Brochur & Service

function trackPrinter(id,info) {
  var url;
  url='/poi-ajax.aspx?fa=poi_print&id=' + id+ '&inf=' + info;
  new Ajax.Request(url, { method:'post' });
	return true;
  }


//______________________________________________________________________________________

// Multimedia 

function trackMultiM(id,info) {
  var url;
  url='/poi-ajax.aspx?fa=poi_multi&id=' + id + '&inf=' + info;
  new Ajax.Request(url, { method:'post' });
	return true;
 }



//______________________________________________________________________________________

// congif (Build your Car)

function trackConfig(pName,clientId,leadId) {
  var url;
  url= '/poi-ajax.aspx?fa=poi_config&pn=' + pName + '&cid=' + clientId + '&lid=' + leadId;
  new Ajax.Request(url, { method:'post' });
	return true;
 }


//______________________________________________________________________________________

// Leads

function trackLead(src,type) {
  var url;
  url='/poi-ajax.aspx?fa=poi_lead&src=' + src + '&t=' + type;
  new Ajax.Request(url, { method:'post' });
	return true;
 }

//______________________________________________________________________________________

// Video widget

function poiTrackVideo(vtype) {
  var url;
  url= '/poi-ajax.aspx?fa=poi_video&type=' + vtype;
  new Ajax.Request(url, { method:'post' });
	return true;
 }

//______________________________________________________________________________________

// Vehicle

function poiTrackVehicle(vid,vtype,data1,data2) {
  var url;

  url= '/poi-ajax.aspx?fa=poi_vehicle&vtype=' + vtype + '&vid=' + vid + '&d1=' + data1 + '&d2=' +data2;
  new Ajax.Request(url, { method:'post' });
	return true;
 }

//______________________________________________________________________________________

// PAGE_VIEWED

function poiTrackPageViewed(ptype) {
  var url;

  url= '/poi-ajax.aspx?fa=poi_pviewed&type=' + ptype ;
  new Ajax.Request(url, { method:'post' });
	return true;
 }



