$(document).ready(function() {
	
	var newsOpts = {fx:'scrollHorz', next: '#blue-right', prev: '#blue-left', speed:400, timeout:0}
	$('.news_wrapper').cycle(newsOpts);

	var eventsOpts = {fx:'scrollHorz', next: '#orange-right', prev: '#orange-left', speed:400, timeout:0}
	$('.events_wrapper').cycle(eventsOpts);

	$('#search').focus(function() { $(this).val(''); });
	$('#search').blur(function() { if($(this).val()=='') { $(this).val('Search MSWA'); } });

	if($('#donate-btn')) {
		$('#donate-btn').click(function(e) {
			e.preventDefault();
			var a = $('input[name=donate_amount]:checked').val(); 
			if(a=="other") {
				a = $('input[name=amount]').val();
			}
			location.href="donate.html?a="+a;
		});
	}
	
	if($('div.event')) {
		$('div.event').click(function() {
			location.href=$(this).find('a:first').attr('href');
		});
	}

	if($('div.centres')) {
		$('div.centres').click(function() {
			location.href=$(this).find('a:first').attr('href');
		});
	}

	if($('div.news_article')) {
		$('div.news_article').click(function() {
			location.href=$(this).find('a:first').attr('href');
		});
	}

});
