Dynamically Call Javascript / CSS

Call a javascript within another javascript
load CSS by calling a function

function loadCssFile(filename){
var filepath = SERVER_CSS_PATH1 + filename;
var fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")
fileref.setAttribute("href", filepath)

if (typeof fileref!="undefined")
document.getElementsByTagName("head")[0].appendChild(fileref)
}

function loadJsFile(filename){
var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src", filename)
}