// floating menu ***** ***** ***** ***** ***** ***** ***** ***** ***** 
function setVariables()
{
  if (navigator.appName == "Netscape")
  {
    v=".top=";
    dS="document.";
    sD="";
    y="window.pageYOffset";
 }
  else
  {
    v=".pixelTop=";
    dS="";
    sD=".style";
    y="document.body.scrollTop";
  }
}

function checkLocation()
{
  object="object1";
  yy=eval(y) + 0;
  eval(dS+object+sD+v+yy);
  setTimeout("checkLocation()",10);
}

// expanding window ***** ***** ***** ***** ***** ***** ***** ***** ***** 
function expandingWindow(website)
{
  var heightspeed = 10; // vertical scrolling speed (higher = slower)
  var widthspeed = 10;  // horizontal scrolling speed (higher = slower)
  var leftdist = 0;    // distance to left edge of window
  var topdist = 0;     // distance to top edge of window
  if (document.all)
  {
    var winwidth = window.screen.availWidth - leftdist;
    var winheight = window.screen.availHeight - topdist;
    var winOptions = "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes";
    var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=1,height=1," + winOptions);
    for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
    {
      sizer.resizeTo("1", sizeheight);
    }
    for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
    {
      sizer.resizeTo(sizewidth, sizeheight);
    }
    sizer.location = website;
  }
  else
  {
    window.location = website;
  }
}

// open and close ***** ***** ***** ***** ***** ***** ***** ***** ***** 
function hideAll()
{
  var x;
  if (document.all)
  {
    for (x=0;x<=99;++x)
    {
      eval ("document.getElementById('qq" + x + "').style.display = 'none'");
    }
  }
}

function toggleAnswer(QuestionID)
{
  if (document.all)
  {
    if (document.getElementById(QuestionID).style.display == '')
    {
      document.getElementById(QuestionID).style.display = 'none';
    }
    else
    {
      document.getElementById(QuestionID).style.display = '';
    }
  }
}

// display file date ***** ***** ***** ***** ***** ***** ***** ***** ***** 
function dayofWeek(day)
{
  switch( day )
  {
    case 0: s = "Sunday"; break;
    case 1: s = "Monday"; break;
    case 2: s = "Tuesday"; break;
    case 3: s = "Wednesday"; break;
    case 4: s = "Thursday"; break;
    case 5: s = "Friday"; break;
    case 6: s = "Saturday"; break;
    default: s = "Unknownday"
  }
  return s;
}

function monthofYear(mon)
{
  switch( mon )
  {
    case 0: s = "January"; break;
    case 1: s = "February"; break;
    case 2: s = "March"; break;
    case 3: s = "April"; break;
    case 4: s = "May"; break;
    case 5: s = "June"; break;
    case 6: s = "July"; break;
    case 7: s = "August"; break;
    case 8: s = "September"; break;
    case 9: s = "October"; break;
    case 10: s = "November"; break;
    case 11: s = "December"; break;
    default: s = "Unknownmonth"
  }
  return s;
}

function displayDateMod()
{      
  lastmod = document.lastModified     // get string of last modified date
  lastmoddate = Date.parse(lastmod)   // convert modified string to date
  if(lastmoddate == 0)                // unknown date (or January 1, 1970 GMT)
  {
    document.writeln("Last Modified: Unknown")
  }
  else
  {
    d = new Date(lastmod);
    day=dayofWeek(d.getDay());
    mon=monthofYear(d.getMonth());
    dte=d.getDate();
    year=d.getYear();
//    document.write("Day=", day, ", ");
//    document.write("Month=", mon, ", ");
//    document.write("Date=", dte, ", ");
//    document.write("Year=", year, "<br>");
    document.write("Last Modified: ", day + ", " + mon + " " + dte + ", " + year);
  }
}

// set date and time ***** ***** ***** ***** ***** ***** ***** ***** ***** 
function setDayDateTime()
{
var today = new Date();
var tDay = today.getDay();
var pDay = "";
switch(tDay)
{
	case 0:
	pDay = "Sunday";
	break;
	case 1:
	pDay = "Monday";
	break;
	case 2:
	pDay = "Tuesday";
	break;
	case 3:
	pDay = "Wednesday";
	break;
	case 4:
	pDay = "Thursday";
	break;
	case 5:
	pDay = "Friday";
	break;
	case 6:
	pDay = "Saturday";
	break;
}
	document.myForm.date.value = pDay;
	var thisDate = today.getDate();
	var thisMonth = today.getMonth() + 1;
	var thisYear = today.getFullYear();
	var thisDayOfWeek = today.getDay();
	var pDate = thisMonth + "/" + thisDate + "/" + thisYear;
	var thisHour = today.getHours();
	var thisMinute = today.getMinutes();
	var thisSecond = today.getSeconds();
	var pTime = " " + ((thisHour > 13) ? thisHour - 12 : thisHour);
	pTime += " " + ((thisMinute < 10) ? ":0" : ":") + thisMinute;
	pTime += " " + ((thisSecond < 10) ? ":0" : ":") + thisSecond;
	pTime += (pTime >= 12) ? "AM" : "PM";
	document.myForm.date.value = pDay + "  --  " + pDate + "  --  " + pTime;
	setTimeout("setDayDateTime()",1000);
}

