// JavaScript Document
$(function(){
	//s_top s_bottom s_left s_right s_auto
	$(".s_top a").mouseover(function(){
		$(this).stop().animate({marginTop:"-143px"},500)
	}).mouseout(function(){
		$(this).stop().animate({marginTop:"0px"},500)
	})
	$(".s_bottom a").mouseover(function(){
		$(this).stop().animate({marginTop:"0px"},500)
	}).mouseout(function(){
		$(this).stop().animate({marginTop:"-143px"},500)
	})
	$(".s_left a").mouseover(function(){
		$(this).stop().animate({marginLeft:"-205px"},500)
	}).mouseout(function(){
		$(this).stop().animate({marginLeft:"0px"},500)
	})
	$(".s_right a").mouseover(function(){
		$(this).stop().animate({marginLeft:"0px"},500)
	}).mouseout(function(){
		$(this).stop().animate({marginLeft:"-205px"},500)
	})
//	$('.s_auto').slides({
//		play: 3000,
//		generatePagination: false
//	});
	
	//tabs
	$(".tabs a").click(function(e){
		e.preventDefault();
		var _t = $(this).parent();
		_t.addClass("on").siblings().removeClass("on");
		var _i = _t.index();
		var _p = _t.parent().siblings(".tabs_cont")
		_p.eq(_i).show().siblings(".tabs_cont").hide();
	});
	
	//导航  
	$(".navi > li").mouseover(function(){
		$(this).addClass("hover");
		$(this).find(".menu").show();
	}).mouseout(function(){
		$(this).removeClass("hover");
		$(this).find(".menu").hide();
	});
		
	//招聘
	$(".view").click(function(e){
		e.preventDefault();
		$(this).parent().siblings(".job_detail").slideToggle()
	});
	//荣誉
	var _y = $(".year_list a");
	var _h = $(".honor_main");
	_y.click(function(e){
		e.preventDefault();
		var _y = $(this).html();
		var _i = $(this).parent().index();
		_h.eq(_i).removeClass("hide").siblings().addClass("hide");
		var _yy = $(this).parent().parent().siblings(".honor_year");
		_yy.html(_y);
	});
	
	
	//height
	var _rh = $(".main_m").height();
	var _lh = $(".sidebar_m").height();
	function hh(){
		if (_lh<_rh){
			//alert(_rh)
			$(".sidebar_m").height(_rh);
		}else{
			//alert(_lh)
		}
	}
	
	function rollnews(){
		var _roll = $(".rollnews ul");
		_roll.animate({"marginTop":"-25px"},function(){
			_roll.find("li:first").appendTo(_roll);
			_roll.css("marginTop","0");
		})
	}
	var roll = setInterval(rollnews, 3000);
	
	
/* 以下可能要单独拆分到页面 */	

	//首页slide
	/*$('.main_vision').slides({
		preload: true,
		preloadImage: '../Public/img/loading.gif',
		play: 5000,
		pause: 2500,
		hoverPause: true
	});*/
//	$('.branch_list').slides({
//		generateNextPrev: false,
//		generatePagination: false

//	});	 
	
	//案例
	$(".c_tab a").click(function(e){
		e.preventDefault();
		var _p = $(this).parent();
		var _i = _p.index();
		_p.addClass("on").siblings().removeClass("on");
		var _c = _p.parent().siblings(".c_tab_cont");
		_c.eq(_i).show().siblings(".c_tab_cont").hide()
	});
	//
	$(".case_list li").hover(function(){
		$(this).toggleClass("hover");
	});
	//
	var _show = $(".brand_list");
	$(".showlist a").click(function(e){
		e.preventDefault();
		$(this).toggleClass("open");
		_show.slideToggle()
	});
	
//	if($(".brand_logo ul")){
//		$(".brand_logo ul").carouFredSel({
//			scroll : { duration: 1000 }, 
//			auto : 5000,
//			prev : {   
//				button  : ".u_prev",
//				key     : "left"
//			},
//			next : {
//				button  : ".u_next",
//				key     : "right"
//			},
//			pagination  : ".u_page"
//		});
//	}
	// 
//	if($(".play_1")){
//	$(".play_1").jshowoff({
//		autoPlay:false
//	}); 
//	}
//	if($(".play_2")){
//	$(".play_2").jshowoff({
//		autoPlay:false
//	});
//	}
	
});
