/*
360 module
*/
var isIEBrowser = false;
(function() {
	// data for the trims for 360
	var trimMap = {
		'camry_l': {
			'modelName': 'Camry L',
			'msrp': "$21,955",
			'asShown': "",
			'lessStory' : "",
			'caption': 'Legendary Toyota Camry efficiency, reliability and power. Still standard.',
			'features': [
				'Standard ten airbags <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/airbag.html\');">[2]</a>',
				'Standard 60/40 split fold-down rear seat',
				'Standard USB <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/usb.html\');">[3]</a> port with iPod<sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/ipod.html\');">[4]</a> connectivity',
				'Standard BLU Logic<sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/blu_logic.html\');">[5]</a> Hands Free System'
			]
		},
		'camry_le': {
			'modelName': 'Camry LE',
			'msrp': "$22,500",
			'asShown': "",
			'lessStory' : "$200 less than the 2011 model.",
			'caption': 'It\'s been the best-selling car in America for 14 of the last 15 years. <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/camry_brand_12.html\');">[2]</a> Now, the 2012 Camry is even better.',
			'features': [
				'Available power tilt/slide moonroof',
				'Standard Display Audio with 6.1-inch touch-screen with <em>Bluetooth</em><sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/bluetooth.html\');">[3]</a> wireless technology',
				'Standard remote keyless entry system',
				'Standard steering wheel-mounted audio controls',
				'Standard ten airbags'
			]
		},
		'camry_se': {
			'modelName': 'Camry SE',
			'msrp': "$23,000",
			'asShown': "$26,640",
			'lessStory' : "$965 less than the 2011 Toyota Camry model.",
			'caption': 'The perfect combo of agility and power.',
			'features': [
				'Standard projector-beam halogen headlamps with black sport trim bezels',
				'Standard color-keyed rear spoiler',
				'Standard integrated fog lamps',
				'Standard leather-trimmed tilt/telescopic sport steering wheel with paddle shifters',
				'Available 18-in. alloy wheels',
				'Available Display Audio with Navigation <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/navigation.html\');">[2]</a> and Entune&trade; <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/entune_launch.html\');">[3]</a>'
			]
		},
		'camry_xle': {
			'modelName': 'Camry XLE',
			'msrp': "$24,725",
			'asShown': "$29,845",
			'lessStory' : "$2000 less than the 2011 Toyota Camry model.",
			'caption': 'An option for some drivers is a necessity for others.',
			'features': [
				'Standard integrated fog lamps',
				'Standard power tile/slide moonroof',
				'Standard dual zone automatic climate control',
				'Standard <em>Bluetooth</em><sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/bluetooth.html\');">[2]</a> wireless technology',
				'Standard 8-way power-adjustable driver\'s seat with power lumbar support',
				'Available Blind Spot Monitor (BSM) <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/bsm.html\');">[3]</a>'
			]
		},
		'hybrid_le': {
			'modelName': 'Camry Hybrid LE',
			'msrp': "$25,900",
			'asShown': "",
			'lessStory' : "$1150 less than the 2011 Toyota Camry model.",
			'caption': 'GAS-P! Get ready for a 43 mpg rating <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/epa_2012_camry_hybrid_le.html\');">[2]</a> and up to 600 miles <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/camry_hybrid_range.html\');">[3]</a> between fill-ups.',
			'features': [
				'Standard acoustic noise-reducing front windshield',
				'Standard dual zone automatic climate control',
				'Standard BLU Logic<sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/blu_logic.html\');">[4]</a> Hands Free System',
				'Standard Optitron instrumentation',
				'Standard metallic-tech-grain interior trim with chrome interior door handles'
			]
		},
		'hybrid_xle': {
			'modelName': 'Camry Hybrid XLE',
			'msrp': "$27,400",
			'asShown': "",
			'lessStory' : "",
			'caption': 'Impressive fuel economy is just the beginning.',
			'features': [
				'Standard integrated fog lamps',
				'Standard 17-in. alloy wheels',
				'Available Display Audio with Navigation <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/navigation.html\');">[2]</a> and Entune&trade; <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/entune_launch.html\');">[3]</a>',
				'Available backup camera',
				'Available leather-trimmed Ultrasuede<sup>&reg;</sup> multi-stage heated front seats',
				'Available Safety Connect<sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/disclaimers/safety_connect_1year.html\');">[4]</a>'
			]
		}
	
	};
	
	var trimMapEsp = {
		'camry_l': {
			'modelName': 'Camry L',
			'msrp': "$21,955",
			'asShown': "",
			'lessStory' : "",
			'caption': 'La legendaria eficiencia, confiabilidad y potencia del Camry todav&iacute;a sigue vigente. Y viene est&aacute;ndar.',
			'features': [
				'Diez bolsas de aire est&aacute;ndar <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/airbag.html\');">[1]</a>',
				'Asiento trasero plegable y dividido 60/40 est&aacute;ndar',
				'Puerto USB <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/usb.html\');">[2]</a> con conexi&oacute;n para iPod<sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/ipod.html\');">[3]</a> est&aacute;ndar',
				'Sistema manos libres BLU Logic<sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/blu_logic.html\');">[4]</a> est&aacute;ndar'
			]
		},
		'camry_le': {
			'modelName': 'Camry LE',
			'msrp': "$22,500",
			'asShown': "",
			'lessStory' : "$200 menos que el modelo 2011.",
			'caption': 'De los &uacute;ltimos 14 a&ntilde;os, ha sido el auto m&aacute;s popular del pa&iacute;s por 13 a&ntilde;os. <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/camry_brand_11.html\');">[5]</a> Ahora es mejor todav&iacute;a.',
			'features': [
				'Techo el&eacute;ctrico corredizo/inclinable disponible',
				'Pantalla t&aacute;ctil de 6.1 plg con audio y tecnolog&iacute;a inal&aacute;mbrica <em>Bluetooth</em><sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/bluetooth.html\');">[6]</a> est&aacute;ndar',
				'Sistema remoto de entrada sin llaves est&aacute;ndar',
				'Controles de audio montados en el volante est&aacute;ndar',
				'Diez bolsas de aire est&aacute;ndar'
			]
		},
		'camry_se': {
			'modelName': 'Camry SE',
			'msrp': "$23,000",
			'asShown': "$26,640",
			'lessStory' : "$965 menos que el modelo 2011.",
			'caption': 'Agilidad y potencia, la combinaci&oacute;n perfecta. Solamente a&ntilde;ade la pista.',
			'features': [
				'Faros proyectores de hal&oacute;geno con biseles negros, detalles deportivos y encendido/apagado autom&aacute;tico est&aacute;ndar',
				'Aler&oacute;n trasero del color del veh&iacute;culo est&aacute;ndar',
				'Faros antiniebla integrados est&aacute;ndar',
				'Volante deportivo de altura y acercamiento ajustables, tapizado en piel y con cambios de velocidades en el tim&oacute;n est&aacute;ndar',
				'Ruedas de aleaci&oacute;n de 18 plg. disponible',
				'Pantalla con audio, con navegaci&oacute;n <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/navigation.html\');">[7]</a> y Entune&trade; <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/entune_launch.html\');">[8]</a>'
			]
		},
		'camry_xle': {
			'modelName': 'Camry XLE',
			'msrp': "$24,725",
			'asShown': "$29,845",
			'lessStory' : "$2000 menos que el modelo 2011.",
			'caption': 'Para muchos conductores es una opci&oacute;n y para otros una necesidad.',
			'features': [
				'Faros antiniebla integrados est&aacute;ndar',
				'Techo el&eacute;ctrico corredizo/inclinable con parasol deslizable est&aacute;ndar',
				'Control autom&aacute;tico del clima en dos zonas est&aacute;ndar',
				'Tecnolog&iacute;a inal&aacute;mbrica <em>Bluetooth</em><sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/bluetooth.html\');">[6]</a> est&aacute;ndar',
				'Asiento del conductor ajustable el&eacute;ctricamente en 8 direcciones y con soporte lumbar el&eacute;ctrico est&aacute;ndar',
				'Monitor de Punto Ciego (Blind Spot Monitor-BSM) disponible <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/bsm.html\');">[9]</a>'
			]
		},
		'hybrid_le': {
			'modelName': 'Camry Hybrid LE',
			'msrp': "$25,900",
			'asShown': "",
			'lessStory' : "$1150 menos que el modelo 2011.",
			'caption': '&iexcl;Incre&iacute;ble! Prep&aacute;rate para 43 mpg est.  <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/epa_2012_camry_hybrid_le.html\');">[2]</a> y hasta 600 millas de alcance <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/camry_hybrid_range.html\');">[10]</a> entre paradas para llenar el tanque.',
			'features': [
				'Parabrisas frontal con reducci&oacute;n del ruido est&aacute;ndar',
				'Control autom&aacute;tico del clima en dos zonas est&aacute;ndar',
				'Sistema manos libres BLU Logic<sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/blu_logic.html\');">[4]</a> est&aacute;ndar',
				'Instrumentaci&oacute;n Optitron est&aacute;ndar',
				'Detalles interiores en metallic-tech-grain con manijas interiores cromadas est&aacute;ndar'
			]
		},
		'hybrid_xle': {
			'modelName': 'Camry Hybrid XLE',
			'msrp': "$27,400",
			'asShown': "",
			'lessStory' : "",
			'caption': 'Una impresionante econom&iacute;a en combustible y es s&oacute;lo el principio.',
			'features': [
				'Faros antiniebla integrados est&aacute;ndar',
				'Ruedas de aleaci&oacute;n de 17 plg. est&aacute;ndar',
				'Pantalla con audio, con navegaci&oacute;n <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/navigation.html\');">[7]</a> y Entune&trade; <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/entune_launch.html\');">[8]</a> disponible',
				'C&aacute;mara retrovisora disponible',
				'Asientos delanteros con calefacci&oacute;n gradual y forrados en Ultrasuede<sup>&reg;</sup> disponibles',
				'Safety Connect<sup>&reg;</sup> <a href="javascript:void(0);" onclick="TMSSite.disclaimerHotlink(\'/espanol/disclaimers/safety_connect_1year.html\');">[11]</a> disponible'
			]
		}
	
	};

  // rewrite the exterior js paths so they don't use the other 360s.
  $H(trimCodes).each(function(trimCode) {
  	trimCode.value.imagePath = trimCode.value.imagePath.replace('exterior360/', 'landing/exterior360/');
  	
  });
        
  document.observe("dom:loaded", function() {
  	
  	
  	// augment the existing info
  	var modelNameEl = $$('#modelDescription .modelName')[0],
  		msrpEl = $$('#modelDescription .msrp360')[0],
  		asShownContEl = $$('#modelDescription h5')[0],
  		asShownEl = $$('#modelDescription .asShown')[0],
  		lessStoryEl = $$('#modelDescription .caption')[0],
  		captionEl	= $$('#modelDescription .caption')[1],
  		featuresEl = $$('#modelDescription .features')[0],
  		trimEls = $$('.trims a'),
  		activeTrimEl = trimEls[0],
  		kalEl = "last son of Krypton";
  	
  	if (TMSSite.lang == "es")
  	{
  		$$('#modelSpinner .trims')[0].observe('click', function(evt) {
			updateTrimInfo(trimMapEsp[evt.element().rel]);
		});
		updateTrimInfo(trimMapEsp['camry_l']);	
  	}
  	else {	
		$$('#modelSpinner .trims')[0].observe('click', function(evt) {
			updateTrimInfo(trimMap[evt.element().rel]);
		});
		updateTrimInfo(trimMap['camry_l']);	
	}
	
	var delayTrimFlag = false; 
	if (typeof activeTrimEl != "undefined") {
		activeTrimEl.addClassName('active');
	}
  	
  	// rewrite the existing hover behavior on trim/grades so it's not selected
	//console.log('trims yet? ' + $$('.trims a').size())
	trimEls.each(function(trim) {
		trim.hover(function(evt) {
			activeTrimEl.removeClassName('active');
			delayTrimFlag = true;
		},
		function(evt) {
			function resetActiveTrim() {
            	if (delayTrimFlag == false) {
            		//alert('active');
            		activeTrimEl.addClassName('active');
            	}
            }
            setTimeout(resetActiveTrim,500);
			delayTrimFlag = false;			
		});
		trim.observe('click', function(evt) {
			activeTrimEl = evt.element();
		});
	});
	
  	function updateTrimInfo(trimInfo) {
  		 modelNameEl.update(trimInfo.modelName);
  		 msrpEl.update(trimInfo.msrp);
  		 //console.log(trimInfo.asShown.length);
  		 if (trimInfo.asShown.length !== 0) {
  		 	asShownContEl.show();
  		 	asShownEl.update(trimInfo.asShown);
  		 } else {
  		 	asShownContEl.hide();
  		 }
  		 
  		 if( trimInfo.lessStory.length !== 0 ) {
  		 	lessStoryEl.show();
  		 	lessStoryEl.update( trimInfo.lessStory );
  		 }
  		 else{
  		 	lessStoryEl.hide();
  		 }
  		 
  		 captionEl.update(trimInfo.caption);
  		 featuresEl.update('<li>' + trimInfo.features.join('</li><li>') + '</li>');		 			
		 
  	}
	
  });    
})();


