function clearList(){
	var usernameElement = document.getElementById("txtEmailAddress");
	var passwordElement = document.getElementById("txtPassword");
	if(usernameElement.value == "Username" || passwordElement.value == "Password"){
		usernameElement.value = "";
		passwordElement.value = "";
	}
}

function clearRentPhrase(){
	var itemElement = document.getElementById("phrase");	
	if(itemElement.value == "What are you looking for?"){
		itemElement.value = "";
	}
}
function clearRentLocation(){
	var locElement = document.getElementById("loc_phrase");
	if(locElement.value == "Enter City, State or ZIP"){
		locElement.value = "";
	}
}

function resetRentPhrase(){
	var locElement = document.getElementById("phrase");
	if(locElement.value == ""){
		locElement.value = "What are you looking for?";
	}
}

function resetRentLocation(){
	var locElement = document.getElementById("loc_phrase");
	if(locElement.value == ""){
		locElement.value = "Enter City, State or ZIP";
	}
}

function focusElement(myElement){
	if(myElement.value == myElement.title){
		myElement.value = "";
	}
}

function blurElement(myElement){
	if(myElement.value == ""){
		myElement.value = myElement.title;
	}
}

function processSearch(){
	
	if(document.forms['frmSearch'].elements['phrase'].value == "What are you looking for?"){
		document.forms['frmSearch'].elements['phrase'].value = "";
	}
	
	if(document.forms['frmSearch'].elements['loc_phrase'].value == "Enter City, State or ZIP"){
		document.forms['frmSearch'].elements['loc_phrase'].value = "";
	}
	
	document.forms['frmSearch'].submit();
}

function categorySearchs(cat_id,cat_name){
	window.location = cat_id;
}

function showHelp(img){
	var tooltip = img.parentNode.getElementsByTagName('DIV')[0];	
	tooltip.style.display = "block";	
}

function hideHelp(img){
	var tooltip = img.parentNode.getElementsByTagName('DIV')[0];	
	tooltip.style.display = "none";	
}

function keyMonitor(event, searchform){
	if (event && event.which == 13){
		searchform.submit();
	}else{
		return true;
	}
}