var loadFile = function(url, fn) {
Aby.loadFileComplete = false;
var doc = document.getElementsByTagName('head')[0];
var js = null;
if (url && url.substring(url.length - 3).toLowerCase() == ".js") {
js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', Aby.loadFileNoCache ? Aby.urlAppend(url,
"nocache=" + new Date().getTime()) : url);
js.setAttribute('originalUrl', url);
doc.appendChild(js);
} else {
js = document.createElement('link');
js.setAttribute('type', 'text/css');
js.setAttribute("rel", "stylesheet");
js.setAttribute('originalUrl', url);
js.setAttribute('href', Aby.loadFileNoCache ? Aby.urlAppend(url,
"nocache=" + new Date().getTime()) : url);
doc.appendChild(js);
}
var flag = false;
try {
if (!Aby.isIE) {
js.onload = function() {
fn(js);
}
} else {
js.onreadystatechange = function() {
if (js.readyState == 'loaded' || js.readyState == 'complete') {
if (typeof fn == "function")
fn(js);
}
}
}
} catch (e) {
}
};