// JavaScript Document
//--------------------------------------------------------------------------//
// Browser Slide-Show script.
// With image cross fade effect for those browsers that support it.
var slideCache = new Array();
function RunSlideShow(pictureName,imageFiles,displaySecs)
{
var imageSeparator = imageFiles.indexOf(";");
var nextImage = imageFiles.substring(0,imageSeparator);
if (document.all)
{
document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
document.getElementById(pictureName).filters.blendTrans.Apply();
}
document.getElementById(pictureName).src = nextImage;
if (document.all)
{
document.getElementById(pictureName).filters.blendTrans.Play();
}
var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)
+ ';' + nextImage;
setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")",
displaySecs*1000);
// Cache the next image to improve performance.
imageSeparator = futureImages.indexOf(";");
nextImage = futureImages.substring(0,imageSeparator);
if (slideCache[nextImage] == null) {
slideCache[nextImage] = new Image;
slideCache[nextImage].src = nextImage;
}
}
//---------------------------------------------------------------------------//
/************************************************** 
Scroll de noticias. Script creado por Tunait! (21/8/2003)
Última modificación 31/1/06 muestra las noticias de a dos. 
Si quieres usar este script en tu sitio eres libre de hacerlo con la condición de que permanezcan intactas estas líneas, osea, los créditos.
No autorizo a publicar y ofrecer el código en sitios de script sin previa autorización
Si quieres publicarlo, por favor, contacta conmigo.
***************************************************/
var ancho = 266 //anchura del cuadro
var alto = 190 //altura del cuadro
var marco = 1 //0 para que notenga marco (borde)
var colormarco = '#FFCC33'
var fondo = '#FFCC33' //color de fondo del cuadro
var pausilla = 2000 //tiempo de la pausa en milisegundos (2000 = 2 segundos)
var destino = "_blank" //target en donde se quiera que se carguen los enlaces, en caso de usarlos.
var cursor = "default;" //cursor que se quiera sobre el cuadro
var colTitular = '#993399' //color del texto del titular
var colTexto = '#999999' // color del texto de la noticia
var colFecha = '#3399FF' //color del texto de la fecha
var colEnlace = '#660000' //color del texto del enlace
var fuente = "arial" //fuente para los textos 
var tamTitular = '12' //tamaño de la fuente del titular
var tamTexto = '12' //tamaño de la fuente del texto de la noticia
var tamFecha = '10' // tamaño de la fuente de la fecha
var tamEnlace = '11' // tamaño de la fuente del enlace 
var masInfo = true //Determina si se usa o no el enlace. true para usarlo. false para omitirlo
var poneFecha = false //true para poner fecha. false para omitirla. Si no se quiere fecha, dejar las comillas vacías ""

function noticia(titular,texto,fecha,enlace,destino)
{
this.titular = titular
this.texto = texto
this.fecha= fecha
this.enlace = enlace
this.destino = destino
}

