function ShowHideObj(eventType, openClassName, closeClassName, defaultNum) {
    var dateObj = {
        eventType: eventType || "mouseover",
        openClassName: openClassName || "selected",
        closeClassName: closeClassName || "",
        defaultNum: defaultNum || 1,
        array: []
    };
    var that = this;
    var addEvent = function(obj, evType, fn) {
        if (obj && obj.addEventListener) {
            obj.addEventListener(evType, fn, false);
            return true;
        } else if (obj && obj.attachEvent) {
            var r = obj.attachEvent("on" + evType, fn);
            return r;
        }
    };
    this.effectFlag = false;
    this.addElement = function(titleId, conId, fun) {
        $get(titleId).num = dateObj.array.length;
        $get(titleId).childNode = $get(conId);
        dateObj.array.push($get(titleId));
        dateObj.defaultNum == dateObj.array.length ? ($get(titleId).className = dateObj.openClassName, $get(conId) && ($get(conId).style.display = "block"), dateObj.openNode = $get(titleId)) : ($get(titleId).className = dateObj.closeClassName, $get(conId) && ($get(conId).style.display = "none"));
		dateObj.defaultNum == -1 && (dateObj.openNode = dateObj.array[0]);
        addEvent($get(titleId), dateObj.eventType,
        function() {
            if (fun) {
                fun();
            };
            that.showItem($get(titleId));
        });
    };
    this.showItem = function(CurDot) {
        dateObj.openNode.className = dateObj.closeClassName;
        dateObj.openNode.childNode && (dateObj.openNode.childNode.style.display = "none");
        CurDot.className = dateObj.openClassName;
        this.effectFlag ? CurDot.childNode && (showEffect(CurDot.childNode, 0, 100)) : CurDot.childNode && (CurDot.childNode.style.display = "block");
        dateObj.openNode = CurDot;
    };
    this.preNode = function(preNodeId, eventType) {
        eventType = eventType || "click";
        addEvent($get(preNodeId), eventType, $get(preNodeId) &&
        function() {
            that.showItem(dateObj.array[(dateObj.openNode.num + dateObj.array.length - 1) % dateObj.array.length]);
        });
    };
    this.nextNode = function(nextNodeId, eventType) {
        eventType = eventType || "click";
        addEvent($get(nextNodeId), eventType, $get(nextNodeId) &&
        function() {
            that.showItem(dateObj.array[(dateObj.openNode.num + 1) % dateObj.array.length]);
        });
    };
    this.autoPlay = function(timeOut, stopDom) {
        timeOut = timeOut || 3000;
        var doAutoPlay = function(timeOut) {
            dateObj.autoTimer && that.showItem(dateObj.array[(dateObj.openNode.num + 1) % dateObj.array.length]);
            dateObj.autoTimer = setTimeout(function() {
                doAutoPlay(timeOut);
            },
            timeOut);
        };
        doAutoPlay(timeOut);
        $get(stopDom) && addEvent($get(stopDom), "mouseover",
        function() {
            clearTimeout(dateObj.autoTimer);
        });
        addEvent($get(stopDom), "mouseout", $get(stopDom) &&
        function() {
            clearTimeout(that.autoTimer);
            dateObj.autoTimer = setTimeout(function() {
                doAutoPlay(timeOut);
            },
            timeOut);
        });
    };
};
ShowHideObj.prototype.author = "jinan";
ShowHideObj.prototype.copyright = "qiyi.com";
ShowHideObj.prototype.date = "10.1.29";
var $get = function(s) {
    return document.getElementById(s);
}
function showEffect(effectDot, x,y) {
	if((x=x+5) <= y){
		effectDot.style.display = "block";
		effectDot.style.opacity = 0.01 * x;
		effectDot.style.filter = "alpha(opacity=" + x + "))";
		setTimeout(function() {showEffect(effectDot, x,y)},0);
	}
}
function showEffect2(effectDot, x,y) {
	if((x=x-5) > y){
		effectDot.style.opacity = 0.01 * x;
		effectDot.style.filter = "alpha(opacity=" + x + "))";
		setTimeout(function() {showEffect2(effectDot, x,y)},0);
	}
	else{
		effectDot.style.display="none";
	}
}
function hideAll(actionDot){
	var newDot = document.createElement("div");
	newDot.style.cssText="width:100%;background:#000;position:absolute;left:0;top:0;z-index:99;opacity:0;display:none;";
	newDot.style.height=(document.body.offsetHeight+30)+"px";
	document.body.appendChild(newDot);
	if(actionDot){actionDot.style.cssText="position:relative;z-index:100";};
	var flag = true;
	actionDot.onclick=function(){newDot.style.display=="none" && flag ? (flag=false,showEffect(newDot,5,95),$get("flashArea").style.cssText="z-index:100;position:relative;",flag=true) : (flag=false,showEffect2(newDot,95,5),$get("flashArea").style.cssText="",flag=true);}
	showEffect(newDot,5,95);
	$get("flashArea").style.cssText="z-index:100;position:relative;";
}
function AddEventToDafen(num,fenshuShow,fenshuPic,aLinks,dafenInfo){
	this.manfenWidth = 140;
	this.starWidth = 24;
	this.starAddMarginWidth = 29;
	var that = this;
	this.init = function(){
		var curWidth = (num / 10 * this.manfenWidth - num / 10 * this.manfenWidth % 1)+"px";
		fenshuShow.innerHTML = "<strong>" + (num - num%1) + "</strong>."+(num % 1).toFixed(1)*10+" <span class='fBlack'>分</span>";
		fenshuPic.style.width = curWidth;
		if(aLinks && dafenInfo){
			var temp = dafenInfo.innerHTML;
			for(var i = 0; i < aLinks.length; i++){
				aLinks[i].num = i;
				aLinks[i].onmouseover = function(){fenshuPic.style.width = that.starAddMarginWidth * this.num + that.starWidth + "px";dafenInfo.className = "dafenInfo2"; AddEventToDafen.prototype.switchC(this.num,dafenInfo);}
				aLinks[i].onmouseout = function(){fenshuPic.style.width = curWidth;dafenInfo.className = "dafenInfo";dafenInfo.innerHTML = temp;}
				aLinks[i].onclick = function(){return false;}
			}
		}
	} 
}

