document.observe("dom:loaded", function() {
	var field = $("goodsearch_keywords_1");
	$("goodsearch_submit_1").observe("click", GoGoodSearch_1);
	
	// the field needs to observe focus/blur events to hide/show the background image.  the, the keydown event
	// traps the enter key since the good search form information didn't want to include a submit button.  I think
	// it'd be okay if I added one, but I'll stick with what they provided.  - dave kees -
	
	field.observe("focus",   function() { field.setStyle({ "backgroundImage": "url(http://www.goodsearch.com/_gfx/spacer.gif)" }); });
	field.observe("blur",    function() { if($F(field).length == 0) field.setStyle({ "backgroundImage": "url(http://www.goodsearch.com/_gfx/title_yahoo_background.gif)" }); });
	field.observe("keydown", CatchEnter_1);
	
	// last thing to do is double-check that we aren't showing the image when there's a value in the field.
	
	if($F(field).length > 0) field.setStyle({ "backgroundImage": "url(http://www.goodsearch.com/_gfx/spacer.gif)" });
});

// the following two functions provided by GoodSearch

function GoGoodSearch_1()
{
	var charityid = 845424;
	var siteURL = "carecentercu.org";
	var openNewWindow = false;
	var baseurl = "http://www.goodsearch.com/search.aspx";
	var keywordsbox = document.getElementById("goodsearch_keywords_1");
	if (typeof keywordsbox != "undefined")
	{
		var keywords = escape(keywordsbox.value);
		var url = baseurl + "?Keywords=" + keywords;
		if (charityid > 0)
			url += "&CharityID=" + charityid;
		url += "&Partner=goodsearch_syn";
		url += "&typetag=" + escape(siteURL);
		if (openNewWindow)
			window.open(url,'SearchResults','height=700,width=900,location=1,status=1,toolbar=1,scrollbars=1,resizable=1');
		else
			window.location.href = url;
	}
}
function CatchEnter_1(e)
{
	var key1 = "13";
	var x = "";
	if (document.all)
	{
		var evnt = window.event;
		x = evnt.keyCode;
	}
	else
		x = e.keyCode;
	if (x == key1)
	{
		document.getElementById("goodsearch_submit_1").click();
		return false;
	}
	else
		return true;
}