var det = false
function escribe(){
	document.writeln ('<div id="mami">')
	document.write ('<div id="uno" style="top: ' + alto + 'px;">')
	document.write ('<h3 class="titular">')
	document.write (noticias[0].titular)
	document.write ('</h3>')
	document.write ('<span class="fecha">')
	document.write (noticias[0].fecha)
	document.write ('</span>')
	document.write ('<p class="texto">')
	document.write (noticias[0].texto)
	document.write ('</p>')
	if(masInfo == true){
	document.write ('<a class="enlace" href="../')
	document.write (noticias[0].enlace)
	document.write ('" target="' + destino + '">más información...</a>')
	}
	document.write ('</div>')
	document.write ('<div id="dos" style="top: ' + (alto + (alto/2)) + 'px;">')
	document.write ('<h3 class="titular">')
	document.write (noticias[1].titular)
	document.write ('</h3>')
	document.write ('<span class="fecha">')
	document.write (noticias[1].fecha)
	document.write ('</span>')
	document.write ('<p class="texto">')
	document.write (noticias[1].texto)
	document.write ('</p>')
	if(masInfo == true){
	document.write ('<a class="enlace" href="../')
	document.write (noticias[1].enlace)
	document.write ('" target = "' + destino + '">más información...</a>')
	}
	document.write ('</div>')
	document.write ('<div id="tres" style="top: ' + alto*2 + 'px;">')
	document.write ('<h3 class="titular">')
	document.write (noticias[2].titular)
	document.write ('</h3>')
	document.write ('<span class="fecha">')
	document.write (noticias[2].fecha)
	document.write ('</span>')
	document.write ('<p class="texto">')
	document.write (noticias[2].texto)
	document.write ('</p>')
	if(masInfo == true){
	document.write ('<a class="enlace" href="../')
	document.write (noticias[2].enlace)
	document.write ('" target = "' + destino + '">más información...</a>')
	}
	document.write ('</div>')
	document.write ('</div>')
	if(navigator.appName == "Netscape")
	{altoUno = document.getElementById('uno').offsetHeight}
	else{
		altoUno = document.getElementById('uno').clientHeight}
		document.getElementById('uno').onmouseover =function(){
		det = true
		clearTimeout(tiempo)
	}
	document.getElementById('uno').onmouseout =function(){
	det = false;
	clearTimeout(tiempo)
	escrolea()
	}
	
	document.getElementById('dos').onmouseover =function(){
	det = true
	clearTimeout(tiempo)
	}
	document.getElementById('dos').onmouseout =function(){
	det = false;
	clearTimeout(tiempo)
	escrolea()
	}
	document.getElementById('tres').onmouseover =function(){
	det = true
	clearTimeout(tiempo)
	}
	document.getElementById('tres').onmouseout =function(){
	det = false;
	clearTimeout(tiempo)
	escrolea()
	}
}
desp = 1
var cont = 2
var pos,pos2,pos3
pepe = 0
function escrolea(){
	pos = document.getElementById('uno').style.top
	pos = pos.replace(/px/,"");
	pos = pos.replace(/pt/,"");
	pos = new Number(pos);
	pos2 = document.getElementById('dos').style.top
	pos2 = pos2.replace(/px/,"");
	pos2 = pos2.replace(/pt/,"");
	pos2 = new Number(pos2);
	pos3 = document.getElementById('tres').style.top
	pos3 = pos3.replace(/px/,"");
	pos3 = pos3.replace(/pt/,"");
	pos3 = new Number(pos3);
	pos -= desp
	pos2 -= desp
	pos3 -= desp

	if (pos == desp){
		var contenidos = ""
		document.getElementById('tres').style.top = alto + "px"
		document.getElementById('tres').childNodes[0].firstChild.nodeValue = noticias[cont].titular
		if(poneFecha == true){
			document.getElementById('tres').childNodes[1].firstChild.nodeValue = noticias[cont].fecha
		}
		document.getElementById('tres').childNodes[2].firstChild.nodeValue = noticias[cont].texto
		if(masInfo == true){
			document.getElementById('tres').childNodes[3].href = noticias[cont].enlace 
		}
		document.getElementById('uno').style.top = 0 + "px"
		if(cont == noticias.length-1){
			cont=0
		}
		else{
			cont++
		}
		pausa()
		return false
	}
	else{
		if (pos2 == desp){
			var contenidos = ""
			document.getElementById('uno').style.top = alto + "px"
			document.getElementById('uno').childNodes[0].firstChild.nodeValue = noticias[cont].titular
			if(poneFecha == true){
				document.getElementById('uno').childNodes[1].firstChild.nodeValue = noticias[cont].fecha
			}
			document.getElementById('uno').childNodes[2].firstChild.nodeValue = noticias[cont].texto
			if(masInfo == true){
				document.getElementById('uno').childNodes[3].href = noticias[cont].enlace
			}
			document.getElementById('dos').style.top = 0 + "px"
			if(cont == noticias.length-1){
				cont=0
			}
			else{
				cont++
			}
			pausa()
			return false
		}
	else{
			if (pos3 == desp){
				var contenidos = ""
				document.getElementById('dos').style.top = alto + "px"
				document.getElementById('dos').childNodes[0].firstChild.nodeValue = noticias[cont].titular
				if(poneFecha == true){
					document.getElementById('dos').childNodes[1].firstChild.nodeValue = noticias[cont].fecha
				}
				document.getElementById('dos').childNodes[2].firstChild.nodeValue = noticias[cont].texto
				if(masInfo == true){
					document.getElementById('dos').childNodes[3].href = noticias[cont].enlace
				}
				document.getElementById('tres').style.top = 0 + "px"
				if(cont == noticias.length-1){
					cont=0
				}
				else{
					cont++
				}
				pausa()
				return false
		}
		else{
			document.getElementById('uno').style.top = pos + "px"
			document.getElementById('dos').style.top = pos2 + "px"
			document.getElementById('tres').style.top = pos3 + "px"
			}
		}
	}
	tiempo = window.setTimeout('escrolea()',50)
}
var tiempo
function pausa()
{
clearTimeout(tiempo)
if (det == false){
tiempo = setTimeout ('continuar()',2000)
}
}
function continuar()
{
if(det == false)
{escrolea()}
}

