rem: top.editorShell.InsertElement(cssElement,true); 
add: try { top.editorShell.InsertElementAtSelection(cssElement,true); } catch (e) { dump("Exception occured in InsertElementAtSelection\n"); } 
context: function EditorInsertCSSFile(url){    var cssElement = top.editorShell.CreateElementWithDefaults("link");    // TODO: do some smartass string parsing to find relative file    //       location so we don't need this big chunky URLs..     //       must utilize document dirty flag.    cssElement.setAttribute("href",url);    cssElement.setAttribute("type","text/css");        cssElement.setAttribute("rel","stylesheet");        top.editorShell.InsertElement(cssElement,true);}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/711c0f72c9655c2558d43bb716847f1a294b8372/sb-FileWidgetFileHandler.js/clean/editor/ui/composer/content/sb-FileWidgetFileHandler.js