/*
	ver 3.0 (29.04.2004)
	ver 3.0.1 (10.05.2004) - changed plugin event call for number of parameters
	ver 3.0.2 (18.05.2004) - changed flash player detection line 68
	ver 3.0.3 (27.05.2004) - changed list of query params for main flash object , added qLTI
	ver 3.0.4 (08.07.2004) - qWm in url query params per HxVMap
	ver 3.0.5 (08.07.2004) need version 6_40_ext - added event VMapDblClicked 
	ver 4.0.0 (03.08.2005) - complex cleaning of obsolete functionalities must have 6_44_clear version of VMap.swf
								-	removed BMAP params from seEnvironment
								- modified BMap management ( removoed internal management )
*/
function baseConverter (number,ob,nb,len) {
	if(len > 25) len = 25; 
	if(len == null && nb == 16) len = 6;
	number = number.toUpperCase();
	var list = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var dec = 0;
	for (var i = 0; i <=  number.length; i++) {
		dec += (list.indexOf(number.charAt(i))) * (Math.pow(ob , (number.length - i - 1)));
	}
	number = "";
	var magnitude = Math.floor((Math.log(dec))/(Math.log(nb)));
	for (var i = magnitude; i >= 0; i--) {
		var amount = Math.floor(dec/Math.pow(nb,i));
		number = number + list.charAt(amount); 
		dec -= amount*(Math.pow(nb,i));
	}
	var ret = String('0000000000000000000000000' + number);
	var sLen = ret.length;
	return ret.substring(sLen - len, sLen);
}

function objSerialize(){
	var ret = "";
	var f = 1;
	for	(k in this){
		ret += (f ? "": "#") + this[k];
		f = 0;
	}
	return ret;
}

//not documented queryParameters:
// qURL='<url to the main server location>' (place where main dll is located)
// qPLGS='urlPLG1!namePLG1$...$urlPLGn!namePLGn' (list of plugins to load)
// qHint='url to hint swf' if not present default 'support/PoiHint.swf' is taken
// qActiv= 'url to activity swf' if not present default 'support/Activity.swf' is taken
// qMeasure= 'url to measurer swf' if not present default 'support/Measure.swf' is taken
// pPrint= 'url to Print cover swf' if not present default 'support/PrintCover.swf' is taken
// qLTI=0 | 1 | 2 | 3  ( different layers and spois management ) 
// qWm= 'url to water mark swf' if not present default 'support/wm.swf' is taken
function insertFlashEmbeded(szObjName, szObjFileName, szWrapperName, w, h, queryParam){
	
	var hook = '';
	if(szWrapperName!=null)
	  if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
		  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
		hook += '<script LANGUAGE=VBScript\> \n';
		hook += 'on error resume next \n';
		hook += 'Sub ' + szObjName + '_FSCommand(ByVal command, ByVal args)\n';
		hook += '  Window.status = "'+ szObjName +' :" + command + "->" + args\n';
		hook += '  call ' + szWrapperName + '.DoFSCommand(command, args)\n';
		hook += 'end sub\n';
		hook += '</script\> \n';
	  }else{
		hook += '<SCRIPT LANGUAGE="JavaScript"\> \n';
		hook += 'function ' + szObjName + '_DoFSCommand(command, args){\n';
		hook += 'status = "'+ szObjName +' :" + command + "->" + args;\n';
		hook += szWrapperName + '.DoFSCommand(command, args);\n';
		hook += '}\n';
		hook += '</script\> \n';
	 }
	//alert(hook);
	document.write(hook);
	var line = '<object	classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\n'; 
	line += 'codebase="support/swflash.cab#version=7,0,19,0" \n';
	//line += 'codebase="http://fpdownload.macromedia.com/get/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" \n';
	line += 'id="' + szObjName + '"\n';
	line += 'width="' + w + '" height="' + h + '" align="CENTER">\n';
	line += '<PARAM NAME="Movie" value="' + szObjFileName + (queryParam != null ? '?' + queryParam : '' ) + '">\n';
	line += '<PARAM NAME="Quality" value=high>\n';
	line += '<PARAM NAME="Bgcolor" value=#CCCCCC>\n';
	line += '<embed src="' + szObjFileName + (queryParam != null ? '?' + queryParam : '' ) + '"\n';
	line += 'quality=heigh bgcolor=#CCCCCC width="' + w + '" height="' + h + '" swliveconnect=true\n';
	line += 'name="' + szObjName + '"\n';
	line += 'align="CENTER"\n';
	line += 'type="application/x-shockwave-flash"\n';
	line += 'pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>\n';
	line += '</object>\n';

	document.write(line);
	
}


	var pr = null;
