//emulated version
Element newElement = element.getDOMFactory().createElement();
newElement.setName("script");
newElement.setAttribute("type","text/javascript");
newElement.insertAfter(element);
Text scriptContent = element.getDOMFactory().createText();
String cornersScript = "Widget.addStartupItem(function(){Widget.register('"+ widgetID +"',new Widget.Corners('" + widgetID + "', [";
cornersScript += "[";
if(topLeftRadius != null) {
cornersScript += "'" + ((StylePair)topLeftRadius).getFirst().getStandardCSS() + "'";
cornersScript += ",'" + ((StylePair)topLeftRadius).getSecond().getStandardCSS() + "'";
}
cornersScript += "]";
cornersScript += ",[";
if(topRightRadius != null) {
cornersScript += "'" + ((StylePair)topRightRadius).getFirst().getStandardCSS() + "'";
cornersScript += ",'" + ((StylePair)topRightRadius).getSecond().getStandardCSS() + "'";
}
cornersScript += "]";
cornersScript += ",[";
if(bottomRightRadius != null) {
cornersScript += "'" + ((StylePair)bottomRightRadius).getFirst().getStandardCSS() + "'";
cornersScript += ",'" + ((StylePair)bottomRightRadius).getSecond().getStandardCSS() + "'";
}
cornersScript += "]";
cornersScript += ",[";
if(bottomLeftRadius != null) {
cornersScript += "'" + ((StylePair)bottomLeftRadius).getFirst().getStandardCSS() + "'";
cornersScript += ",'" + ((StylePair)bottomLeftRadius).getSecond().getStandardCSS() + "'";
}
cornersScript += "]";
cornersScript += "]))});";
scriptContent.append(cornersScript);
newElement.addHead(scriptContent);
//set startup onload body element
setScriptStartup(body);
}