// **********************************
// **  Flashmaps AreaSelector 4.1  **
// **     JavaScript Functions     **
// **********************************
// ** (c)2010 Flashmaps Geospatial **
// **   http://www.flashmaps.com   **
// **********************************

// *********************
// ** THEME functions **
// *********************

	fmASMcPath 	= "map_mc.";

function fmASThemeLoad(url_str, id_str) {
//do: load a new theme into the AS

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_url", url_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASThemeLoad");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASThemeReloadAreas(url_str, mapLevel) {
//do: reload the areas of a theme

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_url", url_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_map_level", mapLevel);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASThemeReloadAreas");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASThemeReloadPOIs(url_str, clear) {
//do: reload the pois of a theme

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_url", url_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_clear", clear);	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASThemeReloadPOIs");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASThemeReloadPolylines(url_str) {
//do: reload the polylines of a theme

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_url", url_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASThemeReloadPolylines");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

// *******************
// ** MAP functions **
// *******************

function fmASMapInitialView() {
//do: return the map to initial view

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASMapInitialView");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASMapBackLevel() {
//do: return the map one level back
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASMapBackLevel");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASMapZoomIn() {
//do: zoom in
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASMapZoomIn");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASMapZoomOut() {
//do: zoom out
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASMapZoomOut");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASMapResetCurrentView() {
//do: reset the current view
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASMapResetCurrentView");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

// ************************
// ** MAP MODE functions **
// ************************

function fmASModeSet(mode_str) {
//do: change the map mode to select mode

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_mode", mode_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASModeSet");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASSelectModeAreaAdd(level, id_str, parent_id_str, color_str) {
//do: add an area to select mode

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_level", level);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_parent_id", parent_id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_color", color_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASSelectModeAreaAdd");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASSelectModeAreaRemove(level, id_str, parent_id_str) {
//do: remove an area to select mode

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_level", level);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_parent_id", parent_id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASSelectModeAreaRemove");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASSelectModeExport() {
//do: return the list of areas selected

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASSelectModeExport");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
	return document.getElementById("fmASEngine").GetVariable("_root." + fmASMcPath + "ASEngine_mc.out_export");
}

function fmASSelectModeClear() {
//do: clean the list of areas selected

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASSelectModeClear");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

// *********************
// ** AREAS functions **
// *********************

function fmASAreasCenter(id_str, filter_str, same_level) {
//do: center the map into an area

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_filter", filter_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_same_level", same_level);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASAreasCenter");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASBackAndAreasCenter(id_str) {
//do: back a level and center the map into an area

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASBackAndAreasCenter");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASAreaFocus(id_str, lat, lon, scale, poisLoad, levelBack) {
//do: center the map into a latitude/longitude

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_lat", lat);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_lon", lon);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_scale", scale);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_pois_load", poisLoad);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_level_back", levelBack);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASAreaFocus");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASAreaEnable(id_str) {
//do: enabled an area

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASAreaEnable");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASAreaDisable(id_str) {
//do: disable an area

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASAreaDisable");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASAreaColorSet(id_str, color_up_str, color_over_str, color_down_str) {
//do: change the color of an area

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_color_up", color_up_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_color_over", color_over_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_color_down", color_down_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASAreaColorSet");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASAreasShow(category_str) {
//do: show all areas of a category (* for all categories)
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_category", category_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASAreasShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASAreasHide(category_str) {
//do: hide all areas of a category (* for all categories)
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_category", category_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASAreasHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//********************
//** POIS FUNCTIONS **
//********************

function fmASPOIsShow(category_str) {
//do: show all pois of a category (* for all categories)
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_category", category_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOIsShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPOIsHide(category_str) {
//do: hide all pois of a category (* for all categories)
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_category", category_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOIsHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPOIsLabelShow() {
//do: show pois labels
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOIsLabelShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPOIsLabelHide() {
//do: hide pois labels
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOIsLabelHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPOIEventAdd(event_str, target_str, url_str, id_str, label_str) {
//do: add an event to a POI

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_event", event_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_target", target_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_url", url_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_label", label_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOIEventAdd");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPOIEventRollOver(id_str, icon_str) {
//do: rollover over a POI
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_icon", icon_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOIEventRollOver");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPOIEventRollOut(id_str) {
//do: rollout over a POI
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOIEventRollOut");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPOIHighlight(id_str, icon_str) {
//do: rollover over a POI
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_icon", icon_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOIHighlight");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPOIUnhighlight() {
//do: rollout over a POI
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOIUnhighlight");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASIconAdd(icon_str, lat, lon) {
//do: add an icon on the map
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_icon", icon_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_lat", lat);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_lon", lon);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASIconAdd");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASIconsClear() {
//do: clear all icons on the map
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASIconsClear");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPOIsRemove(category_str) {
//do: remove a category of POIs
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_category", category_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOIsRemove");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//************************
//** POLYLINE FUNCTIONS **
//************************

function fmASPolylinesShow(category_str) {
//do: show all polylines of a category (* for all categories)
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_category", category_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPolylinesShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPolylinesHide(category_str) {
//do: hide all polylines of a category (* for all categories)
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_category", category_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPolylinesHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//*********************
//** IMAGE FUNCTIONS **
//*********************

function fmASImageLoad(url_str) {
//do: load an image
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_url", url_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASImageLoad");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASImagesShow() {
//do: show images

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASImagesShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASImagesHide() {
//do: hide images

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASImagesHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASImagesClear() {
//do: remove images

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASImagesClear");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//************************
//** OVERLAYS FUNCTIONS **
//************************

function fmASOverlaysLoad(url_str, mask_str) {
//do: load an overlays

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_url", url_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_mask", mask_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASOverlaysLoad");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASOverlaysShow() {
//do: show overlays

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASOverlaysShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASOverlaysHide() {
//do: hide overlays

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASOverlaysHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASOverlaysClear() {
//do: remove overlays

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASOverlaysClear");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//****************************
//** ALERT WINDOW FUNCTIONS **
//****************************

function fmASAlertShow(title_str, text_str) {
//do: show an alert window
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_title", title_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_text", text_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASAlertShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASAlertHide() {
//do: hide an alert window
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASAlertHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//**************************
//** CROSS HAIR FUNCTIONS **
//**************************

function fmASCrossHairShow(lat, lon, scale) {
//do: show an alert window
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_lat", lat);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_lon", lon);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_scale", scale);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASCrossHairShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASCrossHairHide() {
//do: hide the cross hair
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASCrossHairHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//************************
//*** OBJECT FUNCTIONS ***
//************************

function fmASObjectShow(id_str) {
//do: show an object
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASObjectShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASObjectHide(id_str) {
//do: hide an object
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_id", id_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASObjectHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//***********************
//** POITEXT FUNCTIONS **
//***********************

function fmASPOITextsShow() {
//do: show poitext over the map
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOITextsShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASPOITextsHide() {
//do: hide poitext over the map
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPOITextsHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//***********************
//** TOOLTIP FUNCTIONS **
//***********************

function fmASToolTipShow(text_str) {
//do: show tooltip
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_text", text_str);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASToolTipShow");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

function fmASToolTipHide() {
//do: hide tooltip
	
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASToolTipHide");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//*********************
//** PRINT FUNCTIONS **
//*********************

function fmASPrint(show_toolbar) {
//do: print the current view

	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_show_toolbar", show_toolbar);
	document.getElementById("fmASEngine").SetVariable("_root." + fmASMcPath + "ASEngine_mc.out_action", "fmASPrint");
	document.getElementById("fmASEngine").TCallLabel("_root." + fmASMcPath + "ASEngine_mc.outside_mc", "ASAction");
}

//*************
//** FROM AS **
//*************

//NOTE: set the attribute sendJavascript to true and sendJavascriptError to true in fmASEngine.xml in order to activate the following functions

function fmFromASReady() { }
 
function fmFromASPOIsLoaded(total_pois) { }

function fmFromASOverlaysLoaded(total_pois) { }

function fmFromASEventArea(event_str, id_str, url_str, label_str) { }

function fmFromASEventPOI(event_str, id_str, url_str, label_str) { }

function fmFromASEventPolyline(event_str, id_str, url_str, label_str) { }

function fmFromASError(title_str, error_str) { }
