$(function(){
	//当前页面导航高亮
	 var href = window.location.href.split('/')[window.location.href.split('/').length-1].substr(0,4);
	 if(href.length > 0){
	 	$(function(){
	 		$("ul.nav_list a:first[href^='"+href+"']").attr("class","on");
	 		if($("ul.nav_list a:first[href^='"+href+"']").size() == 0){
	 			$("ul.nav_list a:first[href^='index']").attr("class","on");
	 		}
	 	});
	 }else{
	 	$(function(){$("ul.nav_list a:first[href^='index']").attr("class","on")});
	 }
		
})

//显示或隐藏下方导航列表
$(document).click(function(){
	$('.nav_list').removeClass('nav_open')
})
$('.nav_menu,.nav_list').click(function(e){e.stopPropagation()})
$('header').find('.nav_menu').click(function(e){
	$('.nav_list').toggleClass('nav_open')
})
	
//选项卡切换 
function Tabs(tabobj, obj)
{
	var tablist = $("#"+tabobj+" li");
	for(i=0; i<tablist.size(); i++){
		if(tablist[i].id == obj.id){
			$("#"+tabobj+"_title"+i).attr("class","active"); 
			$("#"+tabobj+"_content"+i).show(); 
		} else {
			$("#"+tabobj+"_title"+i).attr("class","normal"); 
			$("#"+tabobj+"_content"+i).hide(); 
		}
	} 
}

//图片延迟加载引入jquery.lazyload.js
// $(document).ready(
// 	function($){
// 		$(".loadimg").lazyload({placeholder: "images/loading.gif",effect: "fadeIn"});
// 	}
// );


function cfm_search()
{
	if($("#keyword").val() == "")
	{
		alert("请输入关键词！");
		$("#keyword").focus();
		return false;
	}
}

//transform.js滑轮滚动模块动画效果引用配合animate.min.cs
$(window).scroll(function () {
	var _ismobile = false;
	var windowTop = $(window).scrollTop();
	var windowBottom = windowTop + $(window).height();
	var showNum = !_ismobile ? 4 :16;
	$('.ani_view').each(function(){
		var pageQ1 = $(this).offset().top + $(this).height() / showNum;
		var pageQ3 = $(this).offset().top + $(this).height() / 1;
		if( ( pageQ1 <= windowBottom ) && ( pageQ3 >= windowTop ) ){
			if( $(this).hasClass("bounceInUp") )  $(this).addClass('animated bounceInUp');
			if( $(this).hasClass("bounceInLeft") )  $(this).addClass('animated bounceInLeft');
			if( $(this).hasClass("bounceInRight") )  $(this).addClass('animated bounceInRight');
			if( $(this).hasClass("bounceInDown") )  $(this).addClass('animated bounceInDown');	
		}else {
			if( $(this).hasClass('bounceInUp') ) $(this).removeClass('animated bounceInUp');
			if( $(this).hasClass('dowebok1') ) $(this).removeClass('animated bounceInLeft');
			if( $(this).hasClass('bounceInRight') ) $(this).removeClass('animated bounceInRight');
			if( $(this).hasClass('bounceInDown') ) $(this).removeClass('animated bounceInDown');
		}
	});
});


$(".navbak .menuzjx").click(function() {
	$(".navbak ul").slideToggle(100);
});


