_scriptName = "/js/util/Util.js";

    _getScriptLocation = function () {
            var scriptLocation = "";
            var scriptName = _scriptName;
         
            var scripts = document.getElementsByTagName('script');
            for (var i = 0; i < scripts.length; i++) {
                var src = scripts[i].getAttribute('src');
                if (src) {
                    var index = src.lastIndexOf(scriptName); 
                    // set path length for src up to a query string
                    var pathLength = src.lastIndexOf('?');
                    if (pathLength < 0) {
                        pathLength = src.length;
                    }
                    // is it found, at the end of the URL?
                    if ((index > -1) && (index + scriptName.length == pathLength)) {
                        scriptLocation = src.slice(0, pathLength - scriptName.length);
                        break;
                    }
                }
            }
            return scriptLocation;
    }
   
    var jsfiles = new Array(
    		
            "util/jquery.js",
            "util/jquery.tools.min.js",
            "util/jquery.simplemodal.js",
            "util/jquery.tabs.js",
            "util/jquery-ui.js",
            "util/thickbox.js",
            "util/ValidateForms.js",
            "util/Parameters.js",
            "util/Confirm.js",
            "util/VentanaFlotante.js",
            "util/Miscelaneas.js",
            "util/jquery.treeview.js",
            "util/GaleriaImaxes.js",
            "util/ParseUrlParameters.js"
    );
        
    var agent = navigator.userAgent;
    var docWrite = (agent.match("MSIE") || agent.match("Safari"));
    if(docWrite) {
        var allScriptTags = new Array(jsfiles.length);
    }
    var host = _getScriptLocation() + "/js/";
    for (var i = 0; i < jsfiles.length; i++) {
        if (docWrite) {
            allScriptTags[i] = "<script src='" + host + jsfiles[i] +
                               "'></script>"; 
        } else {
            var s = document.createElement("script");
            s.src = host + jsfiles[i];
            var h = document.getElementsByTagName("head").length ? 
                       document.getElementsByTagName("head")[0] : 
                       document.body;
            h.appendChild(s);
        }
    }
    if (docWrite) {
        document.write(allScriptTags.join(""));
    }