﻿/*-------导航--------*/
$(function(){
	
	//Append a div with hover class to all the LI
	$(".navli").append('<div class="hover"><\/div>');
	$(".navli").hover(
		//Mouseover, fadeIn the hidden hover class	
		function() {
			var w = $(this).width();
			$(this).children('div').width(w);
			$(this).children('div').fadeIn(400);	
		}, 
		//Mouseout, fadeOut the hover class
		function() {
			$(this).children('div').fadeOut(400);		
	}).click (function () {
		//Add selected class if user clicked on it
		$(this).addClass('selected');
       });
	$(".nav_l").append('<div class="hover_l"><\/div>');
	$(".nav_l").hover(
		//Mouseover, fadeIn the hidden hover class	
		function() {
			var w = $(this).width();
			$(this).children('div').width(w);
			$(this).children('div').fadeIn(400);	
		}, 
		//Mouseout, fadeOut the hover class
		function() {
			$(this).children('div').fadeOut(400);		
	}).click (function () {
		//Add selected class if user clicked on it
		$(this).addClass('selected_l');
       });
	$(".nav_r").append('<div class="hover_r"><\/div>');
	$(".nav_r").hover(
		//Mouseover, fadeIn the hidden hover class	
		function() {
			var w = $(this).width();
			$(this).children('div').width(w);
			$(this).children('div').fadeIn(400);	
		}, 
		//Mouseout, fadeOut the hover class
		function() {
			$(this).children('div').fadeOut(400);		
	}).click (function () {
		$(this).addClass('selected_r');
       });	   
});
/*-------导航end--------*/

/*----------main---------*/
$(function(){
	$(".box").hover(
	    function() {
			$(this).css({background:"url(images/box_bg_b.gif) repeat-x 0 0"}).fadeIn("slow");
			$(this).find("h1").css({color:"#707071"}).fadeIn("slow");
			$(this).find("p").css({color:"#010407"}).fadeIn("slow");
		}, 
		function() {
		   $(this).css({background:"url(images/box_bg.gif) repeat-x 0 0"}).fadeIn("slow");
		   $(this).find("h1").css({color:"#010407"}).fadeIn("slow");
		   $(this).find("p").css({color:"#707071"}).fadeIn("slow");
	});
	
	
	$(".li_l").mouseover(function(){
	     $(this).css({background:"url(images/m1_b.jpg) repeat-x 0 0"}).fadeIn("slow");
		 $(".li_c").css({background:"url(images/m2.jpg) repeat-x 0 0"}).fadeIn("slow");
		 $(".li_r").css({background:"url(images/m3.jpg) repeat-x 0 0"}).fadeIn("slow");
    });
	$(".li_c").mouseover(function(){
	     $(this).css({background:"url(images/m2_b.jpg) repeat-x 0 0"}).fadeIn("slow");
		 $(".li_l").css({background:"url(images/m1.jpg) repeat-x 0 0"}).fadeIn("slow");
		 $(".li_r").css({background:"url(images/m3.jpg) repeat-x 0 0"}).fadeIn("slow");
    });
	$(".li_r").mouseover(function(){
	     $(this).css({background:"url(images/m3_b.jpg) repeat-x 0 0"}).fadeIn("slow");
		 $(".li_l").css({background:"url(images/m1.jpg) repeat-x 0 0"}).fadeIn("slow");
		 $(".li_c").css({background:"url(images/m2.jpg) repeat-x 0 0"}).fadeIn("slow");
    });
	
	/*标签呢内容切换*/
	//Default Action
	$(".tab_content").hide(); //Hide all content
	//$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:last").show(); //Show first tab content
	
    $("#menu ul li").mouseover(function() {
	  $(".tab_content").hide(); //Hide all tab content
		//$(".tab_content").css({"display":"none"});
	  var activeTab = $(this).find("a").attr("class"); //Find the rel attribute value to identify the active tab + content
	  $(activeTab).show(); //Fade in the active content:fadeIn(100)
		
	 });
	//On Click Event
	
	/*标签呢内容切换end*/
	
     $("#sidebar_cont ul li").hover(
	    function() {
		   //$(this).find("h1").stop().animate( {marginLeft:"50px"} , 1000 );
		   $(this).find("p").stop().animate( {marginLeft:"20px"} , 600 );
		}, 
		function() {
		   //$(this).find("h1").stop().animate( {marginLeft:"50px"} , 1000 );
		   $(this).find("p").stop().animate( {marginLeft:"0px"} , 600 );
	});	   
});
/*----------main_end---------*/
