/* champion.js
JavaScript by Jayesh Sheth. September, 2002

These scripts have been inspired by others -
I cited my sources, where appropriate.

Feel free to reuse these scripts.
It would be nice (although not necessary)
to put a link to this site in your comments,
so other designers can find it, just as you did.

Peter-Paul Koch's site has been invaluable to me,
in expanding my knowledge of JavaScript
I have used modified versions of several of his scripts here.
You can find his site here: http://www.xs4all.nl/~ppk
*/

/*
Opera has trouble with certain scripts, when it identifies itself as Microsoft Internet Explorer or Netscape 4.78. I used some tips from http://gemal.dk/browserspy/basic.html and help from the JavaScript 'Pocket Reference' by David Flanagan to attempt a workaround/prevent Opera from running the script.

*/
//Important: If this browser detect code is used by other scripts,
//make sure it appears at the very top of the .js file.
var iamie = false;
var iamns4 = false;
var iamopera = false;
var iamgecko = false;
var appname = navigator.appName;
var appver = navigator.appVersion.slice(0,4);
//alert (appname);
//alert(appver);
function areyouopera()
// This script will detect all browsers which are not
// Internet Explorer, Netscape 4.x or Gecko based as Opera
// That probably means Konqueror (and other browsers unknown to me)
// will be detected as Opera.
// This may not work for everyone's site, but it does for mine.
// You can uncomment out the alerts to see how the script works.
	{
if (navigator.product == 'Gecko')
{
iamgecko = true;
//alert ("I am a Gecko based browser");
}
if (appname == "Opera")
{
iamopera=true;
//alert ("I am Opera (the first check)");
}

			if(document.layers)
//even when masquerading as Netscape 4.8, Opera 
//does not support document.layers
				{
					iamns4 = true;
					//alert("I am really Netscape 4.x");
				}	

if (appname == "Microsoft Internet Explorer")
//alert("I am IE, but wait ...");
	{
//When posing as IE, Opera pretends to support document.all
//uh oh
	if (document.all)
//alert("I do support document.all");
		{
//Gotcha, Opera! Ha ha! You do not support this old IE 4 method
//But I bet IE does (even IE 4 +) !
		if (window.document.expando)
			{
			//alert("I do support window.document.expando");
			iamie = true;
			
			//alert("I am really IE");
			}
		}
	}
if (!(iamie || iamns4 || iamgecko))
	{

		iamopera = true;
		//alert("I am really Opera, yet I am pretending to be someone else.");
	}
else 
	{
		iamopera = false;
	}
/*
alert("i am ie is " + iamie + " i am ns4 is " + iamns4 + " i am gecko is " + iamgecko + " i am opera is " + iamopera);
*/
	}
areyouopera();

//The following snippet is used by other scripts which need to know
// if they are really dealing with Opera or not
 var operaexists = false;
//alert (navigator.appName);
  if (iamopera)
  {
  operaexists = true;
  }

//Drop down menus, which were
//written by Peter-Paul Koch:
//http://www.xs4all.nl/~ppk/js/display.html 
// Parts of this drop down menu code is on the page
//which references this js file. (The document.write part)
var supported = ((document.getElementById || document.all) && (!operaexists));

	var max = 7;
	var shown = new Array();
	for (var i=1;i<=max;i++)
	{
		shown[i+1] = false;
	}

function blocking(i)
{
	if (!supported)
	{
		//alert('This link does not work in your browser. Please //use the contact information listed  below (for Opera users)');
		return;
	}
	shown[i] = (shown[i]) ? false : true;
	current = (shown[i]) ? 'block' : 'none';
	if (document.getElementById)
	{
		document.getElementById('number'+i).style.display = current;
	}
	else if (document.all)
	{
		document.all['number'+i].style.display = current;
	}
}

// last modified script by Bernhard Friedrich; should work in all browsers
	function showlastupdate()
	{
	var a;
	a=new Date(document.lastModified);
	lm_year=a.getYear();
	if (lm_year<1000){ 				//just in case date is delivered with 4 digits
		if (lm_year<70){
		lm_year=2000+lm_year;
		}
		else lm_year=1900+lm_year;
	}								//end workaround
	lm_month=a.getMonth()+1;
	if (lm_month<10){
		lm_month='0'+lm_month;
	}
	lm_day=a.getDate();
	if (lm_day<10){
		lm_day='0'+lm_day;
	}
	lm_hour=a.getHours();
	if (lm_hour<10){
		lm_hour='0'+lm_hour;
	}
	lm_minute=a.getMinutes();
	if (lm_minute<10){
		lm_minute='0'+lm_minute;
	}
	lm_second=a.getSeconds();
		if (lm_second<10){
		lm_second='0'+lm_second;
	}
	monthName = new Array(12)
	monthName[0] = 'January'
	monthName[1] = 'February'
	monthName[2] = 'March'
	monthName[3] = 'April'
	monthName[4] = 'May'
	monthName[5] = 'June'
	monthName[6] = 'July'
	monthName[7] = 'August'
	monthName[8] = 'September'
	monthName[9] = 'October'
	monthName[10] = 'November'
	monthName[11] = 'December'
	document.write("Last updated on:  " + monthName[lm_month-1]+'/'+lm_day+'/'+lm_year+' '+((lm_hour>12)?lm_hour-12:lm_hour)+':'+lm_minute+':'+lm_second+' '+((lm_hour>=12)?'P.M.':'A.M.'));
 }
