var mousesobre = 0;
function domticker(content, divId, divClass, delay, fadeornot){
	this.content=content
	this.tickerid=divId
	this.delay=delay
	this.mouseoverBol=0
	this.mousesobre=0
	this.pointer=1
	this.opacitystring=(typeof fadeornot!="undefined")? "width: 100%; filter:progid:DXImageTransform.Microsoft.alpha(opacity=100); -moz-opacity: 1" : ""
	if (this.opacitystring!="") this.delay+=500
	this.opacitysetting=0.1
	document.write('<div id="'+divId+'" class="'+divClass+'"><div style="'+this.opacitystring+'">'+content[0]+'</div></div>')
	var instanceOfTicker=this
	setTimeout(function(){instanceOfTicker.initialize()}, delay)
}
domticker.prototype.initialize=function(){
	var instanceOfTicker=this
	this.contentdiv=document.getElementById(this.tickerid).firstChild
	document.getElementById(this.tickerid).onmouseover=function(){instanceOfTicker.mouseoverBol=1}
	document.getElementById(this.tickerid).onmouseout=function(){
		instanceOfTicker.mouseoverBol=0;
		mousesobre=0;
		for (i=1; i < 18 + 1 ; i++) {
        	document.getElementById(ctrNoticias + "_" + i).className = 'ctrInactive';
			document.getElementById(tabNoticias + "_" + i).className = 'tabInactive';
    	}
	}
	this.rotatemsg()
}
domticker.prototype.rotatemsg=function(){
	var instanceOfTicker=this
	if ((this.mouseoverBol==1) || (mousesobre==1))
	setTimeout(function(){instanceOfTicker.rotatemsg()}, 100)
	else{	
		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.rotatemsg()}, this.delay)
	}
}
domticker.prototype.fadetransition=function(fadetype, timerid){
	var contentdiv=this.contentdiv
	if (fadetype=="reset")
	this.opacitysetting=0.1
	if (contentdiv.filters && contentdiv.filters[0]){
		if (typeof contentdiv.filters[0].opacity=="number")
		contentdiv.filters[0].opacity=this.opacitysetting*100
		else //IE 5.5
		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.1
	if (fadetype=="up" && this.opacitysetting>=1)
	clearInterval(this[timerid])
}