// JavaScript Document

function switchmodTag(){
}
switchmodTag.prototype = {
	st : 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]).onclick = function(){//如果想把效果变成点击切换，将此行onmouseover 改成onclick即可。
					
				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 STmodel = new switchmodTag();
	STmodel.st(["t1","t2","t3","t4"],["con1","con2","con3","con4"],"current","normal");//第一组动滑轮
	//STmodel.st(["t2_1","t2_2"],["c2_1","c2_2"],"current","normal");//第二组动滑轮
//	STmodel.st(["c_1","c_2","c_3","c_4","c_5"],["c3_1","c3_2","c3_3","c3_4","c3_5"],"st01","st02");//第三组动滑轮
//	STmodel.st(["d_1","d_2","d_3","d_4","d_5"],["c4_1","c4_2","c4_3","c4_4","c4_5"],"st01","st02");//第四组动滑轮
	//如需增加滑动门个数，请复制代码，ID命名规则如上即可。
}