function HxIDNameObject(id, name) {
	this.ID = id;
	this.Name = name;
}
new HxIDNameObject(0, 0);
pr = HxIDNameObject.prototype;
pr.toString = new Function("return(this.ID+\",\"+this.Name);");
delete pr;
function HxZoomLObject(id, miZ, maZ) {
	this.ID = id;
	this.MinZ = miZ;
	this.MaxZ = maZ;
}
new HxZoomLObject(0, 0, 0);
pr = HxZoomLObject.prototype;
pr.toString = new Function("return(this.ID+\",\"+this.MinZ+\",\"+this.MaxZ);");
delete pr;
function HxThemeObject(id, name, visible, ZoomOFF, Minz, Maxz, hGr, LbC, LlC, Lt, Note, Gr) {
	this.ID = id;
	this.Name = name;
	this.Visible = (visible == "true" ? true : false);
	this.ZoomOFF = (ZoomOFF == "true" ? true : false);
	this.Minz = Number(Minz);
	this.Maxz = Number(Maxz);
	this.HasGr = (hGr == "true" ? true : false);
	this.LBColor = baseConverter(String(LbC),10, 16);
	this.LLColor = baseConverter(String(LlC),10, 16);
	this.LType = Lt;
	this.Note = Note;
	this.Group = Gr;
}
new HxThemeObject(0, 0, 0, 0, 0, 0, 0);
pr = HxThemeObject.prototype;
pr.toString = new Function("return(this.ID+','+this.Name+','+this.Visible+','+this.ZoomOFF+','+this.HasGr+','+this.Group+','+this.LBColor+','+this.LLColor+','+this.LType+','+this.Note);");
function _updateTheme(name, visible, ZoomOFF, Minz, Maxz, hGr, LbC, LlC, Lt, Note, Gr) {
	this.Name = name;
	this.Visible = (visible == "true" ? true : false);
	this.ZoomOFF = (ZoomOFF == "true" ? true : false);
	this.Minz = Number(Minz);
	this.Maxz = Number(Maxz);
	this.HasGr = (hGr == "true" ? true : false);
	this.LBColor = baseConverter(String(LbC),10, 16);
	this.LLColor = baseConverter(String(LlC),10, 16);
	this.LType = Lt;
	this.Note = Note;
	this.Group = Gr;
}
pr.updateTheme = _updateTheme;
delete pr;

function createVMapWrapper(szVMapObjName, szWrapperName) {
	if((szVMapObjName=="")||(szVMapObjName==null)) return null;
	var embededVMap = navigator.appName.indexOf("Microsoft") != -1 ? window[szVMapObjName] : document[szVMapObjName];
	return (new HxVMapWrapper(embededVMap, szWrapperName));
}

function _newResize(){
	if(globalMapResizeTimer!=null){
		clearTimeout(globalMapResizeTimer);
	}
	globalMapResizeTimer = setTimeout(this.wrapper.Name + ".callOnMapResize()",200);
}


//new on resize calling politcs! if there is continuos call of flas it make nont goot freeze effect so we need call resiza just one time end at the end of resizing
//so ther we need some timer
var globalMapResizeTimer = null; //initially it well be null


