// JavaScripts.js - A JavaScript Page with JavaScript functions //

// Called from all the pages! //

// Functions: print_menu = prints the menu for all the pages except  //
//                         the Home Page                             //
//            page_footer = the footer for all the pages with a mail //
//                          link to the webmaster and the page       //
//                          updated date                             //
//            page_notes = prints random pithy saying at page bottom //
//            print_return_button = depending on the browser used,   //
//                                  displays a button to return to   //
//                                  the calling page                 //
//            return_to_home = return to Home Page link              //
//            home_header = print a random saying for the Home page  //
//                                                                   //

function print_menu()
{
// *** Page Table start *** //
document.write(' <TABLE ALIGN="center" BORDER="0" WIDTH="100%"> ');
document.write(' <TR> ');

// *** Menu Cell start *** //
document.write (' <TD ALIGN="center" VALIGN="top" WIDTH="5%"> ');

// *** Menu items are 'Haettenschweiler' font, 18 point, width = 105, height = 25 *** //

// *** Menu Table start *** //
document.write(' <TABLE ALIGN="center" BORDER="0" WIDTH="100%"> ');

// *** Home Page Cell *** //
document.write(' <TR><TD ALIGN="right" VALIGN="middle"> ');
document.write(' <A HREF="Home.shtml" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'Return to the CCCC Home Page'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_home.gif" ALT="Home Page" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** News Cell *** //
document.write(' <TR><TD ALIGN="right"> ');
document.write(' <A HREF="News.html" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'Latest Caving News'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_news.gif" ALT="News" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** Calendar Cell *** //
document.write(' <TR><TD ALIGN="right"> ');
document.write(' <A HREF="Calendar.html" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'Calendar of Events'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_calendar.gif" ALT="Calendar" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** Contacts Cell *** //
document.write(' <TR><TD ALIGN="right"> ');
document.write(' <A HREF="Contacts.html" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'Contact Information'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_contacts.gif" ALT="Contact Info" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** Meeting Cell *** //
document.write(' <TR><TD ALIGN="right"> ');
document.write(' <A HREF="Meeting.html" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'Monthly Meeting Information'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_meeting.gif" ALT="Meeting Info" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** Membership Cell *** //
document.write(' <TR><TD ALIGN="right"> ');
document.write(' <A HREF="Membership.html" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'Membership Information'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_membership.gif" ALT="Membership Info" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** FAQ Cell *** //
document.write(' <TR><TD ALIGN="right"> ');
document.write(' <A HREF="FAQ.html" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'Frequently Asked Questions'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_faq.gif" ALT="FAQ" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** Links Cell *** //
document.write(' <TR><TD ALIGN="right"> ');
document.write(' <A HREF="Links.html" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'Links to other caving pages'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_links.gif" ALT="Links Page" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** Photo Gallery Cell *** //
document.write(' <TR><TD ALIGN="right"> ');
document.write(' <A HREF="Gallery.html" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'Caving Photos Page'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_gallery.gif" ALT="Photo Gallery" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** Cave of DE Cell *** //
document.write(' <TR><TD ALIGN="right"> ');
document.write(' <A HREF="Cave_DE.html" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'Cave of Delaware Page'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_bvc.gif" ALT="Cave of Delaware" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** Gift Store *** //
document.write(' <TR><TD ALIGN="right"> ');
document.write(' <A HREF="http://www.geocities.com/kirkh.geo/ccccstore.html" ');
document.write(' onClick="this.blur()" target="_blank" onMouseOver="window.status=');
document.write(" 'CCCC Gift Store'; ");
document.write(' return true;"> ');
document.write(' <IMG SRC="Images/menu_gift.gif" ALT="CCCC Gift Store" ');
document.write(' BORDER="0" HEIGHT="25" WIDTH="105"></A> ');
document.write(' </TD></TR> ');

// *** Menu Table end *** //
document.write(' </TABLE> ');

// *** Menu Cell end *** //
document.write(' </TD> ');
}


// ************************* //
function page_footer()
{
document.write(' <HR NOSHADE SIZE="3"> ');
document.write(' Copyright &#169 1997-2009 by Commander Cody Caving Club ');
document.write(' <BR>For more information contact: ');
document.write(' <A HREF="mailto:caverdave1@cox.net?subject=CCCC_Web_Site" ');
document.write(' onClick="this.blur()" onMouseOver="window.status=');
document.write(" 'E-Mail the Webmaster'; ");
document.write(' return true;">David Fricke</A> ');

//*** Calculate the date this page was last modified ***//
//*** First make sure that there's a date to calculate - if zero, no date so skip ***//
if (Date.parse(document.lastModified) != 0)
{
{document.write('<BR>This page was last updated on '+(new Date(document.lastModified)).toGMTString()); }
}
} // end of page_footer function //


// ************************* //
function page_notes()
{
//*** Random pithy sayings for the page footers ***//
{
var rand = (parseInt(Math.random()*46));
// document.write('<BR>Rand = '+rand); //

switch(rand) {
	case 1:
		var rum = "Where there's a will ... I want to be in it!";
		break;
	case 2:
		var rum = "Don't hate yourself in the morning ... sleep until noon!";
		break;
	case 3:
		var rum = "Friends help you move.  Real friends help you move bodies.";
		break;
	case 4:
		var rum = 'Nothing says "This is serious" like a corpse on the floor ...';
		break;
	case 5:
		var rum = 'Whenever someone says "theoretically", they really mean, "not really".';
		break;
	case 6:
		var rum = "You should emulate your heroes, but don't carry it too far ... especially if they're dead.";
		break;
	case 7:
		var rum = "Crime does not pay ... as well as politics.";
		break;
	case 8:
		var rum = "I'm in love with a girl who doesn't even know I'm alive ... she thinks she got me with her long range rifle, but she missed ...";
		break;
	case 9:
		var rum = "If I can make just one person laugh, then it must've been a pretty good eulogy.";
		break;
	case 10:
		var rum = "They say that breaking up is hard to do ... but it's much easier with a restraining order and a rottweiler.";
		break;
	case 11:
		var rum = "The only thing standing between me and total happiness is reality.";
		break;
	case 12:
		var rum = "Two paths diverged in the woods and I took the one less traveled ... now, I'm eating bugs and berries, and if the Park Ranger doesn't find me soon, I'm a dead man.";
		break;
	case 13:
		var rum = "You can stay up until the cows come home, but it's awful hard to explain the cows to the condo association.";
		break;
	case 14:
		var rum = "Where there's smoke there's fire, but where there's a vague fishy odor, it could be any number of things.";
		break;
	case 15:
		var rum = "As I walk in the Valley of the Shadow of Death, I think to myself 'This place obviously wasn't named by a real-estate developer'.";
		break;
	case 16:
		var rum = "Misery loves company, especially when the company brings over a twelve-pack.";
		break;
	case 17:
		var rum = 'Whoever said "When in Rome, do as the Romans do" has never driven a car there.';
		break;
	case 18:
		var rum = "I wonder why no one ever hacks porn web sites and puts up images of government officials.";
		break;
	case 19:
		var rum = 'You know, poetry would be a lot easier if the words "girlfriend" and "Satan" rhymed.';
		break;
	case 20:
		var rum = 'My grandmother used to say; Remember, things could always get worse - they could teach Mary Lou Retton to sing "You Light Up My Life".';
		break;
	case 21:
		var rum = "I don't like electrons; they've always had a negative influence on society.";
		break;
	case 22:
		var rum = "There are very few personal problems that cannot be solved through suitable application of high explosives.";
		break;
	case 23:
		var rum = "Consider that I live in the most technologically advanced country in the world, it's eerie how many women I meet who have disconnected phone numbers.";
		break;
	case 24:
		var rum = "I'd like to teach the world to sing in perfect harmony ... especially Bob Dylan.";
		break;
	case 25:
		var rum = "Never put off until tomorrow what you can avoid all together.";
		break;
	case 26:
		var rum = "What makes me tick? I don't know, but the noise is driving me nuts!";
		break;
	case 27:
		var rum = "One day, I'm finally gonna to get up enough courage to actually go skydiving, rather than just being thrown out of the plane like last time.";
		break;
	case 28:
		var rum = "The Heineken Uncertainty Principle: You can never be sure just how many beers you had last night.";
		break;
	case 29:
		var rum = "Hard work pays off in the future. Laziness pays off now.";
		break;
	case 30:
		var rum = "If you must choose between two evils, pick the one you've never tried before.";
		break;
	case 31:
		var rum = "Be wary of strong drink. It can make you shoot at tax collectors and miss!";
		break;
	case 32:
		var rum = "It is much easier to suggest a solution when you know nothing about the problem.";
		break;
	case 33:
		var rum = "Everyone should believe in something ... I believe I'll have another drink.";
		break;
	case 34:
		var rum = "All I ask is a chance to prove that money can't make me happy!";
		break;
	case 35:
		var rum = "Honesty is the best policy, but insanity is a better defense.";
		break;
	case 36:
		var rum = "You can fool all of the people some of the time and some of the people all of the time, but you can't fool Mom.";
		break;
	case 37:
		var rum = "Whom computers would destroy, they must first drive mad.";
		break;
	case 38:
		var rum = "You know what I hate most?  Rhetorical questions.";
		break;
	case 39:
		var rum = "You have the capacity to learn from your mistakes. You'll be learning a lot today.";
		break;
	case 40:
		var rum = "Everyone talks about apathy, but no one does anything about it.";
		break;
	case 41:
		var rum = "The only way to get rid of temptation is to yield to it.";
		break;
	case 42:
		var rum = "While money doesn't buy you love, it does put you in a great bargaining position.";
		break;
	case 43:
		var rum = "Honk if you love peace and quiet";
		break;
	case 44:
		var rum = "Never attribute to malice that which is adequately explained by stupidity.";
		break;
	case 45:
		var rum = "There's two theories to arguing with a woman. Neither one works.";
		break;
	default:
		var rum = "Cave 'Til You Puke!";
		break;
}
}

document.write('<BR><I>'+rum+'</I>');

} // end of page_notes function //


// ************************* //
function print_return_button()
{
document.write(' <P> ');
var browser = navigator.appName;
if (browser == 'Microsoft Internet Explorer')
{
  document.write(' <INPUT TYPE="button" VALUE="Return to Previous Page" ');
  document.write(' onclick="history.back()"> ');
}
else
{
  if (document.referrer != "")
  {	var former_page = document.referrer } 
  else
  {	var former_page = "index.html" }

  document.write(' <A HREF="');
  document.write( former_page );
  document.write(' " onClick="this.blur()" onMouseOver="window.status=');
  document.write(" 'Return to the previous page'; ");
  document.write(' return true;"> ');
  document.write(' <IMG SRC="Images/menu_return.gif" ALIGN="center" ');
  document.write(' ALT="Return to the previous page" BORDER="0"></A> ');
// *** Debug *** //
//  document.write(" <P> Referrer = " + document.referrer);       //
//  document.write(" <P> Former Page = " + former_page + "<P>");  //
// *** Debug *** //
}
} // end of print_return_button function //


// ************************* //
function return_to_home()
{
document.write(' <CENTER> ');
document.write(' <A HREF="Home.shtml" onClick="this.blur()" ');
document.write(' onMouseOver="window.status=');
document.write("'Return to the CCCC Home Page'; return true;");
document.write('"> ');
document.write(' <IMG SRC="Images/menu_home.gif" ALT="Home Page" BORDER="0" ');
document.write(' HEIGHT="25" WIDTH="105"></A> ');
document.write(' </CENTER> ');
}
// end of return_to_home function //


// ************************* //
function home_header()
{
//*** Random pithy sayings for the home page ***//
{
var rand = (parseInt(Math.random()*21));
// document.write('<BR>Rand = '+rand); //

switch(rand) {
	case 1:
		document.write("Now with X-K 29 for those who can't roast after every meal!");
		break;
	case 2:
		document.write("As seen on TV!");
		break;
	case 3:
		document.write("Where wearing pants is always optional");
		break;
	case 4:
		document.write("Live from Omicron Persei 8");
		break;
	case 5:
		document.write("Where stalagmites and stalactites meet");
		break;
	case 6:
		document.write("The relentless pursuit of perfec-- Hey! A penny!");
		break;
	case 7:
		document.write("Dead Fish Skimmed Daily");
		break;
	case 8:
		document.write("Presented in DoubleVision When Drunk");
		break;
	case 9:
		document.write("This is not your father's caving club");
		break;
	case 10:
		document.write("Recommended by 4 out of 5 cavers who cave after every meal!");
		break;
	case 11:
		document.write("Some assembly may be required!");
		break;
	case 12:
		document.write("Warning!<BR>Not for use as an aphrodisiac!");
		break;
	case 13:
		document.write("Now with even more raisins!");
		break;
	case 14:
		document.write("Afraid of the dark? Then don't call us!");
		break;
	case 15:
		document.write("Your Guide to the Greatest Polka Music Ever");
		break;
	case 16:
		document.write("When you care enough to cave with the very best ...");
		break;
	case 17:
		document.write("We Cave Harder!");
		break;
	case 18:
		document.write("Welcome Cave Fans!");
		break;
	case 19:
		document.write("When you absolutely, positively have to cave!");
		break;
	case 20:
		document.write("Got Cave?");
		break;
	default:
		document.write("The Professional Reference Edition");
		break;
}
}

} // end of home_header function //

