//onload = onload_search();
//var body = document.getElementsByTagName("body")[0];
var body = window;
if(body.addEventListener){
	//alert("DOM");
	body.addEventListener("load", function (){onload_search();}, false);
} else if (body.attachEvent) { //for IE
	//alert("IE");
	body.attachEvent('onload', function(){onload_search();});
} else {
	//alert("Other");
	body["onload"] = onload_search();
}
function onload_search(){
	//alert("works");
	var q = document.getElementById("q");
	q.value = "Keyword Search";
	
	var model = document.getElementById("model");
	model.value = "Model Search";
	//q.setAttribute("onfocus","setTextQ()");
	//model.setAttribute("onfocus","setTextM()");
	var handlerQ = function() {
		setTextQ();
	};
        var handlerM = function() {
                setTextM();
        };

	if (body.addEventListener) { //for DOM-compliant browsers
		//alert("DOM");	
		q.addEventListener("focus", handlerQ, false);
		model.addEventListener("focus", handlerM, false);
	} else if (body.attachEvent) { //for IE
		//alert("IE");
		q.attachEvent('onfocus', handlerQ);
		model.attachEvent('onfocus', handlerM);
	} else { //for all others
		//alert("other");
		q["onfocus"] = setTextQ();
		model["onfocus"] = setTextM();
	}

}

function setTextQ(){
	var q = document.getElementById("q");
	var model = document.getElementById("model");
	q.value="";
	model.value="Model Search";
}

function setTextM(){
	var q = document.getElementById("q");
        var model = document.getElementById("model");
        model.value="";
        q.value="Keyword Search";
}

