String evt = (String) component.getAttributes().get("event");
if(evt == null || evt.trim().length() == 0){
evt = "onmouseover";
}
function.addParameter(evt);
ScriptOptions subMenuOptions = new ScriptOptions(component);
subMenuOptions.addEventHandler("onopen");
subMenuOptions.addEventHandler("onclose");
subMenuOptions.addOption("direction");
subMenuOptions.addOption("highlightParent", Boolean.TRUE);
function.addParameter(subMenuOptions);
function.appendScript(buffer);
} else {
buffer.append(".");
function = new JSFunction("asDropDown");
function.addParameter(component.getClientId(context));
function.addParameter(component.getClientId(context) + "_span");
String evt = (String) component.getAttributes().get("event");
if(evt == null || evt.trim().length() == 0){
evt = "onmouseover";
}
function.addParameter(evt);
function.addParameter("onmouseout");
ScriptOptions menuOptions = new ScriptOptions(component);
menuOptions.addOption("direction");
menuOptions.addOption("jointPoint");
menuOptions.addOption("verticalOffset");
menuOptions.addOption("horizontalOffset");
menuOptions.addEventHandler("oncollapse");
menuOptions.addEventHandler("onexpand");
menuOptions.addEventHandler("onitemselect");
menuOptions.addEventHandler("ongroupactivate");
menuOptions.addOption("disabled");
function.addParameter(menuOptions);
function.appendScript(buffer);
}