// JavaScript Document

 $(document).ready(function() {
$("span").css("display", "none");

var curtab = window.location.href;
curtab = curtab.split("#");
curtab = "#" + curtab[1];

$("a").each(function(i) {
if(curtab == $(this).attr("href")) {
$(this).attr("id", "active");
} else {
$(this).attr("id", "");

}
});

if (curtab !== '#undefined') {
$(curtab).css("display", "block");
} else {
$(".default").css("display", "block");
var defid = "#" + $(".default").attr("id");

$("a").each(function(i) {
if(defid == $(this).attr("href")) {
$(this).attr("id", "active");
}
})

}

$("ul li").click(function() {
	$("ul li").children().attr("id", "");
	$(this).children().attr("id", "active");
	var tabtocall = $(this).children().attr("href");
	$("span").fadeOut ("slow");
	$(tabtocall).fadeIn ("slow");

});
});
