$(function(){ $("#nav li[class!=line]").mouseover(function(){ $(this).addClass("hover").siblings("li").removeClass("hover"); $("#subnav ul:eq("+$("#nav li[class!=line]").index($(this))+")").show().siblings("ul").hide(); }); $(".listC td").click(function(){ $(this).addClass("cur").siblings("td").removeClass("cur"); }); $(".listC .arrleft").click(function(){ $('#Marquee').stop().animate({scrollLeft:'-=87px'},'normal'); }); $(".listC .arrright").click(function(){ $('#Marquee').stop().animate({scrollLeft:'+=87px'},'normal'); }); initNav(); }); function initNav(){ var tag = $(document.body).attr("id"); if(tag != "undefined"){ var s = tag.split("-"); var l1 = "#"+s[0]; var l2 = "#"+s[1]; $(l1).addClass("hover").siblings("li").removeClass("hover"); $("#subnav ul:eq("+$("#nav li[class!=line]").index($(l1))+")").show().siblings("ul").hide(); if(l2 != "none"){ $(l2).addClass("cur"); } } } function $id() { return document.getElementById(arguments[0]); } //ȡ���ⲿclass������ֵ function getCurrentStyle(o) { return o.currentStyle||document.defaultView.getComputedStyle(o,null); } var SetAllSelects = { Offset:function(e) { var t = e.offsetTop; var l = e.offsetLeft; var w = e.offsetWidth; var h = e.offsetHeight; while(e = e.offsetParent) { t += e.offsetTop; l += e.offsetLeft; } return {top:t, left:l, width:w, height:h}; }, setCreated:function(obj,status) { //�������� obj.setAttribute("childCreated",status); }, getCreated:function(obj) { //��ȡ���� var status = obj.getAttribute("childCreated"); if(status == null) { status = ""; } return status; }, setSelectStyle:function(obj,idnum,showHeight) { if(obj.id == null || obj.id == "") { obj.id = "selectID_"+idnum; } var offset = this.Offset(obj); obj.style.visibility = "hidden"; var mainDiv = document.createElement("div"); var iDiv = document.createElement("div"); var js_select_; var _this = this; iDiv.className = "iDiv"; iDiv.id = js_select_+obj.id; iDiv.style.width = offset.width + "px"; iDiv.style.top = offset.top + "px"; iDiv.style.left = offset.left + "px"; this.setCreated(iDiv,""); mainDiv.appendChild(iDiv); var tValue = obj.options[obj.selectedIndex].innerHTML; iDiv.innerHTML = tValue; iDiv.onclick = function() { var created = _this.getCreated(this); if (created != "") { if (created == "open") { this.nextSibling.style.display = "none"; _this.setCreated(this,"close"); } else { _this.setCreated(this,"open"); var arrLiObj = this.nextSibling.getElementsByTagName("li"); var selOjbIndex = 0; for(var i=0;ishowHeight) { cDiv.style.height = showHeight + "px"; } cDiv.style.top = (offset.top+parseInt(getCurrentStyle(this).height)+1) + "px"; cDiv.style.left = offset.left + "px"; cDiv.onselectstart = function() {return false;}; var uUl = document.createElement("ul"); cDiv.appendChild(uUl); mainDiv.appendChild(cDiv); for (var i=0;i0) { for (var j=0;j