$.loadJS = function(url,callback,charset)
    {
        var script = document.createElement('script');
        script.onload = script.onreadystatechange = function ()
        {
            if (script && script.readyState && /^(?!(?:loaded|complete)$)/.test(script.readyState)) return;
            script.onload = script.onreadystatechange = null;
            script.src = '';
            script.parentNode.removeChild(script);
            script = null;
            if(callback)callback();
        };
        script.charset=charset || document.charset || document.characterSet;
        script.src = url;
        try {
            document.getElementsByTagName("head")[0].appendChild(script);
        } catch (e) {}
    }
    
$.loadCSS = function(url, callback) {
    var head = document.getElementsByTagName("head")[0];
    var css = document.createElement('link');
    css.setAttribute('rel', 'stylesheet');
    css.setAttribute('type', 'text/css');
    css.setAttribute('href', url);

    if (head.innerHTML.search(url) == -1) {
        head.appendChild(css);
    }
    
    if (callback)callback();
}