(function() {
           
  document.observe("dom:loaded", function() {
	var urlPath = window.location.pathname;
	var pagePath = urlPath.substring(urlPath.lastIndexOf('/') + 1).replace(".html","");
	
	if($$(".ie6, .ie7, .ie8, .ie9")[0]){
        isIEBrowser = true;
    }
	
	if (pagePath == '' || pagePath == 'index') {	pagePath = 'index'; }
		
		if(isIEBrowser){            
    		$$('a[href^=#]:not([href=#])').each(function(anchor) {
    			anchor.observe('click', function(e) {    			    
                    document.title = "2012 Toyota Camry";                    
    			});
    		})
        }
		
		//Disclainer links - prevent # links
		$$('.features')[0].observe('click',function(e){
			e.preventDefault();
		});				
		
		//Trim options toggle
		$('camryTrimOptsLeft').observe('click',function(){
			$('trimOptionsLeft').toggle();									  
		});
		$('camryTrimOptsRight').observe('click',function(){
			$('trimOptionsRight').toggle();										  
		});		
		
		//Mouseout event for hiding Trim option - Left 
		$('trimOptionsLeft').observe('mouseout', function(event) {
			 var target = $('trimOptionsLeft');
			 var mouse_over_element; 
			 if( event.toElement ) {
				mouse_over_element = event.toElement;
			 }
			 else if(event.relatedTarget) {
			   mouse_over_element = event.relatedTarget;
			 }
			 if(mouse_over_element == null) {
				return;
			 }
			 if(!mouse_over_element.descendantOf(target) && target != mouse_over_element) {
				target.hide();
			 }
		 });
		
		//Mouseout event for hiding Trim option - Right 
		$('trimOptionsRight').observe('mouseout', function(event) {
			 var target = $('trimOptionsRight');
			 var mouse_over_element; 
			 if( event.toElement ) {
				mouse_over_element = event.toElement;
			 }
			 else if(event.relatedTarget) {
			   mouse_over_element = event.relatedTarget;
			 }
			 if(mouse_over_element == null) {
				return;
			 }
			 if(!mouse_over_element.descendantOf(target) && target != mouse_over_element) {
				target.hide();
			 }
		 });
		
		//$('trimOptionsRight').observe("mouseout" , function(evt) { if( evt.findElement().id == 'trimOptionsRight' ) { this.hide(); } } );
		//$('trimOptionsLeft').observe("mouseout" , function() { this.hide(); } );
				
		//What's New Carousel
		var galleryCarousel = new carousel('gallery',{cloneOffsetTop:'24px', action: 'click',intMultipler:7});
		if(Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6){
			if($('gallery-carousel-content')){
				$('gallery-carousel-content').setStyle({
				  'width': '1700px'
				});
			}
			
		}
		//handleDeeplink(pagePath);
		pagePath = '';
		
	
		//Photos & Videos Carousel
		var photosCarousel = new carousel('photovideo',{cloneOffsetTop:'24px', action: 'click',intMultipler:7});
		if(Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6){
			if($('photovideo-carousel-content')){
				$('photovideo-carousel-content').setStyle({
				  'width': '1700px'
				});
			}
			
		}
		$('gallery-caption').observe('click', function(evt) {
			if (evt.element().hasClassName('disclaimer')) {
				evt.stop(evt);
				TMSSite.disclaimerHotlink(evt.element().href);
			}
		});
		
		$$('.photovideo-caption')[0].observe('click', function(evt) {
			if (evt.element().hasClassName('disclaimer')) {
				evt.stop(evt);
				TMSSite.disclaimerHotlink(evt.element().href);
			}
		});
		handleDeeplinkPhoto(pagePath);
		pagePathPhoto = '';
		
		//initialize video player
		jq('#videoplayer1').mediaelementplayer({
			success: function(player, node) {
				jq(".mejs-overlay-loading").hide();
				player.addEventListener('ended', function(e) {
					jq(".mejs-poster").show();
		        }, false);
		        
		        player.addEventListener('play', function(e) {

		        }, false);
			}
		});

	});
  
})();

var noTrack = false, isHomereferrer = (location.href.indexOf('referrer=homepage') >= 0);

var handleDeeplink = function(pagePath) {
	var itemNum = 0;
    
	if (location.href.split('?i=')[1] && location.href.split('?i=')[1].split('&')[0].split('#')[0] > -1) { // .split('&')[0] = REMOVE ANYTHING AFTER THE i PARAM
		itemNum = location.href.split('?i=')[1].split('&')[0].split('#')[0] - 1;        
	} else if(pagePath == 'first-impressions') {
		return;
	}
	noTrack = true;
	$$('#gallery-carousel-content .slide')[itemNum].simulate('click');
	
	noTrack = false;
}

var handleDeeplinkPhoto = function(pagePath) {
	var itemNum = 0;
    
	if (location.href.split('?i=')[1] && location.href.split('?i=')[1].split('&')[0].split('#')[0] > -1) { // .split('&')[0] = REMOVE ANYTHING AFTER THE i PARAM
		itemNum = location.href.split('?i=')[1].split('&')[0].split('#')[0] - 1;        
	} else if(pagePath == 'first-impressions') {
		return;
	}
	noTrack = true;
	$$('#photovideo-carousel-content .slide')[itemNum].simulate('click');
	
	
	noTrack = false;
}

