
$(document).ready(function() {
	$('#tabs').tabs(1,{ fxSlide: true, fxFade: true, fxSpeed: 'fast' });

	//listener on the Test Email button
	$('#test_email').click(function() {
	
		var url = $(this).attr("href");
		
		//POST request to the admin page
		$.ajax({type:"post", url:url, datatype:"html", 
			success:function(transport) {
				var response = transport.split('|');
				
				if (response[0] == '1') {
					//sucess
					alert(response[1]);
				}
				else if (response[0] == '0') {
					//failure
					alert(response[1]);
				}
				else {
					alert("An unknown error occured");
				}
			}
		});
		
		return false;
	});
});