// ***************************************** // menu.js : dynamic hierarchical menu system // // (c) by E.F. de Moor (Creagraphy) ernst@creagraphy.nl // // date: april 8th 2002 // // // Following function are used for interfacing // // do_menu_sel : distribution function for menu selection // do_menu_over : distribution function for menu over // do_menu_out : distribution function for menu out // // my_menu_sel(id) : called when the user clicks a menu item in our own frame. // my_menu_over(id) : called when the mouse moves over a menu item of our own frame. // my_menu_out(id) : called when the mouse moves out a menu item of our own frame. // // menu_sel(id) : called when the user clicks a menu item in any frame. // menu_over(id) : called when the mouse moves over a menu item in any frame. // menu_out(id) : called when the mouse moves out a menu item in any frame. // set_page_info(sel, info) : called by the content frame, if the content changes. // // cms_onload(sel) : called once when this frame is loaded // // // Note about the my_menu... functions: // These functions are implemented in ../menu.inc. // // Note about the menu_sel, menu_over and menu_out functions: // Any frame is allowed to implement these (not just menu frames). This can be used // To give helpinformation (e.g. popup notes, textual explanations) in other frames // Whenever something happens with a menu button or whenever a new page is loaded // in the content frame. // // Note: Also new is that the content frame is now allowed to have a menu itself. This is // Handy to have a popup menu to appear over the content itself. // Remember the last selection // ------ Interface Functions ------- add_onload(onload_menu_strip); add_page_info(page_info_strip); add_menu_sel(menu_sel_strip); add_menu_over(menu_over_strip); add_menu_out(menu_out_strip); function onload_menu_strip(sel) { set_states_from_sel(sel); check_pos(0,0); //Solve the IE6 bug: Force a refresh setTimeout('refresh_menu()', 15); } function page_info_strip(sel, info) { set_states_from_sel(sel); check_pos(0,0); //Solve the IE6 bug: Force a refresh setTimeout('refresh_menu()', 15); } function menu_sel_strip(id, item_x, item_y) { set_states(id); check_pos(item_x, item_y); } function menu_over_strip(id, item_x, item_y) { window.status = menu_tree[id].explanation; show_menu_item(id,1,menu_tree[id].visible,100); } function menu_out_strip(id, item_x, item_y) { window.status = ''; show_menu_item(id,0,menu_tree[id].visible,100); } // ------ Menu functions ------- function check_pos(item_x, item_y) { var i; var cur_x; var cur_y; var total_width=0; var total_height=0; for(i=0; i total_height) total_height = menu_tree_parms[i].height; } else { total_height += menu_tree_parms[i].height; if(menu_tree_parms[i].width > total_width) total_width= menu_tree_parms[i].width; } } } cur_x = calc_x(menu_settings_strip.x_pos[menu_settings_strip.min_menu_level], menu_settings_strip.x_align[menu_settings_strip.min_menu_level], item_x, total_width); cur_y = calc_y(menu_settings_strip.y_pos[menu_settings_strip.min_menu_level], menu_settings_strip.y_align[menu_settings_strip.min_menu_level], item_y, total_height); for(i=0; i