// run after page loads
jQuery(document).ready(function () {
	// add class to regular footer menu and footer menu
	jQuery('ul#footer-menu li:last-child').addClass('last');
	jQuery('ul#menus > li:last-child').addClass('last');
	
	// search field erase inner text
	searchFieldAction(jQuery('#search input.text'));
});


//erasing top-right search field
function searchFieldAction(field) {
	jQuery(field).focus(function() {
		// set hint if not set already
		var hint = jQuery(this).attr('hint');
		if (hint == undefined || hint == '') {
			var hint = jQuery(this).val();
			jQuery(this).attr('hint', hint);				
		}
		// erase field if contains hint
		var val = jQuery(this).val();
		if (val == hint) {
			jQuery(this).val('');	
		}
	});
	
	jQuery(field).blur(function() {
		// replace hint if field empty and leaves focus
		var val = jQuery(this).val();
		if (val == '') {
			var hint = jQuery(this).attr('hint');
			jQuery(this).val(hint);			
		}
	});
}
