/************************************************************
 ** Clears a field
 ** By: 	Joshua Sowin (fireandknowledge.org)
 ** HTML: <input type="text" value="Search" name="search"
 **			id="search" size="25" 
 ** 		onFocus="clearInput('search', 'Search')" 
 ** 		onBlur="clearInput('search', 'Search')" />
 ***********************************************************/
function clearInput(field_id, term_to_clear) {
	
	// Clear input if it matches default value
	if (document.getElementById(field_id).value == term_to_clear ) {
		document.getElementById(field_id).value = '';
	}
	
	// If the value is blank, then put back term
	else if (document.getElementById(field_id).value == '' ) {
		document.getElementById(field_id).value = term_to_clear;
	}
} // end clearSearch()

$(document).ready(function(){
  // Add arrow to the top of the main content section
  $('#page').prepend("<div class='arrow-top'></div>");
  
  // Add button to the header of the flickr pics
  $('#flickr-sidebar').find('h2').append("<a href='http://flickr.com/photos/olanky1' target='_blank' class='button small alignright'>View All &raquo;</a>")
  
  // Split the categories list into 2 columns
  $('#sidebar .widget_categories ul').easyListSplitter({colNumber: 2});
  
  // Add special class to affiliate links
  $('a[href^="http://www.amazon.com/gp/"]').addClass("aff");
});
