		/*
		$(document).ready(function(){
		
			$("#topArt a").hover(
				function () {
					var base_cat = $(this).attr('base_cat');
					$("#navBar2")
						.find("ul").hide().removeAttr('hover')
						.end()
						.find("ul[base_cat='"+base_cat+"']").show().attr('hover', 'true');
				}, 
				function () {
					$("#navBar2 ul").hide();
					$("#navBar2 ul").not("ul[base_cat]").show();
				}
			);

			$("#navBar1 a").hover(
				function() {
					var url = $(this).attr('href');
					$("#topArt a[href='"+url+"']").mouseover();
				},
				function() {
					$("#topArt a").mouseleave();
				}
			);


			$("#navBar2").hover(
				function() {
					if($(this).find("ul[hover='true']").get(0) != null) {
						$(this).find("ul").hide();
						$(this).find("ul[hover='true']").show();
					}
				},
				function() {
					$(this).find("ul").hide().removeAttr('hover');
					$(this).find("ul").not("ul[base_cat]").show();
				}
			);

			$("div#content").mouseenter(function() {
				$("#navBar2 ul").removeAttr('hover');
			});

		});
		*/
		
		function setToDo(todoItem, actId, uId) {
			var todoValue = 0;
			if ($('#todo'+todoItem).attr('checked')) todoValue = 1;
			$.ajax({
				url: "/includes/setToDo.php",
				type: "GET",
				cache: false,
				data: ({ activityId:actId, userId:uId, todo:todoItem, todoVal:todoValue })
			});
		}
		
		function likeActivity(actId, uId) {
			$.ajax({
				url: "/includes/likeActivity.php",
				type: "GET",
				cache: false,
				data: ({ activityId:actId, userId:uId }),
				success: function( data ) {
					$('#likeActivityContent').html(data);
				}
			});
		}
		
		function disableHelpTip(uId) {
			if ($('#disableHelpTip').attr('checked')) {
				$.ajax({
					url: "/includes/disableHelptip.php",
					type: "GET",
					cache: false,
					data: ({ userId:uId })
				});
			}
			closeHelpTip();
		}
		
		function updateContent(elementId, contentUrl) {
			$.ajax({
				url: contentUrl,
				type: "GET",
				cache: false,
				success: function( data ) {
					$('#'+elementId).html(data);
				}
			});
		}
		
		function submitLogin(useRedirect) {
			var userId = 0;
			$.ajax({
				url: "/includes/modals/loginForm.php",
				type: "POST",
				cache: false,
				async: false,
				data: ({ handle:$('#login-username-modal').val(), mantra:$('#login-password-modal').val() }),
				success: function( data ) {
					var newContent = data.split("|");
					if (newContent[0] == 2) {
						$('#loginErrMsg').html(newContent[2]);
					} else {
						$.fancybox.close();
						if (useRedirect == '1') {
							window.location.replace(newContent[2]);
						} else {
							window.location.reload();
						}
						userId = newContent[1];
					}
				}
			});
			return userId;
		}
		
		function logPage(pagename) {
			$.ajax({
				   url: "/includes/logPage.php",
				   type: "GET",
				   cache: false,
				   data: ({ page:pagename })
			});
		}
		
		function closeHelpTip() {
			$('#helptipBox').hide();
		}
		
		function toggleSection(titleId,contentId) {
			if ($('#'+contentId).css('display') == 'block') {
				$('#'+titleId).removeClass('openSection');
				$('#'+titleId).addClass('closedSection');
				$('#'+contentId).slideUp();
			} else {
				$('#'+titleId).removeClass('closedSection');
				$('#'+titleId).addClass('openSection');
				$('#'+contentId).slideDown();
			}
		}
