	$(document).ready(function() {

$("#explore-nav li a").click(function() {
    
        var curList = $("#explore-nav li.current a").attr("rel");
        var curListHeight = $("#all-list-wrap").height();
        
        $("#all-list-wrap").height(curListHeight);
    
        $("#explore-nav li").removeClass("current");
        $(this).parent().addClass("current");
        
        var listID = $(this).attr("rel");
        
        if (listID != curList) {
            $("#"+curList).fadeOut(300, function() {
    
                $("#"+listID).fadeIn();
                
                var newHeight = $("#"+listID).height();
                
                $("#all-list-wrap").animate({
                    height: newHeight
                });
            
            });
        }        
        
        return false;
    });

});

 
		//$(window).bind("load", function() {
			// $("#load-area").load("load-content.html");
		//});
		


/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 


this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 40;
		yOffset = -150;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("300");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};



// starting the script on page load
$(document).ready(function(){
	tooltip();
});


/* http://www.learningjquery.com/2007/09/animated-scrolling-with-jquery-12 */
$(document).ready(function(){
  $('a.back-top').click(function() {
	if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	&& location.hostname == this.hostname) {
	  var $target = $(this.hash);
	  $target = $target.length && $target
	  || $('[name=' + this.hash.slice(1) +']');
	  if ($target.length) {
		var targetOffset = $target.offset().top;
		$('html,body')
		.animate({scrollTop: targetOffset}, 800);
	   return false;
	  }
	}
  });
});

////* *////

$(document).ready(function() {
	$("#respond p.error").hide();
	$("#respond input.submit").click(function() {
		var Name = $("input#author").val();
			if (Name == "") {
				$("#respond p.author").slideDown("fast");
				return false;
			}
		var Email = $("input#email").val();
			if (Email == "") {
				$("#respond p.email").slideDown("fast");
				return false;
			}
	});
	
	$("#respond input").focus(function() {
		$("#respond p.error").slideUp("fast");
	});
	$("#respond textarea").focus(function() {
		$("#respond p.error").slideUp("fast");
	});
		
});

$(document).ready(function() {
	$('a[href$=.jpg]').lightBox(); 
	$('a[href$=.gif]').lightBox();
	$('a[href$=.png]').lightBox();
});



	