
/***********************************************
* 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 = 4000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=30; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
/*
var startcolor= new Array(255,255,255); // start color (red, green, blue)*/
var startcolor= new Array(085,133,215); // start color (red, green, blue)
var endcolor=new Array(255,255,255); // end color (red, green, blue)


var fcontent=new Array();
begintag='<style type="text/css">a:link{text-decoration:none;} a:visited{text-decoration:none;} a:hover{text-decoration:underline;} a:active{text-decoration:none;}</style>																																									<div align="center" style="font: normal 12px Arial; padding: 5px;">'; //set opening tag, such as font declarations

fcontent[0]="<div style='font:13px'><br /><br /><a target='_blank' href='documentos/PROCESOREINSCRIPCIONEXT-20101.pdf'>Esta listo el proceso de<br /><strong><em>Reinscripción EXTRAORDINARIA</em></strong><br /><strong><em>ENERO- JUNIO 2010...</em></strong><br> ¡¡ Consulta aquí y<br />continua tus estudios !!<br></a></div>";

fcontent[1]="<div style='font:13px'><br /><br /><a target='_blank' href='documentos/CALENDARIOALUMNOSENE-JUL2010.pdf'>Consulta aqui el<br><b>Calendario Escolar<br> ENE - JUN / 2010<br></a></div>";

fcontent[2]="<div><br /><a target='_blank' href='documentos/programa-para-obtener-cedula-y-titulo.pdf'> <b>AVISO<br>IMPORTANTE:</b><br><br>Si tienes pendiente el tramite del Titulo y la Cedula de la Maestria, da Click Aqui y entérate de cómo conseguirla...</a></div>";

fcontent[3]="<div align='left' style='font:10px'><a target='blank' href='/documentos/PONTE_%20LAS_%20PILAS.pdf'><b>¡PONTE LAS PILAS!</b><br><br>En la División de Estudios de Posgrado e Investigación del Instituto, se percibe la necesidad de alentar a la comunidad a la realización de una campaña de recolección de baterías usadas, y evitar de esta manera su repercusión a nivel ambiental.</a></div>";

//fcontent[2]="<div style='font:14px'><br /><br /><a href='/documentos/CONVOCATORIA-CAFETERIA-2010.pdf' target='_self'>Convocatoria para el servicio de CAFETERIA<br><br><em>Click aquí</em></a></div>";

//fcontent[6]="<div><br />  </div>";

closetag='</div>';

var fwidth='170px'; //set scroller width
var fheight='173px'; //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] + ")");
}

if (ie4||DOM2)
  document.write('<style type="text/css">a:link{text-decoration:none;} a:visited{text-decoration:none;} a:hover{text-decoration:underline;} a:active{text-decoration:none;}</style>																																							<table style="color:#FFF"; bgcolor="#5585D7">																																					   <tr valign="middle">																																																														<th valign="top" style="background-color:#0b4f76"; align="left"> Avisos </th>																																									   </tr>																																																																																		    <tr valign="middle">																																																																																																																																<th style="background-color:#5585D7" align="center">																																								<div id="fscroller" style="width:'+fwidth+';height:'+fheight+'; color:#FFF"></div></th>																																																														    </tr>																																																																		</table>');
								 
/***********************************************
<div width="155" >class="scrollerBgC"  align="center"</div><br><tr align="center" class="scrollerItBgCi4" id="fscroller" style="border:0px solid black;width:'+fwidth+';height:'+fheight+'"></tr></table></tr></div>');
<div style="background:#C1D3FB ;width:'+fwidth+';height:'+fheight+'"></div>
***********************************************/
if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent

