You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2009/12/04 17:04:44 UTC

svn commit: r887243 [2/2] - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/component/ core/src/main/java/org/apache/myfaces/tobago/renderkit/css/ core/src/main/java/org/apache/myfaces/tobago/taglib/component/ example/demo/src/ma...

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java Fri Dec  4 16:04:42 2009
@@ -17,7 +17,99 @@
  * limitations under the License.
  */
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.tobago.component.RendererTypes;
+import org.apache.myfaces.tobago.component.UIMenu;
+import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Style;
+import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
+import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
+import org.apache.myfaces.tobago.util.AccessKeyMap;
+import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import java.io.IOException;
+import java.util.List;
 
 public class MenuRenderer extends LayoutComponentRendererBase {
+
+  private static final Log LOG = LogFactory.getLog(MenuRenderer.class);
+
+  private static final String MENU_ACCELERATOR_KEYS = "menuAcceleratorKeys";
+
+  @Override
+  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+    
+    UIMenu menu = (UIMenu)component;
+    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+
+    boolean disabled = menu.isDisabled();
+    boolean firstLevel = RendererTypes.MENU_BAR.equals(menu.getParent().getRendererType());
+    boolean isParentMenu = menu.getChildCount() > 0; // todo: may be not correct
+
+    writer.startElement(HtmlConstants.LI, menu);
+    String clazz = firstLevel ? "tobago-menu-top" : "tobago-menu-parent"; 
+    writer.writeClassAttribute(clazz);
+    if (menu.getImage() != null) {
+      Style style = new Style();
+      style.setBackgroundImage("url(" + menu.getImage() + ")");
+      writer.writeStyleAttribute(style);
+    }
+    writer.startElement(HtmlConstants.A, menu);
+    writer.writeAttribute(HtmlAttributes.HREF, "#", false);
+    writer.writeIdAttribute(menu.getClientId(facesContext));
+
+    LabelWithAccessKey label = new LabelWithAccessKey(menu);
+    if (label.getText() != null) {
+      if (label.getAccessKey() != null) {
+        if (LOG.isInfoEnabled()
+            && !AccessKeyMap.addAccessKey(facesContext, label.getAccessKey())) {
+          LOG.info("duplicated accessKey : " + label.getAccessKey());
+        }
+        if (!disabled) {
+          addAcceleratorKey(facesContext, menu, label.getAccessKey());
+        }
+      }
+      HtmlRendererUtils.writeLabelWithAccessKey(writer, label);
+    }
+    writer.endElement(HtmlConstants.A);
+    if (isParentMenu) {
+      writer.startElement(HtmlConstants.OL, menu);
+    }
+  }
+
+  @Override
+  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+
+    UIMenu menu = (UIMenu)component;
+    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+
+    boolean isParentMenu = menu.getChildCount() > 0; // todo: may be not correct
+    if (isParentMenu) {
+      writer.endElement(HtmlConstants.OL);
+    }
+    writer.endElement(HtmlConstants.LI);
+  }
+  
+  private void addAcceleratorKey(
+      FacesContext facesContext, UIComponent component, Character accessKey) {
+    String clientId = component.getClientId(facesContext);
+    while (component != null && !component.getAttributes().containsKey(MENU_ACCELERATOR_KEYS)) {
+      component = component.getParent();
+    }
+    if (component != null) {
+      List<String> keys
+          = (List<String>) component.getAttributes().get(MENU_ACCELERATOR_KEYS);
+      String jsStatement = HtmlRendererUtils.createOnclickAcceleratorKeyJsStatement(
+          clientId, accessKey, null);
+      keys.add(jsStatement);
+    } else {
+      LOG.warn("Can't find menu root component!");
+    }
+  }
+  
 }

Copied: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuSeparatorRenderer.java (from r883294, myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuSeparatorRenderer.java?p2=myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuSeparatorRenderer.java&p1=myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java&r1=883294&r2=887243&rev=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuSeparatorRenderer.java Fri Dec  4 16:04:42 2009
@@ -17,7 +17,28 @@
  * limitations under the License.
  */
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
+import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
 
-public class MenuRenderer extends LayoutComponentRendererBase {
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import java.io.IOException;
+
+public class MenuSeparatorRenderer extends LayoutComponentRendererBase {
+
+  private static final Log LOG = LogFactory.getLog(MenuSeparatorRenderer.class);
+
+  @Override
+  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+    writer.startElement(HtmlConstants.LI, component);
+    writer.writeClassAttribute();
+    writer.startElement(HtmlConstants.HR, component);    
+    writer.endElement(HtmlConstants.HR);    
+    writer.endElement(HtmlConstants.LI);    
+  }
 }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Fri Dec  4 16:04:42 2009
@@ -23,13 +23,19 @@
 import org.apache.myfaces.tobago.component.Attributes;
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.UIForm;
+import org.apache.myfaces.tobago.component.UIMenuBar;
 import org.apache.myfaces.tobago.component.UIPage;
 import org.apache.myfaces.tobago.component.UIPopup;
+import org.apache.myfaces.tobago.config.Configurable;
+import org.apache.myfaces.tobago.config.ThemeConfig;
 import org.apache.myfaces.tobago.context.ClientProperties;
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
 import org.apache.myfaces.tobago.context.TobagoFacesContext;
 import org.apache.myfaces.tobago.layout.LayoutContext;
+import org.apache.myfaces.tobago.layout.Measure;
+import org.apache.myfaces.tobago.layout.PixelMeasure;
 import org.apache.myfaces.tobago.renderkit.PageRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
 import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
@@ -98,7 +104,6 @@
   @Override
   public void encodeBegin(FacesContext facesContextOrg, UIComponent component) throws IOException {
 
-//  public void encodeEnd(FacesContext facesContextOrg, UIComponent component) throws IOException {
     UIPage page = (UIPage) component;
 
     // invoke prepareRender
@@ -228,6 +233,7 @@
     // script files
     List<String> scriptFiles = facesContext.getScriptFiles();
     // dojo.js and tobago.js needs to be first!
+    addScripts(writer, facesContext, "script/jquery-1.3.2.min.js");
     if (debugMode) {
       addScripts(writer, facesContext, "script/dojo/dojo/dojo.js.uncompressed.js");
     } else {
@@ -236,6 +242,7 @@
     addScripts(writer, facesContext, "script/tobago.js");
     addScripts(writer, facesContext, "script/theme-config.js");
     // remove  dojo.js and tobago.js from list to prevent dublicated rendering of script tags
+    scriptFiles.remove("script/jquery-1.3.2.min.js");
     if (debugMode) {
       scriptFiles.remove("script/dojo/dojo/dojo.js.uncompressed.js");
     } else {
@@ -308,10 +315,10 @@
       }
     }
 
-    UIComponent menubar = page.getFacet(Facets.MENUBAR);
-    if (menubar != null) {
+    UIMenuBar menuBar = (UIMenuBar)page.getFacet(Facets.MENUBAR);
+    if (menuBar != null) {
       facesContext.getOnloadScripts().add("Tobago.setElementWidth('"
-          + menubar.getClientId(facesContext) + "', Tobago.getBrowserInnerWidth())");
+          + menuBar.getClientId(facesContext) + "', Tobago.getBrowserInnerWidth())");
     }
     writer.startJavascript();
     // onload script
@@ -345,8 +352,6 @@
 //    writer.writeAttribute("onunload", "Tobago.onexit();", null);
     writer.writeIdAttribute(clientId);
     writer.writeClassAttribute();
-//    Style style = new Style(facesContext, page);
-//    writer.writeStyleAttribute(style);
 
     writer.startJavascript();
     writer.write("Tobago.pngFixBlankImage = '");
@@ -441,14 +446,25 @@
     }
 */
 
-    if (menubar != null) {
-      menubar.getAttributes().put(Attributes.PAGE_MENU, Boolean.TRUE);
-      RenderUtil.encode(facesContext, menubar);
+    if (menuBar != null) {
+      menuBar.getAttributes().put(Attributes.PAGE_MENU, Boolean.TRUE);
+      RenderUtil.encode(facesContext, menuBar);
     }
     // write the proviously rendered page content
 //    UILayout.getLayout(component).encodeChildrenOfComponent(facesContext, component);
 
 //    page.encodeLayoutBegin(facesContext);
+    
+    writer.startElement(HtmlConstants.DIV, page);
+    writer.writeClassAttribute();
+    Style style = new Style(facesContext, page);
+    // XXX position the div, so that the scrollable area is correct.
+    // XXX better to take this fact into layout management.
+    // XXX is also useful in boxes, etc.
+    Measure topOffset = getBottomOffset(facesContext, page);
+    style.setHeight(page.getHeight().subtract(topOffset));
+    style.setTop(topOffset);
+    writer.writeStyleAttribute(style);
   }
 
 //  @Override
@@ -460,8 +476,6 @@
   @Override
   public void encodeEnd(FacesContext facesContextOrg, UIComponent component) throws IOException {
 
-    UIPage page = (UIPage) component;
-
     TobagoFacesContext facesContext;
     if (facesContextOrg instanceof TobagoFacesContext) {
       facesContext = (TobagoFacesContext) facesContextOrg;
@@ -469,7 +483,10 @@
       facesContext = new TobagoFacesContext(facesContextOrg);
     }
 
-//    page.encodeLayoutEnd(facesContext);
+    UIPage page = (UIPage) component;
+    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+
+    writer.endElement(HtmlConstants.DIV);
 
     // write popup components
     // beware of ConcurrentModificationException in cascating popups!
@@ -479,8 +496,6 @@
       RenderUtil.encode(facesContext, popup);
     }
 
-    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
-
     String clientId = page.getClientId(facesContext);
     final boolean debugMode = ClientProperties.getInstance(facesContext.getViewRoot()).isDebugMode();
 
@@ -642,8 +657,21 @@
     return method == null ? "post" : method;
   }
 
