// JavaScript Document
function checkFieldFocus(that, defaultText){	
	that.value = jQuery.trim(that.value);
	if (that.value.length <1 || that.value==defaultText){
			//check if required field class (background-image), or just field (text value)
			that.value = "";
			if(that.className != "fields"){
				//alert(that.className);
		//put class back on if it was removed
		that.className = that.className.replace(that.name + "_temp", that.name);
				that.className = that.className.replace(" " + that.name,  " " + that.name + "_o");
				//alert(that.className);
				
			}
	}

}
function checkFieldBlur(that, defaultText){
	that.value = jQuery.trim(that.value);
	if (that.value.length <1){
	
		if(that.className == "fields")
			that.value=defaultText;
		else{
			//put class back on if it was removed
			that.className = that.className.replace(that.name + "_temp", that.name);
			//also try just "over" replace to name
			that.className = that.className.replace(that.name + "_o", that.name);	}
}

	
}
function checkFieldPress(that){
	tempval = jQuery.trim(that.value);
	//alert(tempval);
	if (tempval.length > 0){
		if(that.className != "fields"){
	//remove the class with the bg on it.
	that.className = that.className.replace(that.name + "_o", that.name + "_temp");
	}
}
}

function checkFieldsFilled(){
	that = document.contactForm; 
	for(i=0; i<that.elements.length; i++)
	{
		if (that.elements[i].value.length > 0){
			//checkFieldBlur(that.elements[i], that.elements[i].value);
			that.elements[i].className = that.elements[i].className.replace(that.elements[i].name, that.elements[i].name +"_temp");
		}
	}
	
}
