


var __DEBUG__ = false;

var release_sub_path 	= "map/";
var debug_sub_path 		= "map2/";

var sub_path = (__DEBUG__ == true) ? debug_sub_path : release_sub_path;


function System() {}

System.localRun = false;
System.clientPath = "";
System.clientState = null;
System.windowOpener = null;

System.checkPlace = function() {
       this.clientPath = document.URL + "";
       if(this.clientPath.indexOf("file://") == -1)
               this.localRun = false;
       else
               this.localRun = true;
};

System.pathMaker = function(local) {

       if(local == true) {
                // Image uploader form.
                map_upload_form = "img_upload.htm";
                // Nav map url.
                map_nav_url = "map.html";
       } else {
                // By default.
       }
};

System.linkParser = function(url) {
       if(this.clientState == null) this.clientState = new Object;
       if(url.indexOf("auth=") == -1) this.clientState.auth = null;
       else this.clientState.auth = url.replace(/.*auth=(\w*).*/i, "$1");
       if(url.indexOf("mapid=") == -1) this.clientState.mapid = null;
       else this.clientState.mapid = url.replace(/.*mapid=(\w*).*/i, "$1");
       if(url.indexOf("fromeditor") == -1) this.clientState.fromEditor = false;
       else this.clientState.fromEditor = true;
};

/******************* BASE ENTRY *******************/

// Common base.
var map_base = "http://www.okarta.ru/";

// Scripts.
var map_scripts = map_base + "scripts/";

// Map rendering.
map_rendering =  map_scripts + "show.pimg";

// Client map scripts.
var map_base_jsclient = map_base + "jsclient/" + sub_path;

// Image uploader form.
map_upload_form = map_base_jsclient + "img_upload.htm";

// Nav map url.
map_nav_url = map_base_jsclient + "map.html";

// User blog url.
map_blog_url = map_base + "blog.htm";


/*************************************************/


/******************* STATIC ENTRY *******************/

// Common static.
var map_static = "http://static.okarta.ru/";

// Client url.
var map_static_jsclient = map_static + "jsclient/";

// Map data.
var map_static_data = map_static + "map/cache/";
var map_static_public = map_static + "public/";

// Public images.
var map_static_img = map_static_public + "img/";

// Resource url.
var map_resource = map_static_jsclient + "resource/";
var map_resource_map = map_resource + "maps/";

// Image url.
var map_img = map_static + "img/";

// Icons url.
var map_icons = map_img + "icons/";

// Scale image.
var map_scale_url = map_img + "scale.gif";
// Wait image.
var map_cell_loading = map_img + "wait.png";

// Marker url.
map_marker_url = map_img + "marker/";


/****************************************************/

