/* Main Karta24 file
 * $Id: Karta24.js 7 2011-11-30 16:02:39Z guts $
 */

// simple function to load other javascript file
function includeJavascript(file) {
	document.write('<script type="text/javascript" src="' + file + '"></s' + 'cript>');
}

function getScriptLocation() {
	var slocation = '';
	var isOL = new RegExp("(^|(.*?\\/))Karta24.js");
	var scripts = document.getElementsByTagName('script');
	for (var i=0, len=scripts.length; i<len; i++) {
		var src = scripts[i].getAttribute('src');
		if (src) {
			var match = src.match(isOL);
			if(match) {
				slocation = match[1];
				break;
			}
		}
	}
	return slocation;
}

// single global definition of the Karta24 object, with current hostname
var Karta24 = { serverName: window.location.host };

var rootPath = getScriptLocation();

// Include other scripts. Order is important!
includeJavascript( rootPath + 'OpenLayers/OpenLayers.js');
includeJavascript( rootPath + 'Karta24/Util.js');
includeJavascript( rootPath + 'Karta24/KartaMap.js');
includeJavascript( rootPath + 'Karta24/KartaMarker.js');
includeJavascript( rootPath + 'Karta24/KartaVector.js');
includeJavascript( rootPath + 'Karta24/ClickDragFeature.js');


