function dosearch() {
		//get search value and run url
		var query = $("#s_field").val();
		var myurl = "/as/s?searchview&query=" + query;	
		window.location.href=myurl;
		/*$.get(myurl, function(data) {
		var results = $("ul",data);
		if ($.trim(results.html()).length > 0) {
			var rethtml = "<p>Search Results - <a href=\"#\" id=\"s_clear\" title=\"Clear Results\">Clear Results</a></p><ul>" + $(results).html() + "</ul>";
		}
		else
		{
			var rethtml ="<p>Search Results - <a href=\"#\" id=\"s_clear\" title=\"Clear Results\">Clear Results</a></p><p>No results found</p>"
		}
		$("#body_content").html(rethtml);
			$("#s_clear").bind('click',function() {
					location.reload();
		});
	});*/
}

$(document).ready(function() {
//if return is pressed in the search field, run the search function
$("#s_field").keypress(function (e) {
      if (e.which == 13)
            {
			if (!($(this).val()=="")) {
               dosearch();
			}
			return false;
			}
			
});

$("#s_field").blur(function() {
	//reset search field on blur
    if ($(this).val()=="") {
    	$(this).val("> SEARCH");
    }
});
$("#s_field").focus(function() {
	//clear the search field on enter if it's got default text
    if ($(this).val()=="> SEARCH") {
    	$(this).val("");
    }
});

$("#people_lookup").focus(function() {
	//clear the Who are you Looking for field on enter if it's got default text
    if ($(this).val()=="TYPE PERSONS NAME HERE") {
    	$(this).val("");
    }
});

$("#lookup").focus(function() {
	//clear the Who are you Looking for field on enter if it's got default text
    if ($(this).val()=="> WHO ARE YOU LOOKING FOR") {
    	$(this).val("");
    }
});

$("#lookup").blur(function() {
	//reset person search field on blur
    if ($(this).val()=="") {
    	$(this).val("> WHO ARE YOU LOOKING FOR");
    }
});

$("#people_lookup").blur(function() {
	//reset person search field on blur
    if ($(this).val()=="") {
    	$(this).val("TYPE PERSONS NAME HERE");
    }
});


});

