
$('a[title="View all posts in Learn"]').addClass('cat_learn');
$('a[title="View all posts in Live"]').addClass('cat_live');
$('a[title="View all posts in Play"]').addClass('cat_play');
$('a[title="View all posts in Resources"]').addClass('cat_resources');
$('a[title="View all posts in Work"]').addClass('cat_work');
$('a[title="View all posts in Events"]').addClass('cat_events');
$('.sidebar h2').wrapInner("<span></span>");

// =====================================
// = SWITCH OUT SPLASH HEADER RANDOMLY =
// =====================================
splash_count = parseInt($('#splash').attr('rel'));
rand_image = Math.floor(Math.random()*splash_count)+1;
$('#header #splash').css('background-image','url(/wp-content/themes/MHM/images/headers/'+rand_image+'.jpg)');

// ======================================
// = AJAX PROCESSING OF NEWSLETTER FORM =
// ======================================

var newsletter_options = { 
    target:        'li.newsletter',   // target element(s) to be updated with server response 
    beforeSubmit:  showRequest,  			// pre-submit callback 
    success:       showResponse  			// post-submit callback 
}; 
 
// bind form using 'ajaxForm' 
$('#signup_for_newsletter').ajaxForm(newsletter_options);

// pre-submit callback 
function showRequest(formData, jqForm, options) { 
    var queryString = $.param(formData); 
//  alert('About to submit: \n\n' + queryString); 
    return true; 
} 
 
// post-submit callback 
function showResponse(responseText, statusText)  { 
    // alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + '\n\nThe output div should have already been updated with the responseText.'); 
		$('.newsletter div').hide();
		$('.newsletter div').fadeIn('slow');
}