
this.doEffect = function(id,effect,from,to,step,speed){
	this.effectId=id;
	this.effectAction = effect;
	this.effectOpacity=0;
	this.effectFrom=from;
	this.effectTo=to;
	this.effectStep=step;
	//break if timemer busy
	
	if(this.effectTimer == -1){
		if(id.length>0){
			var ele=document.getElementById(id);
			if(effect=="show"){
				if(!((this.effectOpacity > 1)&&(this.effectOpacity < 99))){
					this.effectOpacity=from; 
				}
				this.setOpacity(ele,this.effectOpacity);
				ele.style.display="block";
				this.effectTimer=setInterval("sdxEffectTimer()",speed);
			}else if(effect=="hide"){
				
				if(!((this.effectOpacity > 1)&&(this.effectOpacity < 99))){
					this.effectOpacity=from;
				}
				this.setOpacity(ele,this.effectOpacity);
				this.effectTimer=setInterval("sdxEffectTimer()",speed);
			}
		}
	}
}

this.stopEffectTimer =function(){
	clearInterval(this.effectTimer);
	this.effectTimer=-1;
}

this.sdxEffectTimer=function(){
	if(this.effectId.length>0){
		var ele = document.getElementById(this.effectId);
		if(this.effectAction=="show"){
		//effect show
			if(this.effectOpacity<this.effectTo){
				this.effectOpacity+=this.effectStep;
				setOpacity(ele,this.effectOpacity);
			}else{
				this.stopEffectTimer();
				var str=this.afterEffect;
				this.afterEffect="";
				eval(str);
			}
		}else if(this.effectAction=="hide"){
			//effect hide
			if(this.effectOpacity>this.effectTo){
				this.effectOpacity-=this.effectStep;
				setOpacity(ele,this.effectOpacity);
			}else{
				if(this.effectOpacity==0){
					ele.style.display="none";
				}
				this.stopEffectTimer();		
				var str=this.afterEffect;
				this.afterEffect="";
				eval(str);
			}
		}
		//effect 3
		
		//effect ...
	}
}

this.setOpacity = function(obj,value) {
	obj.style.opacity = value/100;
	obj.style.filter = 'alpha(opacity=' + value + ')';
}

this.showOverflow= function(){
	this.afterEffect="doEffect('overflowFrame','show',0,100,10,10);";
	doEffect('pageGlower','show',0,75,25,50);
}

this.hideOverflow=function(){
	this.afterEffect="doEffect('pageGlower','hide',50,0,10,10);";
	doEffect('overflowFrame','hide',100,0,20,50);
	
}