function HxVMapWrapper(embVMap, embVMapName) {
	if(embVMap==0) return;
	this.VMap = embVMap;
	this.Name = embVMapName;
	this.VMap.wrapper = this;
	
	this.VMap.resize = _newResize;
	
	if(this.VMap.addEventListener){
		this.oldResizeHandler = window.onresize;		
		window.onresize = new Function("if("+embVMapName+".oldResizeHandler) "+embVMapName+".oldResizeHandler();"+embVMapName+".VMap.resize();");
	}else{
		this.VMap.onresize = new Function('this.resize();');
	}
}
//**********************************************************************/
//HxVMapWrapper
new HxVMapWrapper(0, 0);
pr = HxVMapWrapper.prototype;
// public fields
pr.vStatus = null;
pr.iErrorHandlingMode = 0;
//0-Show Alert, 1-Call User handler onVMapError
pr.vILSs = null;
pr.vThemes = null;
pr.vThemeGroups = null;
pr.vLevels = null;
pr.bScale = null;
pr.bZSlider = null;
pr.bIsSessionON = false;
pr.uiPanMode = 0;
//0-Drag&Move; 4-Click&Move
pr.URL = "";
// Event HANDLERS
pr.onStatus = null;
pr.onError = null;
pr.onSessionOK = null;
pr.onSessionClosed = null;
pr.onPOIClicked = null;
pr.onMapClicked = null;
pr.onThemesChanged = null;
pr.onMapReady = null;
pr.onBMapUpdate = null;
pr.onCursorPosChanged = null;
pr.onPluginLoaded = null;
pr.onPluginFailedStart = null;
pr.onMapPosChanged = null;

// public methods
pr.toString = new Function("return this.Name;");
function sE(url, gdll, mz, ms, s, poiDIR, poiPREFIX, setDIR, setPREFIX) {
	
	this.VMap.SetVariable("/_HTTP:URL_BASE", url);
	this.VMap.SetVariable("/_HTTP:VMap_DLL", gdll);
	this.VMap.SetVariable("/_HTTP:MOVE_STEPS", ms);
	this.VMap.SetVariable("/_HTTP:SERVER", s);
	this.VMap.SetVariable("/_HTTP:MAX_ZOOM", mz);
	this.VMap.SetVariable("/_HTTP:MAPVIEW_WIDTH", 400);
	this.VMap.SetVariable("/_HTTP:SCALE_FACTOR", 100);
	//symbols
	this.VMap.SetVariable("/_HTTP:POIDIR", poiDIR);
	this.VMap.SetVariable("/_HTTP:POIPREFIX", poiPREFIX);
	this.VMap.SetVariable("/_HTTP:SETDIR", setDIR);
	this.VMap.SetVariable("/_HTTP:SETPREFIX", setPREFIX);
	this.VMap.TCallLabel("/_HTTP", "setEnviroment");
}
pr.setEnvironment = sE;



