//获取对象 function _$(id) { return typeof(id)=="string"?document.getElementById(id):id; } //树形菜单 左右缩放 function switchSysBar(){ var switchPoint = _$('switchPoint'); var _sidebar_r = _$('sidebar_r'); if (switchPoint.className=='') { switchPoint.className='b2'; _$("frmTitle").style.display="none"; _$("body_bg").style.background="none"; _sidebar_r.style.width = 985+'px'; } else { switchPoint.className=''; _$("frmTitle").style.display="" _$("body_bg").style.background="url(/images/adsense/public/menu_bg.gif) repeat-y" _sidebar_r.style.width = 815 + 'px'; } } //更换class function shover(o,className) { if(!o) return; o.className = className; } //添加class function addClass(o,className) { if(!o) return; o.className = className+" " + o.className; } //顶部菜单高亮定位 function current_position() { var box = _$("top_bar"); box||(box=document.body); if(box==null||!box.getAttribute("type"))return; var _id = box.getAttribute("type").replace(/\s+/g,""); var o = _$(_id); if(o) { o.className = "on"; } } //标题经过效果 function tbhover(o) { var obj=_$(o).getElementsByTagName('tbody')[0]; for(var i=0;i0) { T = document.documentElement.scrollTop+(document.documentElement.clientHeight-o.offsetHeight)/2;//上下居中 } o.style.top=T+'px'; } var objFilters = []; /* * * 判断在数组中是否含有给定的一个变量值 * 参数说明: * needle:需要查询的值 * haystack:被查询的数组 * 在haystack中查询needle是否存在,如果找到返回true,否则返回false。 * 此函数只能对字符和数字有效 * */ function in_array(needle,haystack) { // 得到needle的类型 var type = typeof needle; if(type == "object" ) { for(var i in haystack) { if(haystack[i] == needle) { return true; } } } return false; } /*功能说明:显示和隐藏某个层 *参数说明: _id01为要显示/隐藏的id * _id02为要左右居中的id **/ var showorhide = function(_id01, _id02){ if((_id01 ==""||typeof _id01 !="string")&&(_id02 ==""||typeof _id02 !="string")) return; _obj01 = _$(_id01); _obj02 = _$(_id02); if(!_obj01||!_obj02)return; if(_id01!="pop_filter_login") { if(objFilters.length<1) { objFilters.push(_obj01); } else { if(!in_array(_obj01,objFilters)) { objFilters.push(_obj01); } } } else { for( var i=0,j=objFilters.length;i