
function clearText(thefield){
	if(thefield.name=="username"){
		if(trim(thefield.value) == "username")
			thefield.value = "";
	}
	if(trim(thefield.name)=="red"){
		if(thefield.value == "000")
			thefield.value = "";
	}
	if(trim(thefield.name)=="password"){
		if(thefield.value == "password")
			thefield.value = "";
	}
	if(trim(thefield.name)=="green"){
		if(thefield.value == "000")
			thefield.value = "";
	}
	if(trim(thefield.name)=="blue"){
		if(thefield.value == "000")
			thefield.value = "";
	}
}
function setText(thefield){
if (trim(thefield.value)=="")
{
	if(thefield.name=="name")
	{
		thefield.defaultValue = "name";
		thefield.value = "name";
	}
	if(thefield.name=="email")
	{
		thefield.defaultValue = "email";
		thefield.value = "email";
	}
	if(thefield.name=="business")
	{
		thefield.defaultValue = "business";
		thefield.value = "business";
	}
	if(thefield.name=="suggestions")
	{
		thefield.defaultValue = "suggestions";
		thefield.value = "suggestions";
	}
}
}


function trim(inputString) {
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") {
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") {
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) {
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length);
   }
   return retValue;
}


