// JavaScript Document


var anchoE = 160 //anchura del cuadro
var altoE = 160 //altura del cuadro
var marcoE = 0 //0 para que notenga marcoE (borde)
var fondoE = '#FFFFFF' //color de fondoE del cuadro
var pausillaE = 2000 //tiempoE de la pausaE en milisegunedos (2000 = 2 segunedos)
var cursorE = "default;"  //cursorE que se quiera sobre el cuadro
var colTitularE = '#FF6600' //color del texto del titular
var colTextoE = '#333333' // color del texto de la noticia
var colFechaE = '#FF6600' //color del texto de la fecha
var colEnlaceE = '#660000' //color del texto del enlace
var fuenteE = "Trebuchet MS" //fuenteE para los textos 
var tamTitularE = '14' //tamaño de la fuenteE del titular
var tamTextoE = '13' //tamaño de la fuenteE del texto de la noticia
var tamFechaE = '11' // tamaño de la fuenteE de la fecha
var tamEnlaceE = '12' // tamaño de la fuenteE del enlace 
var masInfoE = true //detEermina si se usa o no el enlace. true para usarlo. false para omitirlo
var poneFechaE = true //true para poner fecha. false para omitirla. Si no se quiere fecha, dejar las comillas vacías ""

function evento(titularE,textoE,fechaE,enlaceE,destinoE){
	this.titularE = titularE
	this.textoE = textoE
	this.fechaE= fechaE
	this.enlaceE = enlaceE
	this.destinoE = destinoE
}

var eventos = new Array()
function cargaEventos (titularE,textoE,fechaE,enlaceE,destinoE,i2)
{
	eventos[i2]=new evento(titularE,textoE,fechaE,enlaceE,destinoE);	
}

