Yes that's what I am tryingto do but it must be done on a client side, and 
i want to avoid cookies, 

I have written some functions for the handling of innerHTML of a hidden div 
that would hold this index, 
and will be parsed using string.split method. It should work in theory, I 
have no desire for the server to 
handle anything related to helping a client navigate through the system 
panels. here's the HTML on the page (with linebreaks added for legibility)(:

<div id="mb_system_state_references" style="display:none;">

and here are the functions relevant to how I am handling the current states 
of the indexes: (sorry if too much code to read):

 function get_system_states() {
    var ref = 
    var systemz = split.ref(":"); var mb_statez = new Array();  
    for(k=100;k<133;k++) {
        var n = k-100;
        var system_statez = systemz[n].split("=");
        var state = system_statez[1];
        mb_statez[n] = state;
    } // end loop
    return mb_statez;
 } // end function
 function get_system_state(system_index) {
     var sys_states = get_system_states();
     var n = (parseInt(system_index)-100);
     return sys_states[n];
 function set_system_state(system_index,state){
     var sys_states = get_system_states();
     var new_ref_string="";
     for(k=100;k<133;k++) {
     //if not the setting we are setting, write its current state and skip 
to the next iteration
     if (parseInt(system_index)!=parseInt(k)){
     new_ref_string+=''+k+'='+get_system_state(k)+':'; continue;
     } else {  // else, write the new one
     } // end else
    } // end loop
  return false;
 } // function

function minimize_mb_system(system_index) {
    if (get_system_state(system_index)=!"M")
                var sp_div_id = 'system'+system_index+'';
                var min_div_id = 'system'+system_index+'_minimized';
                return false;
        else { var warning = "system display state is already minimized. 
did not collapse."; return warning; }
function restore_mb_system(system_index) {
    if (get_system_state(system_index)=!"O")
                var sp_div_id = 'system'+system_index;
                var min_div_id =  'system'+system_index+'_minimized';
                return false;
        else { var warning = "system display state is already open. did not 
restore."; return warning; }

function open_mb_system(system_index) {
    system_index+='';var k=0; var state = get_system_states();
    // if system we are opening is minimized, restore it
    if (state[parseInt(system_index)]=="M") { 
    var restore = restore_mb_system(system_index); 
    if (restore!=false) { alert(restore); }
    // for every other system that might be open, minimize it
                if (k+''==system_index) { continue; }
                         if (state[k] == "O") { 
                              var minimize = minimize_mb_system(k); 
                             if (minimize!=false) { alert(minimize); }    
        } // end for loop
        //preload module image rollovers for the system we are opening
        // get the system HTML from the monkeypanel server
        new Ajax.Updater({ success: 'system'+system_index+'_container', 
failure: 'system'+system_index+'_messages' }, 
        { method: 'get' , onComplete: function(){ 
                var monkeysays_sys_div = 
                new Effect.Appear(monkeysays_sys_div, { duration: 3.0 });
                       Effect.Fade(monkeysays_sys_div, { duration: 15.0 });
                                         } }); 

return false;

Using the getElementsbyClassName could work, thanks for the suggestion. I 
might attempt to simplify and try to do that. 
I will be replying with my finished code once it works, and i hope it does. 
I'm having errors with handling the convention text that I specified as 
some sort of error with "split" not defined.? hrmph..

On Monday, October 15, 2012 3:38:56 PM UTC-4, Jason wrote:
> If $("id") returns null (like in this instance) then the id does not exist 
> on the page
> This might be handled better using a class on each of the panels and 
> simply holding which is the open/minimized index that way you don't have to 
> worry about what ids exist


You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to