var noti_ancho = 215 //anchura del cuadro
var noti_alto = 100 //altura del cuadro
var noti_marco = 0 //0 para que notenga marco (borde)
var noti_fondo = '' //color de fondo del cuadro
var noti_pausilla = 0 //tiempo de la pausa en milisegundos (2000 = 2 segundos)
var noti_destino = "_self" //target en donde se quiera que se carguen los enlaces, en caso de usarlos.
var noti_cursor = "default;"  //cursor que se quiera sobre el cuadro
var noti_colTitular = '#FFFFFF' //color del texto del titular
var noti_colTexto = '#000000' // color del texto de la noticia
var noti_colFecha = '#FFFFFF' //color del texto de la fecha
var noti_colEnlace = '#000099' //color del texto del enlace
var noti_fuente = "arial" //fuente para los textos 
var noti_tamTitular = '11' //tamaño de la fuente del titular
var noti_tamTexto = '11' //tamaño de la fuente del texto de la noticia
var noti_tamFecha = '10' // tamaño de la fuente de la fecha
var noti_tamEnlace = '11' // tamaño de la fuente del enlace 
var noti_masInfo = true //Determina si se usa o no el enlace. true para usarlo. false para omitirlo
var noti_poneFecha = true //true para poner fecha. false para omitirla. Si no se quiere fecha, dejar las comillas vacías ""

function noti_noticia(titular,texto,fecha,enlace,destino){
	this.titular = titular
	this.texto = texto
	this.fecha= fecha
	this.enlace = enlace
	this.destino = destino
}

//var noti_noticias = new Array()

//noti_noticias[0]= new noti_noticia("Noticia 1","Nota usando Arial","12/5/03","noti1.htm","")
//noti_noticias[1]= new noti_noticia("Noticia 2","nota usando Verdana","15/5/03","noti2.htm","")


var noti_det = false
function noti_escribe(){
	document.write ('<div id="noti_mami" style="width:' + noti_ancho + '; height:' + noti_alto + 'px; position:fixed; z-index=0; overflow:hidden ">')
	document.write('<table bgcolor="' + noti_fondo + '" border = "' + noti_marco + '" width="' + noti_ancho + '" height="100%"><tr><td valign="top">')
	document.write ('<div id="noti_uno" style="top:' + noti_alto +'; width:' + noti_ancho + ' height:' + noti_alto + 'px; z-index:0; ">')
	document.write ('<div class="noti_titular">')
	document.write (noti_noticias[0].titular)
	document.write ('</div>')
	document.write ('<div class="noti_fecha">')
	document.write (noti_noticias[0].fecha)
	document.write ('</div>')
	document.write ('<div class="noti_texto">')
	document.write (noti_noticias[0].texto)
	document.write ('</div>')
	if(noti_masInfo == true){
		document.write ('<a class="noti_enlace" href="')
		document.write (noti_noticias[0].enlace)
		document.write ('" target="' + noti_destino + '">Click aquí para leer noticia completa</a>')
	}
	document.write ('</div>')
	document.write ('<div id="noti_dos" style="top:' + (noti_alto*2) +'; width:' + noti_ancho + ' height:' + noti_alto + 'px; ">')
	document.write ('<div class="noti_titular">')
	document.write (noti_noticias[1].titular)
	document.write ('</div>')
	document.write ('<div class="noti_fecha">')
	document.write (noti_noticias[1].fecha)
	document.write ('</div>')
	document.write ('<div class="noti_texto">')
	document.write (noti_noticias[1].texto)
	document.write ('</div>')
	if(noti_masInfo == true){
		document.write ('<a class="noti_enlace" href="')
		document.write (noti_noticias[1].enlace)
		document.write ('" target = "' + noti_destino + '">Click aquí para leer noticia completa</a>')
	}
	document.write ('</div>')
	document.write('</td></tr></table>')
	document.write ('</div>')
	if(navigator.appName == "Netscape"){
		noti_altoUno = document.getElementById('noti_uno').offsetHeight
	}
	else{
		noti_altoUno = document.getElementById('noti_uno').clientHeight
	}

	document.getElementById('noti_uno').onmouseover = function(){
		noti_det = true	
		clearTimeout(noti_tiempo)
	}
	
	document.getElementById('noti_uno').onmouseout =function(){
		noti_det = false;
		clearTimeout(noti_tiempo)
		noti_escrolea()
	}

	document.getElementById('noti_dos').onmouseover =function(){
		noti_det = true
		clearTimeout(noti_tiempo)
	}

	document.getElementById('noti_dos').onmouseout =function(){
		noti_det = false;
		clearTimeout(noti_tiempo)
		noti_escrolea()	 
	}
}

