$(document).ready(function(){

	var isPc = window.screen.width > 768
	
	$('.u5tr_tab div').click(function(){
		var num = $(this).index()
		$('.u5t_right .u5tr_tab div').removeClass('active').eq(num).addClass('active')
		$('.u5tr_line div').css('margin-left',50*num + '%')
		$('.u5_bottom_min').removeClass('active').eq(num).addClass('active')
	})
	
	var _st = 0
	var _start = 0
	_start = $('.banner_tab').offset().top
	$(window).scroll(()=>{
		_st = document.body.scrollTop || document.documentElement.scrollTop;
		if(_st > _start){
			$('.banner_tab').addClass('active')
		}else{
			$('.banner_tab').removeClass('active')
		}
	})
	
	
	var config={
		reset: false,
		origin: 'bottom',
		easing: 'ease-in-out',
		distance: '100px',
		opcity: 0.3,
		duration: 1500,
		delay: 200, // 延迟
	}
	ScrollReveal().reveal('.sr_top_op', config);
	var config2={
		reset: false,
		origin: 'bottom',
		easing: 'ease-in-out',
		distance: '100px',
		opcity: 0.3,
		duration: 1500,
		delay: 400, // 延迟
	}
	ScrollReveal().reveal('.sr_top_op_2', config2);
	
	
	// 视频弹窗
	
	// 视频路径
	var videoUrl = [
		'http://cmsmanage-api.gwm.com.cn/site/ALLYES_CMS201211113046MAWLFSGC/images/other-page/coffee/banner_video.mp4',
		'https://www.haval.com.cn/dist/site/images/car-model-public/b07/v10000.mp4',
		'https://www.haval.com.cn/dist/site/images/car-model-public/b07/v10000.mp4',
		'https://www.haval.com.cn/dist/site/images/car-model-public/b07/v10000.mp4',
		'https://www.haval.com.cn/dist/site/images/car-model-public/b07/v10000.mp4'
	]
	var playerFull = document.getElementById('video_full');
	$('.pc_pop_close').click(function(){
		$('.pc_pop_video').removeClass('active')
		$('body').css('overflow-y','scroll')
		playerFull.pause()
	})
	$('.unit_video_btn').click(function(){
		var index = $(this).attr('data-val')
		$('#video_full').attr('src',videoUrl[index])
		$('.pc_pop_video').addClass('active')
		$('body').css('overflow-y','hidden')
		playerFull.play()
	})
	
}) // ready