//	inline search results functions
	function activateSearch()
	{
		if ( $('searchform') )
		{
			$('s').value = 'Start your search...';	// Default text in the search box
			var oldResults	=	document.createElement('div');	// Old search results div
			var newResults	=	document.createElement('div');	// New search results div
			
			$('searchform').onsubmit	=	function() { doSearch(); return false; };
			$('s').onfocus	=	focusS;	// function to clear the default search box text on focus
			
			var searchResults	=	$('search-results');
			var searchForm		=	$('searchform');
			
			oldResults.id	=	'old-search-results';		// set the id of the old results div
			newResults.id	=	'current-search-results';	// set the id of the new results div
			
			searchResults.appendChild(newResults);	// put the search results into newResults div
			searchResults.appendChild(oldResults);	// put the search results into oldResults div
			
			oldResults.style.display	=	'none';	// hide the oldResults div
			newResults.style.display	=	'none';	// hide the newResults div for now
			
			is_searching	=	false;
		}
	}
	
	function doSearch()
	{
		//	Check to see if we're searching
		if ( is_searching ) return false;	// don't do anything because we are searching
		
		searchResults	=	$F('s');
		
		if ( searchResults == '' || searchResults == 'Start your search...' ) return false;
		
		//	We weren't searching before but now we are
		is_searching	=	true;
		currentResults	=	$('current-search-results');
		oldResults		=	$('old-search-results');
		
		searchButton	=	$('searchbutton');
		searchButton.value		=	'Looking...';	// change the value of the search button
		searchButton.disabled	=	true;	// disable the search button
		
		oldResults.innerHTML	=	currentResults.innerHTML;	// move the current results to the old results div
		
		currentResults.style.display	=	'none'	// hide the current results dive
		oldResults.style.display		=	'block';	// show the oldResults div
		
		//	Make the ajax call
		url		=	'http://gonecksgo.com/'
		pars	=	's=' + escape(searchResults) + '&ajax';
		var myAjax	=	new Ajax.Request
								(
									url,
									{
										method:		'get',
										parameters:	pars,
										onComplete:	doSearchResponse
									}
								);
	}
	
	function doSearchResponse(response)
	{
		$('current-search-results').innerHTML	=	response.responseText;
		
		//	Now for the effects part
		new Effect.BlindUp('old-search-results', { duration: .8 });
		new Effect.BlindDown('current-search-results', { duration: .8, afterFinish:resetForm });
	}
	
	function resetForm()
	{
		//	Reset the form to it's pristine pre-search goodness
		searchButton			=	$('searchbutton');
		searchButton.value		=	'Search';
		searchButton.disabled	=	false;
		is_searching			=	false;
	}
	
	function focusS()
	{
		if ( $F('s') == 'Start your search...' ) $('s').value = '';
	}
	
	//	Hijack the form
	Event.observe(window, 'load', activateSearch, false);