$(document).ready(function() {
	$ = jQuery;
	$("a").click(function() { 
		var href = $(this).attr("href");
		if (href.indexOf("http") === 0 && 
			href.indexOf("http://palmspringsusa.com") === -1 && 
			href.indexOf("http://www.palmspringsusa.com") === -1) {
			_gaq.push(['_trackEvent', 'External Link (Unclassified)', 'External Link', href]);
		}
	});
});

function trackListing(url) {
	_gaq.push(['_trackEvent', 'External Link (Listing)', 'External Link', url]);
}

function trackFormStart(id) {
	_gaq.push(['_trackEvent', 'Forms', 'Form Start', id.toString()]);
}

function trackFormComplete(id) {
	_gaq.push(['_trackEvent', 'Forms', 'Form Complete', id.toString()]);
}

$(document).ready(function() {
	$('form[name="hotForm"]').submit(function() {
		_gaq.push(['_trackEvent', 'Booking Widget', 'Search', 'Hotel Reservations']);
	});
	
	$('form[name="myForm"]').submit(function() {
		_gaq.push(['_trackEvent', 'Booking Widget', 'Search', 'Hotel Reservations']);
	});
	
	$('form[name="airForm"]').submit(function() {
		_gaq.push(['_trackEvent', 'Booking Widget', 'Search', 'Book Flights']);
	});
	
	$('form[name="carForm"]').submit(function() {
		_gaq.push(['_trackEvent', 'Booking Widget', 'Search', 'Rental Cars']);
	});
	
	$('form[name="OT-form"]').submit(function() {
		_gaq.push(['_trackEvent', 'Booking Widget', 'Search', 'Restaurant Reservations']);
	});
	
	$('form[name="hotelForm"]').submit(function() {
		_gaq.push(['_trackEvent', 'Interior Booking Widget', 'Search', 'Hotel Reservations']);
	});
});


