var memorywidth="500px" //el ancho de la tabla
var memoryheight="20px" //la altura de la tabla
var memorybgcolor="#FFFFFF" //color del fonde del recuadro background
var memorypadding="1px" //padding aplica el espaciado entre el texto y la tabla. 0 para quitar el padding de la tabla.
var borderCSS="border: 0px solid black;" //aplica para el borde del color, 0 para quitarlo.
 
var memoryspeed=2 //Velocidad con la que pasa el texto (con rango de: 1-10)
var pauseit=1 //pausa o no cuadno se posiciona el mouse sobre el texto (0=no. 1=si)?
 
var persistlastviewedmsg=1 //opcion para reiniciar los mensajes cuando se recarga la página o bien inicia donde se quedó (1=si, 0=no)?
var persistmsgbehavior="onload" //set to "onload" or "onclick".
 
//especifica el contenido del texto (no borrar el tag: <nobr> )
//En la siguiente variable es donde se insertan los mensajes, incluyendo las etiquetas html para espedificar color de letra, tamaño o fuente.
 
//var memorycontent='<nobr>Si deseas que tu mensaje se publique en este espacio, solo env&iacute;alo y ser&aacute; incluido... Todos los mensajes ser&aacute;n revisados por el Administrador del sitio.</nobr>'
 
 
////A partir de aquí, NO EDITAR NADA////////////
var combinedcssTable="width:"+(parseInt(memorywidth)+6)+"px;background-color:"+memorybgcolor+";padding:"+memorypadding+";"+borderCSS+";"
var combinedcss="width:"+memorywidth+";height:"+memoryheight+";"
 
var divonclick=(persistlastviewedmsg && persistmsgbehavior=="onclick")? 'onClick="savelastmsg()" ' : ''
memoryspeed=(document.all)? memoryspeed : Math.max(1, memoryspeed-1)
var copyspeed=memoryspeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-10000px">'+memorycontent+'</span>')
var actualwidth=''
var memoryscroller
 
if (window.addEventListener)
window.addEventListener("load", populatescroller, false)
else if (window.attachEvent)
window.attachEvent("onload", populatescroller)
else if (document.all || document.getElementById)
window.onload=populatescroller
 
function populatescroller(){
memoryscroller=document.getElementById? document.getElementById("memoryscroller") : document.all.memoryscroller
memoryscroller.style.left=parseInt(memorywidth)+8+"px"
if (persistlastviewedmsg && get_cookie("lastscrollerpos")!="")
revivelastmsg()
memoryscroller.innerHTML=memorycontent
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
lefttime=setInterval("scrollmarquee()",20)
}
 
function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
 
function savelastmsg(){
document.cookie="lastscrollerpos="+memoryscroller.style.left
}
 
function revivelastmsg(){
lastscrollerpos=parseInt(get_cookie("lastscrollerpos"))
memoryscroller.style.left=parseInt(lastscrollerpos)+"px"
}
 
if (persistlastviewedmsg && persistmsgbehavior=="onload")
window.onunload=savelastmsg
 
function scrollmarquee(){
if (parseInt(memoryscroller.style.left)>(actualwidth*(-1)+8))
memoryscroller.style.left=parseInt(memoryscroller.style.left)-copyspeed+"px"
else
memoryscroller.style.left=parseInt(memorywidth)+8+"px"
}
 
if (iedom){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0" style="'+combinedcssTable+'"><td>')
write('<div style="position:relative;overflow:hidden;'+combinedcss+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=memoryspeed">')
write('<div id="memoryscroller" style="position:absolute;left:0px;top:0px;" '+divonclick+'></div>')
write('</div>')
document.write('</td></table>')
}
}