/*  GALLERY  */
// do the image ajax swap on click
var gallerySwap = function(linkObj) {	
	
	if ($('active-image-gallery') != undefined) $('active-image-gallery').remove();
	linkObj.up().up().insert('<div class="active-image" id="active-image-gallery"><img src="/img/vehicles/2012/camry/landing/pointer_courousel.gif"></div>');
	
	var main_img = $("gallery-viewer").firstDescendant(), main_caption = $("gallery-caption");
	var newImg = new Image();
	newImg.src = linkObj.href; //preload
	thisImg = linkObj.firstDescendant();	

	if (!noTrack) {//deeplinking
		// Omniture event
		/*var oEvent = {
			properties:		{
								'14':	'GM:Prius Plug-in:Photo:'+linkObj.up().up().id
							},
			linkTrackVars:	'prop14',
			linkTrackType:	'o',
			linkTrackName:	'tcom_priusplugin_photo_'+linkObj.up().up().id
		};
		// Sends event
		TMSSite.analytics.sendTrackingLink(oEvent);*/
	}
	// swap main image	
	main_img.src = linkObj.href;
	main_img.width = 919;
	main_img.alt = thisImg.alt;
	main_caption.innerHTML = "<h4>" + thisImg.getAttribute('desc').split("|")[0] + "</h4><h5>"   + thisImg.getAttribute('desc').split("|")[1] + "</h5>";		
	main_caption.removeClassName('light').removeClassName('dark').addClassName(linkObj.className);
	
}

var gallerySwapPhoto = function(linkObj) {	

	resetImgTag = '<img width="919" height="475">';
	$('photovideo-viewer').update(resetImgTag);
	
	$('photovideo-viewer').removeClassName('video-loaded');

	if ($('active-image-photovideo') != undefined) $('active-image-photovideo').remove();
	linkObj.up().up().insert('<div class="active-image" id="active-image-photovideo"><img src="/img/vehicles/2012/camry/landing/pointer_courousel.gif"></div>');
	
	var main_img = $("photovideo-viewer").firstDescendant(), main_caption = $$(".photovideo-caption")[0];
	var newImg = new Image();
	newImg.src = linkObj.href; //preload
	thisImg = linkObj.firstDescendant();	

	if (!noTrack) {//deeplinking
		// Omniture event
		/*var oEvent = {
			properties:		{
								'14':	'GM:Prius Plug-in:Photo:'+linkObj.up().up().id
							},
			linkTrackVars:	'prop14',
			linkTrackType:	'o',
			linkTrackName:	'tcom_priusplugin_photo_'+linkObj.up().up().id
		};
		// Sends event
		TMSSite.analytics.sendTrackingLink(oEvent);*/
	}
	// swap main image
	main_img.src = linkObj.href;
	main_img.width = 919;
	main_img.alt = thisImg.alt;
	if (thisImg.alt == '') {
		main_caption.innerHTML = "&nbsp;";		
	} else {
		main_caption.innerHTML = thisImg.getAttribute('desc');
	}	
}

/* VIDEO */
// do the video ajax swap on click
var videoSwap = function(linkObj) {
	if ($('active-image-photovideo') != undefined) $('active-image-photovideo').remove();
	linkObj.up().up().insert('<div class="active-image" id="active-image-photovideo"><img src="/img/vehicles/2012/camry/landing/pointer_courousel.gif"></div>');
	
	var main_caption = $$(".photovideo-caption")[0];
    
    if (!isHomereferrer) { // Only if not from plug-in hompepage hero       
                     
    	// Omniture event
    	/*var oEvent = {
    		properties: {
    			'46':	'GM:Prius Plug-in:First Impressions:Hero:Video:Click to Play:CTA:'+ linkObj.name,
    			'22': 'GM:Prius Plug-in:First Impressions:Hero:Video:Click to Play:'+ linkObj.name
    		},
    		linkTrackVars:	'prop46,prop22',
    		linkTrackType:	'o',
    		linkTrackName:	'tcom_priusplugin_first_impressions_hero_video_clicktoplay_cta_'+ linkObj.up("div").id
    	};
    	// Sends event
    	TMSSite.analytics.sendTrackingLink(oEvent);*/
                
    }
    
    isHomereferrer = false; // Prevent tracking from autoplay but allow future tracking from the carousel items
    
	loadPlayer(linkObj.href.split("/v/")[1]);
	if (linkObj.title == '') {
		main_caption.innerHTML = "&nbsp;";		
	} else {
		main_caption.innerHTML = linkObj.title;
	}
}

var videoId = "";

function loadPlayer(id) {
	videoId = id;
	//var so = new SWFObject('http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=player1', 'ytPlayer', '998', '562', '8', '#fff');
	var so = new SWFObject('http://www.youtube.com/v/'+id+'?version=3&rel=0&autoplay=0&iv_load_policy=3', 'ytPlayer', '790', '475', '8', '#1e2124');
	so.addParam('allowScriptAccess', 'always');
	so.addParam('allowFullScreen', 'true');
	so.addParam('wmode', 'opaque');
	so.write('photovideo-viewer');
	$('photovideo-viewer').addClassName('video-loaded');
}