function fs(com, arg) {
	var i = 0;
	switch (com) {
	case "CurPosChanged" :
		var c = arg.split("#%");
		if (this.onCursorPosChanged != null) {
			this.onCursorPosChanged(Number(c[0]), Number(c[1]));
		}
		delete c;
		break;
	case "MapPosChanged":
		var c = arg.split("#%");
		if(this.onMapPosChanged != null) {
			this.onMapPosChanged({sx:Number(c[0]), sy:Number(c[1]), z:Number(c[2]), a:Number(c[3]), l:Number(c[4]), t:Number(c[5]), r:Number(c[6]), b:Number(c[7]), toString:objSerialize});
		}
		break;
	case "onSessionOFF" :
		this.bIsSessionON = false;
		if (this.onSessionClosed != null) {
			this.onSessionClosed(arg);
		}
		break;
	case "onSessionOK" :
		
		this.bIsSessionON = true;
		this.startMap();
		var vVectors = arg.split("#2%");
		var vILSs = vVectors[0].split("#1%");
		var vThemes = vVectors[1].split("#1%");
		var vLevels = vVectors[2].split("#1%");
		var c1, c2;
		this.URL = vVectors[3];
		delete this.vILSs;
		this.vILSs = new Array(vILSs.length);
		while (i<vILSs.length) {
			var a = vILSs[i].split("#%");
			this.vILSs[i++] = new HxIDNameObject(a[0], a[1]);
		}
		delete this.vThemes;
		delete this.vThemeGroups;
		this.vThemes = new Array(vThemes.length);
		this.vThemeGroups = new Array();
		i = 0;
		while (i<vThemes.length) {
			a = vThemes[i].split("#%");
			//alert(Number(a[10])+","+Number(a[11])+","+Number(a[12]));
			c1 = (Number(a[7]) * 65536) + (Number(a[8])* 256) + Number(a[9]);
			c2 = (Number(a[10]) * 65536) + (Number(a[11])* 256) + Number(a[12]);
			
			this.vThemes[i++] = new HxThemeObject(a[0], a[1], a[2], a[3], a[4], a[5], a[6], c1, c2, Number(a[13]), a[15], a[14]);
			this.vThemeGroups[a[14]] = a[14];
		}
		delete this.vLevels;
		this.vLevels = new Array(vLevels.length);
		
		i = 0;
		while (i<vLevels.length) {
			a = vLevels[i].split("#%");
			this.vLevels[i++] = new HxZoomLObject(a[0], a[1], a[2]);
		}
		if (this.onSessionOK != null) {
			this.onSessionOK(this, this.vILSs, this.vThemes, this.vLevels);
		}
		break;
	case "onZoomOffChanged" :
		var vTh = arg.split("#1%");
		var c1, c2;
		i = 0;
		var tmp;
		while (i<vTh.length) {
			a = vTh[i].split("#%");
			c1 = Number(a[7]) * 0xFFFF + Number(a[8])* 0xFF + Number(a[9]);
			c2 = Number(a[10]) * 0xFFFF + Number(a[11])* 0xFF + Number(a[12]);
			tmp = this.getTheme(a[0]);
			if(tmp!=null){
				tmp.updateTheme(a[1], a[2], a[3], a[4], a[5], a[6], c1, c2, Number(a[13]), a[15], a[14]);
				this.vThemeGroups[a[14]] = a[14];
			}
			i++;
		}
		if (this.onThemesChanged != null) {
			this.onThemesChanged(this.vThemes);
		}
		break;
	case "onStatus" :
		this.vStatus = arg.split("#%");
		if (this.onStatus != null) {
			this.onStatus(this.vStatus);
		}
		break;
	case "msg" :
		alert("Message:"+arg);
		break;
	case "msg1" :
		outText(arg);
		break;
	
	case "Error" :
		var v = arg.split("#");
		var eObj = {id:v[0], text:v[1]};
		if (this.iErrorHandlingMode == 1 && this.onError != null) {
			this.onError(eObj);
		} else {
			alert("Viewer error: "+v[1]);
		}
		break;
	case "MapReady" :
		this.showBMap(this.BMap!=null);
		if (this.onMapReady != null) {
			this.onMapReady(this);
		}
		break;
	case "VMapClicked" :
		var v = arg.split("#%");
		if (this.onMapClicked != null) {
			this.onMapClicked(Number(v[0]), Number(v[1]), v[2]);
		}
		break;
	case "VMapDblClicked" :
		var v = arg.split("#%");
		if (this.onMapDblClicked != null) {
			this.onMapDblClicked(Number(v[0]), Number(v[1]));
		}
		break;
	case "POIClicked" :
		if (this.onPOIClicked != null) {
			this.onPOIClicked(Number(arg));
		}
		break;
	case "SetPosition" :
		this.VMap.SetVariable("/_HTTP:szPosition", arg);
		this.VMap.TCallLabel("/_HTTP", "setPosition");
		break;
		//BMap
	case "UpdateBMap" :
		var sarg = arg.split("#%");
		if(this.onBMapUpdate!=null) this.onBMapUpdate(sarg[0], sarg[1]);
		//this.BMap.setPosition(sarg[0], sarg[1]);			
		break;
	case "plgLoaded" :
		var a = arg.split("#%");
		if (this.onPluginLoaded != null) {
			this.onPluginLoaded(a[0], a[1]);
		}
		break;
	case "plgFailedStart" :
		var a = arg.split("#%");
		if (this.onPluginFailedStart != null) {
			this.onPluginFailedStart(a[0], a[1]);
		}
		break;
	case "plgEvt":
		var a = arg.split("#999%");
		fn = eval("this." + a[0] + "_" + a[1]);
		if(fn!=null) fn(a[2], this);
		break;
	
	
	}
}