// create random number ***** ***** ***** ***** ***** ***** ***** ***** ***** 
function Randomer(Size)
{
var RanNum = Math.round(Math.random() * Size);
return RanNum;
}

// function random web design website ***** ***** ***** ***** ***** ***** ***** ***** ***** 
function MQuote(Qnum)
{
var Quotes = new Array(46);
Quotes[0] = 'goodpractices.com';
Quotes[1] = 'hotwired.lycos.com/webmonkey';
Quotes[2] = 'jobstar.org';
Quotes[3] = 'linuxsurvival.com';
Quotes[4] = 'rute.sourceforge.net';
Quotes[5] = 'sqlzoo.net';
Quotes[6] = 'susanireland.com';
Quotes[7] = 'webreference.com';
Quotes[8] = 'www.aboutdebian.com';
Quotes[9] = 'www.anfyteam.com';
Quotes[10] = 'www.bls.gov/oco';
Quotes[11] = 'www.codehound.com';
Quotes[12] = 'www.coolhomepages.com';
Quotes[13] = 'www.course.com';
Quotes[14] = 'www.damngood.com';
Quotes[15] = 'www.dictionary.com';
Quotes[16] = 'www.digitalcentury.com';
Quotes[17] = 'www.findtutorials.com';
Quotes[18] = 'www.free-ed.net';
Quotes[19] = 'www.functionx.com/access';
Quotes[20] = 'www.htmlgoodies.com';
Quotes[21] = 'www.htmlhelp.com';
Quotes[22] = 'www.hwg.org';
Quotes[23] = 'www.infoteach.org';
Quotes[24] = 'www.javascriptkit.com';
Quotes[25] = 'www.jobweb.com';
Quotes[26] = 'www.killersites.com';
Quotes[27] = 'www.labyrinth.org';
Quotes[28] = 'new.linuxnow.com';
Quotes[29] = 'www.pageresource.com';
Quotes[30] = 'www.ratz.com';
Quotes[31] = 'www.scorpioncity.com';
Quotes[32] = 'www.sqlcourse.com';
Quotes[33] = 'www.sqlcourse2.com';
Quotes[34] = 'www.trainingtools.com';
Quotes[35] = 'www.useit.com';
Quotes[36] = 'www.vbatutor.com';
Quotes[37] = 'www.vbinformation.com';
Quotes[38] = 'www.volunteermatch.org';
Quotes[39] = 'www.w3.org';
Quotes[40] = 'www.w3schools.com';
Quotes[41] = 'www.webdeveloper.com';
Quotes[42] = 'www.webopedia.com';
Quotes[43] = 'www.webpagesthatsuck.com';
Quotes[44] = 'www.webteacher.com';
Quotes[45] = 'www.webreview.com';
//
return Quotes[Qnum];
}

// function weekday countdown ***** ***** ***** ***** ***** ***** ***** ***** ***** 
/* Written by: Mark Woodward (June, 2000)
   Woody's JavaScripts at: woody.cowpi.com/javascripts.html

   The function weekDaysUntil is a WEEKDAY countdown counter. Weekends are
   not included in the count. It calculates the number of weekdays from a
   given date, chkDate, to another date, targetDate. A list of holidays or
   non-working weekdays can be created to subtract from the count.   */

// List any non-working weekdays here (DO NOT include any weekend dates)
var dayOff = new Array();
dayOff[0] = new myDate(2005, 05, 30);   // Old Xmas date for demo

function myDate(y, m, d) {

/* y: 4 digit year, m: month (range: 1-12), d: day (range: 1-7)
   If no parameters are passed, then current date is used.
   myDate object has two properties:
   jDate  - javascript Date object
   dayNum - adjusted javascript representation of day number
   (counts milliseconds from 1970/1/1)   */

	if (y != null) {
		this.jDate = new Date(y, m-1, d);
	}
	else {
		this.jDate = new Date();
	}
	this.dayNum = Math.floor(this.jDate.getTime() / 86400000);
}

function weekDaysUntil(chkDate, targetDate) {

/* chkDate and targetDate are myDate objects.
   targetDate MUST be a weekday! (Erroneous results for weekend dates.)
   chkDate can be ANY date before the targetDate.  */

	var dowT = targetDate.jDate.getDay();
	var dowC = chkDate.jDate.getDay();
	var numDays = targetDate.dayNum - chkDate.dayNum;
	var numWks = Math.floor((numDays + 5 - dowT) / 7);
	var remainder = ((6 - dowC) % 6);
	var wkDays = 5 * (numWks - 1) + remainder + dowT - 1;
	if (remainder == 0) wkDays += 6;
	for (var i = 0; i < dayOff.length; i++)
	if ((targetDate.dayNum > dayOff[i].dayNum) && (dayOff[i].dayNum > chkDate.dayNum)) {
		wkDays--;
	}
	return wkDays
}
// function function ***** ***** ***** ***** ***** ***** ***** ***** ***** 
