document.writeln('<style type="text/css">')
document.writeln ('#mami {')
document.writeln ('position: relative;')
document.writeln ('border: ' + marco + 'px solid ' + colormarco + ';')
document.writeln ('text-align: left;')
document.writeln ('padding: 0px 2px 0px 2px;')
document.writeln ('height: ' + alto + 'px;')
document.writeln ('width: ' + ancho + 'px;')
document.writeln ('overflow: hidden;')
document.writeln ('}')
document.writeln ('#uno {')
document.writeln ('color: #006699;')
document.writeln ('height: ' + (alto/2) + 'px;')
document.writeln ('top: ' + alto + 'px;')
if(cursor == "pointer" || cursor == "hand"){
cursor = (navigator.appName == "Netscape")?'pointer;':'hand;';
}
document.writeln ('cursor:' + cursor + ";")
document.writeln ('position:absolute;}')
document.writeln ('#dos {')
document.writeln ('color: #006699;')
document.writeln ('height: ' + (alto/2) + 'px;')
document.writeln ('top: ' + (alto + (alto/2)) + 'px;')
document.writeln ('cursor:' + cursor + ";")
document.writeln ('position:absolute;}')
document.writeln ('#tres {')
document.writeln ('color: #006699;')
document.writeln ('height: ' + (alto/2) + 'px;')
document.writeln ('top: ' + (alto*2) + 'px;')
document.writeln ('cursor:' + cursor + ";")
document.writeln ('position:absolute;}')
document.writeln ('.titular{')
document.writeln ('margin-bottom: 1px;')
document.writeln ('color:' + colTitular +'; ')
document.writeln ('font-family:' + fuente + ';')
document.writeln ('font-size :' + tamTitular + 'px;font-weight:bold}')
document.writeln ('.texto{')
document.writeln ('margin: 1px;')
document.writeln ('color:' + colTexto + ';')
document.writeln ('font-family:' + fuente + ';')
document.writeln ('font-size:' + tamTexto + 'px;}')
if(poneFecha == true){
document.writeln ('.fecha{')
document.writeln ('margin: 1px;')
document.writeln ('color:' + colFecha +';')
document.writeln ('font-family:' + fuente + ';')
document.writeln ('font-size :' + tamFecha + 'px;font-weight:bold}')
}
else{
document.writeln ('.fecha{display: none;}')
}
document.writeln ('.enlace{')
document.writeln ('margin: 1px;')
document.writeln ('color:' + colEnlace + ';')
document.writeln ('font-family:' + fuente + ';')
document.writeln ('display: block;')
document.writeln ('text-align: right;')
document.writeln ('font-size:' + tamEnlace + 'px;}')
document.writeln ('</style>')