+  @Override
   public boolean getRendersChildren() {
     return true;
   }
 
+  @Override
+  public Measure getBottomOffset(FacesContext facesContext, Configurable component) {
+    // XXX this is a hack. correct whould be the top-offset, but this would shift the content, because of the 
+    // XXX hack before the code: writer.writeStyleAttribute(style)
+    UIPage page = (UIPage) component;
+    UIMenuBar menuBar = (UIMenuBar)page.getFacet(Facets.MENUBAR);
+    if (menuBar != null) {
+      return ThemeConfig.getMeasure(facesContext, menuBar, "fixedHeight");
+    } else {
+      return PixelMeasure.ZERO;
+    }
+  }
 }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java Fri Dec  4 16:04:42 2009
@@ -22,7 +22,6 @@
 import org.apache.myfaces.tobago.component.Attributes;
 import org.apache.myfaces.tobago.component.CreateComponentUtils;
 import org.apache.myfaces.tobago.component.Facets;
-import org.apache.myfaces.tobago.component.RendererTypes;
 import org.apache.myfaces.tobago.component.UICommandBase;
 import org.apache.myfaces.tobago.component.UIMenu;
 import org.apache.myfaces.tobago.component.UIMenuSelectOne;
@@ -45,8 +44,6 @@
 
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIPanel;
-import javax.faces.component.UISelectBoolean;
-import javax.faces.component.UISelectOne;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import javax.faces.model.SelectItem;
@@ -100,13 +97,10 @@
     } else if (command instanceof UISelectOneCommand) {
       renderSelectOne(facesContext, command, writer, first, last);
     } else {
-      if (command.getFacet(Facets.ITEMS) != null) {
-        UIComponent facet = command.getFacet(Facets.ITEMS);
-        if (facet instanceof UISelectBoolean) {
-          renderSelectBoolean(facesContext, command, writer, first, last);
-        } else if (facet instanceof UISelectOne) {
-          renderSelectOne(facesContext, command, writer, first, last);
-        }
+      if (command.getFacet(Facets.RADIO) != null) {
+        renderSelectOne(facesContext, command, writer, first, last);
+      } else if (command.getFacet(Facets.CHECKBOX) != null) {
+        renderSelectBoolean(facesContext, command, writer, first, last);
       } else {
         String onClick = createOnClick(facesContext, command);
         renderToolbarButton(facesContext, command, writer, first, last, false, onClick);
@@ -122,7 +116,7 @@
 
     List<SelectItem> items;
 
-    UIMenuSelectOne radio = (UIMenuSelectOne) command.getFacet(Facets.ITEMS);
+    UIMenuSelectOne radio = (UIMenuSelectOne) command.getFacet(Facets.RADIO);
     if (radio == null) {
       items = RenderUtil.getSelectItems(command);
       radio = CreateComponentUtils.createUIMenuSelectOneFacet(facesContext, command);
@@ -187,7 +181,7 @@
       TobagoResponseWriter writer, boolean first, boolean last)
       throws IOException {
 
-    UIComponent checkbox = command.getFacet(Facets.ITEMS);
+    UIComponent checkbox = command.getFacet(Facets.CHECKBOX);
     if (checkbox == null) {
       checkbox = CreateComponentUtils.createUISelectBooleanFacetWithId(facesContext, command);
     }
@@ -298,8 +292,7 @@
         && !UIToolBar.ICON_OFF.equals(iconSize);
     if (popupOn2) {
       if (popupMenu != null) {
-        renderPopupTd(facesContext, writer, command, popupMenu,
-            true);
+        renderPopupTd(facesContext, writer, command, popupMenu, true);
       }
       writer.endElement(HtmlConstants.TR);
       writer.startElement(HtmlConstants.TR, null);
@@ -461,7 +454,7 @@
       writer.endElement(HtmlConstants.DIV);
       popupMenu.getAttributes().put(Attributes.MENU_POPUP, Boolean.TRUE);
       popupMenu.getAttributes().put(Attributes.MENU_POPUP_TYPE, "ToolBarButton");
-      popupMenu.setRendererType(RendererTypes.MENU_BAR);
+//      popupMenu.setRendererType(RendererTypes.MENU_BAR);
       if (popupMenu instanceof UIMenu)  {
         ((UIMenu) popupMenu).setLabel(null);
       } else {

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties Fri Dec  4 16:04:42 2009
@@ -93,8 +93,7 @@
 Label.fixedHeight=25
 Label.preferredWidth=144
 
-MenuBar.headerHeight=22
-MenuBar.fixedHeight=24
+MenuBar.fixedHeight=19
 
 Message.messageHeight=20
 

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-menu.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-menu.js?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-menu.js (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-menu.js Fri Dec  4 16:04:42 2009
@@ -15,1006 +15,149 @@
  * limitations under the License.
  */
 
-function initMenuPopUp(divId, pageId, type) {
-  initMenuComponents(divId, pageId, type);
-}
-function initMenuBar(divId, pageId) {
-  initMenuComponents(divId, pageId, false);
-}
-function initMenuComponents(divId, pageId, popup) {
-  var menubar = dojo.byId(divId);
-  if (menubar && menubar.menu) {
-    if (! menubar.id) {
-      menubar.id = Tobago.createHtmlId();
-    }
-    menubar.menu.menubarId = menubar.id;
-    var top = Tobago.getAbsoluteTop(menubar) + getMenubarBorderWidth();
-    var left = Tobago.getAbsoluteLeft(menubar) + getMenubarBorderWidth();
-    if (popup) {
-      left = left + menubar.scrollWidth - getPopupMenuWidth();
-      menubar.menu.popup = popup;
-      //LOG.debug("popupType = " + popup);
-    }
-    var body = dojo.byId(pageId);
-    var className = "tobago-menuBar-container";
-    if (popup) {
-      className += " tobago-menuBar-container-" + popup;
-    }
-    var htmlElement = document.createElement('div');
-    htmlElement.id = Tobago.createHtmlId();
-    htmlElement.className = className;
-    htmlElement.style.top = top;
-    htmlElement.style.left = left;
-    htmlElement.style.top = 0;
-    htmlElement.style.left = 0;
-    
-    
-//    menubar.menu.htmlElement.innerHTML = menubar.menu.toHtml();
-//    body.appendChild(menubar.menu.htmlElement);
-//  //menubar.appendChild(menubar.menu.htmlElement);
-
-    htmlElement.innerHTML = menubar.menu.toHtml(false);
-    if (menubar.firstChild) {
-      menubar.removeChild(menubar.firstChild);
-    }
-    menubar.appendChild(htmlElement);
-
-    createSubmenus(menubar.menu, body);
-
-    initMenuItems(menubar.menu);
-    setItemWidth(menubar.menu);
-    setItemPositions(menubar.menu);
-    if (popup) {
-      adjustPopupImage(menubar.menu);
-    }
-    setItemsVisible(menubar.menu);
-  }
-  else {
-    LOG.debug("keine menubar mit id ='" + divId + "'gefunden!");
-  }
-}
-
-function createSubmenus(menu, body) {
-  var id = menu.id + Tobago.SUB_COMPONENT_SEP + "submenuroot";
-  var htmlElement = dojo.byId(id);
-  if (!htmlElement) {
-    htmlElement = document.createElement('div');
-    htmlElement.className = "tobago-menuBar-submenuroot";
-    htmlElement.id = id;
-    body.appendChild(htmlElement);
-  }
-
-  htmlElement.innerHTML = menu.toHtml(true);
-  return htmlElement;
-}
-
-function createMenuRoot(id) {
-  var menu = new Tobago.Menu.Item();
-  menu.id = id + Tobago.SUB_COMPONENT_SEP + Tobago.Menu.MENU_ROOT_ID;
-  menu.level = 0;
-  Tobago.addJsObject(menu);
-  return menu;
-}
-
-Tobago.Menu.Item = function(label, action, disabled, separator) {
-  this.label = label;
-  this.action = action;
-  this.disabled = disabled;
-  this.subItems = new Array();
-  this.separator = separator;
-};
-
-Tobago.Menu.Item.prototype.addMenuItem = function(menuItem) {
-    var index = this.subItems.length;
-    this.subItems[index] = menuItem;
-    menuItem.parent = this;
-    menuItem.id = this.id + Tobago.SUB_COMPONENT_SEP + index;
-    menuItem.index = index;
-    menuItem.level = this.level + 1;
-  };
-
-Tobago.Menu.Item.prototype.toHtml = function(createSubItems) {
-    var html = "";
-//    LOG.debug("toHtml() for"  + this.id + " l=" + this.level);
-    if (this.level > 1 || (this.level == 1 && ! createSubItems)) {
-//      LOG.debug("create menuitem" + this.id);
-      var onClick = "";
-      if (this.action) {
-        onClick = ' onclick="tobagoMenuItemOnmouseout(this, true) ; ' + this.action + '"';
-      }
-      if (this.level == 1 || this.subItems.length > 0) {
-        onClick = ' onclick="tobagoMenuOpenMenu(this, event)"';
-      }
-
-      var itemStyle = "tobago-menu-item";
-      if (this.separator) {
-        itemStyle += "-separator";
-      }
-      html += '<div class="' + itemStyle + '"'
-          + ' id="' + this.id + '"';
-      if (! this.disabled) {
-        html += ' onmouseover="tobagoMenuItemOnmouseover(this)"'
-            + ' onmouseout="tobagoMenuItemOnmouseout(this)"'
-/*            + ' onfocus="tobagoMenuItemOnfocus(this)"'
-            + ' onblur="tobagoMenuItemOnblur(this)"' */
-            + onClick;
-      }
-      html += '>' + this.label + "</div>";
-          //LOG.debug("adding menu entry '" + this.label + "'");
-    }
-    if (this.level == 0 || (createSubItems && this.subItems.length > 0)) {
-//      LOG.debug("create subitems " + this.id);
-
-      if (this.level != 0) {
-        html += '<div class="tobago-menuBar-subitem-container"'
-            + ' id="' + this.id + Tobago.SUB_COMPONENT_SEP + 'items" >';
-      }
-      for (var i = 0; i< this.subItems.length; i++) {
-        html += this.subItems[i].toHtml(createSubItems);
-      }
-      if (this.level != 0) {
-        html += '</div>';
-        if (document.all) {
-          html += '<iframe'
-              + ' id="' + this.id + Tobago.SUB_COMPONENT_SEP + 'iframe"'
-              + ' class="tobago-menuBar-subitem-iframe" '
-              + ' src="' + Tobago.contextPath.value  + '/org/apache/myfaces/tobago/renderkit/html/standard/blank.html" '
-              //+ ' style="display: none; "'
-              + ' style="visibility: hidden;"'
-              + ' frameborder="0" scrolling="no" ></iframe>';
-        }
-      }
-    }
-    return html;
-  };
-
-Tobago.Menu.Item.prototype.openSubMenus = function() {
-    if (! this.subItemContainerId) {
-      return;
-    }
-
-    var htmlElement = Tobago.element(this.id);
-    var subItemContainer = Tobago.element(this.subItemContainerId);
-
-    var width = this.subItemContainerStyleWidth.replace(/\D/g,"") - 0;
-    var height = this.subItemContainerStyleHeight.replace(/\D/g,"") - 0;
-
-    var containerParent;
-    var leftOffset = 0;
-    if (this.menuButton) {
-      containerParent = this.menuButton;
-      leftOffset = Tobago.Config.get("Menu", "toolbarLeftOffset");
-    } else {
-      containerParent = htmlElement;
-    }
-    var parentLeft = Tobago.getAbsoluteLeft(containerParent) + leftOffset;
-    var parentTop = Tobago.getAbsoluteTop(containerParent) ;
-    var parentWidth = htmlElement.style.width.replace(/\D/g,"") - 0;
-    var parentHeight = htmlElement.style.height.replace(/\D/g,"") - 0;
-    
-    
-    var innerLeft = Tobago.getBrowserInnerLeft();
-    var innerTop = Tobago.getBrowserInnerTop();
-    var innerWidth = Tobago.getBrowserInnerWidth();
-    var innerHeight = Tobago.getBrowserInnerHeight();
-    var innerRight = innerLeft + innerWidth;
-    var innerBottom = innerTop + innerHeight;
-
-    if (this.level == 1) {
-      var containerRight = parentLeft + width;
-      if (containerRight <= innerRight) {
-//        subItemContainer.style.left = htmlElement.style.left;
-        subItemContainer.style.left = parentLeft + "px";
-      }
-      else {
-//        subItemContainer.style.left = htmlElement.style.left.replace(/\D/g,"") - (containerRight - innerRight) + "px";
-        subItemContainer.style.left = parentLeft - (containerRight - innerRight) + "px";
-      }
-      var itemHeight = containerParent.clientHeight;
-      subItemContainer.style.top = parentTop + itemHeight + "px";
-    }
-    else if (this.level > 1) {
-      var containerRight = parentLeft + parentWidth + width;
-      var left = 0;
-      if (containerRight <= innerRight) {
-        left = this.parent.childWidth;
-      }
-      else {
-        left = "-" + this.childWidth;
-      }
-      subItemContainer.style.left = left + "px";
-    
-      var containerBottom = parentTop + height;
-      if (containerBottom <= innerBottom) {
-        subItemContainer.style.top = htmlElement.style.top;
-      }
-      else {
-        subItemContainer.style.top = (innerBottom - containerBottom) + "px";
-      }
-      
-    }
-    
-    subItemContainer.style.width = this.subItemContainerStyleWidth;
-    subItemContainer.style.height = this.subItemContainerStyleHeight;
-
-    this.setupIframe(subItemContainer);
-//    this.setSubMenuContainerVisibility("visible");
-//    timing problem when call this directly ??
-//    calling via 'setTimeout()' is not nice, but resolves the problem
-    setTimeout('tobagoSetSubMenuContainerVisible("' + this.id +  '")', 0);
-  };
-
-Tobago.Menu.Item.prototype.hideSubMenus = function() {
-    this.setSubMenuContainerVisibility("hidden");
-  };
-
-Tobago.Menu.Item.prototype.setSubMenuContainerVisibility = function(style) {
-    if (this.subItemContainerId) {
-      Tobago.element(this.subItemContainerId).style.visibility = style;
-      if (this.subItemIframeId) {
-        Tobago.element(this.subItemIframeId).style.visibility = style;
-      }
-    }
-  };
-
-
-Tobago.Menu.Item.prototype.openMenu = function() {
-    this.focusLabelTag();
-  };
-
-Tobago.Menu.Item.prototype.onMouseOver = function() {
-    this.mouseOver = true;
-    //LOG.debug("onMouseOver " + this.id + " level :" + this.level);
-    clearTimeout(this.onBlurTimer);
-
-    if (this.level == 1) {
-      if (! this.isNeighbourOpen()) {
-        Tobago.addCssClass(this.id, "tobago-menu-item-hover");
-      }
-      else {
-        this.focusLabelTag();
-        this.openSubMenus();
-      }
-    }
-    else {
-      this.focusLabelTag();
-      this.hoverTimer = setTimeout("tobagoOpenSubMenus('" + this.id + "')",
-          getOpenSubMenusTimeout());
-    }
-  };
-
-Tobago.Menu.Item.prototype.onMouseOut = function(clicked) {
-    this.mouseOver = false;
-    //LOG.debug("onMouseOut " + this.id + " clicked = " + clicked);
-    clearTimeout(this.hoverTimer);
-    if (clicked) {
-      //this.blurLabelTag();
-      this.focus = false;
-      this.focusLost();
-    }
-    else {
-      Tobago.removeCssClass(this.id, "tobago-menu-item-hover");
-    }
-  };
-
-Tobago.Menu.Item.prototype.onFocus = function() {
-    this.focus = true;
-    Tobago.addCssClass(this.id, "tobago-menu-item-focus");
-    if (this.menuButton) {
-      Tobago.addCssClass(this.menuButton, "tobago-toolBar-button-menu-focus");
-    }
-    this.openSubMenus();
-    
-    if (this.action && window.event && window.event.altKey) {
-    // focus came via alt-<accessKey> : ie needs click())
-      Tobago.element(this.id).click();
-    }
-  };
-
-Tobago.Menu.Item.prototype.onBlur = function() {
-    //LOG.debug("onBlur " + this.id);
-    this.focus = false;
-    this.onBlurTimer = setTimeout("tobagoFocusLost('" + this.id + "')",
-        getFocusLostTimeout());
-  };
-
-Tobago.Menu.Item.prototype.focusLost = function() {
-    //LOG.debug("focusLost " + this.id);
-    if (this.level > 0
-        && (!this.mouseOver)
-        && !(this.level != 1 && this.focus)
-        &&  ! this.childHasFocus()) {
-      this.hideSubMenus();
-      Tobago.removeCssClass(this.id, "tobago-menu-item-focus");
-      if (this.menuButton) {
-        Tobago.removeCssClass(this.menuButton, "tobago-toolBar-button-menu-focus");
-      }
-      this.parent.focusLost();
-    }
-  };
-
-Tobago.Menu.Item.prototype.isExpanded = function() {
-    return this.subItemContainerId
-        && Tobago.element(this.subItemContainerId).style.visibility.match(/visible/);
-  };
-
-Tobago.Menu.Item.prototype.focusLabelTag = function() {
-    //LOG.debug("setze Focus " + this.id);
-    var element = this.getLabelTag();
-    if (element) {
-      try {
-      element.focus();
-      } catch (ex) {
-        // ignore
-      }
-    }
-  };
-
-Tobago.Menu.Item.prototype.blurLabelTag = function() {
-    //LOG.debug("entferne Focus " + this.id);
-    var element = this.getLabelTag();
-    if (element) {
-      element.blur();
-    }
-  };
-
-Tobago.Menu.Item.prototype.childHasFocus = function() {
-    for (var i = 0; i < this.subItems.length; i++) {
-       if (this.subItems[i].focus) {
-         return true;
-       }
-       else if (this.subItems[i].childHasFocus()) {
-         return true;
-       }
-    }
-    return false;
-  };
-
+// todo: rename xxx_
+function xxx_tobagoMenuHandelKey(event) {
 
-Tobago.Menu.Item.prototype.isNeighbourOpen = function() {
-    for (var i = 0; i < this.parent.subItems.length; i++) {
-      if (this.parent.subItems[i].isExpanded()) {
-        return true;
-      }
-    }
-    return false;
+  var handled = false;
+  
+  var code = event.which;
+  if (code == 0) {
+    code = event.keyCode;
   }
 
-
-
-  // #########################################################  key access
-
-Tobago.Menu.Item.prototype.keyDown = function() {
-    if (this.level == 1) {
-      this.openSubMenus();
-      this.nextItem(-1, 1);
-    }
-    else {
-      if (this.parent.nextItem(this.index, 1)) {
-        this.hover = false;
-      }
-    }
-  };
-
-Tobago.Menu.Item.prototype.keyUp = function() {
-    if (this.level == 1) {
-      this.openSubMenus();
-      this.nextItem(this.subItems.length, -1);
-    }
-    else {
-      if (this.parent.nextItem(this.index, -1)) {
-        this.hover = false;
-      }
-    }
-  };
-
-Tobago.Menu.Item.prototype.keyLeft = function() {
-    if (this.level == 1) {
-      var next = this.parent.nextItem(this.index, -1);
-      if (next && next.id != this.id) { // menu has changed
-        this.hover = false;
-        next.openSubMenus();
-      }
-    }
-    else if (this.level == 2) {
-      if (this.isExpanded()) {
-        this.hideSubMenus();
+  switch (code) {
+    case 27: // escape
+      xxx_tobagoMenuSwitchOff($(this).closest(".tobago-menuBar-default"));
+      handled = true;
+      break;
+    case 37: // cursor left
+      if ($(this).parent().hasClass('tobago-menu-top')) {
+        $(this).parent().prev('li').children('a').focus();
+      } else if ($(this).parent().parent().parent().hasClass('tobago-menu-top')) {
+        $(this).parent().parent().parent().prev('li').children('a').focus();
       } else {
-        var next = this.parent.parent.nextItem(this.parent.index, -1);
-        if (next && next.id != this.parent.id) { // menu has changed
-          this.hover = false;
-          next.openSubMenus();
-        }
+        $(this).closest('ol').prev('a').focus();
       }
-    }
-    else { // level > 2
-      var next = this.parent.getLabelTag();
-      this.parent.hover = true;
-      this.parent.hideSubMenus();
-      next.focus();
-      this.hover = false;
-    }
-  };
-
-Tobago.Menu.Item.prototype.keyRight = function() {
-    if (this.level == 1) {
-      var next = this.parent.nextItem(this.index, 1);
-      if (next && next.id != this.id) { // menu has changed
-        this.hover = false;
-        next.openSubMenus();
-      }
-    }
-    else if (this.level > 1) {
-      if (this.subItemContainerId) {
-        this.openSubMenus();
-        this.hover = false;
-        var next = this.nextItem(-1, 1);
+      handled = true;
+      break;
+    case 38: // cursor up
+      if ($(this).parent().hasClass('tobago-menu-top')) {
+        // nothing
       } else {
-        var parent = this.parent;
-        while (parent.level != 1) {
-          parent = parent.parent;
-        }
-        var next = parent.parent.nextItem(parent.index, 1);
-        if (next && next.id != parent.id) { // menu has changed
-          parent.hover = false;
-          next.openSubMenus();
-        }
-      }
-    }
-  };
-
-Tobago.Menu.Item.prototype.nextItem = function(start, offset) {
-    var i = start + offset;
-
-    while (!(this.subItems[i] && ! this.subItems[i].disabled) && i != start) {
-      if (offset > 0) {
-        if (i >= this.subItems.length) {
-          i = -1;
-        }
-      }
-      else {
-        if (i < 0) {
-          i = this.subItems.length;
-        }
-      }
-      i += offset;
-    }
-
-    var j = dojo.byId(this.subItems[i].id).childNodes.length;
-    var span = this.subItems[i].getLabelTag();
-    if (span) {
-      this.subItems[i].hover = true;
-      span.focus();
-      return this.subItems[i];
-    }
-    return false;
-  };
-
-Tobago.Menu.Item.prototype.collapse = function() {
-    //LOG.debug("collapse " + this.id);
-    if (this.level < 2) {
-      var aTag = this.getLabelTag();
-      if (aTag) {
-        aTag.blur();
-      }
-      //this.onMouseOut(true);
-    }
-    else if (this.level == 2
-        && !(this.isExpanded() )) {
-      var aTag = this.getLabelTag();
-      if (aTag) {
-        aTag.blur();
+        $(this).parent().prevAll('li:first').children('a').focus();
       }
-      //this.onMouseOut(true);
-      //this.parent.onMouseOut(true);
-    }
-    else {
-      if (this.isExpanded()) {
-        this.hideSubMenus();
-      }
-      else {
-        var aTag = this.parent.getLabelTag();
-        if (aTag) {
-          this.parent.hover = true;
-          aTag.focus();
-        }
-      }
-    }
-  };
-  
-Tobago.Menu.Item.prototype.getLabelTag = function() {
-    var children = dojo.byId(this.id).childNodes;
-    for (var k = 0; k < children.length; k++) {
-      if (children[k].className.match(/tobago-menuBar-item-span/)) {
-        return children[k];
+      handled = true;
+      break;
+    case 39: // cursor right
+      if ($(this).parent().hasClass('tobago-menu-top')) {
+        $(this).parent().next('li').children('a').focus();
+      } else if ($(this).next('ol').size() > 0) {
+        $(this).next('ol').children(":nth-child(1)").children('a').focus();
+      } else {
+        $(this).closest('.tobago-menu-top').next('li').children('a').focus();
       }
-    }
-  };
-  
-Tobago.Menu.Item.prototype.setSubitemArrowImage = function(image) {
-    this.subitemArrowImage = image;
-  };
-
-Tobago.Menu.Item.prototype.getSubitemArrowImage = function() {
-    if (! this.subitemArrowImage) {
-      if (this.parent) {
-        this.subitemArrowImage = this.parent.getSubitemArrowImage();
+      handled = true;
+      break;
+    case 40: // cursor down
+      if ($(this).parent().hasClass('tobago-menu-top')) {
+        $(this).next('ol').children(":nth-child(1)").children('a').focus();
+      } else {
+        $(this).parent().nextAll('li:first').children('a').focus();
       }
-    }
-    return this.subitemArrowImage;
-  };
-  
-Tobago.Menu.Item.prototype.addSubitemArrowImage = function() {
-    if (this.level > 1 && this.subItems && this.subItems.length > 0) {
-      var htmlElement = dojo.byId(this.id);
-      var html = htmlElement.innerHTML;
-      html += '<img class="tobago-menu-subitem-arrow" src="';
-      html += this.getSubitemArrowImage() + '" />';
-      htmlElement.innerHTML = html;
-    }
-  };
-  
-Tobago.Menu.Item.prototype.setupIframe = function(subItemContainer) {
-    var subItemIframe = dojo.byId(this.subItemIframeId);
-    if (subItemIframe) {
-      subItemIframe.style.width = subItemContainer.scrollWidth;
-      subItemIframe.style.height = subItemContainer.scrollHeight;
-      subItemIframe.style.top = subItemContainer.style.top;
-      subItemIframe.style.left = subItemContainer.style.left;
-    }
-  };
-
-Tobago.Menu.Item.prototype.setMenuButton = function(button) {
-    this.menuButton = button;
-  };
-
-
-
-function adjustPopupImage(menu) {
-  if (menu.subItems && menu.subItems.length > 0) {
-    var img = dojo.byId(menu.subItems[0].id).childNodes[0];
-    if (img) {
-      img.style.top = getPopupImageTop(menu.popup);
-    }
-    else {
-      LOG.debug("kein IMG im popup");
-    }
+      handled = true;
+      break;
+    default:
+      break;
   }
+  return !handled;
 }
 
-function setItemWidth(menu) {
-
-  if (menu.level != 0) {
-    var htmlElement = dojo.byId(menu.id);
-    if (htmlElement) {
-
-      if (menu.level == 1) {
-        htmlElement.style.width = htmlElement.scrollWidth + "px";
-      }
-      else { // level not 0 or 1
-
-        var width = menu.parent.childWidth;
+function xxx_tobagoMenuOpen(event) {
 
-        if (! width) {
-          width = 0;
-          var re = new RegExp("(.*" + Tobago.SUB_COMPONENT_SEP +")\\d$");
-          var childIdPrefix = menu.id.match(re)[1];
-          var i = 0;
-          var childElement = dojo.byId(childIdPrefix + i++);
-          while (childElement) {
-            //LOG.debug("item " + childElement.id + "  -->" + childElement.scrollWidth) ;//+ ":::" + childElement.innerHTML);
-            width = Math.max(width, childElement.scrollWidth);
-            childElement = dojo.byId(childIdPrefix + i++);
-          }
-          //LOG.debug("das waren " + (i-1) + " items  ---> width wird " + width);
-          width += getMenuArrowWidth();
-          menu.parent.childWidth = width;
-        }
-        
-        menu.addSubitemArrowImage();
-        
-        htmlElement.style.width = width + "px";
+  // close menus in other branches
+  $(this).parent().siblings().find("ol").css('visibility', 'hidden');
 
-      }
+  // close sub sub menu 
+  $(this).next("ol").children().find("ol").css('visibility', 'hidden');
 
-    htmlElement.style.overflow = 'hidden';
-    }
-  }
-  for (var i = 0; i < menu.subItems.length; i++) {
-    setItemWidth(menu.subItems[i]);
-  }
-  var subItemContainer = dojo.byId(menu.subItemContainerId);
-  if (subItemContainer && menu.level != 0) {
-    menu.subItemContainerStyleWidth
-        = (menu.childWidth + getSubitemContainerBorderWidthSum()) + "px";
-    var subMenuHeight = 0;
-    for (var i = 0; i < menu.subItems.length; ++i) {
-      var item = menu.subItems[i];
-      subMenuHeight += (item.separator ? getSeparatorHeight() : getItemHeight());
+  // open sub menu
+  // todo: this must be done only one time...
+  var sub = $(this).next("ol");
+  if (sub.size() > 0) { // XXX check if there is a nicer method
+    // compute position
+    if ($(this).parent().hasClass('tobago-menu-top')) {
+      // is top menu
+      sub.css('left', sub.parent().position().left);
+      sub.css('top', sub.parent().outerHeight());
+    } else {
+      // is sub menu
+      sub.css('left', sub.parent().position().left + sub.parent().outerWidth());
+      sub.css('top', sub.parent().position().top - 1); // 1 = border-top
     }
-    menu.subItemContainerStyleHeight = (subMenuHeight + getSubitemContainerBorderWidthSum()) + "px";
 
-    subItemContainer.style.width = "0px";
-    subItemContainer.style.height = "0px";
-
-    var subItemIframe = dojo.byId(menu.subItemIframeId);
-    if (subItemIframe) {
-      subItemIframe.style.width = subItemContainer.style.width;
-      subItemIframe.style.height = subItemContainer.style.height;
-    }
+    // show
+    sub.css('visibility', 'visible');
   }
+      
+  // old "hover" off
+  $(this).parent().siblings('.tobago-menu-selected').removeClass("tobago-menu-selected");
+  $(this).next("ol").children('.tobago-menu-selected').removeClass("tobago-menu-selected");
+  // "hover" on
+  $(this).parents('li').addClass("tobago-menu-selected");
 }
 
-function setItemPositions(menu) {
-
-  if (menu.level != 0) {
-    var htmlElement = dojo.byId(menu.id);
-    if (htmlElement) {
-
-      if (menu.level == 1) {
-        var itemHeight = getItemHeight(menu);
-        var top = 0;
-        if (menu.parent.popup) {
-          top = Tobago.Config.get("Menu", menu.parent.popup + "MenuTopOffset");
-        }
-        htmlElement.style.top = top +"px";
-        htmlElement.style.height = itemHeight + "px";
-        var subItemContainer = dojo.byId(menu.subItemContainerId);
-        if (subItemContainer) {
-          subItemContainer.style.top = (itemHeight + top) + "px";
-        }
-        var left = 0;
-        if (menu.index != 0) {
-          var neighbour = menu.parent.subItems[menu.index -1];
-          var left = dojo.byId(neighbour.id).style.left.replace(/\D/g,"") - 0;
-          left += dojo.byId(neighbour.id).style.width.replace(/\D/g,"") - 0;
-        }
-        htmlElement.style.left = left + "px";
-        if (subItemContainer) {
-//          menu.subItemContainer.style.left = left + "px";
-          subItemContainer.style.left = "0px";
-        }
-        htmlElement.style.zIndex = "999";
-      }
-      else { // level not 0 or 1
-        var top = 0;
-        for (var i = 0; i < menu.index; ++i) {
-          var item = menu.parent.subItems[i];
-          top += (item.separator ? getSeparatorHeight() : getItemHeight());
-        }
-        var left = 0;
-        if (menu.level == 2 && menu.parent.parent.popup) {
-          if (menu.parent.parent.popup == "ToolbarButton") {
-            var menubar = dojo.byId(menu.parent.parent.menubarId);
-            left = getPopupMenuWidth() - menubar.scrollWidth;
-          }
-          var subItemContainer = dojo.byId(menu.parent.subItemContainerId);
-          if (subItemContainer) {
-            subItemContainer.style.left = left + "px";
-
-            if (menu.parent.subItemIframe) {
-              menu.parent.subItemIframe.style.left
-                  = menu.parent.subItemContainer.style.left;
-            }
-          }
-        }
-        var subItemContainer = dojo.byId(menu.subItemContainerId);
-        if (subItemContainer) {
-          //if (menu.level == 2) {
-          //  top = getItemHeight();
-          //}
-          /*
-          if (menu.level != 1) {
-            left = menu.parent.childWidth;
-          }
-          subItemContainer.style.top = top + "px";
-          subItemContainer.style.left = left + "px";*/
-          subItemContainer.style.top = "0px";
-          subItemContainer.style.left = "-" + menu.parent.childWidth + "px";
-        }
-
-        htmlElement.style.top = top + "px";
-        htmlElement.style.left = "0px";
-
-      }
-    }
-  }
-  for (var i = 0; i < menu.subItems.length; i++) {
-    setItemPositions(menu.subItems[i]);
-  }
+/**
+* returns the browser specific event which should be used.
+*/
+function compatibleKeyEvent() {
+  return jQuery.browser.msie || jQuery.browser.safari ? 'keydown' : 'keypress';
 }
 
-function setItemsVisible(menu) {
-  for (var i = 0; i < menu.subItems.length; i++) {
-    dojo.byId(menu.subItems[i].id).style.visibility = 'visible';
-  }
+function xxx_tobagoMenuMouseOver(event) {
+      $(this).children('a').focus();
+      return false;
 }
 
-function initMenuItems(menu) {
-  var htmlElement = dojo.byId(menu.id);
-  if (htmlElement) {
-
-    htmlElement.menuItem = menu;
-    if (menu.parent && menu.parent.menubarId
-        && dojo.byId(menu.parent.menubarId).className.match(/tobago-menuBar-page-facet/)) {
-      Tobago.addCssClass(htmlElement, 'tobago-menuBar-item-page-facet');
-    }
-    var id = menu.id + Tobago.SUB_COMPONENT_SEP + 'items';
-    if (dojo.byId(id)) {
-      menu.subItemContainerId = id;
-    }
-    id = menu.id + Tobago.SUB_COMPONENT_SEP + 'iframe';
-    if (dojo.byId(id)) {
-      menu.subItemIframeId = id;
-    }
-    var subItemIframe = dojo.byId(menu.subItemIframeId);
-    if (subItemIframe) {
-      subItemIframe.style.visibility = "hidden";
-      subItemIframe.style.position = "absolute";
-      subItemIframe.style.border = "0px solid black";
-      subItemIframe.style.zIndex
-          = Tobago.getRuntimeStyle(htmlElement).zIndex - 1;
-    }
-  }
-  for (var i = 0; i < menu.subItems.length; i++) {
-    initMenuItems(menu.subItems[i]);
-  }
+function xxx_tobagoMenuSwitchOn(menuBar, menu) {
+  menuBar.find("li")
+      .bind('mouseover', xxx_tobagoMenuMouseOver)
+      .children('a')
+      .bind('focus', xxx_tobagoMenuOpen)
+      .bind(compatibleKeyEvent(), xxx_tobagoMenuHandelKey);
+  menu.children('a').focus();
+  menuBar.attr('menu-active', 'true');        // write state back
 }
 
-
-
-function tobagoMenuSetHover(id) {
-  dojo.byId(id).menuItem.setHover();
-}
-function tobagoMenuRemoveHover(id, mouseOut) {
-  dojo.byId(id).menuItem.removeHover(mouseOut);
+function xxx_tobagoMenuSwitchOff(menuBar) {
+  menuBar.find("ol").css('visibility', 'hidden');
+  menuBar.find("li")
+      .unbind('mouseover', xxx_tobagoMenuMouseOver)
+      .children('a')
+      .unbind('focus', xxx_tobagoMenuOpen)
+      .unbind(compatibleKeyEvent(), xxx_tobagoMenuHandelKey);
+  menuBar.attr('menu-active', 'false');        // write state back
 }
 
+function xxx_tobagoMenuInit() {
+  $(document).ready(function() {
 
+    // a click on the top menu make the complete menu active or inactive respectively.
+    $(".tobago-menu-top").click(function(event) {
 
-function getMenuTimeoutHover() {
-  return 100;
-}
-function getMenuTimeoutOut() {
-  return 30;
-}
+      // register on click handlers
+      var menuBar = $(this).parent();
+      var wasActive = 'true' == menuBar.attr('menu-active'); // read state
 
-function getMenubarBorderWidth() {
-  return 2;
-}
-
-function getSubitemContainerBorderWidthSum() {
-  return 4; // border * 2
-}
-
-function getItemHeight(menu) {
-  if (menu && menu.level == 1) {
-    if (menu.parent.popup) {
-      if (menu.parent.popup == "ToolbarButton") {
-        return 20;
-      }
-      else if (menu.parent.popup == "SheetSelector") {
-       return 16;
+      if (wasActive) {
+        xxx_tobagoMenuSwitchOff(menuBar);
+      } else {
+        xxx_tobagoMenuSwitchOn(menuBar, $(this));
       }
-    }
-
-    if (dojo.byId(menu.parent.menubarId).className.match(/tobago-menuBar-page-facet/)) {
-      return 23;
-    }
-    else {
-      return 20;
-    }
-  }
-  else {
-    return 20;
-  }
-}
-
-function getSeparatorHeight() {
-  return 20;
-}
-
-function getMenuArrowWidth() {
-  return 20;
-}
-
-function getPopupMenuWidth() {
-  return 21;
-}
-
-function getPopupImageTop(popup) {
-  if (popup == "ToolBarButton") {
-    return "2px";
-  }
-  else if (popup == "SheetSelector") {
-    return "0px";
-  }
-  else {
-    LOG.debug("unbekanter Popup Typ :" + popup);
-    return "0px";
-  }
-}
-
-function getSheetSelectorMenuTopOffset() {
-  return -1;
-}
-
-function menuCheckToggle(id) {
-  var element = document.getElementById(id);
-  var form = document.forms[0];
-  if (element) {
-    //LOG.debug("remove  " + id);
-    form.removeChild(element);
-  }
-  else {
-    //LOG.debug("adding " + id);
-    element = document.createElement('INPUT');
-    element.type = 'hidden';
-    element.name = id;
-    element.id = id;
-    element.value = 'true';
-    form.appendChild(element);
-  }
-}
-
-function menuSetRadioValue(id, value) {
-  var element = document.getElementById(id);
-  if (! element) {
-    element = document.createElement('INPUT');
-    element.type = 'hidden';
-    element.name = id;
-    element.id = id;
-    document.forms[0].appendChild(element);
-  }
-  element.value = value;
-}
-
-function tobagoMenuFocus(event) {
-  //("tobagoMenuFocus" );
-  if (! event) {
-    event = window.event;
-  }
-  var element = Tobago.element(event);
-  element.parentNode.menuItem.onFocus();
-}
-function tobagoMenuBlur(event) {
-  //LOG.debug("tobagoMenuBlur" );
-
-  if (! event) {
-    event = window.event;
-  }
-  var element = Tobago.element(event);
-  element.parentNode.menuItem.onBlur();
-}
-
-function tobagoMenuDown(event) {
-  var element = Tobago.element(event);
-  element.parentNode.menuItem.keyDown();
-}
-function tobagoMenuUp(event) {
-  var element = Tobago.element(event);
-  element.parentNode.menuItem.keyUp();
-}
-function tobagoMenuLeft(event) {
-  var element = Tobago.element(event);
-  element.parentNode.menuItem.keyLeft();
-}
-function tobagoMenuRight(event) {
-  var element = Tobago.element(event);
-  element.parentNode.menuItem.keyRight();
-}
-
-function tobagoMenuItemCollapse(event) {
-  var element = Tobago.element(event);
-  element.parentNode.menuItem.collapse();
-}
-
-
-
-// mozilla can't cancel default action at keydown event
-// ie can't see up/down/... in keypress event
-// so both handlers are installed but only one should do the action
-function tobagoMenuKeyPress(event) {
-  if (event.stopPropagation) { // mozilla event
-    tobagoMenuHandelKey(event);
-  }
-}
-
-function tobagoMenuKeyDown(event) {
-  if (!event || !event.stopPropagation) { // ! mozilla event
-    tobagoMenuHandelKey(window.event);
-  }
-}
 
-function tobagoMenuHandelKey(event) {
-  var cancel;
-  var code;
-  if (event.which) {
-    code = event.which;
-  } else {
-    code = event.keyCode;
-  }
-
-  if (code == 27) {  // ESC
-    tobagoMenuItemCollapse(event);
-  }
-  else if (code == 37) { // left
-    tobagoMenuLeft(event);
-    cancel = true;
-  }
-  else if (code == 38) { // up
-    tobagoMenuUp(event);
-    cancel = true;
-  }
-  else if (code == 39) { // right
-    tobagoMenuRight(event);
-    cancel = true;
-  }
-  else if (code == 40) { // down
-    tobagoMenuDown(event);
-    cancel = true;
-  }
-
-  if (cancel) {
-    event.returnValue = false;
-    event.cancelBubble = true;
-    if (event.preventDefault) {
-      event.preventDefault();
-    }
-    if (event.stopPropagation) {
       event.stopPropagation();
-    }
-  }
-}
-
-
 
-// ----------------------------------------------------------------------------
-function getFocusLostTimeout() {
-  return 0;
-}
-function getOpenSubMenusTimeout() {
-  return 0;
-}
-
-function tobagoOpenSubMenus(id) {
-  document.getElementById(id).menuItem.openSubMenus();
-}
-function tobagoFocusLost(id) {
-  document.getElementById(id).menuItem.focusLost();
+    });
+  });
 }
 
-function tobagoMenuItemOnmouseover(element) {
-  element.menuItem.onMouseOver();
-}
-function tobagoMenuItemOnmouseout(element, clicked) {
-  element.menuItem.onMouseOut(clicked);
-}
-/*
-function tobagoMenuItemOnfocus(element) {
-  LOG.debug("tobagoMenuItemOnfocus " + element.id);
-  element.menuItem.onFocus();
-}
-function tobagoMenuItemOnblur(element) {
-  LOG.debug("tobagoMenuItemOnblur " + element.id);
-  element.menuItem.onBlur();
-}
-*/
-function tobagoMenuOpenMenu(element, event) {
-  if (event) {
-    Tobago.stopEventPropagation(event);
-  }
-  element.menuItem.openMenu();
-}
-function tobagoButtonOpenMenu(button, idPrefix) {
-  var menu = Tobago.element(idPrefix + Tobago.SUB_COMPONENT_SEP
-      + Tobago.Menu.MENU_ROOT_ID + Tobago.SUB_COMPONENT_SEP + 0);
-  if (menu) {
-    menu.menuItem.setMenuButton(button);
-    tobagoMenuOpenMenu(menu);
-  }
-}
-
-function tobagoSetSubMenuContainerVisible(id){
-  document.getElementById(id).menuItem.setSubMenuContainerVisibility("visible");
-}
+xxx_tobagoMenuInit();

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Fri Dec  4 16:04:42 2009
@@ -27,14 +27,23 @@
 }
 
 form {
-  margin: 0px;
+  margin: 0;
 }
 
-/* this ist for ie6 to prevent scrollbars where none are needed */
-html {
-  overflow: auto;
+/*
+  This is to make the menu bar to be always at the top of the page.
+  The "position: fixed;" doesn't work with ie6 and makes 
+  on other browsers problems, when clicking the menu (the scroll panel scrolls then).
+*/
+html, body {
+  height: 100%;
+  width: 100%;
+  padding: 0;
+  margin: 0;
+  overflow: hidden;
 }
 
+
 /* Tab ------------------------------------------------------------------ */
 
 .tobago-tab-link {
@@ -46,13 +55,13 @@
 
 div.tobago-tab-selected-outer {
   border-color: #ddeeff #778899 #ddeeff #ddeeff;
-  border-width: 0.13ex 0.13ex 0px 0.13ex;
+  border-width: 0.13ex 0.13ex 0 0.13ex;
   border-style: solid;
   padding: 0.2ex 0.2em;
 }
 
 div.tobago-tab-selected-inner {
-  margin: 0px 0.7em;
+  margin: 0 0.7em;
   white-space: nowrap;
 }
 
@@ -63,19 +72,19 @@
 }
 
 div.tobago-tab-unselected-inner {
-  margin: 0px 0.7em;
+  margin: 0 0.7em;
   white-space: nowrap;
 }
 
 div.tobago-tab-fulfill {
   border-color: #ddeeff;
-  border-width: 0px 0px 1px 0px;
+  border-width: 0 0 1px 0;
   border-style: solid;
 }
 
 td.tobago-tab-content {
   border-color: #ddeeff #778899 #778899 #ddeeff;
-  border-width: 0px 1px 1px 1px;
+  border-width: 0 1px 1px 1px;
   border-style: solid;
   padding: 11px 11px;
 }
@@ -85,8 +94,8 @@
   border-bottom-style: solid;
   border-bottom-width: 1px;
   height: 25px;
-  top: 0px;
-  margin-right: 0px;
+  top: 0;
+  margin-right: 0;
   position: absolute;
 }
 
@@ -99,13 +108,13 @@
 
 img.tobago-progress-color1 {
   background: #aabbcc;
-  border-width: 1px 0px 1px 1px;
+  border-width: 1px 0 1px 1px;
   height: 1.4ex;
 }
 
 img.tobago-progress-color2 {
   background: #ddeeff;
-  border-width: 1px 1px 1px 0px;
+  border-width: 1px 1px 1px 0;
   height: 1.4ex;
 }
 
@@ -149,7 +158,7 @@
 
 .tree-item img {
   vertical-align: middle;
-  border: 0px;
+  border: 0;
 }
 
 .tree-icon {
@@ -166,8 +175,8 @@
 
 .tobago-tree-default {
   overflow: auto;
-  padding: 0px;
-  margin: 0px;
+  padding: 0;
+  margin: 0;
   font: icon;
   color: black;
   white-space: nowrap;
@@ -175,7 +184,7 @@
 
 .tobago-treeNode-default img {
   vertical-align: middle;
-  border: 0px;
+  border: 0;
 }
 
 .tobago-treeNode-default a, .tobago-treeNode-default a:active, .tobago-treeNode-default a:hover {
@@ -307,33 +316,28 @@
 /* gridLayout -------------------------------------------------------------- */
 
 .tobago-gridLayout-default {
-  border-spacing: 0px;
-  padding: 0px;
-  margin: 0px;
+  border-spacing: 0;
+  padding: 0;
+  margin: 0;
 }
 
 .tobago-gridLayout-cell-td {
-  border-spacing: 0px;
-  padding: 0px;
-  margin: 0px;
+  border-spacing: 0;
+  padding: 0;
+  margin: 0;
 }
 
 div.tobago-gridLayout-default {
-  padding-bottom: 0px;
-  padding-right: 0px;
-/* XXX was changed from 5px */
-  padding-left: 0px;
-/* XXX was changed from 5px */
-  padding-top: 0px;
+  padding: 0;
   overflow: hidden;
 }
 
 div.tobago-gridLayout-first-row {
-  padding-top: 0px;
+  padding-top: 0;
 }
 
 div.tobago-gridLayout-first-column {
-  padding-left: 0px;
+  padding-left: 0;
 }
 
 /* box ---------------------------------------------------------------- */
@@ -357,8 +361,8 @@
 
 .tobago-box-toolbar-span {
   position: absolute;
-  top: 0px;
-  right: 0px;
+  top: 0;
+  right: 0;
   border: 2px groove #f6faff;
   background: #bbccdd; /*  font-size: 22px; */
   white-space: nowrap;
@@ -373,7 +377,7 @@
 }
 
 a.tobago-label-markup-number {
-  padding-left: 0px;
+  padding-left: 0;
   padding-right: 8px;
   
 }
@@ -407,7 +411,7 @@
 
 label.tobago-label-inline {
   width: auto;
-  padding-left: 0px;
+  padding-left: 0;
 }
 
 /* selectBooleanCheckbox --------------------------------------------------- */
@@ -532,11 +536,17 @@
 }
 
 /* page -------------------------------------------------------------------- */
+
 .tobago-page-default {
   background: #bbccdd;
   font-family: arial, helvetica, sans-serif; /*  font-size: 14px;*/
-  padding: 0px;
-  margin: 0px;
+  padding: 0;
+  margin: 0;
+  width: 100%;
+  top: 0;
+  left: 0;
+  overflow: auto;
+  position: absolute;
 }
 
 /* popup-------------------------------------------------------------- */
@@ -546,8 +556,8 @@
   width: 100%;
   height: 100%;
   position: absolute;
-  top: 0px;
-  left: 0px; /*background: url(../../standard/image/popupBg.png);*/
+  top: 0;
+  left: 0; /*background: url(../../standard/image/popupBg.png);*/
   opacity: .40;
   background: url( ../image/popupBg.png );
   filter: alpha( opacity = 40 );
@@ -562,13 +572,13 @@
   position: absolute;
   width: 100%;
   height: 100%;
-  top: 0px;
-  left: 0px;
+  top: 0;
+  left: 0;
   filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);
 }
 
 .tobago-popup-content {
-  border-width: 0px;
+  border-width: 0;
   background: #bbccdd;
   position: absolute;
   cursor: default;
@@ -585,8 +595,8 @@
 
 .tobago-popup-parent {
   position: absolute;
-  top: 0px;
-  left: 0px;
+  top: 0;
+  left: 0;
 }
 
 /* richTextEditor ---------------------------------------------------------- */
@@ -604,7 +614,7 @@
   padding-top: 4px;
   padding-bottom: 4px;
   padding-left: 1px;
-  padding-right: 0px; /*  font: 12px arial, helvetica, sans-serif;*/
+  padding-right: 0; /*  font: 12px arial, helvetica, sans-serif;*/
 }
 
 .tobago-richTextEditor-toolbar-button-span-enabled, .tobago-richTextEditor-toolbar-button-span-disabled {
@@ -637,7 +647,7 @@
   border-right: 2px solid #f6f2f6;
   border-top: 2px solid #7b7d7b;
   border-bottom: 2px solid #f6f2f6;
-  margin: 0px;
+  margin: 0;
   background: #ffffff;
   height: 75px;
 }
@@ -678,7 +688,7 @@
   background: #ffffff;
   color: #000000;
   overflow: auto;
-  margin: 0px;
+  margin: 0;
 }
 
 .tobago-textArea-readonly {
@@ -743,8 +753,8 @@
   width: 250px;
   background-color: white;
   border: 1px solid #888;
-  margin: 0px;
-  padding: 0px;
+  margin: 0;
+  padding: 0;
   z-index: 5;
   box-sizing: border-box;
   -moz-box-sizing: border-box;
@@ -760,8 +770,8 @@
 
 .tobago-in-suggest-popup ul {
   list-style-type: none;
-  margin: 0px;
-  padding: 0px;
+  margin: 0;
+  padding: 0;
 }
 
 /* date ---------------------------------------------------------------------- */
@@ -775,7 +785,7 @@
   border-color: #bbccdd;
   border-style: inset;
   border-width: 2px;
-  margin: 0px;
+  margin: 0;
 }
 
 .tobago-date-required {
@@ -807,7 +817,7 @@
 /* object ------------------------------------------------------------------ */
 
 .tobago-object-default {
-  border: 0px solid black;
+  border: 0 solid black;
 }
 
 /* separator ------------------------------------------------------------------- */
@@ -890,6 +900,7 @@
 }
 
 /* Toolbar ----------------------------------------------------------------- */
+
 .tobago-toolBar-default {
   border: 2px groove #f6faff;
   position: relative;
@@ -903,7 +914,7 @@
 }
 
 .tobago-toolbar-orientation-right {
-  right: 0px;
+  right: 0;
   position: absolute;
 }
 
@@ -916,7 +927,7 @@
   padding-bottom: 2px;
   padding-left: 5px;
   margin: 1px;
-  border: 0px solid #bbccdd;
+  border: 0 solid #bbccdd;
   box-sizing: border-box;
   -moz-box-sizing: border-box;
 }
@@ -936,7 +947,7 @@
 
 .tobago-toolBar-button-selected-enabled {
   cursor: pointer;
-  margin: 0px;
+  margin: 0;
   border-right: 1px solid #ddeeff;
   border-left: 1px solid #6688aa;
   border-bottom: 1px solid #ddeeff;
@@ -946,7 +957,7 @@
 
 .tobago-toolBar-button-box-facet-selected-enabled {
   cursor: pointer;
-  margin: 0px;
+  margin: 0;
   border-right: 1px solid #ddeeff;
   border-left: 1px solid #6688aa;
   border-bottom: 1px solid #ddeeff;
@@ -975,8 +986,8 @@
   position: relative;
   width: 20px;
   height: 20px;
-  top: 0px;
-  left: 0px; /*  background: yellow;*/
+  top: 0;
+  left: 0; /*  background: yellow;*/
 }
 
 /*
@@ -984,7 +995,7 @@
     should have the same content, but needs different names !
 */
 .tobago-toolBar-button-hover {
-  margin: 0px;
+  margin: 0;
   border-left: 1px solid #ddeeff;
   border-right: 1px solid #6688aa;
   border-top: 1px solid #ddeeff;
@@ -993,7 +1004,7 @@
 }
 
 .tobago-toolBar-button-menu-focus {
-  margin: 0px;
+  margin: 0;
   border-left: 1px solid #ddeeff;
   border-right: 1px solid #6688aa;
   border-top: 1px solid #ddeeff;
@@ -1037,135 +1048,81 @@
   padding-left: 5px;
 }
 
-/* MenuBar ------------------------------------------------------------------ */
-.tobago-menuBar-default {
-  height: 24px;
-  border: 2px groove #f6faff;
-  position: relative;
-  top: 0px;
-  left: 0px;
-  background: #bbccdd;
-  -moz-box-sizing: border-box;
-  box-sizing: border-box;
-}
-
-.tobago-menuBar-page-facet {
-  height: 27px;
-}
+/* MenuBar, Menu, etc. ------------------------------------------------------------------ */
 
-.tobago-menuBar-item-page-facet {
-  font: inherit;
-}
-
-.tobago-menuBar-container {
-  width: 10px;
-  height: 10px;
-  position: absolute;
-  font: inherit;
-  /* top and left are set from script on the client */
-  -moz-box-sizing: border-box;
-  box-sizing: border-box;
+.tobago-menuBar-default, .tobago-menuBar-default a:link, .tobago-menuBar-default a:visited, .tobago-menuBar-default a:active {
+  color: black;
+  font-family: arial, helvetica, sans-serif;
+  font-size: 12px;
+  font-size-adjust: none;
+  font-style: normal;
+  font-variant: normal;
+  font-weight: normal;
+  line-height: normal;
+  text-decoration: none;
 }
 
-.tobago-menuBar-submenuroot {
-    top: 0px;
-    left: 0px;
-    position: absolute;
-    width: 0px;
-    height: 0px;
-    overflow: visible;
- }
-
-.tobago-menuBar-container-ToolbarButton {
-  width: 20px;
-  height: 20px;
-  display: inline;
+.tobago-menuBar-default li {
+  background-color: #aabbcc;
+  list-style: none outside none;
 }
 
-.tobago-menuBar-subitem-container {
-  border: 2px groove #f6faff;
-  position: absolute;
-  padding: 0px;
-  background: #bbccdd;
-  z-index: 1000;
-  overflow: visible;
-  visibility: hidden;
-  -moz-box-sizing: border-box;
-  box-sizing: border-box;
-
+li.tobago-menu-selected {
+  background-color: #d8e9fb;
 }
 
-.tobago-menu-item, .tobago-menu-item-separator {
-  visibility: inherit;
-  overflow: auto; /* this MUST be auto (is needed and overwritten in javascript ) */
-  height: 20px;
+.tobago-menuBar-default {
+  padding: 0;
+  margin: 0;
+  border-bottom-width: 1px;
+  border-bottom-style: solid;
+  border-bottom-color: #6688aa;
+  height: 18px;
+  left: 0;
+  top: 0;
   position: absolute;
-  padding: 0px;
-  padding-left: 5px;
-  padding-right: 0px;
-  z-index: 1000;
-  white-space: nowrap;
-  -moz-box-sizing: border-box;
-  box-sizing: border-box;
-
-}
-
-.tobago-menuBar-separator  {
-  width: 90%;
-  margin-top: 0px;
-  margin-bottom: 0px;
-  padding-top: 0px;
-  padding-bottom: 0px;
-}
-
-.tobago-menu-item-hover {
-  background: #ccddee;
-}
-.tobago-menu-item-focus {
-  background: #ccddee;
+  width: 100%;
+  background-color: #aabbcc;
+  z-index: 1000; /* todo */
 }
 
-
-.tobago-menuBar-item-span {
+.tobago-menuBar-default ol {
+  padding: 0;
+  margin: 0;
+  border-width: 1px;
+  border-style: solid;
+  border-color: #888888;
+  visibility: hidden;
   position: absolute;
-  top: 0px;
-  left: 20px;
-  text-decoration: none;
 }
 
-.tobago-menuBar-item-span-enabled {
-  color: #000000;
-}
-
-.tobago-menuBar-item-span-disabled {
-  color: #888888;
-}
-
-.tobago-menuBar-item-span-top {
-  left: 0px;
-  padding-right: 5px;
-  padding-left: 5px;
+.tobago-menu-top {
+  float: left;
+  white-space: nowrap;
+  padding: 2px 3px 2px 5px;
 }
 
-.tobago-menuBar-item-page-top {
-  top: 2px;
+.tobago-menu-parent {
+  white-space: nowrap;
+  padding: 2px 3px 2px 25px; 
+  background-repeat: no-repeat; /* prepare for images via element style */
+  background-position: 5px center;
 }
 
-.tobago-menu-item-image {
-  position: absolute;
-  top: 0px;
-  left: 0px;
-  width: 20px;
-  height: 20px;
+.tobago-menuSeparator-default {
+  padding: 2px 3px 2px 5px;
+  display: block;
+  position: static;
 }
 
-.tobago-menu-subitem-arrow {
-  float: right;
-  width: 20px;
-  height: 20px;
+.tobago-menuSeparator-default hr {
+  margin: 3px 0;
+  border-width: 1px 0 0 0;
+  border-style: solid;
 }
 
 /* Sheet ------------------------------------------------------------------ */
+
 .tobago-sheet-outer-div {
   overflow: hidden;
   position: relative;
@@ -1177,10 +1134,10 @@
   height: 20px;
   width: 100%;
   overflow: hidden;
-  padding: 0px 0px 0px 0px;
+  padding: 0 0 0 0;
   position: absolute;
-  left: 0px;
-  top: 0px;
+  left: 0;
+  top: 0;
   white-space: nowrap;
   z-index: 2;
   box-sizing: border-box;
@@ -1189,9 +1146,9 @@
 }
 
 .tobago-sheet-header-table {
-  padding: 0px 0px 0px 0px;
+  padding: 0 0 0 0;
   width: 100%;
-  border: 0px solid black;
+  border: 0 solid black;
 }
 
 .tobago-sheet-header-box{
@@ -1204,7 +1161,7 @@
 	vertical-align: top;
 	display: inline;
 	height: 100%;
-	padding: 0px;
+	padding: 0;
 	text-overflow: ellipsis;
 
 }
@@ -1213,7 +1170,7 @@
 	background-color: #bbccdd;
 	height: 100%;
 	overflow: hidden;
-	padding: 0px 5px;
+	padding: 0 5px;
 	text-overflow: ellipsis;
 	white-space: nowrap;
 	width: 100%;
@@ -1237,7 +1194,7 @@
 	height: 100%;
 	overflow: hidden;
 	right: -5px;
-	top: 0px;
+	top: 0;
 	width: 10px;
 }
 
@@ -1250,7 +1207,7 @@
 	height: 100%;
 	overflow: hidden;
 	right: 5px;
-	top: 0px;
+	top: 0;
 	width: 8px;
 }
 
@@ -1258,14 +1215,14 @@
   overflow: auto;
   padding-top: 20px;
   position: absolute;
-  left: 0px;
-  top: 0px;
+  left: 0;
+  top: 0;
   background: #ebf4fd;
 }
 
 .tobago-sheet-cell-td {
-  padding-left: 0px;
-  padding-right: 0px;
+  padding-left: 0;
+  padding-right: 0;
   vertical-align: top;
 }
 
@@ -1307,8 +1264,8 @@
 .tobago-sheet-footer {
   z-index: 1000;
   position: absolute;
-  left: 0px;
-  top: 0px;
+  left: 0;
+  top: 0;
   text-align: center;
   overflow: hidden;
   box-sizing: border-box;
@@ -1317,22 +1274,22 @@
 
 .tobago-sheet-paging-span-left {
   position : absolute;
-  top: 0px;
-  left: 0px;
+  top: 0;
+  left: 0;
 }
 .tobago-sheet-paging-span-center {
 
 }
 .tobago-sheet-paging-span-right {
   position : absolute;
-  top: 0px;
-  right: 0px;
+  top: 0;
+  right: 0;
 }
 
 .tobago-sheet-paging-input {
   width: 30px;
   height: 20px;
-  padding-top: 0px;
+  padding-top: 0;
   text-align: center;
   vertical-align: top;
 

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/mozilla/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/mozilla/style/style.css?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/mozilla/style/style.css (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/mozilla/style/style.css Fri Dec  4 16:04:42 2009
@@ -15,12 +15,13 @@
  * limitations under the License.
  */
 
-/* in ---------------------------------------------------------------------- */
+/* date ---------------------------------------------------------------------- */
+
 .tobago-date-default  {
   margin-top: 0px;
 }
 
-/* - Label ------------------------------------------------------------------ */
+/* label ------------------------------------------------------------------ */
 
 label.tobago-label-default  {
   margin-top: 0px;
@@ -31,8 +32,6 @@
   border-bottom: 0px solid transparent;
 }
 
-/* in ---------------------------------------------------------------------- */
-
 .tobago-label-default  {
   padding-top: 0px;
 }
@@ -41,7 +40,6 @@
   padding-top: 1px;
 }
 
-
 /* selectManyListbox ------------------------------------------------------- */
 
 .tobago-selectManyListbox-default  {
@@ -62,8 +60,8 @@
   height: 12px;
 }
 
-/* Sheet -------------------------------------------------------- */
+/* sheet -------------------------------------------------------- */
+
 .tobago-sheet-header-box {
 	height: 19px;
 }
-

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/msie/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/msie/property/tobago-theme-config.properties?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/msie/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/msie/property/tobago-theme-config.properties Fri Dec  4 16:04:42 2009
@@ -17,8 +17,6 @@
 
 Box.paddingHeight=11
 
-MenuBar.fixedHeight=19
-
 SelectManyListbox.fixedHeight=21
 #SelectOneChoice.fixedHeight=21
 File.fixedHeight=24

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/msie/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/msie/style/style.css?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/msie/style/style.css (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/msie/style/style.css Fri Dec  4 16:04:42 2009
@@ -42,14 +42,6 @@
    color: #660000;
 }
 
-/* MenuBar -------------------------------------------------------- */
-.tobago-menuBar-separator  {
-  width: 100%;
-  position: relative;
-  top: -4px;
-  left: -2px;
-}
-
 /* Sheet -------------------------------------------------------- */
 .tobago-sheet-paging-input {
 

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties Fri Dec  4 16:04:42 2009
@@ -60,8 +60,6 @@
 In.css.padding-right=2
 In.css.padding-bottom=2
 
-MenuBar.fixedHeight=17
-
 Label.fixedWidth=120
 Label.preferredWidth=120
 

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css?rev=887243&r1=887242&r2=887243&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css Fri Dec  4 16:04:42 2009
@@ -52,13 +52,6 @@
 
 }
 
-/*-- Menu --------------------------------------------------------------------*/
-
-td.menu {
- height: 100%;
- background: #c1bebe url(../image/nav_bg.gif) repeat-y right;
-}
-
 /*-- Popup ------------------------------------------------------------------ */
 .tobago-popup-content  {
   background: #E2E2E2;
@@ -769,96 +762,23 @@
   color: #660000;
 }
 
-/* MenuBar -------------------------------------------------------- */
-.tobago-menuBar-default {
-  height: 17px;
-  border: 1px solid gray;
-  background: #dddddd;
-}
-
-.tobago-menuBar-page-facet {
-  height: 22px;
-}
-
-.tobago-menuBar-item-page-facet {
-  font: bold 12px arial, helvetica, sans-serif;
-}
-
-.tobago-menuBar-container {
-  font: normal 12px arial, helvetica, sans-serif;
-}
+/* menuBar -------------------------------------------------------- */
 
-.tobago-menuBar-subitem-container {
-  border: 1px solid gray;
-  background: #dddddd;
-  z-index: 1000;
+.tobago-menuBar-default li {
+  background-color: #dddddd;
 }
 
-.tobago-menu-item {
-  height: 18px;
-  z-index: 1000;
+li.tobago-menu-selected {
+  background-color: #bbbbbb;
 }
 
-.tobago-menu-item-separator {
-  height: 8px;
-  z-index: 1000;
-}
-
-.tobago-menu-item-hover {
-  background: #bbbbbb;
-}
-
-.tobago-menu-item-focus {
-  background: #bbbbbb;
-}
-
-.tobago-menuBar-item-span {
-  left: 20px;
-  text-decoration: none;
-}
-
-.tobago-menuBar-item-span-enabled {
-}
-
-.tobago-menuBar-item-span-disabled {
-  color: #888888;
-}
-
-.tobago-menuBar-item-span-top {
-  left: 0px;
-}
-
-.tobago-menuBar-item-page-top {
-  top: 3px;
-}
-
-.tobago-menu-item-image {
-  width: 16px;
-  height: 16px;
-  position: absolute;
-  top: 1px;
-  left: 1px
-}
-
-.tobago-menu-subitem-arrow {
-  width: 16px;
-  height: 16px;
-}
-
-.tobago-toolBarButton-menu-item {
-  padding-top: 2px;
-  background: red;
+.tobago-menuBar-default {
+  border-bottom-color: #808080;
+  background-color: #dddddd;
 }
 
-.tobago-menuBar-separator {
-  width: 100%;
-  position: relative;
-  top: 3px;
-  left: -3px;
-  border-top: 1px solid #E2E2E2;
-  border-right: 1px solid #E2E2E2;
-  border-bottom: 1px solid gray;
-  border-left: 1px solid #E2E2E2;
+.tobago-menuBar-default ol {
+  border-color: #888888;
 }
 
 /* separator ------------------------------------------------------------------- */