$(document).ready(function()
{

	// older internet explorer message
	if (document.all && !window.opera && !window.XMLHttpRequest && $.browser.msie)
	{
		$('div#nmHeader').after('<div id="nmMessage"><p>Note: this website has been created to support the following browsers: <a href="http://www.google.com/chrome" title="Download Google Chrome" rel="external">Chrome 1.*</a>, <a href="http://www.mozilla.com/firefox/" title="Download Mozilla Firefox" rel="external">Firefox 3.*</a>, <a href="http://www.microsoft.com/windows/Internet-explorer/download-ie.aspx" title="Download Microsoft Internet Explorer" rel="external">Internet Explorer 7.*</a> and <a href="http://www.apple.com/safari/download/" title="Download Apple Safari" rel="external">Safari 3.*</a>. It appears that you are using an older browser, it is suggested that you upgrade your browser at your earliest convenience, to do so simply click any of the above recommended browser links.</p></div>');
	}

	// external links
    $('a[rel="external"]').click( function()
	{
		window.open($(this).attr('href'));
		return false;
	});

	// show/hide top posts
	$('div#nmSBTopPosts a:first').addClass('selected');
	$('div#nmSBTopPosts ul').hide();
	$('div#nmSBTopPosts ul:first').show().addClass('selected');
	$('div#nmSBTopPosts div#nmSBTPSelector a').click(function()
	{
		var thisTarget = $(this).attr('href');
		$('div#nmSBTopPosts ul.selected').removeClass('selected').slideUp(100,function()
		{
			$(thisTarget).slideDown(250).addClass('selected');
		});
		$('div#nmSBTopPosts a.selected').removeClass('selected');
		$(this).addClass('selected');
		return false;
	});

	// remove/replace search input text for footer search bar
	$('input#nmFSFTerm').val('Search for keyword(s)');
    $('input#nmFSFTerm').attr({value:'Search for keyword(s)'}).focus(function()
	{
		if ($(this).val()=='Search for keyword(s)')
		{
			$(this).val('');
		}
	}).blur(function()
	{
		if ($(this).val()=='')
		{
			$(this).val('Search for keyword(s)');
		}
	});

    // remove/replace search input text for content search bar
	$('input#nmCSFTerm').val('Search for keyword(s)');
    $('input#nmCSFTerm').attr({value:'Search for keyword(s)'}).focus(function()
	{
		if ($(this).val()=='Search for keyword(s)')
		{
			$(this).val('');
		}
	}).blur(function()
	{
		if ($(this).val()=='')
		{
			$(this).val('Search for keyword(s)');
		}
	});
});