/***********************************************
* Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var delay = 8000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(2,40,79); // start color (red, green, blue)
var endcolor=new Array(2,40,79); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div class="post">'; //set opening tag, such as font declarations
fcontent[0]=getNoticia8();
fcontent[1]=getNoticia7();
fcontent[2]=getNoticia6();
closetag='</div>';

var fwidth='220px'; //set scroller width
var fheight='300px'; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////


var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;


/*Rafael Raposo edited function*/
//function to change content
function changecontent()
{
  if (index>=fcontent.length)
    index=0
  if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
  index++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step)
{
  var obj=document.getElementById("fscroller").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor(step);
  }
}

/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) 
{
  if(step<=maxsteps) {	
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);
	
  }   
}

/*Rafael Raposo's new function*/
function getstepcolor(step) 
{
  var diff
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
      newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
      newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}


/***************************************************************************************************/
function getNoticia8()
{
	return "<h1 class='title'><a href='#'>TLT 2009</a></h1>" +
		   "<p class='byline'><small>MCL, 30 de Septiembre del 2009</small></p> " +
		   "<div class='entry'>" +
		   "<p>Del 12 al 13 de Diciembre se celebra en Bielefeld el TLT 2009. Es un torneo donde equipos de 8 jugadores (tanto para chicos como para chicas) tratan de ganar la copa de Campeones. &iquest;Te animas?" + 
		   "</div>" +
		   "<p class='entry' align='right'><small><a href=news/new_20090930_131800.html>Seguir leyendo &raquo;&raquo;</a></small></p> ";
}
function getNoticia7()
{
	return "<h1 class='title'><a href='#'>En-RED-ate Chamber&iacute; </a></h1>" +
		   "<p class='byline'><small>MCL, 18 de Septiembre del 2009</small></p> " +
		   "<div class='entry'>" +
		   "<p>El 4 de Octubre se va a celebrar en la Junta de Distrito de Chamber&iacute; unas jornadas deportivas en las que el MCL va a participar." + 
		   "</div>" +
		   "<p class='entry' align='right'><small><a href=news/new_20090918_110000.html>Seguir leyendo &raquo;&raquo;</a></small></p> ";
}

function getNoticia6()
{
	return "<h1 class='title'><a href='#'>24H Lacrosse Utrecht </a></h1>" +
		   "<p class='byline'><small>MCL, 7 de Agosto del 2009</small></p> " +
		   "<div class='entry'>" +
		   "<p>Del 3 al 4 de Octubre se va a celebrar en Utrecht un marat&oacute;n de Lacrosse. Habr&aacute; barbacoa, m&uacute;sica y mucha diversi&oacute;n, adem&aacute;s de Lacrosse, claro." + 
		   "<p><small><a href=javascript:openLinkURL('http://www.devilsextreme.nl')>M&aacute;s Informaci&oacute;n</a></small></p> " + 
		   "</div>" +
		   "<p class='entry' align='right'><small><a href=news/new_20090807_110000.html>Seguir leyendo &raquo;&raquo;</a></small></p> ";
}

function getNoticia5()
{
	return "<h1 class='title'><a href='#'>Lacrosse en Oliva</a></h1>" +
		   "<p class='byline'><small>MCL, 4 de Agosto del 2009</small></p> " +
		   "<div class='entry'>" +
		   "<p>El pr&oacute;ximo mes de Octubre se celebrar&aacute; en Oliva un Torneo de Lacrosse organizado por la Universidad de Algo. " + 
		   "M&aacute;s Informaci&oacute;n en la web del torneo.</p>" +
		   "</div>" +
		   "<p class='entry' align='right'><small><a href='#'>Ir a la Noticias</a></small></p> ";
}

function getNoticia4()
{
	return "<h1 class='title'><a href='#'>I Copa de Espa&ntilde;a</a></h1>" +
		   "<p class='byline'><small>MCL, 2 de Agosto del 2009</small></p> " +
		   "<div class='entry'>" +
		   "<p>El pasado 18 de Julio se celebr&oacute en Madrid la I Copa de Lacrosse." + 
		   "&nbsp;El equipo de Madrid derrot&oacute; por un ajustado resultado a un Combinado de jugadores nacionales." +
		   "</p>" +
		   "</div>" +
		   "<p class='entry' align='right'><small><a href='#'>M&aacute;s Noticias</a></small></p> ";
}

function getNoticia3()
{
	return "<h1 class='title'><a href='#'>Nuevo Grupo Lacrosse en Burgos</a></h1>" +
		   "<p class='byline'><small>MCL, 15 de Julio del 2009</small></p> " +
		   "<div class='entry'>" +
		   "<p>Robert Alvarez ha comenzado a formar un peque&ntilde;o grupo de personas en la ciudad de Burgos." +
		   "</p>" +
		   "</div>" +
		   "<p class='entry' align='right'><small><a href='#'>M&aacute;s Noticias</a></small></p> ";
}

function getNoticia2()
{
	return "<h1 class='title'><a href='#'>Nuevo Grupo Lacrosse en Sevilla</a></h1>" +
		   "<p class='byline'><small>MCL, 15 de Julio del 2009</small></p> " +
		   "<div class='entry'>" +
		   "<p>Javier Dominguez ha comenzado a formar un peque&ntilde;o grupo de personas en la ciudad de Sevilla." +
		   "</p>" +
		   "</div>" +
		   "<p class='entry' align='right'><small><a href='#'>M&aacute;s Noticias</a></small></p> ";
}

function getNoticia1()
{
	return "<h1 class='title'><a href='#'>Nuevo Grupo Lacrosse en Valencia</a></h1>" +
		   "<p class='byline'><small>MCL, 1 de enero del 2009</small></p> " +
		   "<div class='entry'>" +
		   "<p>Jorge Alvarez ha comenzado a formar un peque&ntilde;o grupo de personas en la ciudad de Valencia." +
		   "</p>" +
		   "</div>" +
		   "<p class='entry' align='right'><small><a href='#'>M&aacute;s Noticias</a></small></p> ";
}