// $Id: menu.tpl,v 1.1 2003/01/05 // // osCommerce, Open Source E-Commerce Solutions // http://www.oscommerce.com // // Copyright (c) 2003 osCommerce // // Released under the GNU General Public License /* --- geometry and timing of the menu --- */ // +-- Get Target Position ---------------------------------------------------- var t = 0; var l = 0; var cNode = document.images["ddmenu"]; while(cNode.tagName!='BODY'){ l+=cNode.offsetLeft; t+=cNode.offsetTop; cNode=cNode.offsetParent; } // --- Get Target Position ---------------------------------------------------- // +-- Menu Configuration ----------------------------------------------------- //var menuOriginY = 98; // Number of pixels from top of screen //var menuOriginX = 8; // Number of pixels from left of screen var menuOriginY = t; // Y coordinate of anchor var menuOriginX = l; // X coordinate of anchor var menuTextHeight = 16; // Height of text panel for each top level menu var menuTextWidth = 78; // Width of text panel for each top level menu (Was 100) var menuBackground = '#FFFFFF'; // '#da251d'; #bbc3d3; var menuTextColour = '#996666'; var menuHoverBckGrd = '#666666'; // '#d9d9d9'; var menuHoverText = '#FFFFFF'; // '#da251d'; var subMenuBackground = '#666666'; var subMenuTextColour = '#FFFFFF'; var subMenuHoverBckGrd = '#666666'; var subMenuHoverText = '#FFFFFF'; var subMenuTextWidth = 100; var subMenuTextHeight = 16; // --- Menu Configuration ----------------------------------------------------- var MENU_STYLES = new Array(); var MENU_POS = new Array(); // item sizes for different levels of menu MENU_POS['height'] = [menuTextHeight, subMenuTextHeight, subMenuTextHeight, subMenuTextHeight]; MENU_POS['width'] = [menuTextWidth, subMenuTextWidth, subMenuTextWidth, subMenuTextWidth]; // menu block offset from the origin: // for root level origin is upper left corner of the page // for other levels origin is upper left corner of parent item MENU_POS['block_top'] = [menuOriginY, menuTextHeight+1, menuTextHeight/2, menuTextHeight/2]; MENU_POS['block_left'] = [menuOriginX, 0, menuTextWidth+1, 126]; // offsets between items of the same level MENU_POS['top'] = [0, subMenuTextHeight+1, subMenuTextHeight+1, subMenuTextHeight+1]; MENU_POS['left'] = [menuTextWidth+1, 0, 0, 0]; // time in milliseconds before menu is hidden after cursor has gone out // of any items MENU_POS['hide_delay'] = [200, 200, 200, 200]; /* --- dynamic menu styles --- note: you can add as many style properties as you wish but not all browsers are able to render them correctly. The only relatively safe properties are 'color' and 'background'. */ // default item state when it is visible but doesn't have mouse over MENU_STYLES['onmouseout'] = [ 'background', [menuBackground, subMenuBackground, subMenuBackground, subMenuBackground], 'color', [menuTextColour, subMenuTextColour, subMenuTextColour, subMenuTextColour], ]; // state when item has mouse over it MENU_STYLES['onmouseover'] = [ 'background', [menuHoverBckGrd, subMenuHoverBckGrd, subMenuHoverBckGrd, subMenuHoverBckGrd], 'color', [menuHoverText, subMenuHoverText, subMenuHoverText, subMenuHoverText], ]; // state when mouse button has been pressed on the item MENU_STYLES['onmousedown'] = [ 'background', [menuBackground, subMenuBackground, subMenuBackground, subMenuBackground], 'color', [menuTextColour, subMenuTextColour, subMenuTextColour, subMenuTextColour], ];