// track if this is the first time the element has been given focus or not
prevFocus = false;

function addEvent(elm, evType, fn, useCapture) {
	// cross-browser event handling for IE5+, NS6 and Mozilla 
	// By Scott Andrew 
	if (elm.addEventListener) { 
		elm.addEventListener(evType, fn, useCapture); 
		return true; 
	} else if (elm.attachEvent) { 
		var r = elm.attachEvent('on' + evType, fn); 
		return r; 
	} else {
		elm['on' + evType] = fn;
	}
}
function clearInitial(e){
	var el;
	if (window.event && window.event.srcElement) {el = window.event.srcElement;}
	if (e && e.target) {el = e.target;}
	if (!el) {return;}

	if (!prevFocus) {
		el.value = "";
		prevFocus = true;
	}
}
function init(){
	if(document.getElementsByName("txtSearch")){
		searchText = document.getElementsByName("txtSearch")[0];
		addEvent(searchText,"focus",clearInitial,false);
	}
}
addEvent(window,"load",init);