var _lastNav;
var _type = "";

/*
 * Initialize
 */
function sigilInit( type ) {
    _type = type;
    update_nav( type );

	// tacky jQuery bling
	// $( "#right" ).hide().fadeIn( 5000, undefined );
}

/**
 * Update the nav pane and title
 */
function update_nav( type ) {

	// set CSS for nav pane
    var current = "nav_" + type;
    var link = document.getElementById( current );
    if ( ! link ) {
        return;
    }
    if ( _lastNav != current ) {

        link.className = "cur_nav";
        if ( _lastNav ) {
            var last = document.getElementById( _lastNav );
            last.className="";
        }
        _lastNav = current;
    }
    link.blur();

	// set title
	set_page_title( type );

}

function set_page_title( title ) {
	document.title = "sigil.org | "+title;
}
