$(document).ready(function(){
//ID NOOB SCRIPTING XB

	// SMOOTHSCROLL TO #DIV
	$("a[href^=#][href!=#]").live('click',function(e){
		$('html,body').animate({'scrollTop': $($(this).attr('href')).offset().top+'px'}); 
		e.preventDefault();
	});
	
	
	 // Automatically open external links open in new window/tab
	$("a[rel='external']").attr('target','_blank');	
	
	
	// Expand Panel
	$("#open, .hihi").click(function(){
		$("div#panel").slideDown("slow");
	});	
	// Collapse Panel
	$("#close").click(function(){
		$("div#panel").slideUp("slow");	
	});		
	// Switch buttons from "Log In | Register" to "Close Panel" on click
	$("#toggle a, .hihi").click(function () {
		$("#toggle a").toggle();
	});		
		
		
	//When page loads...
	$(".editinfo").hide(); //Hide all content
	$("ul.profile-nav li:first").addClass("active").show(); //Activate first tab
	$(".editinfo:first").show(); //Show first tab content
	//On Click Event
	$("ul.profile-nav li").click(function() {

		$("ul.profile-nav li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".editinfo").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
		




});

