///公用js文件================ //*清除空白节点* //较少使用,多一次循环过程 //=========================== function cleanwhitespaces(elem){ var elem = elem || document; var parentelem = elem; var childelem = parentelem.childnodes; var childelemarray = new array; for (var i=0; i0 && image.height>0){ if(image.width/image.height>= picwidth/picheight){ if(image.width>picwidth){ imgd.width=picwidth; imgd.height=(image.height*picwidth)/image.width; }else{ imgd.width=image.width; imgd.height=image.height; } imgd.alt=""; }else{ if(image.height>picheight){ imgd.height=picheight; imgd.width=(image.width*picheight)/image.height; }else{ imgd.width=image.width; imgd.height=image.height; } imgd.alt=""; } } } //*图片等比例大小* //图片对象、比例宽、比例高 //=========================== var sidedrawimage = function (imgd,picwidth,picheight){ var wrap = imgd.parentnode; var wrappadding = parseint(currentstyle(wrap).paddingleft) || 0; var image=new image(); image.src=imgd.src; if(image.width>0 && image.height>0){ if(image.width/image.height>= picwidth/picheight){ if(image.width>picwidth){ imgd.width=picwidth; imgd.height=(image.height*picwidth)/image.width; wrap.style.width = (picwidth + wrappadding) + "px"; wrap.style.height = ((image.height*picwidth)/image.width + wrappadding) + "px"; }else{ imgd.width=image.width; imgd.height=image.height; wrap.style.width = (image.width + wrappadding) + "px"; wrap.style.height = (image.height + wrappadding) + "px"; } imgd.alt=""; }else{ if(image.height>picheight){ imgd.height=picheight; imgd.width=(image.width*picheight)/image.height; wrap.style.height = (picheight + wrappadding) + "px"; wrap.style.width = ((image.width*picheight)/image.height + wrappadding) + "px"; }else{ imgd.width=image.width; imgd.height=image.height; wrap.style.width = (image.width + wrappadding) + "px"; wrap.style.height = (image.height + wrappadding) + "px"; } imgd.alt=""; } } } //*修正ie6 :hover背景闪烁* //使用时统一加载判断,此处不做浏览器判断 //=========================== var iebgimgcache = function(){ document.execcommand('backgroundimagecache', false, true); } //加入收藏 //=========================== function addfavorite(surl, stitle){ try{ window.external.addfavorite(surl, stitle); }catch (e){ try{ window.sidebar.addpanel(stitle, surl, ""); }catch (e){ alert("加入收藏失败,请使用ctrl+d进行添加"); } } } //*导航菜单显示方式* //显示方式、操作 //=========================== var menuorder = function (status,handle){ if (status!=""){ var obj = document.getelementbyid("nav"); var childobj = cleanwhitespaces(obj); var liarr = new array; var liwidth = new array; var allliw = 0; for (var i=0;i"; //var timeid = setinterval(runtime,1000); break; case "6"://设定宽度+显示时间 for(var s=0;s"; } break; default: return; } } } //栏目特效驱动 var coleffect = function (id,pic){ var tags = $getobj("hidteshuid").value; var hdparr = new array(); hdparr = tags.split("|"); for(var h=0;h