//////////////////////////////////////
// lets google know when the cust.  //
// is clicking on one of the print  //
// links for coupons and rebates    //
//////////////////////////////////////
// updated 6 May, 08                //
// original script did not allow for//
// gasc site and second tracker was //
// not reporting in the format set  //
// up in google analytics           //
//////////////////////////////////////
function notifyGoogle(myVar) {
	var region = getRegion();
	//if(region == 'gasc') {
	//	if(myVar == 'coupon') {
	//		pageTracker._trackPageview('/gasc/couponRebate/printCoupon.html');
	//	}
	//	if(myVar == 'rebate') {
	//		pageTracker._trackPageview('/gasc/couponRebate/printRebate.html');
	//	}
	//	return false;
	//}
	if(myVar == 'coupon') {
		firstTracker._trackPageview('/couponRebate/' + region + '/printCoupon.html'); // lets the regional tracker know the link is clicked
		secondTracker._trackPageview('/' + region + '/couponRebate/printCoupon.html'); // don't need to include region as this info goes to the individual account
		return false;
	}
	if(myVar == 'rebate') {
		firstTracker._trackPageview('/couponRebate/' + region + '/printRebate.html'); // lets the regional tracker know the link is clicked
		secondTracker._trackPageview('/' + region + '/couponRebate/printRebate.html'); // don't need to include region as this info goes to the individual account
	return false;
	}
	else {
		secondTracker._trackPageview(myVar);
		return false;
	}
}
//////////////////////////////////////
// divides url into an array using  //
// the slash for the divider        //
// first element is http:           //
// second element is null space     //
// between slashes, third element   //
// is www.goodyeardealers.com       //
// fourth element is the region     //
//////////////////////////////////////
// UPDATE: converts region to all   //
// lowercase. Benefits to Google    //
// Analytics reporting and use in   //
// notifyGoogleAdwords function     //
//////////////////////////////////////
function getRegion() {
	var thisUrl = "" + window.location;
	var urlArray = thisUrl.split('/');
	var region = urlArray[3];
	return region.toLowerCase();
}
//////////////////////////////////////
// List of Google Adwords conv      //
// codes by site                    //
//////////////////////////////////////
var gadsitecode = new Array();
gadsitecode["socal"] 		= "http://www.googleadservices.com/pagead/conversion/1064483025/?value=1.0&amp;label=olaICJXGgwEQ0fHK-wM&amp;guid=ON&amp;script=0";
gadsitecode["sandiego"] 	= "http://www.googleadservices.com/pagead/conversion/1056350245/?value=1.0&amp;label=WzCzCOOWggEQpcDa9wM&amp;guid=ON&amp;script=0";
gadsitecode["sacramento"] 	= "http://www.googleadservices.com/pagead/conversion/1056135508/?value=1.0&amp;label=V3BTCPamggEQ1LLN9wM&amp;guid=ON&amp;script=0";
gadsitecode["seattle"] 		= "http://www.googleadservices.com/pagead/conversion/1056350605/?value=1.0&amp;label=fVE6CMuUehCNw9r3Aw&amp;guid=ON&amp;script=0";
gadsitecode["bayarea"] 		= "http://www.googleadservices.com/pagead/conversion/1064482905/?value=1.0&amp;label=29cFCO3TjwEQ2fDK-wM&amp;guid=ON&amp;script=0";


//////////////////////////////////////
// notifies Google Adwords of a     //
// conversion by adding the noscript//
// image from Google Adwords        //
// conversion code to the bottom of //
// the page                         //
//////////////////////////////////////
function notifyGoogleAdwords() {
	if(!$('googleAdwordsImage')) {
		$('googleAdwordsDiv').update("<img src='" + gadsitecode[getRegion()] + "' id='googleAdwordsImage' />");
	}
}