/**
 * Event.simulate(@element, eventName[, options]) -> Element
 * 
 * - @element: element to fire event on
 * - eventName: name of event to fire (only MouseEvents and HTMLEvents interfaces are supported)
 * - options: optional object to fine-tune event properties - pointerX, pointerY, ctrlKey, etc.
 *
 *    $('foo').simulate('click'); // => fires "click" event on an element with id=foo
 *
 **/
(function(){
  
  var eventMatchers = {
    'HTMLEvents': /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,
    'MouseEvents': /^(?:click|mouse(?:down|up|over|move|out))$/
  }
  var defaultOptions = {
    pointerX: 0,
    pointerY: 0,
    button: 0,
    ctrlKey: false,
    altKey: false,
    shiftKey: false,
    metaKey: false,
    bubbles: true,
    cancelable: true
  }
  
  Event.simulate = function(element, eventName) {
    var options = Object.extend(defaultOptions, arguments[2] || { });
    var oEvent, eventType = null;
    
    element = $(element);
    
    for (var name in eventMatchers) {
      if (eventMatchers[name].test(eventName)) { eventType = name; break; }
    }

    if (!eventType)
      throw new SyntaxError('Only HTMLEvents and MouseEvents interfaces are supported');

    if (document.createEvent) {
      oEvent = document.createEvent(eventType);
      if (eventType == 'HTMLEvents') {
        oEvent.initEvent(eventName, options.bubbles, options.cancelable);
      }
      else {
        oEvent.initMouseEvent(eventName, options.bubbles, options.cancelable, document.defaultView, 
          options.button, options.pointerX, options.pointerY, options.pointerX, options.pointerY,
          options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, element);
      }
      element.dispatchEvent(oEvent);
    }
    else {
      options.clientX = options.pointerX;
      options.clientY = options.pointerY;
      oEvent = Object.extend(document.createEventObject(), options);
      element.fireEvent('on' + eventName, oEvent);
    }
    return element;
  }
  
  Element.addMethods({ simulate: Event.simulate });
})()



