  $(document).ready(function(){
 	var page = 1;
	$('li').remove()
 	$("#hotd").load("/functions/functions.hotd.ajax.php?page="+ page +"&js=1");
$("a").live("mouseover", function(){

	 $('a#next').click(function() {
	 	$('li').fadeOut('fast');
	 	page++;
		$("#hotd").load("/functions/functions.hotd.ajax.php?page="+ page +"&js=1", function(){
			$(this).hide()
			.fadeIn('fast');});
		if ($('li').size() == 12) {
			if  (page != 1) {
				$("a#back").remove()
				$("span#hotd-nav").prepend("<a href='hooker-of-the-day.php?page="+ (page - 1) +"' id='back'>Previous</a> ")
				$("a#next").remove()
				$("span#hotd-nav").append("<a href='hooker-of-the-day.php?page="+ (page + 1) +"' id='next'>Next</a> ");
			}  
			
		} else {
			$("a#back").remove()
			$("a#next").remove()
			$("span#hotd-nav").prepend("<a href='hooker-of-the-day.php?page="+ (page - 1) +"' id='back'>Previous</a> ");
		}
		return false;
	 })

	 $('a#back').click(function() {
	 	$('li').fadeOut('fast');
	 	page--;
		$("#hotd").load("/functions/functions.hotd.ajax.php?page="+ page+"&js=1", function(){
			$(this).hide()
			.fadeIn('fast');});
		if  (page != 1) {
			$("a#back").remove()
			$("span#hotd-nav").prepend("<a href='hooker-of-the-day.php?page="+ (page - 1) +"' id='back'>Previous</a> ")
			$("a#next").remove()
			$("span#hotd-nav").append("<a href='hooker-of-the-day.php?page="+ (page + 1) +"' id='next'>Next</a> ");
		} else {
			$("a#back").remove()
			$("a#next").remove()
			$("span#hotd-nav").append("<a href='hooker-of-the-day.php?page="+ (page + 1) +"' id='next'>Next</a> ");
		}
	 	return false;
	 })
   });
});