if(eventHide.startsWith("on")){
eventHide = eventHide.substring(2);
}
Map<JSReference, Object> eventsMap = new HashMap<JSReference, Object>();
eventsMap.put(new JSReference("showEvent"), eventShow);
eventsMap.put(new JSReference("hideEvent"), eventHide);
eventsMap.put(new JSReference("delay"), new Integer(toolTip.getShowDelay()));
eventsMap.put(new JSReference("hideDelay"), new Integer(toolTip.getHideDelay()));
JSFunction function = AjaxRendererUtils.buildAjaxFunction(component, context);
JSReference ref = new JSReference("ajaxOptions");
function.addParameter(ref);
String ajaxFunc = function.toScript();
Map<String, Object> ajaxOptions = buildEventOptions(context, toolTip, targetClientId);
ajaxOptions.putAll(getParamsMap(context, toolTip));
JSFunctionDefinition completeFunc = getUtils().getAsEventHandler(context, component, "oncomplete", "; return true;");
JSFunctionDefinition hideFunc = getUtils().getAsEventHandler(context, component,"onhide", "; return true;");
JSFunctionDefinition showFunc = getUtils().getAsEventHandler(context, component,"onshow", "; return true;");
Map<JSReference, Object> funcMap = new HashMap<JSReference, Object>();
funcMap.put(new JSReference("oncomplete"), completeFunc);
funcMap.put(new JSReference("onhide"), hideFunc);
funcMap.put(new JSReference("onshow"), showFunc);
ret.append("new ToolTip(" + ScriptUtils.toScript(eventsMap)).append(comma).append(ScriptUtils.toScript(funcMap))
.append(comma).append(quot).append( toolTip.getClientId(context)).append(quot).append(comma).
append(quot).append(targetClientId).append(quot).append(comma).