/* Rotating Images */

function domticker(content, divId, delay, fadethis){
this.content=content
this.tickerid=divId 
this.delay=delay 
this.mouseoverBol=0 
this.pointer=1
/*Need a better way for this ... */
this.opacitystring=(fadethis)? "width: 100%; filter:progid:DXImageTransform.Microsoft.alpha(opacity=100); -moz-opacity: 1" : ""
/* ... */
if (this.opacitystring!="") this.delay+=500 
this.opacitysetting=0.2 
var flashContainer = document.getElementById(divId);
if(flashContainer){
	flashContainer.innerHTML = '<div style="'+this.opacitystring+'">'+content[0]+'</div>';
	var instanceOfTicker=this
		if(content.length > 1){
			this.contentdiv=document.getElementById(this.tickerid).firstChild 
			this.rotateimg()
		}	
	}
}

domticker.prototype.rotateimg=function(){
	var instanceOfTicker=this
	this.fadetransition("reset") 
	this.contentdiv.innerHTML=this.content[this.pointer]
	this.fadetimer1=setInterval(function(){instanceOfTicker.fadetransition('up', 'fadetimer1')}, 100) 
	this.pointer=(this.pointer<this.content.length-1)? this.pointer+1 : 0
	setTimeout(function(){instanceOfTicker.rotateimg()}, this.delay) 
}

domticker.prototype.fadetransition=function(fadetype, timerid){
var contentdiv=this.contentdiv
	if (fadetype=="reset")
		this.opacitysetting=0.2
	if (contentdiv.filters && contentdiv.filters[0]){
		if (typeof contentdiv.filters[0].opacity=="number") 
			contentdiv.filters[0].opacity=this.opacitysetting*100
		else 
			contentdiv.style.filter="alpha(opacity="+this.opacitysetting*100+")"
	}else if (typeof contentdiv.style.MozOpacity!="undefined" && this.opacitystring!=""){
		contentdiv.style.MozOpacity=this.opacitysetting
	}else
		this.opacitysetting=1

	if (fadetype=="up")
		this.opacitysetting+=0.2
		
	if (fadetype=="up" && this.opacitysetting>1)
		clearInterval(this[timerid])
}

function flashImagesArray(){
var images = new Array();
for (var i=0, len = flashImages.length; i< len ; i++)
	if (flashImages[i])
		images.push(flashImages[i]);
return images;
}
