// JavaScript Document function setTab(name,cursel,n){ for(i=1;i<=n;i++){ var menu=document.getElementById(name+i); var con=document.getElementById("con_"+name+"_"+i); menu.className=i==cursel?"hover":""; con.style.display=i==cursel?"block":"none"; } } function setmenu(name,cursel,n){ for(i=1;i<=n;i++){ var m=document.getElementById(name+i); m.className=i==cursel?"hover":""; } } function set_csn(name,dis,cursel,n){ for(i=1;i<=n;i++){ var m=document.getElementById(name+i); var d=document.getElementById(dis+i); m.className=i==cursel?"hover":""; d.className=i==cursel?"con_show":"con_hide"; } } function changeBigImg(url){ var obj=document.getElementById("big_img"); obj.src=url; } function hightShow(t){ document.getElementById("download"+t).src = "images/downloadH.gif"; } function nomalShow(t){ document.getElementById("download"+t).src = "images/downloadN.gif"; } $(document).ready(function() { function megaHoverOver(){ $(this).find(".sub").slideDown('fast').fadeTo('fast', 1).show(); //Calculate width of all ul's (function($) { jQuery.fn.calcSubWidth = function() { rowWidth = 0; //Calculate row $(this).find("div").each(function() { rowWidth += $(this).width(); }); }; })(jQuery); if ( $(this).find(".row").length > 0 ) { //If row exists... var biggestRow = 0; //Calculate each row $(this).find(".row").each(function() { $(this).calcSubWidth(); //Find biggest row if(rowWidth > biggestRow) { biggestRow = rowWidth; } }); //Set width $(this).find(".sub").css({'width' :biggestRow}); $(this).find(".row:last").css({'margin':'0'}); } else { //If row does not exist... $(this).calcSubWidth(); //Set Width $(this).find(".sub").css({'width' : rowWidth}); } } function megaHoverOut(){ $(this).find(".sub").slideDown('fast').hide(0); } var config = { sensitivity: 2, // number = sensitivity threshold (must be 1 or higher) interval: 0, // number = milliseconds for onMouseOver polling interval over: megaHoverOver, // function = onMouseOver callback (REQUIRED) timeout: 0, // number = milliseconds delay before onMouseOut out: megaHoverOut // function = onMouseOut callback (REQUIRED) }; $("ul#nav li .sub").css({'opacity':'1'}); $("ul#nav li").hoverIntent(config); }); //banner切换JS var currentindex=1; function changeflash(i) { currentindex=i; for (j=1;j<=6;j++){ if (j==i) { $("#flash"+j).fadeIn("normal"); $("#flash"+j).css("display","block"); $("#f"+j).removeClass(); $("#f"+j).addClass("on"); $("#flashBg").css("background-color",$("#flash"+j).attr("name")); } else { $("#flash"+j).css("display","none"); $("#f"+j).removeClass(); $("#f"+j).addClass("nomall"); } } } function startAm(){ timerID = setInterval("timer_tick()",5000); } function stopAm(){ clearInterval(timerID); } function timer_tick() { currentindex=currentindex>=6?1:currentindex+1; changeflash(currentindex); } $(document).ready(function(){ startAm(); }); function setbanner_smallbg(name,cursel,n){ stopAm(); for(i=1;i<=n;i++){ var m=document.getElementById(name+i); m.className=i==cursel?"on":"nomall"; } } //要闻滚动JS $(document).ready(function(){ $("#scrollDiv").Scroll({line:1,speed:500,timer:3000,up:"but_up",down:"but_down"}); });