var mac, win, shortnow, NN, IE, AOL, other_browser, version, IE4, NN4;

// ############################
function showdate(){

var dayNames = new Array("Sun","Mon","Tues","Wed","Thurs","Fri","Sat");
var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");

var now = new Date();
document.write(dayNames[now.getDay()] + "&nbsp;" + now.getDate()+ "&nbsp;" + monthNames[now.getMonth()] + "&nbsp;" + now.getFullYear());

shortnow = now.getDate() + "&nbsp;" + monthNames[now.getMonth()] + "&nbsp;" + now.getFullYear();
}

// ########################
function os() {			//	browsers and platforms and versions

if (navigator.appVersion.indexOf("Mac") != -1) {
	mac=1;
    } 
else if (navigator.appVersion.indexOf("Win") != -1) {
	win=1;
    }

var agt = navigator.userAgent.toLowerCase();

IE = (agt.indexOf("msie")!=-1);			//	internet explorer
AOL = (agt.indexOf("aol")!=-1);			//	aol
NN = (document.layers ? true : false);			//	netscape

if ((!IE) && (!AOL) && (!NN)){				//	everything else
	other_browser = true;
	}

version = parseInt(navigator.appVersion);

if((IE) && (version > 3)){					//		Int.Explorer 4+
	IE4 = true;
	}
if((NN) && (version > 3)){					//		Netscape 4+
	NN4 = true;
	}

}

// ############ trim...
function trim(text) {

   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.

if (typeof text != "string") {
   return text;
   }

var return_value = text;
var ch = return_value.substring(0, 1);

while (ch == " ") {				// Check for spaces at the beginning of the string
	
	return_value = return_value.substring(1, return_value.length);
   ch = return_value.substring(0, 1);
   
   }

ch = return_value.substring(return_value.length-1, return_value.length);

while (ch == " ") {				// Check for spaces at the end of the string
	
	return_value = return_value.substring(0, return_value.length-1);
	ch = return_value.substring(return_value.length-1, return_value.length);
	
	}
   
while (return_value.indexOf("  ") != -1) {			 // Note that there are two spaces in the string - look for multiple spaces within the string

	return_value = return_value.substring(0, return_value.indexOf("  ")) + return_value.substring(return_value.indexOf("  ")+1, return_value.length); // Again, there are two spaces in each of the strings
	
	}
   
return return_value; // Return the trimmed string back to the user

}	// end trim...

function urlencode(str) {
str = escape(str);
str = str.replace(/\+/g, '%2B');
str = str.replace(/%20/g, '+');
str = str.replace(/\*/g, '%2A');
str = str.replace(/\//g, '%2F');
str = str.replace(/@/g, '%40');
return str;
}

