//misc.js  -- assorted javascript functions with universal appeal


// RANDOM 'LAST UPDATE' GENERATOR

var w1max = 18
var w1 = new Array(w1max)
w1[0]="Any minute now"
w1[1]="Last Tuesday"
w1[2]="Just before the next one"
w1[3]="The 12<sup>th</sup> of Never"
w1[4]="Just now, when you blinked"
w1[5]="There has never been an update"
w1[6]="Now in progress"
w1[7]="Wednesday Morning 5 A.M."
w1[8]="One hour ago"
w1[9]="Before you were born"
w1[10]="That day that hell froze over"
w1[11]="As we speak"
w1[12]="This is it"
w1[13]="Thursday, or maybe Sunday..."
w1[14]="Does it matter?"
w1[15]="None of Your !@#$%&!?! Business!"
w1[16]="Who really cares?"
w1[17]="Hard to say"
w1[18]="When the Moon is in the seventh house and Jupiter aligns with Mars"
function rndnumber(max){
	var randscript = -1
	while (randscript < 0 || randscript > max || isNaN(randscript)){
	randscript = parseInt(Math.random()*(max+1))
}
return randscript
}
function update() {
	subscript=rndnumber(w1max)
	msg = "Last Update: " + w1[subscript]
	return msg
}


// COPYRIGHT LINE

function getCopy() {
	var today = new Date()
	var year = today.getFullYear()
	copy = "All Content &#169; " + year + " P.D. Appert"
	return copy
}

		
// POP UP WINDOW

function popUpWindow(path,name,width,height,scroll) {
	wid=window.open(path, name, 'toolbar=no,status=no,directories=no,location=no,scrolling='+scroll+',width='+width+',height='+height);
	if (wid.opener == null) wid.opener = window;
}

// DROP DOWN LIST THING

function GoHere() {
    selected = document.GoPlaces.place.selectedIndex;
    if (selected > 0) 
      {
       gonow = document.GoPlaces.place.options[selected].value;
       open(gonow,'_top');
       }
}

// MULTIPLE DROP DOWNS ON ONE PAGE, USE THIS ONE

function goMulti(form)
   {
    var selected =form.place.selectedIndex;
    if (selected > 0)
      {
       var gonow = form.place.options[selected].value;
       open(gonow,'_top');
       }
}

