
var TREffects={setup:function(params){if(params['rollPrefix']){this._rollPrefix=params['rollPrefix'];}
if(params['rollCols']){this._rollCols=params['rollCols'];}},toggleObj:function(obj){if($(obj).style.display=="none"){$(obj).style.display="block";}else{$(obj).style.display="none";}},showObj:function(obj){if($(obj)){$(obj).style.display="block";}},hideObj:function(obj){if($(obj)){$(obj).style.display="none";}},showPopup:function(obj){this.getScreenParams();var centerWidth=((this.frameWidth/2)-300)+"px";this.showOverlay();scrollAdd=f_scrollTop()+100;$(obj).style.top=scrollAdd+"px";$(obj).style.left=centerWidth;$(obj).style.display="block";},hidePopup:function(obj){this.hideOverlay();this.hideObj(obj);},getScreenParams:function(){if(self.innerWidth){this.frameWidth=self.innerWidth;this.frameHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientWidth){this.frameWidth=document.documentElement.clientWidth;this.frameHeight=document.documentElement.clientHeight;}else if(document.body){this.frameWidth=document.body.clientWidth;this.frameHeight=document.body.clientHeight;}
else return;},getDocHeight:function(){var D=document;return Math.max(Math.max(D.body.scrollHeight,D.documentElement.scrollHeight),Math.max(D.body.offsetHeight,D.documentElement.offsetHeight),Math.max(D.body.clientHeight,D.documentElement.clientHeight));},showOverlay:function(){if($('overlay')){var _docHeight=this.getDocHeight();var _docWidth=(document.width||document.body.offsetWidth);var objOverlay=$('overlay');objOverlay.style.bottom="0px";objOverlay.style.height=_docHeight+"px";objOverlay.style.width=_docWidth+"px";if(!this.isIE){objOverlay.style.display='block';}}},showIndicator:function(){this.getScreenParams();var objIndicator=$('overlay_indicator');var ySpot=(document.all)?document.body.scrollTop:window.pageYOffset;var newYSpot=((this.frameHeight/2)+ySpot-150);var xSpot=(document.all)?document.body.scrollLeft:window.pageXOffset;var newXSpot=((this.frameWidth/2)+xSpot-100);objIndicator.style.left=newXSpot+"px";objIndicator.style.top=newYSpot+"px";objIndicator.style.display="block";},hideOverlay:function(){if($("overlay")){$("overlay").style.display="none";$('overlay_indicator').style.display="none";}},highLight:function(){var obj=arguments[0];if(arguments[1]!=undefined){this._overColor=arguments[1];}
if(arguments[2]!=undefined){this._rowPrefix=arguments[2];}
if(arguments[3]!=undefined){this._rowCols=arguments[3];}
if(obj!=undefined){if(this._rowCols!=1){for(ii=0;ii<this._rowCols;ii++){tempCol="td_"+this._rowPrefix+"_"+ii;if($(tempCol)){this.do_colorChange($(tempCol),this._overColor);}}}else{this.do_colorChange(obj,this._overColor);}}},lowLight:function(){alert("Function no longer valid, tell Steve what page you saw this on.");},do_colorChange:function(obj,color){obj.style.backgroundColor="#"+color;},clicked:function(){},increase:function(objId,finalSize){if(!this._inAction){this._inAction=true;this._workingOn=objId;this._finalSize=finalSize;$(this._workingOn).style.height="20px";$(this._workingOn).style.display="block";this._direction="increase";this.do_box_motion();}else{this.addStack(this.moveDown,objId,finalY);}},decrease:function(objId,intSize){if(!this._inAction){this._inAction=true;this._workingOn=objId;this._finalSize=intSize;this._direction="decrease";this.startHeight=$(this._workingOn).offsetHeight;this.do_box_motion();}else{this.addStack(this.moveDown,objId,finalY);}},do_box_motion:function(){if(this._direction=="increase"){if($(this._workingOn).offsetHeight<this._finalSize){$(this._workingOn).style.height=($(this._workingOn).offsetHeight+this.motionSpeed)+"px";}
if($(this._workingOn).offsetHeight<this._finalSize){this.resizeTimer=setTimeout("TREffects.do_box_motion();",this.delayTime);}else{window.clearTimeout(this.resizeTimer);this._inAction=false;}}
else if(this._direction=="decrease"){var movement;if($(this._workingOn).offsetHeight>this._finalSize){if(($(this._workingOn).offsetHeight-this.motionSpeed*2)<0){movement=0;}else{movement=($(this._workingOn).offsetHeight-this.motionSpeed*2);}
$(this._workingOn).style.height=movement+"px";}
if($(this._workingOn).offsetHeight>this._finalSize){this.resizeTimer=setTimeout("TREffects.do_box_motion();",this.delayTime);}else if(this._dontHide){$(this._workingOn).style.height=this._finalSize+"px";this._inAction=false;this._dontHide=false;}else{$(this._workingOn).style.display="none";window.clearTimeout(this.resizeTimer);this._inAction=false;}}
else if(this._direction=="down"){if(this.startHeight>this.movedBy){$(this._workingOn).style.top=($(this._workingOn).offsetTop+2)+"px";this.movedBy+=2;}
if(this.startHeight>this.movedBy){this.resizeTimer=setTimeout("TREffects.do_box_motion();",this.delayTime);}else{window.clearTimeout(this.resizeTimer);this._inAction=false;}}
else if(this._direction=="up"){if(this.startHeight>this.movedBy){$(this._workingOn).style.top=($(this._workingOn).offsetTop-2)+"px";this.movedBy+=2;}
if(this.startHeight>this.movedBy){this.resizeTimer=setTimeout("TREffects.do_box_motion();",this.delayTime);}else{$(this._workingOn).style.display="none";window.clearTimeout(this.resizeTimer);this._inAction=false;}}else{}
if(!this._inAction){TREffects.getStack();}},moveDown:function(objId,finalY){if(!this._inAction){this._inAction=true;this._workingOn=objId;this._finalSize=finalY;this._direction="down";this.startHeight=finalY;this.movedBy=0;this.startTop=$(this._workingOn).offsetTop;if(0>parseInt($(this._workingOn).offsetTop)){this.do_box_motion();}
else{this._inAction=false;}}else{this.addStack(this.moveDown,objId,finalY);}},moveUp:function(objId,finalY){if(!this._inAction){this._inAction=true;this._workingOn=objId;this._finalSize=finalY;this._direction="up";this.startHeight=$(this._workingOn).offsetHeight;this.movedBy=0;this.startTop=$(this._workingOn).offsetTop;this.do_box_motion();}else{this.addStack(this.moveDown,objId,finalY);}},addStack:function(){if(typeof MAXSTACK=='undefined'){MAXSTACK=5;}
if(this.funcStack.length<MAXSTACK){this.funcStack.push({func:arguments[0],varA:arguments[1],varB:arguments[2]});}},getStack:function(){if(this.funcStack.length>0){var nextFunc=this.funcStack.pop();try{nextFunc.func.call(this,nextFunc.varA,nextFunc.varB);}catch(E){alert(E);}}},funcStack:new Array(),MAXSTACK:5,frameWidth:0,frameHeight:0,movedBy:0,startHeight:0,delayTime:30,motionSpeed:12,_finalSize:0,_direction:"increase",_dontHide:false,_inAction:false,_workingOn:null,_lastColor:null,_overColor:"bed2e8",_rowPrefix:"",_rowCols:1,added:0,isIE:(!!navigator.userAgent.match(/MSIE/))};
