if(!R9_Objects){
var R9_Objects=[];
}
function R9_Flippy(_1){
	this._objectId;
	this.characterList=" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.";
	this.width=300;
	this.height=25;
	this.numLetters=20;
	this.valueDefault=new Array();
	this.flipTime=75;
	this.pauseAfterMatch=2000;
	this.loop=false;
	this.letterColor="white";
	this.letterBg="black";
	this.letterBorder;
	this.letterFontFamily="Courier, monospace";
	this.letterFontSize="12pt";
	this.letterFontWeight="bold";
	this.backgroundColor="#808080";
	this.letterSpacing=1;
	this.baseZindex=1;
	this.styleContainerClass;
	this.styleLetterFieldClass="flippyLetter";
	this.styleTableClass="flippyTable";
	this.alldonecallback=null;
	this.ctrl;
	this._textArray;
	this._awaitingArray;
	this._textArrayIndex=0;
	this._timerID;
	this._handleId;
	this._handleObj;
	this._tableId;
	this._tableObj;
	this._letterId;
	this._letterObj=new Array();
	
	//constructor
	this._constructor=function(_2){
		this._id=R9_Objects.length;
		R9_Objects[this._id]=this;
		this._objectId="R9_Flippy"+this._id;
		this.objectName=this._objectId;
		if(typeof (_2)=="string"){
			this.fieldName=_2+"_value";
			this.objectName=_2;
		}
	};
	
	//checkup
	this._checkup=function(){
		this._textArray=this.valueDefault;
	};
	
	//render
	this.render=function(_3) {
		this._checkup();
		this._containerId="co"+_3;
		this._tableId="tbl"+_3;
		this._letterId="td"+_3;
		
		var _4=this.width;
		var _5=this.height;
		var _6=new Array();
		var _7=0;
		var _8=0;
		
		_6[_7++]="<div id=\""+this._containerId+"\"";
		if(this.styleContainerClass){
			_6[_7++]=" class=\""+this.styleContainerClass+"\"";
		}
		
		_6[_7++]=" style=\"position:relative;";
		_6[_7++]="\"> ";
		_6[_7++]="<table id=\""+this._tableId+"\" cellpadding=\"0\" cellspacing=\""+this.letterSpacing+"\" ";
		
		var _9=0;
		var _a=0;
		
		_6[_7++]=" style=\"position:relative; left:"+_9+"px; top:"+_a+"px; width:"+_4+"px; height: "+_5+"px; clip:rect(0 "+_4+"  "+_5+" 0);";
		
		if(this.backgroundColor) {
			_6[_7++]="background-color:"+this.backgroundColor+"; layer-background-color:"+this.backgroundColor+";";
		}
		
		_6[_7++]="\" ";
		
		if(this.styleTableClass) {
			_6[_7++]="class=\""+this.styleTableClass+"\" ";
		}
		
		_6[_7++]=">";
		
		var _b=Math.floor((this.width/this.numLetters)-this.letterSpacing);
		
		for(var i=0;i<this.numLetters;i++) {
			var _d=this._tableId+i+"";
			
			_6[_7++]="<td align=\"center\" style=\"height: 100%; text-align: center; width:"+_b+"px; ";
			
			if(this.letterColor) {
				_6[_7++]="color:"+this.letterColor+"; layer-color:"+this.letterColor+";";
			}
			
			if(this.letterBg) {
				_6[_7++]="background-color: "+this.letterBg+"; layer-background-color:"+this.letterBg+";";
			}
			
			if(this.letterFontFamily) {
				_6[_7++]="font-family: "+this.letterFontFamily+";";
			}
			
			if(this.letterFontWeight) {
				_6[_7++]="font-weight: "+this.letterFontWeight+";";
			}
			
			if(this.letterFontSize){
				_6[_7++]="font-size: "+this.letterFontSize+";";
			}
			
			if(this.letterBorder){
				_6[_7++]="border: "+this.letterBorder+";";
			}
			
			_6[_7++]="\" width=\"";
			_6[_7++]=_b+"\" ";
			
			if(this.styleLetterFieldClass){
				_6[_7++]="class=\""+this.styleLetterFieldClass+"\" ";
			}
			_6[_7++]="><span id=\""+_d+"\">&nbsp;</span></td>";
		}
		
		_6[_7++]="</table>";
		_6[_7++]="</div>";
		
		document.getElementById(_3).innerHTML=_6.join("");
		
		this._containerObj=document.getElementById(this._containerId);
		this._tableObj=document.getElementById(this._tableId);
		
		for(var i=0;i<this.numLetters;i++){
			var _d=this._tableId+i+"";
			this._letterObj[i]=document.getElementById(_d);
		}
	};
	
	//drawInto
	this.drawInto=function(_e) {
		this.render(_e);
	};
	
	//setString
	this.setStrings=function(_f) {
		if(_f!=null&&typeof (_f)=="object"){
			if(this._textArray==null||this._textArray.length==0){
				this._textArray=_f;
				this._startTimer();
			}else{
				this._awaitingArray=_f;
			}
		}
	};
	
	//addString
	this.addString=function(_10){
		if(_10!=null&&typeof (_10)=="string"){
			if(this._textArray==null){
				this._textArray=new Array();
			}
			var obj=new Object();
			obj.name=_10;
			obj.shown=false;
			this._textArray.push(obj);
			if(this._timerID==null){
				this._startTimer();
			}
		}
	};
	
	//getValue
	this.getValue=function(){
		if(this._textArray!=null&&this._textArray[this._textArrayIndex]!=null){
			return this._textArray[this._textArrayIndex];
		}
		return null;
	};
	
	//timerCallBack
	this.timerCallback=function(){
		if(this._textArray!=null&&this._textArray[this._textArrayIndex]!=null) {
			var _12=this._textArray[this._textArrayIndex].name;
			var _13=true;
			
			for(var i=0;i<this._letterObj.length;i++) {
				var _15=this._letterObj[i].innerHTML;
				if(_15=="&nbsp;"||_15==""){
					_15=" ";
				}
				var _16=" ";
				if(i<_12.length){
					_16=_12.charAt(i);
				}
				if(_16==_15){
					continue;
				}
				_13=false;
				var _17=this.characterList.indexOf(_15);
				
				if(_17==this.characterList.length-1) {
					_17=0;
				}else{
					_17++;
				}
				if(window.console){
					this._letterObj[i].innerHTML=(this.characterList.charAt(_17)==" ")?" ":this.characterList.charAt(_17);
				}else{
					this._letterObj[i].innerHTML=(this.characterList.charAt(_17)==" ")?"&nbsp;":this.characterList.charAt(_17);
				}
			}
			
			if(_13){
				if(!this._textArray[this._textArrayIndex].shown){
					if(this.alldonecallback){
						this.alldonecallback();
					}
				}
				
				this._textArray[this._textArrayIndex].shown=true;
				if(this._textArrayIndex+1>=this._textArray.length){
					if(this.loop){
						this._textArrayIndex=0;
					}else{
						this._stopTimer();
					}
				} else {
					this._textArrayIndex++;
					var _18=this._textArray[this._textArrayIndex];
					while(_18!=null&&_18.shown){
						if(this._textArrayIndex+1>this._textArray.length) {
							break;
						}
						this._textArrayIndex++;
						_18=this._textArray[this._textArrayIndex];
					}
				}
				this._wordMatched();
			}
		} else {
			if(this.loop){
				this._textArrayIndex=0;
			}else{
				this._stopTimer();
			}
		}	
	};
	
	//startTimer
	this._startTimer=function(){
		if(this._timerID==null){
			this._timerID=window.setInterval("R9_Objects["+this._id+"].timerCallback()",this.flipTime);
		}
	};
	
	//stopTimer
	this._stopTimer=function(){
		if(this._timerID!=null){
			window.clearInterval(this._timerID);
			this._timerID=null;
		}
	};
	
	//WordMatcher
	this._wordMatched=function(){
		this._stopTimer();
		window.setTimeout("R9_Objects["+this._id+"]._startTimer()",this.pauseAfterMatch);
	};
	
	this._constructor(_1);
}
// r9compressed
