/* 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

			Journal Watch homepage behavior layer

			Created: 	3.12.06
 
			By:		Scott Jehl, Mindseye Inc.
			
			notes:	-> This script clears the homepage text fields when you focus em
								
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/


// function for clearing an input on focus
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}

function setupfields(){
	// this will set up text fields to clear on focus.

		var field1 = document.getElementById("email");
		var field2 = document.getElementById("txtName");
		var field3 = document.getElementById("txtPass");
		var field1 = document.getElementById("emailPFWArt");
		
		if(field1){
		field1.onfocus = function(){
			clearText(this);
			}
		}
		
		if(field2){
		field2.onfocus = function(){
			clearText(this);
			}
		}
		if(field3){
		field3.onfocus = function(){
			clearText(this);
			}		
		}
		if(field4){
		field4.onfocus = function(){
			clearText(this);
			}		
		}
		
	// this will set up the clear buttons in forms so that they clear a form on click
		var clear1 = document.getElementById('clearButton1');
		var clear2 = document.getElementById('clearButton2');
		if(clear1){
			clear1.onclick = function(){
				this.form.reset();
				return false
			}
		}
		if(clear2){
			clear2.onclick = function(){
				this.form.reset();
				return false
			}
		}
	
	}
