// JQUERY Accordion for events
$(document).ready(function() {
	$('.eventcontent').hide();
	$('.active').next('.eventcontent').show();
	$('.accordiontitle').click( function() {
		
		if ($(this).hasClass('active') ) {
			$(this).next('.eventcontent').slideToggle('slow');
			$(this).removeClass('active');
		} else {
			$('.active').next('.eventcontent').slideToggle('slow');
			$('.active').removeClass('active');
			$(this).next('.eventcontent').slideToggle('slow');
			$(this).addClass('active');
		};
	
	return false;
	});
});


// JQUERY Newsletter submit
// prepare the form when the DOM is ready 
$(document).ready(function() { 
    var options = { 
        target:        '#log_res',   // target element(s) to be updated with server response 
        success:       showResponse  // post-submit callback 
    }; 
 
    // bind form using 'ajaxForm' 
    $('#getnewsletter').ajaxForm(options); 
}); 

// post-submit callback 
function showResponse(responseText, statusText, xhr, $form)  { 
    // for normal html responses, the first argument to the success callback 
    // is the XMLHttpRequest object's responseText property 
 
    // if the ajaxForm method was passed an Options Object with the dataType 
    // property set to 'xml' then the first argument to the success callback 
    // is the XMLHttpRequest object's responseXML property 
 
    // if the ajaxForm method was passed an Options Object with the dataType 
    // property set to 'json' then the first argument to the success callback 
    // is the json data object returned by the server 
	$('#log_res').fadeOut('slow');
	$('#log_res').removeClass('bg');
	$('#log_res').fadeIn('slow');
	$('#log_res').addClass('bg');
} 