﻿// JScript File

// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = 'trav1.jpg'
theImages[1] = 'trav2.jpg'
theImages[2] = 'trav3.jpg'
theImages[3] = 'trav4.jpg'
theImages[4] = 'trav5.jpg'
theImages[5] = 'trav6.jpg'
theImages[6] = 'trav7.jpg'
theImages[7] = 'trav8.jpg'

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="/images/'+theImages[whichImage]+'">');
}

//  End -->

// Years Since
function time() {
  // Enter the month, day, and year below you want to use as
  // the starting point for the date calculation
  var amonth = 01
  var aday = 01
  var ayear = 1977

  var x = new Date()
  var dyear
  var dmonth
  var dday
  var tyear = x.getFullYear()
  var tmonth = x.getMonth()+1
  var tday = x.getDate()
  var y=1
  var mm=1 
  var d=1 
  var a2=0 
  var a1=0
  var f=28

  if ((tyear/4)-parseInt(tyear/4)==0) {
    f=29
  }

  m = new Array(31, f, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)

  dyear = tyear-(ayear)

  dmonth = tmonth-amonth
  if (dmonth<0) {
    dmonth = dmonth+12
    dyear--
  }

  dday = tday-aday
  if (dday<0) {
    var ma = amonth+tmonth
    if (ma>12) {ma = ma-12}
    if (ma=0) {ma = ma+12}
    dday = dday+m[ma]
    dmonth--
  }

  if (dyear==0) {y=0}
  if (dmonth==0) {mm=0}
  if (dday==0) {d=0}
  if ((y==1) && (mm==1)) {a1=1}
  if ((y==1) && (d==1)) {a1=1}
  if ((mm==1) && (d==1)) {a2=1}
  if (y==1){
  document.write(+dyear+" years") }
  }
  // End -->