$(document).ready(function(){
      jq_init("#topnav>li");
	  jq_init("#nav_m>li");
	  hkClick("#hr_hkt>li");
	  tabs();
   }				   
 );
function jq_init(obj){
	  $(obj).hover(
							function(){
							      $(this).children("ul").show("fast");
								},
							function(){
								 $(this).children("ul").hide("fast");
								}
							);
	}
function hkClick(obj){
	  $(obj).click(function(){
							  $(this).addClass("on");
							  $(this).siblings().removeClass("on");
							  var num=$(this).index();
							  //alert(num);
							  $("#hr_hkc3 table").eq(num).siblings("table").hide().end().fadeIn("fast");
							});
	}
function tabs(){
		//$(".tab dl dd ul").not(":first").hide();
		$(".tab dl dt>a").unbind("click").bind("click", function(){
		$(this).siblings("a").removeClass("tabActive").end().addClass("tabActive");
				var index = $(".tab dl dt>a").index( $(this) );
				$(".tab dl dd div").eq(index).siblings(".tab dl dd div").hide().end().fadeIn("slow");
		   });

	}
 function  flashPics(images_arr,flashlinks,flashtexts,swf_width,swf_height){
         var files="";
         var links="";
         var texts="";
         var  flashpicn=0;
          
         for(flashpicn=0;flashpicn<images_arr.length;flashpicn++){
                  if(flashpicn!=images_arr.length-1){
                      files+=images_arr[flashpicn]+"|";
                     links+=flashlinks[flashpicn]+"|";
                     texts+=flashtexts[flashpicn]+"|";
                    }else{
                      files+=images_arr[flashpicn];
                      links+=flashlinks[flashpicn];
                      texts+=flashtexts[flashpicn];
                     }
        }

            
            document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
            document.write('<param name="movie" value="focus.swf" />');
            document.write('<param name="quality" value="high" />');
            document.write('<param name="menu" value="false" />');
            document.write('<param name=wmode value="transparent" />');
            document.write('<param name="FlashVars" value="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'" />');
            document.write('<embed src="focus.swf" wmode="transparent" FlashVars="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'" menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
            document.write('</object>');
			}
function  high(obj){
	if(obj.filters){
		obj.filters.alpha.opacity=0;//ie
		}
	else obj.style.opacity = 0;//ff
	setLight=setInterval(function(){ highLight(obj);},50);
}
function  low(obj){
	clearInterval(setLight);
	if(obj.filters){
		obj.filters.alpha.opacity=100;//ie
		}
	else obj.style.opacity = 1;//ff
}
function  highLight(obj){
	if(obj.filters){
		   obj.filters.alpha.opacity=Number(obj.filters.alpha.opacity)+20;
		   if(obj.filters.alpha.opacity>=100){
			    clearInterval(setLight);
			   }
		}else{
			  obj.style.opacity =Number(obj.style.opacity)+0.2;
			  if(Number(obj.style.opacity)>=100){
				    clearInterval(setLight);
				  }
			}
	
}
//µ¥ÐÐ¹ö¶¯js
  function goUpOne(obj,pp1,pp2,num){
	    var target=document.getElementById(obj)
		var p1=document.getElementById(pp1);
		var p2=document.getElementById(pp2);
		var setUpOne;
		var setUpT; 
		var i=0;
	//	alert(p1.offsetHeight);
	    if(target==null){
			  return null;
			}
		else{
			  if(Number(p1.offsetHeight)>=Number(target.offsetHeight)){
				    p2.innerHTML=p1.innerHTML;
				  }
			  setUpT=setTimeout(function(){goUp();},1000);
			}
	    target.onmouseover=function(){clearInterval(setUpOne);clearTimeout(setUpT);}
		target.onmouseout=goUp;
	   function goUp(){
							  setUpOne=setInterval(function(){upup();},50);
										  }
		function upup(){
					  target.scrollTop=i++;
					  if(i>=Number(p1.offsetHeight)){
						    i=0;
						  }
					  if(i%num==0){
						    clearInterval(setUpOne);
							clearTimeout(setUpT);
							setUpT=setTimeout(function(){goUp();},1000);
						  };
					}
 }