function countdown(field, maxchars, report) {  
   
   if(field.value.length - maxchars >= 0) {
   	
      report.style.color = "#FF0000";      
      report.style.fontWeight = "bold";
      
      
	  
      field.value = field.value.substring(0,maxchars);
      report.value = 0;
      
      return false;
          
           
}
   else {
      report.value = maxchars - field.value.length;
      report.style.color = "#000000";
      report.style.fontWeight = "lighter";
   }

}



function limit(field, maxchars, report){
	
var count = maxchars;
var tex = document.getElementById(field).value;
var len = tex.length;

if(len > count){
        tex = tex.substring(0,count);
        document.shouts.field.value = tex;
        return false;
}
document.getElementById(report).value = count-len;
}


function color(elemID, clr) {

var table=[];
table['purple'] = "871F78";
table['deep blue'] = "23238E";
table['emerald'] = "25310C";
table['red'] = "AA0000";
table['green'] = "00FF00";
table['aqua'] = "00FFFF";
table['yellow'] = "FFFF00";
table['orange'] = "FF7F00";
table['black'] = "000000";




document.getElementById(elemID).style.color= "#" + table[clr];

}

function font(elemID, fnt) {
	
	
	
var table=[];
table['arial'] = "arial bold";
table['fixedsys'] = "fixedsys";
table['courbd'] = "courier new bold";
table['calibri'] = "calibri bold";
table['comic'] = "comic sans MS";
table['palino'] = "palatino linotype";
table['time'] = "Times New Roman";

document.getElementById(elemID).style.fontFamily=table[fnt];
}

function validate() {
	
	var user=document.getElementById('username').value;
	var message=document.getElementById('message').value;
	submitOK="true";
	
if (user.length==0) {
	alert("Please enter a username in order to continue");
	submitOK="false";
}
if (message.length==0) {
	alert("Please enter a message in order to continue");
	submitOK="false";
}
if (submitOK=="false") {
	return false;
 }
}

function changeCaptcha() {
	var i = 0; // to stop caching of the image
	document.getElementById('captcha').src='captch1.php?'+i;
	i++;
	}
