var dns = {};
dns.common = {
	goBackTop : function(){
    $('body,html').animate({scrollTop:0});
  },
	showBackTop : function(scrollTop){
		if(scrollTop >= 450){
      $('.backTop').fadeIn();
    }else{
      $('.backTop').fadeOut();
    }
	},
};
//帮助中心
dns.help = function(){
	$('.help-content .yes').click(function(){
		$('.help-content .bottom').html('感谢您的反馈！');
	});
	$('.help-content .no').click(function(){
		$(this).parent().hide();
		$('.help-content .sorry').show();
	});
	$('.help-search .text').focus(function(){
		$('.help-search .dropdown').show();
	});
	$('.help-search .text').blur(function(){
		$('.help-search .dropdown').hide();
	});
	$('.help-side dt').click(function(){
		var next = $(this).next('dd');
		$(this).addClass('current').siblings().removeClass('current');
		
    if((next.is('dd')) && (!next.is(':visible'))) {
      $('.help-side dd:visible').slideUp('normal').removeClass('current');
      next.slideDown('normal');
    }else if(!next.is('dd')){
    	$('.help-side dd:visible').slideUp('normal').removeClass('current');
    }
	});
};
//关于我们
dns.about = function(){
	$('.about-nav dd').click(function(){
    // $(this).addClass('current').siblings().removeClass('current');
	  var total = $('.about-nav dd').index($(this));
		if(total==2)
		{
			// window.open("joinus.html");
		}
		else
		{
			if(total>2)
			{
				total=total-1;
			}
			$('.about-content').eq(total).addClass('on').siblings().removeClass('on');               
			$('.aboutus-banner li').eq(total).addClass('on').siblings().removeClass('on');
			$(this).addClass('current').siblings().removeClass('current');
		}
  });
};
//加入我们
dns.joinus = function(){
	var cur = 0,
	ulL = 0,
	firstLi = $('.list-pic').find('li').clone(),
	clearT;
	$('.list-pic ul').append(firstLi);
	var lenth = $('.list-pic li').length,
	liWidth = $('.list-pic li').width()+21,
	ulWidth =liWidth*($('.list-pic li').length);
	$('.list-pic ul').width(ulWidth);
	function cut(){
	  cur++;
	  ulL = -(liWidth * cur);
		$('.list-pic ul').animate({'left':ulL},800,function(){
			if(cur >= lenth/2){
				cur = 0;
				$(this).css('left',0);
			}
		});
	};
	$(function() {
		clearT = setInterval(cut,2000);
		$('.yxmt a').lightBox();
		$('.list-pic ul').hover(function(){
			clearInterval(clearT);
		},function(){
			clearT = setInterval(cut,2000);
		});
		$('.recruitment-nav li').click(function(){
			$(this).addClass('current').siblings().removeClass('current');
		});
		$(window).scroll(function(){
			if($(window).scrollTop() >= 673){
				$('.recruitment-nav').addClass('recruitment-fixed');
				$('.recruitment').css('padding-top',139);
			}else{
				$('.recruitment-nav').removeClass('recruitment-fixed');
				$('.recruitment').css('padding-top',156);
			}
		});
	});
}
$(function(){
	var $window = $(window);
	$window.scroll(function(){
		dns.common.showBackTop($window.scrollTop());
	});
	$('.backTop').click(function(){
		dns.common.goBackTop();
	});
});















