<?php
/*
Plugin Name: listCollapse
Plugin URI: http://www.soderlind.no/
Description: Adds a collapsible category menu to your blog<br/>You'll find the listCollapse.js at <a href="http://www.howtocreate.co.uk/jslibs/htmlhigh/listCollapse.html">http://www.howtocreate.co.uk/jslibs/htmlhigh/listCollapse.html</a><br/>The plugin is licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>, Copyright 2004 Per Soderlind
Version: 1.0
Author: Per Soderlind
Author URI: http://www.soderlind.no
*/

/*
INSTRUCTIONS:

No edits to the WordPress source are required.

Just save the plugin into your WordPress plugins directory, and then
Activate it on the Plugins tab of the WordPress admin console.
Read the comments below
*/


add_filter('wp_head', 'listCollapse');

function
listCollapse()
{
?>
<!-- change the path below to point to where you have installed listCollapse.js-->
<script type="text/javascript" src="/weblogg/wp-content/plugins/listCollapse/listCollapse.js"></script>
<script type="text/javascript">
//<![CDATA[
// You should add a better onload function here incase there are other onload's
window.onload = function () {
    if (document.getElementById) {
        document.getElementById('categories').getElementsByTagName('UL')[0].setAttribute("ID","collapseMe");
        compactMenu('collapseMe',true,'&plusmn; ');
    }
}
//]]>
</script>
<?php
}
?>