// JavaScript Document
$(function(){
	var LoadMsg = 'Please Wait ...';
	var AjaxPath = '';
	$('#nav-top a,#nav-bottom a,.eventListTitle a, .eventListDescrip a').click(function(){
		if(!$(this).hasClass("current")) {
			var _Href = $(this).attr('href');
			$('<div id="loading">'+LoadMsg+'</div>').appendTo('#tabs').fadeIn('slow',function(){
				$.ajax({
					type:	'GET',
					url:	AjaxPath+_Href,
					dataType:	'html',
					timeout:	5000,
					success: function(d,s){
							$('#loading').fadeOut('slow',function(){
								$(this).remove();
								$('#ui-tabs-1').html(d);
							});
						},
					error: function(o,s,e){
								$('#loading').html('Ajax Request Failed: '+s);
								eTimer(_Href);
							}
				});
			});
		}
		return false;
	});
	
	function eTimer(url) {
		var t=setTimeout("window.location='"+url+"'",1000);
		$('#loading').fadeOut('slow');
	}
});
