//RFLAN Javascript/JQuery Functionality Script
//Any misc JS code needed by multiple pages should go here

var searchFirstTime = true;

//called when the page finishes loading
$(document).ready( function() {

	//Set the search bar to remove 'search' first time round	
	var searchBar = $('#ajaxSearch_input');
	searchBar.val("Search");
	searchBar.focus(function() { 
		if( !searchFirstTime )
			return;

		$(this).val("");
		$(this).removeClass("unselected");
		searchFirstTime = false;
	} );
	searchBar.blur(function() {
		if( $(this).val() == "" )
		{
			$(this).val("Search");
			$(this).addClass("unselected");
			searchFirstTime=true;
		}
	} );
	
	//Set up Twitter if needed
	$(".tweets").tweet({
            username: "rflan",
            join_text: "auto",
            count: 5,
            auto_join_text_default: "",
            auto_join_text_ed: "",
            auto_join_text_ing: "",
            auto_join_text_reply: "",
            auto_join_text_url: "",
            loading_text: "Loading Tweets..."
     });

});
