//
//Techmale.com CSS Text replacement Search Box
//
//
// These javascript functions allow the CSS Search Box to work
// 

//
// These are the attribute variables used in the functions
// They need to be defined in a global context
//
var standardText = "";
var rolloverText = "";

//
// These styles define the look of the box
//
var standardStyle = "1px none #999999";
var rolloverStyle = "1px dotted #999999";

/*************************************
 * get the attribute values
 ************************************/
function getTexts(id){
	standardText = id.getAttribute("standardText");
	rolloverText = id.getAttribute("rolloverText");
}

/*************************************
 * called when mouseOver box
 ************************************/
function activate(id){
	getTexts(id);
	//alert("changing text from " + standardText + " to " + focusedText);	
	if (id.value == standardText){
		id.value = rolloverText;
		id.style.border = rolloverStyle;
	}
}

/*************************************
 * called when mouseOut
 ************************************/
function deactivate(id){
	getTexts(id);
	//alert("changing text from " + rolloverText + " to " + standardText);	
	if (id.value == rolloverText){
		id.value = standardText;
		id.style.border = standardStyle;
	}
}

/*************************************
 * called when users clicks on box
 ************************************/
function gotFocus(id){
	//alert("got focus");
	getTexts(id);
	if(id.value == rolloverText){
		//remove text in box
		id.value="";
	}
}

/*************************************
 * called when user clicks outside box
 ************************************/
function lostFocus(id){
	//alert("lost focus");
	getTexts(id);
	if(id.value == ""){
		id.value = rolloverText;
		deactivate(id);
	}
}