var detE = false
function escribeE(){

document.write ('<div id="mami2" style="width:' + anchoE + 'px; height:' + altoE + 'px; position:relative;  overflow:hidden; margin-left:4px ">')
document.write('<table bgcolor="' + fondoE + '" border = "' + marcoE + '" width="' + anchoE + 'px" height="100%"><tr><td >')
document.write ('<div id="euno" style="top:' + altoE +'px; width:' + anchoE + 'px; height:' + altoE + 'px;  ">')
document.write ('<div class="titularE">')
document.write (eventos[0].titularE)
document.write ('</div>')
document.write ('<div class="fechaE">')
document.write (eventos[0].fechaE)
document.write ('</div>')
document.write ('<div class="textoE">')
document.write (eventos[0].textoE)
document.write ('</div>')

if(masInfoE == true){
	document.write ('<a class="enlaceE" href="../')
	document.write (eventos[0].enlaceE)
	document.write ('" target="' + eventos[0].destinoE + '">más información...</a>')
	}

	
document.write ('</div>')
document.write ('<div id="edos" style="top:' + (altoE*2) +'px; width:' + anchoE + 'px; height:' + altoE + 'px; ">')
document.write ('<div class="titularE">')
document.write (eventos[1].titularE)
document.write ('</div>')
document.write ('<div class="fechaE">')
document.write (eventos[1].fechaE)
document.write ('</div>')
document.write ('<div class="textoE">')
document.write (eventos[1].textoE)
document.write ('</div>')

if(masInfoE == true){
	document.write ('<a class="enlaceE" href="../')
	document.write (eventos[1].enlaceE)
	document.write ('" target = "' + eventos[1].destinoE + '">más información...</a>')
	}
document.write ('</div>')
document.write('</td></tr></table>')
document.write ('</div>')

if(navigator.appName == "Netscape")
{altoEeuno = document.getElementById('euno').offsetHeight}
else
{altoEeuno = document.getElementById('euno').clientHeight}
document.getElementById('euno').onmouseover =function(){
	detE = true
	clearTimeout(tiempoE)
	}
document.getElementById('euno').onmouseout =function(){
	detE = false;
	clearTimeout(tiempoE)
	escroleaE()
	}
document.getElementById('edos').onmouseover =function(){
	detE = true
	clearTimeout(tiempoE)
	}
document.getElementById('edos').onmouseout =function(){
	detE = false;
	clearTimeout(tiempoE)
	 escroleaE()
	 
	}

}
despE = 2
var contE = 1
var posE,pos2E
function escroleaE(){
posE = document.getElementById('euno').style.top 
posE = posE.replace(/px/,"");
posE = posE.replace(/pt/,"");
posE = new Number(posE);
pos2E =document.getElementById('edos').style.top
pos2E = pos2E.replace(/px/,"");
pos2E = pos2E.replace(/pt/,"");
pos2E = new Number(pos2E);
posE -= despE
pos2E -= despE

if (posE == despE){
	var contenidos = ""
	document.getElementById('edos').style.top = altoE + "px"
	document.getElementById('edos').childNodes[0].firstChild.nodeValue  = eventos[contE].titularE
	if(poneFechaE == true){
	document.getElementById('edos').childNodes[1].firstChild.nodeValue  = eventos[contE].fechaE
	}
	if (eventos[contE].textoE!=''){
	document.getElementById('edos').childNodes[2].firstChild.nodeValue  = eventos[contE].textoE
	}
	if(masInfoE == true){
		document.getElementById('edos').childNodes[3].href = eventos[contE].enlaceE
		document.getElementById('edos').childNodes[3].target = eventos[contE].destinoE
	}
	document.getElementById('euno').style.top = 0
	if(contE == eventos.length-1)
		{contE=0}
	else{
		contE++
		}
	pausaE()
	return false
	}
else{
	if (pos2E == despE){
		var contenidos = ""
		document.getElementById('euno').style.top = altoE + "px"
		document.getElementById('euno').childNodes[0].firstChild.nodeValue  = eventos[contE].titularE
		if(poneFechaE == true){
		document.getElementById('euno').childNodes[1].firstChild.nodeValue  = eventos[contE].fechaE
		}
		if (eventos[contE].textoE!=''){			
		document.getElementById('euno').childNodes[2].firstChild.nodeValue  = eventos[contE].textoE
		}
		if(masInfoE == true){
		document.getElementById('euno').childNodes[3].href  = eventos[contE].enlaceE
		document.getElementById('euno').childNodes[3].target  = eventos[contE].destinoE
		}
		document.getElementById('edos').style.top = 0
		if(contE == eventos.length-1)
		{contE=0}
	else{
		contE++
		}
		pausaE()
		return false
		}
	else{
		document.getElementById('euno').style.top = posE + "px"
		document.getElementById('edos').style.top = pos2E + "px"
		}
	}
tiempoE = window.setTimeout('escroleaE()',50)
}
var tiempoE
function pausaE()
{
clearTimeout(tiempoE)
if (detE == false){
	tiempoE = setTimeout ('continuarE()',2000)
	}
}
function continuarE()
{
if(detE == false)
	{escroleaE()}
}

document.write('<style type="text/css">')
document.write ('#euno {')
document.write ('color: #006699;')
if(cursorE == "pointer" || cursorE == "hand"){
cursorE = (navigator.appName == "Netscape")?'pointer;':'hand;';
}
document.write ('cursorE:' + cursorE + ";")
document.write ('position:absolute;}')
document.write ('#edos {')
document.write ('color: #006699;')
document.write ('cursorE:' + cursorE + ";")
document.write ('position:absolute;}')
document.write ('.titularE{')
document.write ('color:' + colTitularE +';')
document.write ('font-family:' + fuenteE + ';')
document.write ('font-size :' + tamTitularE + 'px;font-weight:bold}')
document.write ('.textoE{')
document.write ('color:' + colTextoE + ';')
document.write ('font-family:' + fuenteE + ';')
document.write ('font-size:' + tamTextoE + 'px;}')
if(poneFechaE == true){
document.write ('.fechaE{')
document.write ('color:' + colFechaE +';')
document.write ('font-family:' + fuenteE + ';')
document.write ('font-size :' + tamFechaE + 'px;font-weight:bold}')
}
else{
document.write ('.fechaE{display: none;}')
}
document.write ('.enlaceE{')
document.write ('color:' + colEnlaceE + ';')
document.write ('font-family:' + fuenteE + ';')
document.write ('font-size:' + tamEnlaceE + 'px;}')
document.write ('</style>')