//simplecarouselforscriptaculous v.2 J. Reading
  var carousel = Class.create();
  carousel.prototype = {

  	//
  	//  Setup the Variables
  	//
  	itemWidth : null,
  	scrollWidth : null,
  	intNumItems : null,
  	totalMoves : null,
  	madeMoves : 0,
  	intPos : 0,
  	current: 0, // zero based integer of first offset
  	//  
  	//  Initialize the carousel
  	//
  	initialize: function(container, options) {
  	  var currPos = this.current;
	  var maxImages;
	  var multiplerVal;
	  var manualInteraction = false;
	  
	  if (!$(container+'-carousel-content')) {
  	    throw(container+"-carousel-content doesn't exist");
  	    return false;
  	  }
  	  
  		this.options = Object.extend({
  			cloneOffsetTop : '42px',
  			action: 'mouseenter',
  		  	intMultipler: 5
  		}, options || {});
  		
  		this.itemWidth = $$('#' + container + '-carousel-content .slide').first().getWidth() + parseInt($$('#' + container + '-carousel-content .slide').first().getStyle('margin-left'));
		multiplerVal = this.options.intMultipler;
  		this.scrollWidth = this.itemWidth * this.options.intMultipler;
  		this.intNumItems = maxImages = $$('#' + container + '-carousel-content .slide').size();
  		this.totalMoves = Math.ceil(this.intNumItems / this.options.intMultipler) - Math.floor($(container + '-carousel-wrapper').getWidth()/this.scrollWidth);

  		$(container + '-carousel-content').setStyle({width:(this.intNumItems * this.itemWidth)+'px'});
  		if ($$('#' + container + '-carousel-content .slide').size() <= this.options.intMultipler) $(container + '-arrow-right').addClassName('disabled');
  		$(container + '-arrow-left').observe('click', function(ev){
  			if(this.madeMoves > 0) {
  				new Effect.Move(container + '-carousel-content', { 
  					x: this.intPos + this.scrollWidth, 
  					mode: 'absolute',
  					duration:.5
  				});
  				this.madeMoves--;
  				this.intPos = this.intPos + this.scrollWidth;
  				$(container + '-arrow-right').removeClassName("disabled");
  				if (this.madeMoves < 1) $(container + '-arrow-left').addClassName("disabled");
  			}
  		}.bind(this));
  		
  		$(container + '-arrow-right').observe('click', function(ev){
  			if(this.madeMoves < this.totalMoves) {
  				new Effect.Move(container + '-carousel-content', { 
  					x: this.intPos - this.scrollWidth, 
  					mode: 'absolute',
  					duration:.5
  				});
  				this.madeMoves++;
  				this.intPos = this.intPos - this.scrollWidth;
  				$(container + '-arrow-left').removeClassName("disabled");
  				if (this.madeMoves == this.totalMoves) $(container + '-arrow-right').addClassName("disabled");

  			}
  		}.bind(this));
  		
  		$(container + '-image-arrow-left').observe('click', function(ev){
  			manualInteraction = true;
			if (this.current ==  0) {
				$(container + '-arrow-right').simulate('click');
				$$('#' + container + '-carousel-content .slide')[this.intNumItems-1].simulate('click');
				return;	
			}
			if (this.current <= this.options.intMultipler ) $(container + '-arrow-left').simulate('click');
  			//console.log('right arrow clicked')
  			this.current--;
  			
			clearInterval(this.tmpInterval);
			$$('#' + container + '-carousel-content .slide')[this.current].simulate('click');				
			
  		}.bind(this));
  		
  		$(container + '-image-arrow-right').observe('click', function(ev){			
			manualInteraction = true;
			if (this.current == (this.intNumItems-1)) {
				$(container + '-arrow-left').simulate('click');
				$$('#' + container + '-carousel-content .slide')[0].simulate('click');
				return;
			}
			if (this.current >= (this.options.intMultipler-1) ) $(container + '-arrow-right').simulate('click');			
  			//console.log('right arrow clicked')
  			this.current++;
			clearInterval(this.tmpInterval);
			$$('#' + container + '-carousel-content .slide')[this.current].simulate('click');
			
  		}.bind(this));		
		
  		this.addRollovers(container);  	
		
		$$('#' + container + '-carousel-content .slide')[0].simulate('click');
		
		//setTimeout(initGallery, 10000);
		/* Disable autoplay for galleries
		this.tmpInterval = setInterval(function(){
		noTrack = true;
		isHomereferrer = true;
		if(currPos >= maxImages){
			$$('#' + container + '-carousel-content .slide')[0].simulate('click');
			$(container + '-arrow-left').simulate('click');
			currPos = 0;
		}else{
			$$('#' + container + '-carousel-content .slide')[currPos].simulate('click');
			if (currPos >= multiplerVal) 
				$(container + '-arrow-right').simulate('click');
		}
		noTrack = false;
		isHomereferrer = false;
		/* 
		if (manualInteraction == false) {
			setTimeout(function() {	currPos++; }, 10000);
		}
		
		},4000)
		*/
				
	},	
  	addRollovers: function(container){
  		$$('#' + container + '-carousel-content .slide').each(function(el) {
  			el.observe(this.options.action, function(e){
  				this.handleRollovers(e,el, container);
  			}.bind(this));
  			
  			el.down('a').observe('click', function(e) {
				clearInterval(this.tmpInterval);
  			}.bind(this));
  		}.bind(this));
  	}, 
  	handleRollovers: function(e,el,container) {
  		this.current = el.previousSiblings().size()
  		$$('.carousel-clone').each(function(cloneEl){cloneEl.remove()});
		clone = el.clone(true);
		if (clone.firstDescendant().next()) clone.firstDescendant().next().hide(); //kill source div on first looks
		if (this.options.action == 'click') {
			Event.stop(e);			
			
			leftOrigin = el.positionedOffset().left - parseInt(el.getStyle('margin-left'));
			//$(el).insert({after: clone});		
			if (el.up().up().up().hasClassName('testimonials')) {
				videoSwap(el.firstDescendant('a').firstDescendant());
			} else if (el.up().up().up().hasClassName('photos')) {
				gallerySwap(el.firstDescendant('a').firstDescendant());								
			} 
			if (el.up().up().up().hasClassName('photosgallery') && el.hasClassName('videoCnt')) {
				videoSwap(el.firstDescendant('a').firstDescendant());			
			} else if (el.up().up().up().hasClassName('photosgallery') && el.hasClassName('photoCnt') ) {
				gallerySwapPhoto(el.firstDescendant('a').firstDescendant());				
			}
		} else {
			$(el).stopObserving(this.options.action);
			leftOrigin = (el.positionedOffset().left + $(container + '-carousel-content').positionedOffset().left + $(container + '-carousel-wrapper').positionedOffset().left - parseInt(el.getStyle('margin-left')));
			$(container + '-carousel-wrapper').insert({after: clone});
			clone.observe('mouseleave',function(e){
				clone.remove();
		  		this.addRollovers(container);
			}.bind(this));
			if ($(document.body).hasClassName('home') && container == 'hp-gallery') {//Homepage Photos
				clone.observe('click',function(e){
					Event.stop(e);
					// Omniture event
					/*var oEvent = {
						properties:		{
											'14':	'GM:Prius Plug-in:Home:Photo:'+this.id
										},
						linkTrackVars:	'prop14',
						linkTrackType:	'o',
						linkTrackName:	'tcom_priusplugin_home_photo_'+this.id
					};
					// Sends event
					TMSSite.analytics.sendTrackingLink(oEvent);*/
					location.href = clone.firstDescendant().firstDescendant().href;
				});
			}
			
		}
		clone.addClassName('active carousel-clone');
		clone.setStyle({
			top: this.options.cloneOffsetTop,
			left: (leftOrigin - (clone.getWidth() / 2)) + (el.getWidth() / 2) + "px"
		});			
		
  	}  	
  }
  
//String to Number
String.prototype.toNumber = function(){
	if(this.match(/\./)){
		return parseFloat(this, 10);
	} else {
		return parseInt(this, 10);
	}
};

