// JavaScript Document

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

$(function() {

    $("#nav li a").click(function() {

        // Figure out current list via CSS class
        var curList = $("#nav li a.current").attr("rel");

        // List moving to
        var $newList = $(this);

        // Set outer wrapper height to height of current inner list
        var curListHeight = $("#list-wrap").height();
        $("#list-wrap").height(curListHeight);

        // Remove highlighting - Add to just-clicked tab
        $("#nav li a").removeClass("current");
        $newList.addClass("current");

        // Figure out ID of new list
        var listID = $newList.attr("rel");

        if (listID != curList) {

            // Fade out current list
            $("#"+curList).fadeOut(300, function() {

                // Fade in new list on callback
                $("#"+listID).fadeIn();

                // Adjust outer wrapper to fit new list snuggly
                var newHeight = $("#"+listID).height();
                $("#list-wrap").animate({
                    height: newHeight
                });

            });

        }        

        // Don't behave like a regular link
        return false;
    });

});

$(function() {

    $("#nav2 li a").click(function() {

        // Figure out current list via CSS class
        var curList = $("#nav2 li a.current").attr("rel");

        // List moving to
        var $newList = $(this);

        // Set outer wrapper height to height of current inner list
        var curListHeight = $("#list-wrap2").height();
        $("#list-wrap2").height(curListHeight);

        // Remove highlighting - Add to just-clicked tab
        $("#nav2 li a").removeClass("current");
        $newList.addClass("current");

        // Figure out ID of new list
        var listID = $newList.attr("rel");

        if (listID != curList) {

            // Fade out current list
            $("#"+curList).fadeOut(300, function() {

                // Fade in new list on callback
                $("#"+listID).fadeIn();

                // Adjust outer wrapper to fit new list snuggly
                var newHeight = $("#"+listID).height();
                $("#list-wrap2").animate({
                    height: newHeight
                });

            });

        }        

        // Don't behave like a regular link
        return false;
    });

});
$(function() {

    $("#nav3 li a").click(function() {

        // Figure out current list via CSS class
        var curList = $("#nav3 li a.current").attr("rel");

        // List moving to
        var $newList = $(this);

        // Set outer wrapper height to height of current inner list
        var curListHeight = $("#list-wrap3").height();
        $("#list-wrap3").height(curListHeight);

        // Remove highlighting - Add to just-clicked tab
        $("#nav3 li a").removeClass("current");
        $newList.addClass("current");

        // Figure out ID of new list
        var listID = $newList.attr("rel");

        if (listID != curList) {

            // Fade out current list
            $("#"+curList).fadeOut(300, function() {

                // Fade in new list on callback
                $("#"+listID).fadeIn();

                // Adjust outer wrapper to fit new list snuggly
                var newHeight = $("#"+listID).height();
                $("#list-wrap3").animate({
                    height: newHeight
                });

            });

        }        

        // Don't behave like a regular link
        return false;
    });

});

function addBookmark(title,url){if(window.sidebar){window.sidebar.addPanel(title,url,"")}else if(document.all){window.external.AddFavorite(url,title)}else if(window.opera&&window.print){return true}}