/*
	ver 1.0 (19.05.2004)
*/

//not documented queryParameters:

function insertFlashEmbeded(szObjName, szObjFileName, szWrapperName, w, h, queryParam){
	//alert(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);
	
}

function createMMapWrapper(szMMapObjName, szWrapperName) {
	if((szMMapObjName=="")) return null;
	var embededMMap = navigator.appName.indexOf("Microsoft") != -1 ? window[szMMapObjName] : document[szMMapObjName];
	return (new HxMMapWrapper(embededMMap, szWrapperName));
}


function HxMMapWrapper(embMMap, embMMapName){
	if(embMMap==0) return;
	this.MMap = embMMap;
	this.Name = embMMapName;
	this.MMap.wrapper = this;
}
new HxMMapWrapper(0, 0);
pr = HxMMapWrapper.prototype;
pr.onMMapPosCahnged = null;
function fs(com, arg) {
	var i = 0;
	switch (com) {
		case "POS" :
			var c = arg.split(",");
			if (this.onMMapPosCahnged != null) {
				this.onMMapPosCahnged(Number(c[0]), Number(c[1]));
			}
			delete c;
			break;
		case "msg" :
			alert(arg);
			break;
	}
}
pr.DoFSCommand = fs;
function MiniMap_SetPosition(x, y){
	this.MMap.SetVariable("/_HTTP:X", x);
	this.MMap.SetVariable("/_HTTP:Y", y);
	this.MMap.TCallLabel("/_HTTP", "setPos");
}
pr.setPosition = MiniMap_SetPosition;
delete pr;