/*
========================================
 NewsBar v1.2 (modified to Forum Images NewsBar v1.02)
 License : Freeware (Enjoy it!)
 (c)2002 VASIL DINKOV- PLOVDIV, BULGARIA
========================================
 NewsBar v1.2 was modified for forumimages.com by Daz and SamG.
 Get the unmodified NewsBar script at:
 http://smartmenus.tripod.com/other.html
 and don't wait to get the great SmartMenus script at:
 http://smartmenus.tripod.com

 LEAVE THESE NOTES PLEASE - delete the comments if you want.
 
 Traduccion al español: Tarirotariro para www.villaamateur.com
*/

/* Parte 1: descripcion de contenidos - edita las lineas, añade y quita, para poner tus comentarios  */
var defaultText = 'Ultimas Noticias sobre el Elche C.F.'; // texto cabecera, solo sale una vez cada vez que se carga la barra
var newsBarContent = [
 ['http://elchecf.webelix.com', ' Visita PUNTO DEPORTIVO - elchecf.webelix.com - PINCHA AQUÍ', '_self'], 
 ['http://elchecf.webelix.com/viewtopic.php?t=7267', ' Ayuda a promocionar al foro - lee aquí cómo', '_self'],
 ['http://elchecf.webelix.com/viewtopic.php?t=6118', ' Fotos históricas del ElcheCF - merece la pena', '_self'],
 ['http://www.terra.es/personal8/canal-aspe/rinconelchecf/porra2a0506.htm', ' Estadísticas de las PORRAS (by aspe)', '_blank'],
 ['http://www.elchecf.es', 'Web Oficial del Elche Club de Futbol', '_blank'],   
 ['http://elchecf.webelix.com/viewtopic.php?t=26', 'Lee las Normas del Foro', '_self']  
 /*['', '', ''],*/

]; // Contenido[] las lineas han de tener el formato ['href', 'text', 'target'] las variables han de estar separadas por comas y cada una encerrada entre comillas
/* En 'href' coloca la url a donde quieras direccionar, dejala en blanco si no quieres poner un link */
/* En 'text' coloca el texto que quieras que se vea en la barra */
/* En 'target' puedes usar '_blank' y el link se te abrira en otra ventana, o '_self' y se te abrira en la misma ventana, dejala en blanco si no hay link */

/* Parte 2: variables - editalas a tu gusto */
var defaultTextTimeOut = 2; // tiempo que se ve el texto cabecera, en segundos
var newsBarTimeOut = 3; // tiempo que se ve cada linea
var newsBarSpeed = 20; // velocidad de la barra   1000 = 1 segundo
var leadingSign = '...'; // signos que salen al final de cada frase
var newsBarStyle = 'style="position: relative; font-size: 12px;"'; // tamaño de fuente; si quieres cambiar el color de fuente añade despues de 12px: color:#FFFFFF; para cambiar tipo fuente añade: font-family:arial
var pauseNewsBarOnMouseOver = true; // true detiene la barra de noticias cuando pones el raton encima de un link, false no lo hace

/* Parte 3: el motor de la barra de noticias - ¡si tocas aquí será a tu propio riesgo! */
var contentIndex = 0;
var cursorPosition = 0;
var textLength = newsBarContent[0][1].length;
var newsBarCycle = null;
defaultTextTimeOut *= 1000;
newsBarTimeOut *= 1000;
if ( pauseNewsBarOnMouseOver ) var eventHandlers = ' onmouseout="newsBarCycle = setTimeout(\'newsBarNew()\', ' + newsBarTimeOut + ');" onmouseover="clearTimeout(newsBarCycle);">';
else var eventHandlers = '>';

function newsBarNew() {
  if ( (newsBarContent[contentIndex][0] != '') && (cursorPosition == textLength) ) var text = '<a href="' + newsBarContent[contentIndex][0] + '" target="' + newsBarContent[contentIndex][2] + '"' + eventHandlers + newsBarContent[contentIndex][1] + leadingSign + '</a>';
  else var text = newsBarContent[contentIndex][1].substring(0, cursorPosition) + leadingSign;
  document.getElementById('newsbar').innerHTML = text;
  if ( cursorPosition++ == textLength ) {
    cursorPosition = 0;
    newsBarCycle = setTimeout('newsBarNew()', newsBarTimeOut);
    contentIndex++;
    if ( contentIndex == newsBarContent.length ) contentIndex = 0;
    textLength = newsBarContent[contentIndex][1].length;
  }
  else setTimeout('newsBarNew()', newsBarSpeed);
}

document.write("<div id=\"newsbar\" style=\"position: relative;font-size:12px;font-weight:bold\">" + defaultText + "</div>"); // si no quieres el texto en negrita quitar: font-weight:bold
setTimeout('newsBarNew()', defaultTextTimeOut);