pr.DoFSCommand = fs;
pr.openSession = new Function("i", "this.VMap.resize();this.VMap.SetVariable(\"/:iSpeed\",i);this.VMap.TCallLabel(\"/_HTTP\",\"openSession\");");
pr.closeSession = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"closeSession\");");
pr.startMap = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"startMap\");");
pr.firstLoad = new Function("iVal", "this.VMap.SetVariable(\"/_HTTP:szILSName\",iVal);this.VMap.TCallLabel(\"/_HTTP\",\"firstLoad\");");
pr.zoomIN = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"zoomIN\");");
pr.zoomOUT = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"zoomOUT\");");
pr.resetZoom = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"resetZoom\");");
function sp(x, y, z, uBm, bAnim, iSteps, bMarker) {
	var szPosition = (x != null ? String(x) : "")+"#%"+(y != null ? String(y) : "")+"#%"+(z != null ? String(z) : "")+"#%"+(uBm != null ? String(uBm) : "")+"#%"+(bAnim != null ? String(bAnim) : "")+"#%"+(iSteps != null ? String(iSteps) : "")+"#%"+(bMarker != null ? String(bMarker) : "");
	//alert(szPosition);
	this.VMap.SetVariable("/_HTTP:szPosition", szPosition);
	this.VMap.TCallLabel("/_HTTP", "setPosition");
}
pr.setPosition = sp;

function spP(x, y, z, uBm, bAnim, iSteps, bMarker) {
	var szPosition = (x != null ? String(x) : "")+"#%"+(y != null ? String(y) : "")+"#%"+(z != null ? String(z) : "")+"#%"+(uBm != null ? String(uBm) : "")+"#%"+(bAnim != null ? String(bAnim) : "")+"#%"+(iSteps != null ? String(iSteps) : "")+"#%"+(bMarker != null ? String(bMarker) : "");
	this.VMap.SetVariable("/_HTTP:szPosition", szPosition);
	this.VMap.TCallLabel("/_HTTP", "setPosition");
	this.callPlugin('Marker', 'showAnimation', '_Anim1');
	bIgnoreStatus = true;
	pluginCalled= true;
}
pr.setPositionPlugin = spP;

function ll(url, x, y) {
	var Param = "0#%"+url + "#%" +(x != null ? String(x) : "")+"#%"+(y != null ? String(y) : "");
	this.VMap.SetVariable("/_HTTP:Param", Param);
	this.VMap.TCallLabel("/_HTTP", "LOGO");
}

pr.loadLogo = ll;
pr.hideLogo = new Function("this.VMap.SetVariable(\"/_HTTP:Param\",\"1\");this.VMap.TCallLabel(\"/_HTTP\",\"LOGO\");");
pr.rotateLeft = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"rotateLeft\");");
pr.rotateRight = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"rotateRight\");");
pr.Print = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"Print\");");
pr.moveL = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"moveL\");");
pr.moveLD = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"moveLD\");"); 
pr.moveD = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"moveD\");");
pr.moveRD = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"moveRD\");");
pr.moveR = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"moveR\");");
pr.moveRU = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"moveRU\");");
pr.moveU = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"moveU\");");
pr.moveLU = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"moveLU\");");
pr.restartMap = new Function("this.bIsSessionON = false;this.VMap.TCallLabel(\"/_HTTP\",\"restartMap\");");
pr.setStatusEnabled = new Function("cs", "this.VMap.SetVariable(\"/_HTTP:bCallStatus\",cs);");
pr.setDragMode = new Function("dm", "this.VMap.SetVariable(\"/_HTTP:szDragMode\",dm);this.VMap.TCallLabel(\"/_HTTP\",\"setDragMode\");");
pr.showTheme = new Function("iId,bVal", "this.VMap.SetVariable(\"/_HTTP:szTheme\",iId+\"#%\"+bVal);this.VMap.TCallLabel(\"/_HTTP\",\"showTheme\");");
pr.showScale = new Function("bSC", "this.VMap.SetVariable(\"/_HTTP:szScale\",String(bSC));this.VMap.TCallLabel(\"/_HTTP\",\"showScale\");");
pr.showBMap = new Function("bSBM", "this.VMap.SetVariable(\"/_HTTP:szBMap\",String(bSBM));this.VMap.TCallLabel(\"/_HTTP\",\"showBMap\");");
pr.showZoomSlider = new Function("bZS,bZSS,iX,iY", "this.VMap.SetVariable(\"/_HTTP:szSlider\",String(bZS)+\"#%\"+String(bZSS)+\"#%\"+String(iX)+\"#%\"+String(iY));this.VMap.TCallLabel(\"/_HTTP\",\"showZoomSlider\");");
pr.resetSearch = new Function("this.VMap.TCallLabel(\"/_HTTP\",\"resetSearch\");");
pr.loadMeasure = new Function("bZS,bZSS", "this.VMap.SetVariable(\"/_HTTP:szMeasure\",String(bZS)+\"#%\"+String(bZSS));this.VMap.TCallLabel(\"/_HTTP\",\"loadMeasure\");");
pr.loadPlugin = new Function("szURL, szName", "this.VMap.SetVariable(\"/_HTTP:szName\",szName);this.VMap.SetVariable(\"/_HTTP:szURL\",szURL);this.VMap.TCallLabel(\"/_HTTP\",\"loadPlugin\");");
pr.removePlugin = new Function("szName", "this.VMap.SetVariable(\"/_HTTP:szName\",szName);this.VMap.TCallLabel(\"/_HTTP\",\"removePlugin\");");
function _CP(szName, szFName, szArg){
	try{
		this.VMap.SetVariable("/_HTTP:szArgs",szArg);
		this.VMap.SetVariable("/_HTTP:szFName",szFName);
		this.VMap.SetVariable("/_HTTP:szName",szName);
		this.VMap.TCallLabel("/_HTTP","callPlugin");
	}catch(e){
		alert("Problem during plugin:["+szFName+"] call!");
	}
}
pr.callPlugin = _CP;
pr.showPlugin = new Function("szName, szVal", "this.VMap.SetVariable(\"/_HTTP:szName\",szName);this.VMap.SetVariable(\"/_HTTP:szVal\",szVal);this.VMap.TCallLabel(\"/_HTTP\",\"showPlugin\");");

