function setFocus3(i) { selectLayer3(i); } function selectLayer3(i) { switch(i) { case 1: document.getElementById("N1").className="toocle2"; document.getElementById("N2").className="toocle1"; document.getElementById("N3").className="toocle1"; break; case 2: document.getElementById("N1").className="toocle1"; document.getElementById("N2").className="toocle2"; document.getElementById("N3").className="toocle1"; break; case 3: document.getElementById("N1").className="toocle1"; document.getElementById("N2").className="toocle1"; document.getElementById("N3").className="toocle2"; break; } } function scrollDoor(){ } scrollDoor.prototype = { sd : function(menus,divs,openClass,closeClass){ var _this = this; if(menus.length != divs.length) { alert("菜单层数量和内容层数量不一样!"); return false; } for(var i = 0 ; i < menus.length ; i++) { _this.$(menus[i]).value = i; _this.$(menus[i]).onmouseover = function(){ for(var j = 0 ; j < menus.length ; j++) { _this.$(menus[j]).className = closeClass; _this.$(divs[j]).style.display = "none"; } _this.$(menus[this.value]).className = openClass; _this.$(divs[this.value]).style.display = "block"; } } }, $ : function(oid){ if(typeof(oid) == "string") return document.getElementById(oid); return oid; } } window.onload = function(){ var SDmodel = new scrollDoor(); SDmodel.sd(["m01","m02"],["c01","c02"],"sd01","sd02"); } function startmarquee(lh,speed,delay,index){ var t; var p=false; var o=document.getElementById("marqueebox"+index); o.innerHTML+=o.innerHTML; o.onmouseover=function(){p=true} o.onmouseout=function(){p=false} o.scrollTop = 0; function start(){ t=setInterval(scrolling,speed); if(!p) o.scrollTop += 2; } function scrolling(){ if(o.scrollTop%lh!=0){ o.scrollTop += 2; if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0; }else{ clearInterval(t); setTimeout(start,delay);}} setTimeout(start,delay);} startmarquee(22,50,3000,0);