noti_desp = 1
var noti_cont = 1
var noti_pos,noti_pos2

function noti_escrolea(){
	noti_pos = document.getElementById('noti_uno').style.top
	noti_pos = noti_pos.replace(/px/,"");
	noti_pos = noti_pos.replace(/pt/,"");
	noti_pos = new Number(noti_pos);
	noti_pos2 = document.getElementById('noti_dos').style.top
	noti_pos2 = noti_pos2.replace(/px/,"");
	noti_pos2 = noti_pos2.replace(/pt/,"");
	noti_pos2 = new Number(noti_pos2);
	noti_pos -= noti_desp
	noti_pos2 -= noti_desp

	if (noti_pos == noti_desp){
		var noti_contenidos = ""
		document.getElementById('noti_dos').style.top = noti_alto
		document.getElementById('noti_dos').childNodes[0].firstChild.nodeValue  = noti_noticias[noti_cont].titular
		if(noti_poneFecha == true){
			document.getElementById('noti_dos').childNodes[1].firstChild.nodeValue  = noti_noticias[noti_cont].fecha
		}
		
		document.getElementById('noti_dos').childNodes[2].firstChild.nodeValue  = noti_noticias[noti_cont].texto

		if(noti_masInfo == true){
			document.getElementById('noti_dos').childNodes[3].href = noti_noticias[noti_cont].enlace 
		}

		document.getElementById('noti_uno').style.top = 0
		if(noti_cont == noti_noticias.length-1){
			noti_cont=0
		}
		else{
			noti_cont++
		}
		noti_pausa()
		return false
	}
	else{
		if (noti_pos2 == noti_desp){
			var noti_contenidos = ""
			document.getElementById('noti_uno').style.top = noti_alto
			document.getElementById('noti_uno').childNodes[0].firstChild.nodeValue  = noti_noticias[noti_cont].titular
			if(noti_poneFecha == true){
				document.getElementById('noti_uno').childNodes[1].firstChild.nodeValue  = noti_noticias[noti_cont].fecha
			}
			document.getElementById('noti_uno').childNodes[2].firstChild.nodeValue  = noti_noticias[noti_cont].texto
			if(noti_masInfo == true){
				document.getElementById('noti_uno').childNodes[3].href  = noti_noticias[noti_cont].enlace
			}
			document.getElementById('noti_dos').style.top = 0
			if(noti_cont == noti_noticias.length-1){noti_cont=0}
			else{noti_cont++}
			noti_pausa()
			return false
		}
		else{
			document.getElementById('noti_uno').style.top = noti_pos
			document.getElementById('noti_dos').style.top = noti_pos2
		}
	}

	noti_tiempo = window.setTimeout('noti_escrolea()',50)
}
var noti_tiempo

function noti_pausa(){
	clearTimeout(noti_tiempo)
	if (noti_det == false){
		noti_tiempo = setTimeout ('noti_continuar()',0)
	}
}

function noti_continuar(){
	if(noti_det == false){ noti_escrolea() }
}

document.write('<style type="text/css">')
document.write ('#noti_uno {')
document.write ('color: #006699;')
if(noti_cursor == "pointer" || noti_cursor == "hand"){
	noti_cursor = (navigator.appName == "Netscape")?'pointer;':'hand;';
}
document.write ('cursor:' + noti_cursor + ";")
document.write ('position:absolute;}')
document.write ('#noti_dos {')
document.write ('color: #006699;')
document.write ('cursor:' + noti_cursor + ";")
document.write ('position:absolute;}')
document.write ('.noti_titular{')
document.write ('color:' + noti_colTitular +';')
document.write ('font-family:' + noti_fuente + ';')
document.write ('font-size :' + noti_tamTitular + ';font-weight:bold}')
document.write ('.noti_texto{')
document.write ('color:' + noti_colTexto + ';')
document.write ('font-family:' + noti_fuente + ';')
document.write ('font-size:' + noti_tamTexto + ';}')
if(noti_poneFecha == true){
	document.write ('.noti_fecha{')
	document.write ('color:' + noti_colFecha +';')
	document.write ('font-family:' + noti_fuente + ';')
	document.write ('font-size :' + noti_tamFecha + ';font-weight:bold}')
}
else{
	document.write ('.noti_fecha{display: none;}')
}
document.write ('.noti_enlace{')
document.write ('color:' + noti_colEnlace + ';')
document.write ('font-family:' + noti_fuente + ';')
document.write ('font-size:' + noti_tamEnlace + ';}')
document.write ('</style>')