var today, month, day, year; var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");  

today = new Date(); month = months[today.getMonth()]; 
day = today.getDate(); 
year = today.getFullYear();  
if (document.images){          
abouton = new Image; aboutoff = new Image;         
abouton.src = "index2001/ab3_on.gif";         
aboutoff.src = "index2001/ab3.gif";          
adviceon = new Image; adviceoff = new Image;         
adviceon.src = "index2001/ad3_on.gif";         
adviceoff.src = "index2001/ad3.gif";   	   	
fortuneon = new Image; fortuneoff = new Image;         
fortuneon.src = "index2001/for3_on.gif";         
fortuneoff.src = "index2001/for3.gif";          
archiveson = new Image; archivesoff = new Image;         
archiveson.src = "index2001/ar3_on.gif";         
archivesoff.src = "index2001/ar3.gif";          
taleson = new Image; talesoff = new Image;         
taleson.src = "index2001/ta3_on.gif";         
talesoff.src = "index2001/ta3.gif";          
linkson = new Image; linksoff = new Image;         
linkson.src = "index2001/li3_on.gif";         
linksoff.src = "index2001/li3.gif";          
homeon = new Image; homeoff = new Image;         
homeon.src = "index2001/ho3_on.gif";         
homeoff.src = "index2001/ho3.gif";  	
phoneon = new Image; phoneoff = new Image; 	
phoneon.src = "index2001/phone_on.gif" 	
phoneoff.src = "index2001/phone_off.gif"  	
}     

function swapem(iname, gname)  {         
if(document.images) 	
{                 
iname.src = gname.src;         
} 
}  

function Trim (string) {
	if (string.length > 0) {
		string = RemoveLeadingSpaces (string);
	}
	if (string.length > 0) {
		string = RemoveTrailingSpaces(string);
	}
	return string;
}

function RemoveLeadingSpaces(string) {
	while(string.substring(0, 1) == " ") {
		string = string.substring(1, string.length);
	}
	return string;
}

function RemoveTrailingSpaces(string) {
	while(string.substring((string.length - 1), string.length) == " ") {
		string = string.substring(0, (string.length - 1));
	}
	return string;
} 

function isSpam(string) {
	var link = /href/gi;
	return link.test(string);
}

function checkFields() {  
	// checks for blank content field
	var description = Trim(document.form.content.value);
	if (description.length > 2) {
		if(isSpam(description)) {
			alert("Sorry, links are not accepted.");
			document.form.content.value = "";		 	
			document.form.content.focus();
			return false;	
		}
		else {
		    return !(isSpam(description));
		}
	}
	else { 	
		alert("Nothing on your mind, honeybunch?"); 		
			document.form.content.value = "";		 	
			document.form.content.focus(); 	
		//document.form.content.select();  		 	
		return false; 
	} 		
} 
