	_scriptName = "/js/public/mapfacade/MapFacade.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/openlayers/OpenLayers.js",
            "util/openlayers/proj4js/lib/proj4js.js",
            "util/openlayers/proj4js/lib/defs/EPSG900913.js",
            "util/openlayers/proj4js/lib/defs/EPSG23029.js",
            "util/openlayers/proj4js/lib/defs/EPSG4302.js",
            "util/openlayers/proj4js/lib/projCode/utm.js",
            "util/openlayers/proj4js/lib/projCode/merc.js",
            "util/openlayers/proj4js/lib/projCode/tmerc.js",
            "mapfacade/openlayershacks/LayerSwitcher.js",
            "mapfacade/openlayershacks/LoadingPanel.js",
            "mapfacade/openlayershacks/Google.js",
            "mapfacade/openlayershacks/Util.js",
            "public/mapfacade/PlainMapFacade.js",
            "public/mapfacade/MarcarUnicoPunto.js",
            "public/mapfacade/MarcarWKT.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(""));
    }