/***KBB widget***/
(function() {
		       
  	document.observe("dom:loaded", function() {  

		//kbb feed: http://www.kbb.com/rss/consumer-ratings/toyota/camry/2011/

		var url = "http://"+document.location.hostname;
		var randomnumber = Math.floor(Math.random()*4);
		var pipeId;
		
		switch(randomnumber){
			case 0 :
				pipeId = 'ba79e74b06348a50828d7312b0cbb489'	;
				break;
			case 1 :
				pipeId = '3d7b2587cb14ba02ff9b956f57f65aea'	;
				break;
			case 2 :
				pipeId = 'd911523758682969bd469dedf0edc0d6'	;
				break;
			case 3 :
				pipeId = '2555b9d1e00679f3caa976bab89e3546'	;
				break;
			case 4 :
				pipeId = 'ca7a10a727b31a5e1cfa152b10145d31'	;
				break;
		}

		jq.getJSON("http://pipes.yahoo.com/pipes/pipe.run?u="+ encodeURIComponent(url) + "&_id=" + pipeId + "&_render=json&_callback=?",
			function (data){
				
				var kbbMaxScore = 5;
				var kbbResult = {};
				var valueOffset = 6;

				kbbResult.overall 		= data.value.items[0].channel.item[0].description;
				kbbResult.valueRating	= data.value.items[0].channel.item[1].description;
				kbbResult.reliability	= data.value.items[0].channel.item[2].description;
				kbbResult.quality		= data.value.items[0].channel.item[3].description;
				kbbResult.performance 	= data.value.items[0].channel.item[4].description;
				kbbResult.styling		= data.value.items[0].channel.item[5].description;
				kbbResult.comfort	 	= data.value.items[0].channel.item[6].description;
				kbbResult.numberofratings 	= data.value.items[0].channel['kbbcr:numberofratings'];
				kbbResult.beginyear			= data.value.items[0].channel['kbbcr:genbeginyear'];
				kbbResult.endyear			= data.value.items[0].channel['kbbcr:genendyear'];
				
				function kbbGraph(result) {
					var layout = (parseFloat(result) / kbbMaxScore) * 100;
					return layout.toFixed(2);
				}
				
				//graph positioning
				$('kbbValueRating').setStyle({
					width: kbbGraph(kbbResult.valueRating) + '%'
				});
				$('kbbReliability').setStyle({
					width: kbbGraph(kbbResult.reliability) + '%'
				});
				$('kbbQuality').setStyle({
					width: kbbGraph(kbbResult.quality) + '%'
				});
				$('kbbPerformance').setStyle({
					width: kbbGraph(kbbResult.performance) + '%'
				});
				$('kbbStyling').setStyle({
					width: kbbGraph(kbbResult.styling) + '%'
				});
				$('kbbComfort').setStyle({
					width: kbbGraph(kbbResult.comfort) + '%'
				});
				
				//value positioning
				$('kbbValueRating-value').setStyle({
					left: (kbbGraph(kbbResult.valueRating) - valueOffset) + '%'
				});
				$('kbbReliability-value').setStyle({
					left: (kbbGraph(kbbResult.reliability) - valueOffset) + '%'
				});
				$('kbbQuality-value').setStyle({
					left: (kbbGraph(kbbResult.quality) - valueOffset) + '%'
				});
				$('kbbPerformance-value').setStyle({
					left: (kbbGraph(kbbResult.performance) - valueOffset) + '%'
				});
				$('kbbStyling-value').setStyle({
					left: (kbbGraph(kbbResult.styling) - valueOffset) + '%'
				});
				$('kbbComfort-value').setStyle({
					left: (kbbGraph(kbbResult.comfort) - valueOffset) + '%'
				});
				
				//value insert
				$('kbbOverall-value').innerHTML 	= kbbResult.overall;
				$('kbbValueRating-value').innerHTML = kbbResult.valueRating;
				$('kbbQuality-value').innerHTML 	= kbbResult.quality;
				$('kbbPerformance-value').innerHTML = kbbResult.performance;
				$('kbbReliability-value').innerHTML = kbbResult.reliability;
				$('kbbStyling-value').innerHTML 	= kbbResult.styling;
				$('kbbComfort-value').innerHTML 	= kbbResult.comfort;
				
				$('kbb-ratingCount').innerHTML 		= kbbResult.numberofratings;
				$('kbb-beginyear').innerHTML 		= kbbResult.beginyear;
				$('kbb-endyear').innerHTML 			= kbbResult.endyear;
		});

	});
})();
(function() {
		       
  	document.observe("dom:loaded", function() {
  	 
        $$("#kbb-logo, .kbb-title a, #kbb-view-link, #reviewDesc .review-viewall .btn").each(function(btn){
            
            btn.observe("click",function(e){                        
					// Omniture event                    
                    
                    var title = (this.id == "kbb-logo") 
                        ? "KBB Consumer Reviews" 
                        : (this.id == "kbb-view-link") 
                            ? "View 2012 Camry Reviews" 
                            : "KBB Camry Review Widget";
                    
					var oEvent = {
						properties:		{
											'46': TMSSite.i18n[TMSSite.lang].pageName + ':Camry:Home:Reviews & Awards:CTA:'+title,
                                            '22': TMSSite.i18n[TMSSite.lang].pageName + ':Camry:Home:Reviews & Awards'
										},
						linkTrackVars:	'prop46,prop22',
						linkTrackType:	'o',
						linkTrackName:	TMSSite.i18n[TMSSite.lang].location + '_camry_reviews_&_awards_cta_'+title.toLowerCase().replace(/ /g,"_")
					};
					// Sends event
					TMSSite.analytics.sendTrackingLink(oEvent);                
                
            });            
            
        });     
     
		if ($('socialLinks') || $('storiesSocial')) {
			/* TRACK CLICKS FOR SOCIAL SHARE IFRAMES */
			function TrackIframe() {
				var isOverIFrame = false;
				var iframeContainer = "";
				var element = document.getElementsByTagName("iframe");
				
				
				processMouseOut = function() {
					//console.log("IFrame mouse >> OUT << detected.");
					isOverIFrame = false;
					top.focus();
				}
				
				processMouseOver = function(event) {
					//console.log("IFrame mouse >> IN << detected.");
					isOverIFrame = true;
					
					// IE doesn't pass event into the parameter
					if ( !event )
					{
					    event = window.event;
					}
			
					iframeContainer = (event.rangeParent) ? event.rangeParent.id : event.srcElement.parentNode.id;
				}
				
				processIFrameClick = function() {
					if(isOverIFrame) {
						// replace with your function
						//console.log("IFrame >> CLICK << detected. ");
						trackSocial(iframeContainer);
					}
				}
				
				for (var i=0; i<element.length; i++) {
					element[i].onmouseover = processMouseOver;
					element[i].onmouseout = processMouseOut;
					//console.log(element[i].parentNode.id);
				}
				
			
				if (typeof window.attachEvent != 'undefined') {
					top.attachEvent('onblur', processIFrameClick);
				}
				else if (typeof window.addEventListener != 'undefined') {
					top.addEventListener('blur', processIFrameClick, false);
				}
				
			}
		
			//initiatie tracking on iframe
			setTimeout(TrackIframe,'2000'); //time for google plus to initialize
			
			function trackSocial(data) {
				if (data == "")
				{
					return false;
				}
				
				if (data == "___plusone_0")
				{
					data = "Google+";	
				}
				var oEvent = {};
				if (data == "storiesFblike") {
					data = "Like";
					oEvent = {
						eventVars: {'3': 'Tcom_Camry_Owner_Stories_' + data},
						properties:{
										'22':'GM:Camry:Home:Owner Stories',
										'46':'GM:Camry:Home:Owner Stories:CTA:' + data
									},
						linkTrackVars:	'eVar3,prop22,prop46',
						linkTrackType: 'o',
						linkTrackName: 'tcom_camry_owner_stories_cta_' + data.toLowerCase()
					};
					TMSSite.analytics.sendTrackingLink(oEvent);
				}
				else {          
					oEvent = {
						eventVars: {'3': 'Tcom_Camry_Social_Media_BtmRight_' + data},
						properties:{
										'22':TMSSite.i18n[TMSSite.lang].pageName + ':Camry:Home:Social Media',
										'46':TMSSite.i18n[TMSSite.lang].pageName + ':Camry:Home:Social Media:BtmRight:CTA:' + data
									},
						linkTrackVars:	'eVar3,prop22,prop46',
						linkTrackType: 'o',
						linkTrackName: TMSSite.i18n[TMSSite.lang].location + '_camry_social_media_btmright_cta_' + data.toLowerCase()
					};
					TMSSite.analytics.sendTrackingLink(oEvent);
				}
			}
		
		}		
		
		/* Awards & Accolades carousel */
		if (typeof $$(".itemCarouselContainer")[0] != "undefined") {
			var totalAwards = $$("#arwardsAccolades .carouselRow .awardsContainer").size();
			var awardSize = parseInt($$("#arwardsAccolades .carouselRow .awardsContainer")[0].getStyle("width").replace("px","")) + parseInt($$("#arwardsAccolades .carouselRow .awardsContainer")[0].getStyle("margin-left").replace("px",""));
			var carouselRowSize = (awardSize*totalAwards) + 20;	
			var carouselRow = $$("#arwardsAccolades .carouselRow")[0];
			var isMoving = false;
			
			$$("#arwardsAccolades .carouselRow .awardsContainer")[4].down(".awardsHolder h4").setStyle({display: "none"});
			carouselRow.setStyle({width: carouselRowSize + "px"});
			$$("#arwardsAccolades .itemCarouselRightArrow")[0].observe('click', function(evt) {
				var currentMargin = parseInt(carouselRow.getStyle("left").replace("px","")) * -1;
				if (!isMoving) {					
					isMoving = true;
					$$("#arwardsAccolades .carouselRow .awardsContainer")[4].down(".awardsHolder h4").setStyle({display: "block"});
					new Effect.Move(carouselRow, { 
						x: (awardSize + currentMargin) * -1, 
						y: 0,
						mode: 'absolute',
						duration:.4,
						afterFinishInternal: function(effect) { 
							isMoving = false;							
							$$(".carouselRow")[0].insert($$("#arwardsAccolades .carouselRow .awardsContainer")[1]);
							carouselRow.setStyle({left: (currentMargin * -1) + "px"});
							$$("#arwardsAccolades .carouselRow .awardsContainer")[4].down(".awardsHolder h4").setStyle({display: "none"});
						}
					});
					
					//tagging
					oEvent = {						
						properties:{
										'14': 'GM:Camry:Home:Awards_Accolades:Next',
										'22': 'GM:Camry:Home:Awards_Accolades'										
									},
						linkTrackVars:	'prop14,prop22',
						linkTrackType: 'o',
						linkTrackName: 'tcom_camry_awards_accolades_next'
					};
					TMSSite.analytics.sendTrackingLink(oEvent);
				} 
			});
			
			$$("#arwardsAccolades .itemCarouselLeftArrow")[0].observe('click', function(evt) {
				var currentMargin = parseInt(carouselRow.getStyle("left").replace("px",""));
				if (!isMoving) {	
					var blankItem = $$("#arwardsAccolades .carouselRow .awardsContainer")[0];
					isMoving = true;
					
					$$("#arwardsAccolades .carouselRow .awardsContainer")[4].down(".awardsHolder h4").setStyle({display: "block"});
					$$("#arwardsAccolades .carouselRow .awardsContainer")[0].remove();
					$$("#arwardsAccolades .carouselRow")[0].insert({
						top: $$("#arwardsAccolades .carouselRow .awardsContainer")[$$("#arwardsAccolades .carouselRow .awardsContainer").size()-1]
					});
					$$("#arwardsAccolades .carouselRow")[0].insert({ top: blankItem });
					carouselRow.setStyle({left: (awardSize + (currentMargin * -1)) * -1 + "px"});
					new Effect.Move(carouselRow, { 
						x: currentMargin, 
						y: 0,
						mode: 'absolute',
						duration:.4,
						afterFinishInternal: function(effect) { 
							isMoving = false;
							$$("#arwardsAccolades .carouselRow .awardsContainer")[4].down(".awardsHolder h4").setStyle({display: "none"});
						}
					});
					
					//tagging
					oEvent = {						
						properties:{
										'14': 'GM:Camry:Home:Awards_Accolades:Previous',
										'22': 'GM:Camry:Home:Awards_Accolades'										
									},
						linkTrackVars:	'prop14,prop22',
						linkTrackType: 'o',
						linkTrackName: 'tcom_camry_awards_accolades_previous'
					};
					TMSSite.analytics.sendTrackingLink(oEvent);
				} 
			});
						
		}
		
		if (typeof $$("#arwardsAccolades .review-viewall .btn")[0] != "undefined") {
			$$("#arwardsAccolades .review-viewall .btn")[0].observe('click', function(evt) {
				oEvent = {						
					properties:{
									'46': 'GM:Camry:Home:Awards_Accolades:CTA:View All Awards',
									'22': 'GM:Camry:Home:Awards_Accolades'										
								},
					linkTrackVars:	'prop22,prop46',
					linkTrackType: 'o',
					linkTrackName: 'tcom_camry_awards_accolades_cta_view_all_awards'
				};
				TMSSite.analytics.sendTrackingLink(oEvent);
			});
		}
		
	});
})();

(function() {		       
  	Event.observe(window, 'load', function() {    	 
        if(isIEBrowser){            
            document.title = "2012 Toyota Camry";
        }
	});
})();
