
//################# generate current year for copyright #################
function copyright() { // automatically updates the copyright
var year="";
mydate = new Date();
myyear= mydate.getFullYear();
year = myyear;
if (year < 2000)
year = year + 1900;
var year = ("&nbsp; &copy; " + year);
document.write(year);
}

//################# hide email addresses from robots #################
function safemail(name, domain, display) {
displayed=(typeof(display)=="undefined") ? name+"@"+domain : display
document.write('<a href=mailto:' + name + '@' + domain + '>Email</a>');
}

//################# remote control with close  #################
function popShutGo(URL) {
window.opener.parent.location=URL;
window.close(self);
}

//################# standard netscape resize fix #################
function reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&((parseInt(appVersion)==4)||(parseInt(appVersion)==6))) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

//################# mailer #################
u = window.location;
m = (window.location)+ " -- Link from weepingwatergunclub.com:";
address = ""
function mailIt() {
window.location = "mailto:?subject="+m+"&body="+u;
}

//################# bookmark the page#################
var url = top.location.href;
var title = "Weeping Water Gun Club";
function bookMark() {
window.external.AddFavorite(url, title);
}

//################# conditionally display page title graphic ###############
function searchWrite(){ 
query = '' + this.location; 
	// Get the current URL so we can parse out the data. 
	// Adding a null-string '' forces an implicit type cast from property to string 

query = query.substring((query.indexOf('/')) + 2); 
	// Keep everything after the 'http://' 
  
if (query.length < 1) { return false; } 
	// Perhaps we got some bad data? 

myArray = query.split("/"); 
fileName = myArray[1].concat(".gif");

gen = Math.floor(Math.random() * 123456789123456789);
	// generates a 16 or 17 digit random number to help us catch 404's

if ((myArray[2] == "") || (myArray[1] == "")) { // catches all files where 'index.html' is not specified...
	document.write("<img src=/images/home.gif>");
	} else if (myArray[1] != gen) {  // for 404 codes (or any other file exc. var gen) on the root...
	document.write("<img src=/images/home.gif>");
        } else {
	document.write("<img src=/images/" + fileName + ">"); 
	}
}

//################# home link (if needed)#################
function homeWrite() {
if ((myArray[1] == "index.html") || (myArray[1] == "")) { 
	document.write("&nbsp;");
	} else {
	document.write("<a title=Home href=/index.html>HOME</a>  |   "); 
	}
}
