Scripts

All the HTML work on my pages is my own, made in a notepad or similar type of text editor, none of that fancy FrontPage crap was used.
I have spent a lot of time getting all the stuff on these pages the way it is, and most of them are not currently under construction, meaning that they are complete in whatever form you see them in. I, as well as anyone else who takes pride in their own creation, appreciate you spending your time viewing my page. Whatever page impresses you, be it mine or not, a good word or advice is usually generously accepted by the creator, so feel free in leaving a suggestion or signing my guestbook.
Also, I worked on all the script throughout my pages, and if you like something, feel free to use and distribute it as long as you credit me what was mine. Some script is my own, and if you improve on it, please let me know so I can see what has come of what I thought up. The script I use is below, so it should be cut-and-pasteable, but you need to read how to use it anyway.
Also, let me know if you need any help on how to use the stuff. It's fairly easy if you program, but if not you may need a little instruction. The date code is ready to go, the others two need you to customize them.
Enjoy
--Paul

NOTE: the code included above is written in JavaScript, so when you put it into your HTML code, make sure its in the <HEAD> and </HEAD> portion of your document as well as between the tags <SCRIPT LANGUAGE="JavaScript"> and </script>. The script tags are here, so you can cut and paste them.
Also, the comments are to help you out, leave them in to make it easier to see what's happening in the code.


[Main] [Links] [Codes] [Files] [Pics] [Jokes] [View Guestbook] [Sign Guestbook]

Datestamp code
Fading Background code
Random Background code
=======================
Datestamp code:

<SCRIPT LANGUAGE="JavaScript">
<!--   //hides from browser
//by Paul Bilnoski(paul_b8@hotmail.com) 4-17-1999
function todaysdate() {
  var dayary = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
  var monthary = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  var now = new Date();
  var day = dayary[now.getDay()];
  var month = monthary[now.getMonth()];
  var date = now.getDate();
  var year = "19" + now.getYear();
  document.write(day + ", " + month + " " + date + ", " + year);
  }
-->   
</script>

=======================
To use: In the document, wherever you want the date to appear, put the following lines(you may want to change the font color):
<font color="#0000FF">
<SCRIPT LANGUAGE=JavaScript>todaysdate();</script>
</font>

Note: inside this script line, it is CaSe sEnSeTiVe, so be careful

topofpage
=======================
Fading Background code:

<SCRIPT LANGUAGE="JavaScript">
<!--   //hides from browser
hexary = new Array(1,2,3,4,5,6,7,8,9,"a","b","c","d","e","f");
function numbertohex(i) {
  if (i <= 0) return "00";
  else if (i >= 255) return "ff";
  else return "" + hexary[Math.floor(i/16)] + hexary[i%16];
 }
function setbgColor(r, g, b) {
  var xr = numbertohex(r); var xg = numbertohex(g); var xb = numbertohex(b);
  document.bgColor = "#"+xr+xg+xb;
 }
function fade(sr, sg, sb, er, eg, eb, step) {
  for(var i = 0; i <= step; i++) {
    setbgColor(
     Math.floor(sr * ((step-i)/step) + er * (i/step)),
     Math.floor(sg * ((step-i)/step) + eg * (i/step)),
     Math.floor(sb * ((step-i)/step) + eb * (i/step)));
   }
 }
function fadein() {fade(0,0,0, 250,250,250, 100);}
function fadeout() {fade(250,250,250, 0,0,0, 500);}
function fadefast()
  {
   fade(0,0,0, 0,0,0, 0);
   fade(0,0,0, 0,0,0, 0);
  }
-->   
</script>

=======================
To use: Just put it in the browser's header, on the document's load, or you can make it go on another event, such as onUnload. Call either fadein(), fadeout() or fadefast() for desired effect with the numerical values(i.e 0-255) for the colors, not the hex(0-f). I'll get around to making it hex input rather than decimal.
Note: this function works well in NS 4.5 and earlier versions, and in IE 4.0 and earlier, but IE5 messes it up by trying to load all the colors before displaying them

topofpage
=======================
Random Background image code:

<SCRIPT LANGUAGE="JavaScript">
<!--   //hides from browser
//by Paul Bilnoski(paul_b8@hotmail.com) 4-15-1999
var graphicArray = new Array()
// don't forget trailing sentinel in info files
// any gif bakcground files
var gifinfo = "gif1 gif2 gif3 gif4 "
var jpginfo = "jpg1 jpg2 jpg3 jpg4 "
var bmpinfo = "bmp1 bmp2 bmp3 bmp4 "
// Initializes the variables before the do-while loop
var str = char = ""
var c = i = 0
// Puts the strings into an array
do {
  char = gifinfo.charAt(c)
  if (char != " ") { str += char }
  else
   {
    graphicArray[i] = str + ".gif"
    i++
    str = ""
   }
  c++
} while (c < gifinfo.length)
// the variable i stays in the right place, make sure to reinitialize the counter
c = 0
do {
  char = jpginfo.charAt(c)
  if (char != " ") { str += char }
  else
   {
    graphicArray[i] = str + ".jpg"
    i++
    str = ""
   }
  c++
} while (c < jpginfo.length)
//after graphicArray is filled
var rndnumber = Math.round(Math.random() * graphicArray.length)
document.body.background = "" + graphicArray[rndnumber]
-->   
</script>

=======================
To use: Just put it in the browser's header, on the document's load, it will run, or you can make it go on another event the info string is where all the filenames for the images go. Separate each name(without dot or extension) by a space, and leave a trailing space before the end quote mark. Rework the code if they are .jpgs and .gifs, I only allow for .gifs
Notes: You can use any sentinel character for the info strings (I use a blank space, if your filenames contain spaces, use something like ~,*,|,<,>, or something else. Be careful when using escape characters in code).
Just copy the loop again and substitute appropriately for adding bitmaps to the end of the array, the index variable should stay at the end of the array after each loop.
I used a loop to add the .gif to the end of the filenames because I only used gifs. If you use many filetypes, it may be easier to write the entire filename in the info string and take that part from the loop so you only need one loop.
In the last line, the null string is where an optional path may go if the graphic files are not in the same directory as the HTML file.
Also, there is a bug that makes an undefined image come up once in a while. Let me know if you find how to fix this and I haven't yet(check this page).

topofpage
=======================