$(document).ready(function(){

(function($) {
	$.fn.customFadeIn = function(speed, callback) {
		$(this).fadeIn(speed, function() {
			if(jQuery.browser.msie)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	$.fn.customFadeOut = function(speed, callback) {
		$(this).fadeOut(speed, function() {
			if(jQuery.browser.msie)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
})(jQuery);

//click event-handler for splash elements
	$("#accordion_2 .post").click(function () { 
		var rel = $(this).find("a").attr("rel");
			
			//AJAX CHANGE PAGE
			if(rel){
			$("#main").css("display", "none");
			//$("#main").html('<div align="center"><img src="/images/misc/loading.gif" alt="loading" /> Loading</div>');
			$("#main").html('');
			$("#main").customFadeIn(1000);
			$.get("/ajax_newsletter.php",{story: rel}, function(data){
			$("#main").html(data);
			},"text");
			}
			
			$('html, body').scrollTop(0); 
			
			
	return false;
	}); 
}); 
