// JavaScript Document

//Tracking
var CategoryName = "SUV";
var TrackingClick = new Array('SUVTech', 'SUVExterior', 'SUVInterior', 'SUVPerformance', 'SUVQuality', 'SUVSafety', 'SUVColor', 'SUVMedia');

//youtube Video
var VideoIds = new Array('UnmGV-U0Pg4', 'p9vY_wtCYoc', 'WK23B6mlK5U', 'CYlioM9GOcM', 'vXvooaL8iOQ', 'EYYws2ii17M', '8qP_Cz-X3tA');

$(document).ready(function(){
	//kindsNav
	$(".kindsNav").find("li:eq(1)").addClass("activte");
	
	//Technology �蝘�
	$(".Technology .technologyUL").find("li.technologyList:nth-child(3n+2)").addClass("technologyCenter");
	

	//Wrap
	$("span.mediaHref[rel^='prettyPhoto']").prettyPhoto({
		animation_speed    : "normal",
		theme              : "light_square",
		slideshow          : 3000,
		autoplay_slideshow : false
	});

	//Exterior 憭�
	$(".Exterior").find("li.photoList").addClass("photoLeft");
	$(".Exterior").find("li.photoList:eq(3)").addClass("photoCenter");
	$(".Exterior").find("li.photoList:eq(1)").addClass("photoRight");
	
	$(".Exterior .ContData li.photoList .infoFrame").hide();
	$(".Exterior .ContData li.photoList").hover(function () {
		$(this).find(".infoFrame").fadeIn(300);
	}, function () {
		$(this).find(".infoFrame").fadeOut(300);
	});
	
	$(".Exterior ul:first li.photoList[rel^='prettyPhoto']").prettyPhoto({
		animation_speed    : "normal",
		theme              : "light_square",
		slideshow          : 3000,
		autoplay_slideshow : false
	});
	
	//Interior �扯�
	var cf = new ContentFlow("contentFlow", {
		reflectionColor      : "#FFF" ,
		endOpacity           : 0.1, //敺item��摨�
		maxItemHeight        : 250, //�憭折�摨�
		relativeItemPosition : "center"
	});
	
	$(".flow:first div.item[rel^='prettyPhoto']").prettyPhoto({
		animation_speed    : "normal",
		theme              : "light_square",
		slideshow          : 3000,
		autoplay_slideshow : false
	});

	//Power �扯 & Safety 摰
	$(function(){
		$('.ConSlides').slides({
			preload    : false,
			play       : 0,
			pause      : 2500,
			hoverPause : true
		});
	});
	
	jQuery(".ConSlides .ConSlidesUL").children().each(function(index, value) {
		//console.log(jQuery(this).attr('class'));
		
		var arrConSList = jQuery(this).attr('class').split(' ');
		for (var i = 0; i < arrConSList.length; i++) {
			//console.log(arrConSList[i]);
			
			if (arrConSList[i] == "ConSlidesList") {
				jQuery(this).attr('id', 'ConSNum' + index);

				var ConSobj = jQuery(".ConSlides .ConSlidesUL").children().eq(index);
				//console.log(ConSobj.attr('id'));

				var	conSet = ConSobj.find(".ConSlidesInfo")
					_conSetHG = conSet.height();

				conSet.css({
					top       : 50+'%',
					marginTop : -(_conSetHG / 2)
				});
			}			
		}
	});
	
	//Quality �釭
	$("div.Quality .ContData").find(".qualityList:nth-child(3n+2)").addClass("qualityListCenter");	

	//頠隞見
	$(".CarColor .list:first span.image[rel^='prettyPhoto']").prettyPhoto({
		animation_speed    : "normal",
		theme              : "light_square",
		slideshow          : 3000,
		autoplay_slideshow : false
	});

	jQuery(".CarColor").hover(function(){
		jQuery(this).find("li.list").slideDown(300);
	}, function(){
		jQuery(this).find("li.list").slideUp(300);		
	});
})