// JavaScript Document
// JavaScript Document
<!--
  var index = 0;
	var flag =  0;
	function changeOntime(){
	      
	     if(index == 3)
		    index = 0;		  
		 document.getElementById("infoo_"+(flag+1)).style.backgroundImage="url(http://www.jhjsw.com/images/quehuanweidianji.jpg)";
		  document.getElementById("infoo_"+(flag+1)).style.color="#ffffff"; 
		 document.getElementById("d"+(flag)).style.display="none";
		
		 $("#d"+(index)).fadeIn();
	     document.getElementById("infoo_"+(index+1)).style.backgroundImage="url(http://www.jhjsw.com/images/quehuandianji.jpg)";
		  document.getElementById("infoo_"+(index+1)).style.color="#000000"; 
		
		 flag = index;
		 index++;		   
	}
	
	var setInter = setInterval(changeOntime,15000);
	
	function changes(idValue){
	  clearInterval(setInter);
	  
	   index = idValue-1;	   
		  document.getElementById("infoo_"+(flag+1)).style.backgroundImage="url(http://www.jhjsw.com/images/quehuanweidianji.jpg)";
		   document.getElementById("infoo_"+(flag+1)).style.color="#ffffff"; 
		  document.getElementById("d"+(flag)).style.display="none";
		 
		 document.getElementById("d"+(index)).style.display="";
	     document.getElementById("infoo_"+(index+1)).style.backgroundImage="url(http://www.jhjsw.com/images/quehuandianji.jpg)";
		 document.getElementById("infoo_"+(index+1)).style.color="#000000"; 
		   flag = index;	
	}
		
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return;
	
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
	//
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;
    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

  window.onload = changeOntime;
   
  function startInterval(){
	 setInter = setInterval(changeOntime,15000);
}
//-->
/*
 * Power by xu
 * Date: 2010.07.24 15:56
 */
 
$(function(){
	//header page arr style
	$("#nav>li").each(function(){
		var i = $("#nav>li").index($(this)[0]);
		$(this).bind("mouseover",function(){
			$("#nar_arr").css("background-position",i*62);
		})	
	})
	
	$(".banner2menucon>ul li").each(function(){
		$(this).hover(function(){
				nereidFade(this,100,100,10);changes(parseInt(this.id.replace('infoo_','')));},
			function(){
				startInterval();nereidFade(this,50,10,5);
			})	
	})
	
	//footer page guide style
/*	$("#guide_box").mouseenter(function(){
		var pos=$(this).offset();
		$("#guide").show().css({left:"0px",top:"-298px"});	
	}).mouseleave(function(){
		$("#guide").hide()		
	})
*/	 
	
	
	$(".this_map").mouseover(function(){
		$(this).find("ul").stop().animate({top:'-155px'},{queue:false,duration:500});
	}).mouseout(function() {
		$(this).find("ul").stop().animate({top:'0'},{queue:false,duration:500});
	});
	
	//show/hidden information
	$("#news_btn>img").toggle(function(){
			$("#text_box").slideUp("fast");
			$(this).attr("src","images/news_btn2.jpg");
		},
		function(){
			$('html,body').animate({scrollTop:document.body.scrollTop+document.documentElement.scrollTop+500},1200);//定位到该位置			
			$("#text_box").slideDown();
			$(this).attr("src","images/news_btn.jpg");
		})
	
	//The same height of news
	$("#text_news .text_col").height(function(){
		var h=0;
		$("#text_news .text_col").each(function(){
			if(h<$(this).height())h=$(this).height();
		})
		return h;
	})
}) 


