$(document).ready(function() {													 		 $('#nav li a, #about a').live('click', function() {    var toLoad = $(this).attr('href')+' #content';		$('#content').hide('fast',loadContent);    $('#load').remove();    $('#container').append('<span id="load">LOADING...</span>');    $('#load').fadeIn('normal');    function loadContent() {    	$('#content').load(toLoad,'',showNewContent())    }    function showNewContent() {    	$('#content').show('slow',hideLoader());			    }    function hideLoader() {    	$('#load').fadeOut('normal');    }    return false;    });	});$(document).ready(function() {$('.delete').hide();action_category();action_links();});function login(){	var User = document.login.username.value;	var Pass = document.login.password.value;			$('#load').fadeIn();		$.ajax({						type: "POST",		data: "username="+User+"&password="+Pass,		url: "php/login.php",		success: function(msg)		{			//remove the spinner			$('#load').fadeOut();						if((msg) == "1")			{				window.location="index.php"			}			else			{				alert('You fail at logging in.');			}		}	});};function add_cat(){	var Name = document.add_cat.new_category.value;	var T = "add_cat";		$('#load').remove();	$('#container').append('<span id="load">LOADING...</span>');	$('#load').fadeIn();		$.ajax({						type: "POST",		data: "category_name="+Name+"&T="+T,		url: "php/add_cat.php",		success: function(msg)		{			//remove the spinner			$('#load').fadeOut();			$("#nav ul").html(msg);		}	});};function delete_link(ID) {var answer = confirm("Delete photo?")	if (answer){	$('#load').remove();	$('#container').append('<span id="load">LOADING...</span>');	$('#load').fadeIn();	var commentContainer = $('#delete_'+ID);	var string = 'id='+ID ;	$.ajax({	   type: 'POST',	   url: 'php/delete.php',	   data: string,	   cache: false,	   success: function(){		commentContainer.slideUp('slow', function() {$('#delete_'+ID).remove();});		$('#load').fadeOut();	   }	});	}	else{		alert("No action taken.")	}};function delete_category(ID) {var answer = confirm("Delete category?")	if (answer){	$('#load').remove();	$('#container').append('<span id="load">LOADING...</span>');	$('#load').fadeIn();	var commentContainer = $('.'+ID).parent(this);	var string = 'id='+ID ;	$.ajax({	   type: 'POST',	   url: 'php/delete_category.php',	   data: string,	   cache: false,	   success: function(){		commentContainer.slideUp('slow', function() {$('.'+ID).remove();});		$('#load').fadeOut();	   }	});	}	else{		alert("No action taken.")	}};function action_links() { $(".link_action").hover(function(){	var ID = $(this).attr('alt');		$(".div_"+ID).fadeIn("fast"); },  function() {	var ID = $(this).attr('alt'); 	$(".div_"+ID).fadeOut("fast"); 	}); };function action_category() { $(".category_action").hover(function(){	var ID = $(this).attr('id');		$(".div_category_"+ID).fadeIn("fast"); },  function() {	var ID = $(this).attr('id'); 	$(".div_category_"+ID).fadeOut("fast"); 	}); };
