function nodeletExpandCollapse () { var bodyId = arguments[0]; var showCustom = arguments[1]; var hideCustom = arguments[2]; var whichcustom = document.getElementById(bodyId); if (whichcustom.className==showCustom) { whichcustom.className=hideCustom; } else { whichcustom.className=showCustom; } } function nodeletObject ( text, headId, bodyId, defaultState ) { this.text = text; this.headId = headId; this.bodyId = bodyId; this.defaultState = defaultState; } function replaceNodeletHeadings () { var cpan = new nodeletObject( 'CPAN nodelet', 'nodelet_head_row_CPAN_nodelet', 'nodelet_body_row_CPAN_nodelet', 'hide' ); var chat = new nodeletObject( 'Chatterbox', 'nodelet_head_row_Chatterbox', 'nodelet_body_row_Chatterbox', 'hide' ); var vote = new nodeletObject( 'Voting Booth', 'nodelet_head_row_Voting_Booth', 'nodelet_body_row_Voting_Booth', 'hide' ); var info = new nodeletObject( 'Information', 'nodelet_head_row_Information', 'nodelet_body_row_Information', 'hide' ); var pers = new nodeletObject( 'Personal Nodelet', 'nodelet_head_row_Personal_Nodelet', 'nodelet_body_row_Personal_Nodelet', 'hide' ); var free = new nodeletObject( 'Free Nodelet', 'nodelet_head_row_Free_Nodelet', 'nodelet_body_row_Free_Nodelet', 'show' ); var myxp = new nodeletObject( 'XP Nodelet', 'nodelet_head_row_XP_Nodelet', 'nodelet_body_row_XP_Nodelet', 'show' ); var time = new nodeletObject( 'Tick tock', 'nodelet_head_row_Tick_tock', 'nodelet_body_row_Tick_tock', 'show' ); var nodeList = new Array( cpan, chat, vote, info, pers, free, myxp, time ); for ( var index in nodeList ) { var nodeletObj = document.getElementById( nodeList[index].headId ); //+ "\n" var newInnerHTML = "\n\n" + "\n" + nodeList[index].text + "\n" + "\n\n"; nodeletObj.innerHTML = newInnerHTML; if ( nodeList[index].defaultState == 'hide' ) { nodeletExpandCollapse(nodeList[index].bodyId, "nodelet_body_row", "hideblock"); } } } function init(){ replaceNodeletHeadings(); } window.onload=init;