function sScale() {
	if (this.bScale || this.bScale == null) {
		this.showScale(false);
		this.bScale = false;
	} else {
		this.showScale(true);
		this.bScale = true;
	}
}
pr.switchScale = sScale;
function sZSlider() {
	if (this.bZSlider || this.bZSlider == null) {
		this.showZoomSlider(false);
		this.bZSlider = false;
	} else {
		this.showZoomSlider(true);
		this.bZSlider = true;
	}
}
pr.switchZoomSlider = sZSlider;
function tClicked(id) {
	var th = this.getTheme(id);
	if(th == null) return; 
	if (th.Visible) {
		th.Visible = false;
		this.showTheme(th.ID, false);
	} else {
		th.Visible = true;
		this.showTheme(th.ID, true);
	}
}
pr.themeClicked = tClicked;

//added 13.12.2003
function sIR(l, t, r, b, bR, bZ, x, y, z) {
	if (t == null || l == null || r == null || b == null) {
		alert("Error: startInRect must have at least starting rect deffined!");return;
	}
	
	if (bZ && (x == null || y == null || z == null)) {
		alert("Error: startInRect must have x, y, z in case satartZoomed!");return;
	}
	
	
	var str = String(l)+"#%"+String(t)+"#%"+String(r)+"#%"+String(b)+"#%"+(bR ? 'true' : '')+"#%"+(bZ ? 'true' : '')+"#%"+(x != null && bZ != null ? String(x) : "")+"#%"+(y != null && bZ != null ? String(y) : "")+"#%"+(z != null && bZ != null ? String(z) : "");
	this.VMap.SetVariable("/_HTTP:szPosition", str);
	this.VMap.TCallLabel("/_HTTP", "startInRect");
}
pr.startInRect = sIR;
function _getTheme(id){
	try{
		var i = 0;
		while(i<this.vThemes.length && this.vThemes[i].ID!=id) i++;
		return  i==this.vThemes.length ? null : this.vThemes[i];
	}catch(e){
		return null;
	}
}
pr.getTheme = _getTheme;

function __callOnMapRsize(){
	this.VMap.SetVariable("/_HTTP:szW", this.VMap.offsetWidth);
	this.VMap.SetVariable("/_HTTP:szH", this.VMap.offsetHeight);
	this.VMap.TCallLabel("/_HTTP","htmlResized");
	clearTimeout(globalMapResizeTimer);
}
pr.callOnMapResize = __callOnMapRsize;
delete pr;
//support functions
function outText(szText){
		var pp = document.createElement("p");
		var tt = document.createTextNode(szText);
		document.body.appendChild(pp).appendChild(tt);
}
