Posted By

aurele on 08/28/06


Tagged


Versions (?)

mensaje.js


 / Published in: JavaScript
 

con elyon

  1. <!-- This script and many more are available free online at -->
  2. <!-- The JavaScript Source!! http://javascript.internet.com -->
  3. <!-- Ken Tholke, kentholke@firstsaga.com. -->
  4. <!-- Begin
  5. // add as many or as few messages as you would like
  6. var msg=new Array()
  7. msg[0]="<CENTER>Bienvenido a ELYON PATER</CENTER>";
  8. msg[1]="<CENTER>ESCUELA CULTURAL DE MÚSICA Y ARTE</CENTER>";
  9. msg[2]="<CENTER>porque naciste con el talento...</CENTER>";
  10. msg[3]="<CENTER>preparate para hacerlo con excelencia.</CENTER>";
  11.  
  12. // set your first set of colors. Use as many or as few as you wish.
  13. var colors1=new Array("ffffff", "fffffd", "fffffa", "fffff8", "fffff6", "f9f9f2", "a6d9de",
  14. "8ad2d9", "f1f1df", "eaead2", "e7e7c5", "e8e7bc", "eae9b4","ecebaa", "1111ff", "fffd44")
  15.  
  16. //set your second set of colors
  17. // *** must have exactly the same number of colors as the array above ***
  18. var colors2=new Array("ffffff", "dff4f6", "d8f4f6", "c5f4f8", "b6eef3", "a9e7ec", "ff9999",
  19. "ff8888", "84e0e8", "7feaf4", "7bf4ff", "7ed7f1", "9bdef1", "abe9fb", "b9ebf9", "c6e9f3")
  20.  
  21. //set the height of the display in pixels
  22. high=60;
  23.  
  24. //set the width of the display in pixels
  25. wide=350;
  26.  
  27. //set the pixel coordinates for the upper left hand corner of the display
  28. Xpos=220;
  29. Ypos=180;
  30.  
  31. // move the display away from the edges of the background
  32. pad=15;
  33.  
  34. // set the background color of the display
  35. bgcol="transparent";
  36.  
  37. //add a background image if you want.
  38. // *** for no image, just leave empty quotes (ex. cellbg=""; ) ***
  39. cellbg="";
  40.  
  41. // set the font
  42. fntFam="serif,verdana,helvetica,arial";
  43. fntSize=14;
  44.  
  45. // set how how many seconds you want the message to stay remain at totality.
  46. pause=2.5;
  47.  
  48.  
  49. // Do not edit these values below!!!
  50.  
  51. icolor=0;
  52. mcolor=1;
  53. imsg=0;
  54. spWidth=wide-(2*pad);
  55. totality=false;
  56. glowing=true;
  57. var theMsg="";
  58. var cellcontent="";
  59. pause=pause*1000;
  60. if(cellbg.length>4){cellbg=" background="+cellbg}
  61. else{cellbg="";}
  62.  
  63. function doPause(){
  64. totality=false; t=setTimeout("changecolor()",pause);
  65. }
  66. function initiate(){
  67. getContentColor();
  68. getMsg();
  69. getCellContent();
  70. if(document.all){
  71. msgbg.innerHTML=cellcontent;
  72. msgfade.innerHTML=theMsg;
  73. msgbg.style.posLeft=Xpos;
  74. msgbg.style.posTop=Ypos;
  75. msgfade.style.posLeft=Xpos+pad;
  76. msgfade.style.posTop=Ypos+pad;
  77. t=setTimeout("changecolor()",50);}
  78. if(document.layers){
  79. document.msgbg.document.write(cellcontent);
  80. document.msgbg.document.close();
  81. document.msgfade.document.write(theMsg);
  82. document.msgfade.document.close();
  83. document.msgbg.left=Xpos;
  84. document.msgbg.top=Ypos;
  85. document.msgfade.left=Xpos+pad;
  86. document.msgfade.top=Ypos+pad;
  87. t=setTimeout("changecolor()",100);}
  88. }
  89. function changecolor(){
  90. if(totality==true){doPause();}
  91. else{
  92. getMsg();
  93. getContentColor();
  94. if(document.all){
  95. msgfade.innerHTML=theMsg;
  96. t=setTimeout("changecolor()",50);}
  97. if(document.layers){
  98. document.msgfade.document.write(theMsg);
  99. document.msgfade.document.close();
  100. t=setTimeout("changecolor()",70);}
  101. }
  102. }
  103. function getFadeColor(){
  104. icolor=icolor-1;
  105. if(mcolor==1){contentcolor=colors1[icolor];}
  106. else{contentcolor=colors2[icolor];}
  107. }
  108. function getGlowColor(){
  109. icolor=icolor+1;
  110. if(mcolor==1){contentcolor=colors1[icolor];}
  111. else{contentcolor=colors2[icolor];}
  112. }
  113. function changemsg(){
  114. if(imsg==msg.length-1){imsg=0; mcolor=1;}
  115. else if(imsg != msg.lenght-1 && mcolor==1){imsg=imsg+1; mcolor=0;}
  116. else{imsg=imsg+1; mcolor=1;}
  117. }
  118. function getContentColor(){
  119. if(icolor==colors1.length-1 && glowing==true){
  120. getFadeColor(); glowing=false; totality=true;}
  121. else if(icolor < colors1.length && glowing==true){
  122. getGlowColor();}
  123. else if(icolor < 1 && glowing==false){changemsg(); getGlowColor(); glowing=true;}
  124. else{getFadeColor();}
  125. }
  126. function getMsg() {
  127. theMsg="<span style='font-size:"+fntSize+"pt; font-family:"+fntFam+"; width:"+spWidth+";'>"
  128. theMsg+="<B><font color="+contentcolor+">"+msg[imsg]+"</font></B> "
  129. theMsg+="</span>"
  130. }
  131. function getCellContent(){
  132. cellcontent="<TABLE height="+high+
  133. " width="+wide+" bgcolor="+bgcol+" cellpadding=0 cellspacing=0><TR><TD"+cellbg+"> </TD></TR></TABLE>"}
  134. // End -->

Report this snippet  

You need to login to post a comment.