// %%%%% // %%%%% // %%%%% // %%%%% // %%%%% // // %%%%% // %%%%% // %%%%% // %%%%% // %%%%% // // // // created by: c. kempen // // date: november 2006 // // [c] I.T. Squared CC 2006 // // www.it2.co.za // // // // last updated: 1 march 2009 // // // // this is the script file for the // // menu manager in the frontend // // // // %%%%% // %%%%% // %%%%% // %%%%% // %%%%% // // %%%%% // %%%%% // %%%%% // %%%%% // %%%%% // // // // DO NOT EDIT THIS FILE IN ANY WAY // // ...unless you have permission... // // // // %%%%% // %%%%% // %%%%% // %%%%% // %%%%% // // %%%%% // %%%%% // %%%%% // %%%%% // %%%%% // // ----- // // global variables... var main_menu_minimise_timer = 0; // end: global variables... // ----- // // ----- // // function which displays child menu tables... // also runs backwards and displays the parents... // also hides all other menu tables... function show_child_menu(id, orientation, direction, spacing) { // build an array of id's in the current chain... // goes from the root parent down to the current child... var temp_array = id.split('_'); var current_chain = new Array(); for (var i=3; i 0) { var table = document.getElementById('main_menu_table_' + current_chain[i-1]); var child = document.getElementById('main_menu_item_' + current_chain[i]); var y = parseInt(table.style.top) + parseInt(child.offsetTop); var x = table.style.left; } else { var x = get_xpos('main_menu_item_' + current_chain[i]); var y = get_ypos('main_menu_item_' + current_chain[i]); } var h = get_height('main_menu_item_' + current_chain[i]); var w = get_width('main_menu_item_' + current_chain[i]); // get the child's particulars... // set the child's location and display... // depending on the orientation and direction... if (document.getElementById('main_menu_table_' + current_chain[i])) { var child = document.getElementById('main_menu_table_' + current_chain[i]); switch(orientation) { case 'horizontal': switch(direction) { case 'up': var left = parseInt(x) - (2 * parseInt(spacing)) + parseInt(spacing); if (i > 0) left += parseInt(w) + (2 * parseInt(spacing)); var top = parseInt(y); if (i > 0) top += parseInt(h) + parseInt(spacing); child.style.left = left + 'px'; child.style.top = top + 'px'; child.style.zIndex = '10'; child.style.display = 'block'; child.style.top = (parseInt(child.style.top) - parseInt(get_height(child.id))) + 'px'; break; case 'down': var left = parseInt(x) - (2 * parseInt(spacing)) + parseInt(spacing); if (i > 0) left += parseInt(w) + (2 * parseInt(spacing)); var top = parseInt(y) + parseInt(h);// + parseInt(spacing); if (i > 0) top -= parseInt(h) + parseInt(spacing); child.style.left = left + 'px'; child.style.top = top + 'px'; child.style.zIndex = '10'; child.style.display = 'block'; break; } break; case 'vertical': switch(direction) { case 'left': var left = parseInt(x); if (i > 0) left += parseInt(spacing); top = parseInt(y) - parseInt(spacing); child.style.left = left + 'px'; child.style.top = top + 'px'; child.style.zIndex = '10000'; child.style.display = 'block'; child.style.left = (parseInt(child.style.left) - parseInt(get_width(child.id))) + 'px'; break; case 'right': var left = parseInt(x) + parseInt(w); if (i > 0) left += parseInt(spacing); var top = parseInt(y) - parseInt(spacing); child.style.left = left + 'px'; child.style.top = top + 'px'; child.style.zIndex = '10000'; child.style.display = 'block'; break; } break; } } } } // end function: show_child_menu(id, orientation, direction)... // ----- // // ----- // // funtion to hide all menu tables // parameter: exclusion array, containing id's of items to exclude from the hiding process... function hide_all_menu_children(exclusion_array) { // grab the children tables from the document, and hide the necessary ones... var children_tables = document.getElementsByTagName('table'); for (var i=0; i 0) { for (var j=0; j