function SwitchTab() {            
	if (typeof arguments[0] == "string") this.EVENT = arguments[0];            
	if (typeof arguments[1] == "object") this.TAB = arguments[1];
	if (typeof arguments[2] == "object") this.WRAP = arguments[2];
	if (typeof arguments[3] == "string") this.CLASS = arguments[3];
	this.isIE = (navigator.appName.indexOf("Explorer") > -1);
	var msobj = this;
	msobj.Switch = function() {
		var events = arguments[0];
		var obj = msobj.isIE ? events['srcElement'] : events['target'];
		var regClassName = new RegExp("\s*" + msobj.CLASS, "ig");
		for (var i = 0, j = msobj.TAB.length; i < j; i++) {
			if (obj.id != msobj.TAB[i]) {
				msobj.$(msobj.TAB[i]).className = msobj.$(msobj.TAB[i]).className.replace(regClassName, "");
				msobj.$(msobj.WRAP[i]).style.display = 'none';
			} else {
				msobj.$(msobj.TAB[i]).className += msobj.CLASS;
				msobj.$(msobj.WRAP[i]).style.display = 'block';
			}
		}
	}
	msobj.attachEvents();
}
SwitchTab.prototype.$ = function(objId) {
	return document.getElementById(objId);
}
SwitchTab.prototype.attachEvents = function() {
	if (this.TAB == undefined || this.TAB.length == 0) return;
	if (this.isIE) {
		for (var i = 0, j = this.TAB.length; i < j; i++) {
			var obj = this.$(this.TAB[i]);
			obj.attachEvent('on' + this.EVENT, this.Switch);
		}
	} else {
		for (var i = 0, j = this.TAB.length; i < j; i++) {
			var obj = this.$(this.TAB[i]);
			obj.addEventListener(this.EVENT, this.Switch, false);
		}
	}
}
