function searchClear(){	
	//remove text in the search field
	jQuery("#search_field").focus(function(){
		jQuery(this).val('');
	});
	
	//replace the search text only if there is no other text
	jQuery("#search_field").blur(function(){
		if (jQuery(this).val() == '' ){
			jQuery(this).val('Search');
		};
	});
};

function faqsShowHide(){		
	//create show/hide links and set dd to be hidden
	jQuery("dl#faqs dt").append('<small><a href="#">show</a></small>').next("dd").css("display","none");
		
	//change text value of link and show/hide dd content
	jQuery("dl#faqs dt a").toggle(
		function(){
			jQuery(this).text("hide").parents("dt").next("dd").show("fast");
		},
		
		function(){
			jQuery(this).text("show").parents("dt").next("dd").hide("normal");
			
		}
	);
	
	//make the question toggleable also
	jQuery("dl#faqs dt").toggle(
		function(){
			jQuery(this).children('small').children('a').text('hide');
			jQuery(this).next("dd").show("fast");
		},
		
		function(){
			jQuery(this).children('small').children('a').text('show');
			jQuery(this).next("dd").hide("normal");
			
		}
	);


};

jQuery(document).ready(function(){

	// add a class to the last featured item
	jQuery("#features .featured_items:last").addClass("last");
	
	searchClear();
	faqsShowHide();
	
}); // end jQuery