﻿// 鼠标经过
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[j]).style.display = "block";

				}
				_this.$(menus[this.value]).className = openClass;	
				_this.$(menus[this.value]).style.display = "none";
				_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(["tjt1","tjt2","tjt3","tjt4","tjt5","tjt6","tjt7","tjt8","tjt9","tjt10","tjt11","tjt12","tjt13","tjt14","tjt15","tjt16"],["tjl1","tjl2","tjl3","tjl4","tjl5","tjl6","tjl7","tjl8","tjl9","tjl10","tjl11","tjl12","tjl13","tjl14","tjl15","tjl16"]);
}

