jQuery(function( $ ){    
    $('div#all-welcome h6').click(function() {
        if ($(this).hasClass('activeExp')) {
            $(this).next().hide('fast');
            $(this).removeClass('activeExp');
        } else{
            $(this).next().show('fast');
            $(this).addClass('activeExp');
        }
    });
    
    if ($("#news-home").length!=0) { //check if we're on the newsletter page    
		if (newsContent==""){
		newsContent = "The latest issue of <em>Contact</em> is available at <a href='" + latestLink + "'>this link</a>. Past issues of <em>Contact</em> are available on our <a href='/about-us/newsletter/contact-archive/'>Contact Archive</a> page.";
		}
    $("#news-home").html(newsContent); //that newsContent variable is generated on page.php in the theme
    }
    
    $("#menu-item-3599").html('<a title="Latest Newsletter" href="' + latestLink + '">Latest Newsletter (Contact)</a>');
    
   /*body.whympc #content h6*/
    //$(".whympc_quote").prepend('<img src="/images/quote_balloon_top.gif" border="0" />');   
        
    $('.menu-mainmenu-container').append('<form role="search" method="get" id="searchform" action="/" name="searchform"><input value="Search for..." name="s" id="s" type="text" onfocus="clearSearch()"><input type="image" src="/images/btn_go.gif" value="Search" id="searchsubmit" width="45" height="27"></form>');
    
	/* at least for now, deactivating this in favor of just linking to our public page
	if ($("#all-welcome").length!=0) { //check if we're on the home page
	    $.ajax({
		  url: '/wp-content/themes/mpc_home/facebook_code_backup.php',
		  success: function(data) {
		  	$('#facebook-status').html();
		    $('#facebook-status').html(data);
		    //alert('Load was performed.'+data);
		  }
		});
	}
	*/


});

function clearSearch() {
	document.searchform.s.value="";
	document.getElementById('s').style.color="#333";
}

