 var loading = "<img src=\"./images/loading.jpg\"><br /><br /><img src=\"./images/wait.gif\">";
	 $(document).ready(function(){
	$.ajax({
			method: "get",url: "image_collector.php",data: "request=load_categories",
			beforeSend: function(){
			$("#categories_display").hide();
			$("#categories_display").html(loading);
			$("#categories_display").fadeIn("slow");
			},
			success: function(html){
			$("#categories_display").hide();
			$("#categories_display").html(html);
			setTimeout("$(\"#categories_display\").fadeIn(\"slow\")", 500);

		 }
	});

    $("#will_name").mouseover(function () {
      $("#will_profile").fadeIn("slow");
    });
	 $("#joel_name").mouseover(function () {
	  $("#joel_profile").fadeIn("slow");
    });
    $("#will_name").mouseout(function () {
      $("#will_profile").fadeOut("fast");
    });
	 $("#joel_name").mouseout(function () {
	  $("#joel_profile").fadeOut("fast");
    });
    $("#lnl_click").mouseover(function () {
	  $("#lnl_profile").fadeIn("slow");
    });
    $("#lnl_click").mouseout(function () {
      $("#lnl_profile").fadeOut("fast");
    });
  });

function show_info(image_id){
		$(document).ready(function(){
			$(".image_info").hide();
		});
		$(document).ready(function(){
			$("#"+image_id.rel).fadeIn("slow");
		});
}

function hide_info(image_id){
		$(document).ready(function(){
			$("#"+image_id.rel).hide();
		});
}

function goto_image_viewer(image_id){
	$(document).ready(function(){
		$.ajax({
			method: "get",url: "image_collector.php",data: "request=load_image&image_cat="+image_id.rev+"&image_name="+image_id.id,
			beforeSend: function(){
			$("#categories_display").fadeOut("slow");
			$("#body_div").css("background-image", "url(./images/image_viewer.jpg)");
			$("#categories_display").html(loading);
			$("#categories_display").hide();
			$("#categories_display").fadeIn("slow");
			$(".thumbnails_a").attr("onclick", "return false;");
			},
			success: function(html){
			$(".bd").hide();
			$(".bd").fadeIn("slow");
			$("#image_viewer").hide();
			$("#image_viewer").html(html);
			setTimeout("$(\"#image_viewer\").fadeIn(\"slow\")", 500);
		 	}
		});
	});
}

function load_image(button_id){
	$(document).ready(function(){
		var button_cat = button_id.rev;
		var button_image = button_id.rel;
		$.ajax({
			method: "get",url: "image_collector.php",data: "request=load_image&image_cat="+button_cat+"&image_name="+button_image,
			beforeSend: function(){
			$(".bd").attr("onclick", "return false;");
			$(".bd").hide();
			$("#show_main").fadeOut("slow");
			$("#main").hide();
			$("#main").css("top", "170px");
			$("#main").css("left", "150px");
			$("#main").html(loading);
			$("#main").fadeIn("slow");
			},
			success: function(html){
			$("#main").css("top", "120px");
			$("#main").css("left", "150px");
			$("#image_viewer").html(html);
			$(".bd").hide();
			$(".bd").fadeIn("slow");
			$("#show_main").hide();
			$("#show_main").fadeIn("slow");
		 	}
		});

	});
}

function onload(tag_name){
	$(document).ready(function(){$("#"+tag_name).html("<center>Loading</center>");});
}
