
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 = "tries2002/ab_on.gif";         
aboutoff.src = "tries2002/ab_off.gif";
          
adviceon = new Image; adviceoff = new Image;         
adviceon.src = "tries2002/ad_on.gif";         
adviceoff.src = "tries2002/ad_off.gif";
   	   	  
fortuneon = new Image; fortuneoff = new Image;         
fortuneon.src = "tries2002/for_on.gif";         
fortuneoff.src = "tries2002/for_off.gif";
          
archiveson = new Image; archivesoff = new Image;         
archiveson.src = "tries2002/ar_on.gif";         
archivesoff.src = "tries2002/ar_off.gif";
          
taleson = new Image; talesoff = new Image;         
taleson.src = "tries2002/ta_on.gif";         
talesoff.src = "tries2002/ta_off.gif";
          
contacton = new Image; contactoff = new Image;         
contacton.src = "tries2002/co_on.gif";         
contactoff.src = "tries2002/co_off.gif";
          
linkson = new Image; linksoff = new Image;         
linkson.src = "tries2002/li_on.gif";         
linksoff.src = "tries2002/li_off.gif";
          
homeon = new Image; homeoff = new Image;         
homeon.src = "tries2002/ho_on.gif";         
homeoff.src = "tries2002/ho_off.gif";
                  
mailon = new Image; mailoff = new Image;         
mailon.src = "tries2002/mail_on.gif";         
mailoff.src = "tries2002/mail_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) {
	var space = /\s/;
	string.multiline = true;
	while(space.test(string.substring(0, 1))) {
		string = string.substring(1, string.length);
	}
	return string;
}

function RemoveTrailingSpaces(string) {
	var space = /\s/;
	string.multiline = true;
	while(space.test(string.substring((string.length - 1), string.length))) {
		string = string.substring(0, (string.length - 1));
	}
	return string;
} 

function isSpam(string) {
	var link = /<a\s+href/gi;
	return link.test(string);
}

function checkFields() {  
// checks for blank content field  	
	var content = Trim(document.form.content.value);
	if (content.length > 2) {
		if(isSpam(content)) {
			alert("Sorry, links are not accepted.");
			document.form.content.value = "";		 	
			document.form.content.focus(); 	
			return false;	
		}
		return true;
	}
	else { 	
		alert("Nothing on your mind, honeybunch?"); 		
		document.form.content.value = "";		 	
		document.form.content.focus(); 		 	
		//document.form.content.select();  		 	
		return false; 
	} 		
} 

