﻿/**
* Class: VisKort.Component.MastDB
* 
* This component class contains functionality related to the Mastdatabase tab.
*/
VisKort.Component.FilterDataView = OpenLayers.Class(VisKort.Component, {

	/*
	* Property: 
	* select_filter  
	*/
	select_filters: null,

	/*
	* Propterty:
	* check_filters
	*/
	check_filters: null,

	/*
	* Property:
	* jsonParameters
	*/
	jsonparameters: null,

	/*
	* Propterty:
	* number_of_filters
	*/
	number_of_filters: 0,

	/*
	* Propterty:
	* number_of_sub_filters
	*/
	number_of_sub_filters: 0,

	/*
	* Propterty:
	* number_of_layers
	*/
	number_of_layers: 0,

	/** 
	* Property: marker  
	* {<OpenLayers.Marker>} address marker 
	*/
	marker: null,

	/** 
	* Property: address_markers_layer 
	* {<OpenLayers.Layer.Markers>} address marker layer  
	*/
	address_markers_layer: null,

	/** 
	* Property: municipalityList 
	* {<Array>} double array with list of municipality names
	* and municipality codes for each region  
	*/
	municipalityList: new Array(),

	/** 
	* Property: regionList 
	* {<Array>} Array with wfs municipality layer for each
	* region    
	*/
	regionList: new Array(5),

	/* 
	* Constructor: VisKort.Component.MastDB
	*/
	initialize: function(jsonselect, jsoncheck, jsonsearch, jsonparameters) {
		this.select_filters = jsonselect;
		this.check_filters = jsoncheck;
		this.jsonparameters = jsonparameters;
		var useseperator = true;
		if (!jsonsearch.filterSearchOption.enableAddressSearch && !jsonsearch.filterSearchOption.enableRegionSearch) {
			useseperator = false;
		}
		if (!jsonsearch.filterSearchOption.enableAddressSearch) {
			var search_adr = document.getElementById("filterDataView_addressearch_div");
			if (search_adr) {
				search_adr.style.display = "none";
			}
		}

		if (!jsonsearch.filterSearchOption.enableRegionSearch) {
			var search_reg = document.getElementById("filterDataView_regionsearch_div");
			if (search_reg) {
				search_reg.style.display = "none";
			}
		}

		this.createSelectBox(useseperator);
		this.createCheckbox();
	},

	/** 
	* Method: activate (override)
	*
	*/
	activate: function() {
		if (!this.address_markers_layer) {
			this.setupSearch();
		}
		this.populateRegionMunicipality();
	},

	/** 
	* Method: deActivate
	* Gets called when the tab for this class is unselected
	*/
	deActivate: function() {
		if (this.address_markers_layer) {
			this.clearaddressMarkers();
		}
	},

	/**
	* Method: setupSearch
	* Initials the needed layers for this class
	*/
	setupSearch: function() {
		var size = new OpenLayers.Size(21, 25);
		var offset = new OpenLayers.Pixel(-(size.w / 2), -size.h);

		this.icon_addressMarker = new OpenLayers.Icon("/Viskort/App_Themes/" + this.application.active_theme + "/Images/OpenLayers/marker-default.png", size, offset);
		this.address_markers_layer = new OpenLayers.Layer.Markers("Adresse_1");
		this.address_markers_layer.displayInLayerSwitcher = false;
		this.map.addLayer(this.address_markers_layer);
	},

	/**
	* Method: addressFDVSearchAddress
	* Initails the handler for return of the UpdatePanel_Address asyncron postback
	*/
	addressFDVSearchAddress: function() {
		Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this.endRequestHandlerFDV);
	},

	/**
	* EventHandler: EndRequestHandlerFDV
	* Handles endrequest for asycronpost for address finding
	*/
	endRequestHandlerFDV: function(sender, args) {
		addressparameters = document.getElementById(addressElements);

		var util_instance = new VisKort.Utils();
		util_instance.ResetPrintInfo();
		if (args.get_error() == undefined && addressparameters.value != "") {
			parameters = addressparameters.value.split("#");
			if (parameters.length == 3) {
				viskort.components["filterdataview"].showAddressOnMap(parameters[0], parameters[1], parameters[2]);
				// Clear hiddenaddressfieldValue
				addressparameters.value = "";
			} else if (parameters.length == 2) {
				viskort.components["filterdataview"].showPlaceOnMap(parameters[0], parameters[1]);
				// Clear hiddenaddressfieldValue
				addressparameters.value = "";
			}

		}
		if (args.get_error() && args.get_error().name === "Sys.WebForms.PageRequestManagerTimeoutException") {
			// Sets errorHandled = true to avoid an error message box from the AJAX library
			args.set_errorHandled(true);
			alert("Søgning tog for lang tid");
		}
	},

	/**
	* Method: showAddressOnMap 
	* Creates info for address and links to route and municipality tab
	* 
	* Parameters: 
	* placeAddress - <String> "streetname nr postalcode postaldistrict municipality
	* east_coordinat - <Number> UTM32 Easting coordinate
	* north_coordinat - <Number> UTM32 Northing coordinate
	*/
	showAddressOnMap: function(placeAddress, east_coordinat, north_coordinat) {

		var elements = placeAddress.split(":");
		var streetname = "";
		var nr = "";
		var postal_identifer = "";
		var postal_district = "";
		var municipality_name = "";

		if (elements.length == 5) {
			streetname = elements[0];
			nr = elements[1];
			postal_identifer = elements[2];
			postal_district = elements[3];
			municipality_name = elements[4];
		}

		var address_textbox = document.getElementById(adr_TextBox);
		if (address_textbox) {
			var address_text = streetname + " " + nr + ", " + postal_identifer + " " + postal_district;
			address_textbox.value = address_text;
		}
		// Set printinfo
		var util_instance = new VisKort.Utils();
		util_instance.SetPrintInfo(address_text);

		// Make resultfield
		// <img alt='' class='floatRight' src='/Viskort/App_Themes/" + this.application.active_theme + "/Images/OpenLayers/marker-default.png' />
		//display_info = "<br /><div class='FilterDataView_AddressResult_div'>" + streetname + " " + nr + ",<br />" +
		//postal_identifer + " " + postal_district + "<br /></div>";

		var addressInfo = document.createElement("div");
		addressInfo.className = "FilterDataView_AddressResult_div";
		addressInfo.innerHTML = "<img alt='' class='floatRight' src='/Viskort/App_Themes/" + this.application.active_theme + "/Images/OpenLayers/marker-default.png' />" + streetname + " " + nr + ",<br />" + postal_identifer + " " + postal_district + "<br />";


		var header_div = document.getElementById("HeaderInfo");
		if (header_div) {
			header_div.innerHTML = "Aktuelt vises: " + streetname + " " + nr + ", " + postal_identifer + " " + postal_district + " (Kommune: " + municipality_name + ")";
		}
		display_div = document.getElementById(result_div);
		if (display_div) {
			display_div.innerHTML = "";
			//display_div.innerHTML = display_info;
			display_div.appendChild(addressInfo);
		}
		this.showAddressOnMapWithMarker(east_coordinat, north_coordinat, this.application.zoomlevels - 1, streetname + " " + nr + ", " + postal_identifer + " " + postal_district, 0.0, 0.0, 0);
	},

	/**
	* Method: showAddressOnMapWithMarker 
	* Show input address on map with marker and actives find nearest
	*
	* Parameters: 
	* east_koodinat - <Number> UTM32 Easting coordinate
	* north_koordinat - <Number> UTM32 Northing coordinate
	* zoomlevel - <Int> 0-11
	* popuptext - <String>
	* pantoNorthing - <Number> UTM32 Northing coordinate
	* pantoEasting - <Number> UTM32 Easting coordinate
	* showPopup - <Int> 0-1
	*/
	showAddressOnMapWithMarker: function(east_koordinat, north_koordinat, zoomlevel, popuptext, pantoNorthing, pantoEasting, showPopup) {

		this.clearaddressMarkers();
		this.marker = new OpenLayers.Marker(new OpenLayers.LonLat(east_koordinat, north_koordinat), this.icon_addressMarker);
		this.marker.popuptext = popuptext;
		this.address_markers_layer.addMarker(this.marker);

		if (popuptext != "" && showPopup == 1) {
			this.application.infoBox.showCustomInfo(new OpenLayers.LonLat(east_koordinat, north_koordinat), popuptext);
		}

		// Set the markerpoint as center on the map.
		if (pantoNorthing != 0.0 && pantoEasting != 0.0) {
			// Panto point
			this.map.setCenter(new OpenLayers.LonLat(pantoEasting, pantoNorthing), zoomlevel);
		} else {
			// Set the markerpoint as center on the map.
			this.map.setCenter(new OpenLayers.LonLat(east_koordinat, north_koordinat), zoomlevel);
		}
	},

	/**
	* Method: showPlaceOnMap
	* Shows a place on the map and sets a marker in center of the boundingbox
	*
	* Parameteres:
	* placeAddress - <String> 
	*
	*/
	showPlaceOnMap: function(placeAddress, bbox) {

		var elements = placeAddress.split(":");
		var placename = "";
		var municipalityname = "";
		if (elements.length == 2) {
			placename = elements[0];
			municipalityname = elements[1];
		}
		// Show mapheader
		var header_div = document.getElementById("HeaderInfo");
		if (header_div) {
			header_div.innerHTML = "Aktuelt vises: " + placename;
		}
		// set textbox
		var address_textbox = document.getElementById(adr_TextBox);
		if (address_textbox) {
			address_textbox.value = placename;
		}

		// Set printinfo
		var util_instance = new VisKort.Utils();
		util_instance.SetPrintInfo(placename);

		// Make resultfield
		display_info = "<br /><div class='Address_div_result' ><img alt='' class='floatRight' src='/Viskort/App_Themes/" + this.application.active_theme + "/Images/OpenLayers/marker-default.png' />" + placename + "<br /><br /></div>";
		display_div = document.getElementById(result_div);
		if (display_div) {
			display_div.innerHTML = "";
			display_div.innerHTML = display_info;
		}

		// zoom to bbox
		if (bbox != "") {
			var bboxcoordinats = bbox.split(":");
			var boundingbox = new OpenLayers.Bounds(bboxcoordinats[0], bboxcoordinats[1], bboxcoordinats[2], bboxcoordinats[3]);
			this.map.zoomToExtent(boundingbox);
			var lotlat = this.map.getCenter();
			this.clearaddressMarkers();
			this.marker = new OpenLayers.Marker(lotlat, this.icon_addressMarker);
			this.address_markers_layer.addMarker(this.marker);
		}
	},

	/**
	* Method: clearaddressMarkers
	* Clears the address marker layer
	*/
	clearaddressMarkers: function() {
		this.address_markers_layer.clearMarkers();
	},

	/**
	* Method: enterKeyPress_address
	* Keypressdown event for address textboxs
	*
	* Parameters:
	* buttonName -<ID>
	* e - <Event>
	*/
	enterKeyPress_address: function(buttonName, e) {
		if (e.which || e.keyCode) {
			if ((e.which == 13) || (e.keyCode == 13)) {
				var btn = document.getElementById(buttonName);
				try {

					btn.click();
					Event.stop(e);
				} catch (err) {

				}
				return false;
			}
			else {
				return true;
			}
		}
	},

	/**
	* Method: Address_from_parameters 
	* Used when address page is called with parameters sets address info and links
	* 
	* Parameters:
	* streetname - <String>
	* nr - <String>
	* postal_identifer - <String>
	* postal_district - <String>
	* municipality_name - <String>
	* east_coordinat - <Number> UTM32 Easting coordinate 
	* north_coordinat - <Number> UTM32 Northing coordinate
	* resultdiv - 
	* zoomlevel - <Int> 0-11
	* pantoNorth - <Number> UTM32 Northing coordinate
	* pantoEast - <Number> UTM32 Easting coordinate
	*/
	address_from_parameters: function(streetname, nr, postal_identifer, postal_district, municipality_name, east_coordinat, north_coordinat, textbox, resultdiv, zoomlevel, pantoNorth, pantoEast) {

		if (zoomlevel == -1) {
			zoomlevel = this.application.zoomlevels - 1;
		}

		var address_text = streetname + " " + nr + ", " + postal_identifer + " " + postal_district;
		// Set textseachBox
		address_textbox = document.getElementById(textbox);
		address_textbox.value = address_text;

		// Set printinfo
		var util_instance = new VisKort.Utils();
		util_instance.SetPrintInfo(address_text);

		// Make resultfield
		display_info = "<br /><div class='Address_div_result'><img alt='' class='floatRight' src='/Viskort/App_Themes/" + this.application.active_theme + "/Images/OpenLayers/marker-default.png' />" + streetname + " " + nr + ",<br />" +
        postal_identifer + " " + postal_district + "<br /></div>";

		var header_div = document.getElementById("HeaderInfo");
		if (header_div) {
			header_div.innerHTML = "Aktuelt vises: " + streetname + " " + nr + ", " + postal_identifer + " " + postal_district + " (Kommune: " + municipality_name + ")";
		}

		display_div = document.getElementById(resultdiv);
		if (display_div) {
			display_div.innerHTML = "";
			display_div.innerHTML = display_info;
		}
		viskort.components["filterdataview"].showAddressOnMapWithMarker(east_coordinat, north_coordinat, zoomlevel, streetname + " " + nr + ", " + postal_identifer + " " + postal_district, pantoNorth, pantoEast, 0);
	},

	ZoomToRegionOnMap: function() {
		var regionDropdown = document.getElementById("ddlRegion_client");
		var regionCode = regionDropdown[regionDropdown.selectedIndex].value;

		if (regionDropdown) {
			var services = new VisKort.Utils.Services();
			services.getmunicipalitys(regionCode, viskort.components['filterdataview'].populateMunicipalityDropDown.bind(this));
		}
	},

	ZoomToMunicipalityOnMap: function() {
		var municipalityDropdown = document.getElementById("ddlMunicipality_client");
		var regionDropdown = document.getElementById("ddlRegion_client");
		var municipalityCode = municipalityDropdown[municipalityDropdown.selectedIndex].value;
		var municipalityIndex = municipalityDropdown.selectedIndex;
		var regionCode = regionDropdown[regionDropdown.selectedIndex].value;

		if (municipalityDropdown) {
			var services = new VisKort.Utils.Services();
			if (municipalityCode == "Kommuner") {
				if (regionCode == "Regioner") {
					regionDropdown.selectedIndex = 0;
				}
			}
			else {
				services.getmunicipalityregion(municipalityCode, viskort.components['filterdataview'].setSelectedRegion.bind(this));
				services.getmunicipalitymunicipalities(municipalityCode, viskort.components['filterdataview'].populateMunicipalityDropDown.bind(this));
			}
		}
	},
	
	/**
	* Method: switchMapTabContainerActiveTab
	* Switch active tab on MapTabContainer
	*/
	switchMapTabContainerActiveTab: function(tabIdxToBeActive) {
		if (MapTabContainer) {
			var tab = $find(MapTabContainer);
			var active = tab.get_activeTabIndex();
			if (active != tabIdxToBeActive) {
				tab.set_activeTabIndex(tabIdxToBeActive);
			}
		}
	},

	/**
	* Method: click_show_region
	* Shows selected region on map
	*/
	click_show_region: function() {
		var regionDropdown = document.getElementById("ddlRegion_client");
		var municipalityDropdown = document.getElementById("ddlMunicipality_client");
		if (regionDropdown && municipalityDropdown) {
			var services = new VisKort.Utils.Services();
			var breadCrum = document.getElementById("HeaderInfo");
			var reg_code = regionDropdown[regionDropdown.selectedIndex].value;
			var reg_name = regionDropdown[regionDropdown.selectedIndex].text;
			var mun_code = municipalityDropdown[municipalityDropdown.selectedIndex].value;
			var mun_name = municipalityDropdown[municipalityDropdown.selectedIndex].text;
			if (reg_code == "Regioner") {
				if (breadCrum) {
					breadCrum.innerHTML = "Aktuelt vises: Danmark";
				}
				services.getregionbbox("Regioner", viskort.components['filterdataview'].zoomToBbox.bind(this));
			} else if (mun_code == "Kommuner") {
				if (breadCrum) {
					breadCrum.innerHTML = "Aktuelt vises: Danmark: " + reg_name;
				}
				services.getregionbbox(reg_code, viskort.components['filterdataview'].zoomToBbox.bind(this));
			} else {
				if (breadCrum) {
					breadCrum.innerHTML = "Aktuelt vises: Danmark: " + reg_name + " : " + mun_name;
				}
				services.getmunicipalitybbox(mun_code, viskort.components['filterdataview'].zoomToBbox.bind(this));
			}
		}
	},

	/**
	* Method: populateRegionMunicipality
	* Main function for populating region and municipality dropdowns
	*/
	populateRegionMunicipality: function() {
		var services = new VisKort.Utils.Services();
		services.getregions(viskort.components['filterdataview'].populateRegionDropDown.bind(this));
		services.getmunicipalitys("Regioner", viskort.components['filterdataview'].populateMunicipalityDropDown.bind(this));
	},

	/**
	* Method: populateRegionDropDown
	* Populates region dropdown
	*/
	populateRegionDropDown: function(regions) {
		var regionDropdown = document.getElementById("ddlRegion_client");

		if (regionDropdown) {
			regionDropdown.innerHTML = "";
			var opt = document.createElement("option");
			opt.text = "Regioner";
			opt.value = "Regioner";
			regionDropdown.options.add(opt);
			try {
				for (var i = 0; i < regions.length; i++) {
					var opt = document.createElement("option");
					opt.text = regions[i].RegionName;
					opt.value = regions[i].RegionCode;
					regionDropdown.options.add(opt);
				}
			} catch (e) {
				// error
			}
		}
	},

	/**
	* Method: populateMunicipalityDropDown
	* Populates municipality dropdown
	*/
	populateMunicipalityDropDown: function(municipalities) {
		var municipalityDropdown = document.getElementById("ddlMunicipality_client");

		if (municipalityDropdown) {
			var municipalityCode = "Kommuner";
			var regionDropdown = document.getElementById("ddlRegion_client");
			var regionCode = regionDropdown[regionDropdown.selectedIndex].value;
			if (municipalityDropdown.length > 0 && regionCode != "Regioner") {
				municipalityCode = municipalityDropdown[municipalityDropdown.selectedIndex].value;
			}

			municipalityDropdown.innerHTML = "";
			var opt = document.createElement("option");
			opt.text = "Kommuner";
			opt.value = "Kommuner";
			municipalityDropdown.options.add(opt);
			try {
				for (var i = 0; i < municipalities.length; i++) {
					var opt = document.createElement("option");
					opt.text = municipalities[i].MunicipalityName;
					opt.value = municipalities[i].MunicipalityCode;
					municipalityDropdown.options.add(opt);
					if (opt.value == municipalityCode) municipalityDropdown.selectedIndex = i + 1;
				}
			} catch (e) {
				// error
			}
		}
	},

	/**
	* Method: setSelectedRegion
	* Re-sets the selected region on dropdown
	*/
	setSelectedRegion: function(regionCode) {
		var regionDropdown = document.getElementById("ddlRegion_client");

		if (regionDropdown) {
			for (var i = 0; i < regionDropdown.length; i++) {
				if (regionDropdown[i].value == regionCode) {
					regionDropdown.selectedIndex = i;
				}
			}
		}
	},

	/**
	* Method: zoomToBbox
	* Zooms to given bounding box
	*/
	zoomToBbox: function(bbox) {
		var bboxArr = bbox.split(',');
		var bbox = new OpenLayers.Bounds(bboxArr[0], bboxArr[1], bboxArr[2], bboxArr[3]);
		this.map.zoomToExtent(bbox);
	},

	/**
	* Method: createSelectBox 
	* Creates the select filters boxes
	*/
	createSelectBox: function(seperator) {
		var optiondiv = document.getElementById("filterDataView_option_div");
		if (optiondiv) {
			optiondiv.appendChild(document.createElement("br"));

			if (this.select_filters.dropdowns.dropdown.length) {
				// Multi
				for (var i = 0; i < this.select_filters.dropdowns.dropdown.length; i++) {
					select = document.createElement("select");
					var parent_select_id = "filterDataView_select_" + (i + 1);
					select.id = parent_select_id;
					select.className = "FilterDataView_filter_select";

					// Init eventhandler
					var eventhandler = function(e) { this.sender.select_parent_option_onchangeEvent(this.select); };
					OpenLayers.Event.observe(select, "change", OpenLayers.Function.bindAsEventListener(eventhandler, { sender: this, select: select.id }));
					var opt = document.createElement("option");
					opt.text = "Vælg";
					opt.value = "Vælg";
					opt.title = "Vælg";
					select.options.add(opt);
					// Only create dropbox with values
					if (this.select_filters.dropdowns.dropdown[i].option) {
						if (this.select_filters.dropdowns.dropdown[i].option.length) {
							// Multi option
							for (var j = 0; j < this.select_filters.dropdowns.dropdown[i].option.length; j++) {
								opt = document.createElement("option")
								opt.text = this.select_filters.dropdowns.dropdown[i].option[j]["@value"].toString();
								opt.value = this.select_filters.dropdowns.dropdown[i].option[j]["@id"].toString();
								opt.title = this.select_filters.dropdowns.dropdown[i].option[j]["@value"].toString();
								select.options.add(opt);
							}
						} else {
							// Single option
							opt = document.createElement("option")
							opt.text = this.select_filters.dropdowns.dropdown[i].option["@value"].toString();
							opt.value = this.select_filters.dropdowns.dropdown[i].option["@id"].toString();
							opt.title = this.select_filters.dropdowns.dropdown[i].option["@value"].toString();
							select.options.add(opt);
						}

						var header = document.createElement("span");
						header.innerHTML = this.select_filters.dropdowns.dropdown[i]["@header"].toString();
						header.className = "FilterDataView_filter_span";
						optiondiv.appendChild(header);
						optiondiv.appendChild(select);
						this.number_of_filters += 1;
						// init second div
						if (this.select_filters.dropdowns.dropdown[i]["@subheader"]) {
							select = document.createElement("select");
							select.id = "sub_" + parent_select_id;
							select.className = "FilterDataView_filter_select";
							opt = document.createElement("option")
							opt.text = "Vælg";
							opt.value = "Vælg";
							opt.title = "Vælg";
							select.options.add(opt)
							select.disabled = true;
							header = document.createElement("span");
							header.innerHTML = this.select_filters.dropdowns.dropdown[i]["@subheader"];
							header.className = "FilterDataView_filter_span";
							optiondiv.appendChild(header);
							//optiondiv.appendChild(document.createElement("br"));
							optiondiv.appendChild(select);
							this.number_of_sub_filters += 1;
						}
					}
				} //end for
			}
			else {
				// Single
				var select = document.createElement("select");
				select.id = "filterDataView_select_1";
				select.className = "FilterDataView_filter_select";
				// Create eventhandler for onchange
				var eventhandler = function(e) { this.sender.select_parent_option_onchangeEvent(this.select); };
				OpenLayers.Event.observe(select, "change",
                OpenLayers.Function.bindAsEventListener(eventhandler, { sender: this, select: select.id }));

				var opt = document.createElement("option");
				opt.text = "Vælg";
				opt.value = "Vælg";
				opt.title = "Vælg";
				select.options.add(opt);
				if (this.select_filters.dropdowns.dropdown.option.length) {
					// Multi option
					for (var i = 0; i < this.select_filters.dropdowns.dropdown.option.length; i++) {
						opt = document.createElement("option")
						opt.text = this.select_filters.dropdowns.dropdown.option[i]["@value"].toString();
						opt.value = this.select_filters.dropdowns.dropdown.option[i]["@id"].toString();
						opt.title = this.select_filters.dropdowns.dropdown.option[i]["@value"].toString();
						select.options.add(opt);
					}
				} else {
					// Single option
					opt = document.createElement("option")
					opt.text = this.select_filters.dropdowns.dropdown.option["@value"].toString();
					opt.value = this.select_filters.dropdowns.dropdown.option["@id"].toString();
					opt.title = this.select_filters.dropdowns.dropdown.option["@value"].toString();
					select.options.add(opt);
				}
				// Header for parent select
				var header = document.createElement("span");
				header.innerHTML = this.select_filters.dropdowns.dropdown["@header"].toString();
				header.className = "FilterDataView_filter_span";
				optiondiv.appendChild(header);
				//optiondiv.appendChild(document.createElement("br"));
				optiondiv.appendChild(select);
				//optiondiv.appendChild(document.createElement("br"));
				this.number_of_filters += 1;
				// init sub select
				if (this.select_filters.dropdowns.dropdown["@subheader"]) {
					select = document.createElement("select");
					select.id = "sub_filterDataView_select_1";
					select.className = "FilterDataView_filter_select";
					opt = document.createElement("option")
					opt.text = "Vælg";
					opt.value = "Vælg";
					opt.title = "Vælg";
					select.options.add(opt)
					select.disabled = true;
					header = document.createElement("span");
					header.innerHTML = this.select_filters.dropdowns.dropdown["@subheader"];
					header.className = "FilterDataView_filter_span";
					optiondiv.appendChild(header);
					//optiondiv.appendChild(document.createElement("br"));
					optiondiv.appendChild(select);
					this.number_of_sub_filters += 1;
				}
			}
		}
	},

	/**
	* Event: select_parent_option_onchangeEvent
	* Handles the onchange event for parent select.
	* Updates the subtion with new options
	*/
	select_parent_option_onchangeEvent: function(id) {
		var selectbox = document.getElementById(id);
		var extension = id.toString().substring(id.toString().lastIndexOf("_"));
		var parent_selec_index = id.toString().substring(id.toString().lastIndexOf("_") + 1);
		var childselectbox = document.getElementById("sub_filterDataView_select" + extension);
		if (selectbox && childselectbox) {

			var index = selectbox[selectbox.selectedIndex].index;
			if (index == 0) {
				// reset
				childselectbox.selectedIndex = 0;
				childselectbox.disabled = true;
			} else {
				// selectbox
				childselectbox.innerHTML = "";
				childselectbox.className = "FilterDataView_filter_select";
				opt = document.createElement("option")
				opt.text = "Vælg";
				opt.value = "Vælg";
				opt.title = "Vælg";
				childselectbox.options.add(opt);
				if (this.select_filters.dropdowns.dropdown.length) {
					// Multi dropdown
					parent_selec_index = parseInt(parent_selec_index) - 1;
					if (this.select_filters.dropdowns.dropdown[parent_selec_index].option.length) {
						// Multi option
						if (this.select_filters.dropdowns.dropdown[parent_selec_index].option[index - 1].suboption.length) {
							// Multi suboption
							for (var i = 0; i < this.select_filters.dropdowns.dropdown[parent_selec_index].option[index - 1].suboption.length; i++) {
								opt = document.createElement("option")
								opt.value = this.select_filters.dropdowns.dropdown[parent_selec_index].option[index - 1].suboption[i]["@id"].toString();
								opt.text = this.select_filters.dropdowns.dropdown[parent_selec_index].option[index - 1].suboption[i]["@value"].toString();
								opt.title = this.select_filters.dropdowns.dropdown[parent_selec_index].option[index - 1].suboption[i]["@value"].toString();
								childselectbox.options.add(opt);
							}
						} else {
							// Single suboption
							opt = document.createElement("option")
							opt.value = this.select_filters.dropdowns.dropdown[parent_selec_index].option[index - 1].suboption["@id"].toString();
							opt.text = this.select_filters.dropdowns.dropdown[parent_selec_index].option[index - 1].suboption["@value"].toString();
							opt.title = this.select_filters.dropdowns.dropdown[parent_selec_index].option[index - 1].suboption["@value"].toString();
							childselectbox.options.add(opt);
						}
					} else {
						// Single option
						if (this.select_filters.dropdowns.dropdown[parent_selec_index].option.suboption.length) {
							// Multi suboption
							for (var i = 0; i < this.select_filters.dropdowns.dropdown[parent_selec_index].option.suboption.length; i++) {
								opt = document.createElement("option")
								opt.value = this.select_filters.dropdowns.dropdown[parent_selec_index].option.suboption[i]["@id"].toString();
								opt.text = this.select_filters.dropdowns.dropdown[parent_selec_index].option.suboption[i]["@value"].toString();
								opt.title = this.select_filters.dropdowns.dropdown[parent_selec_index].option.suboption[i]["@value"].toString();
								childselectbox.options.add(opt);
							}
						} else {
							// Single suboption
							opt = document.createElement("option")
							opt.value = this.select_filters.dropdowns.dropdown[parent_selec_index].option.suboption["@id"].toString();
							opt.text = this.select_filters.dropdowns.dropdown[parent_selec_index].option.suboption["@value"].toString();
							opt.title = this.select_filters.dropdowns.dropdown[parent_selec_index].option.suboption["@value"].toString();
							childselectbox.options.add(opt);
						}
					}
				} else {
					// Single dropdown
					if (this.select_filters.dropdowns.dropdown.option.length) {
						// Multi option
						if (this.select_filters.dropdowns.dropdown.option[index - 1].suboption.length) {
							// Muliti suboption
							for (var i = 0; i < this.select_filters.dropdowns.dropdown.option[index - 1].suboption.length; i++) {
								opt = document.createElement("option")
								opt.value = this.select_filters.dropdowns.dropdown.option[index - 1].suboption[i]["@id"].toString();
								opt.text = this.select_filters.dropdowns.dropdown.option[index - 1].suboption[i]["@value"].toString();
								opt.title = this.select_filters.dropdowns.dropdown.option[index - 1].suboption[i]["@value"].toString();
								childselectbox.options.add(opt);
							}
						} else {
							// Single suboption
							opt = document.createElement("option")
							opt.value = this.select_filters.dropdowns.dropdown.option[index - 1].suboption["@id"].toString();
							opt.text = this.select_filters.dropdowns.dropdown.option[index - 1].suboption["@value"].toString();
							opt.title = this.select_filters.dropdowns.dropdown.option[index - 1].suboption["@value"].toString();
							childselectbox.options.add(opt);
						}
					} else {
						// Single option
						if (this.select_filters.dropdowns.dropdown.option.suboption.length) {
							// Multi suboption
							opt = document.createElement("option")
							opt.value = this.select_filters.dropdowns.dropdown.option.suboption[i]["@id"].toString();
							opt.text = this.select_filters.dropdowns.dropdown.option.suboption[i]["@value"].toString();
							opt.title = this.select_filters.dropdowns.dropdown.option.suboption[i]["@value"].toString();
							childselectbox.options.add(opt);
						} else {
							// Single suboption
							opt = document.createElement("option")
							opt.value = this.select_filters.dropdowns.dropdown.option.suboption["@id"].toString();
							opt.text = this.select_filters.dropdowns.dropdown.option.suboption["@value"].toString();
							opt.title = this.select_filters.dropdowns.dropdown.option.suboption["@value"].toString();
							childselectbox.options.add(opt);
						}
					}
				}
				childselectbox.disabled = false;
			}
		}
	},

	/**
	* Method: createCheckbox
	* Creates a option list of layers to apply the filters on
	*/
	createCheckbox: function() {
		try {
			var layers_div = document.getElementById("fdv_layers_div");
			if (layers_div) {
				// Test for multi layers
				if (this.check_filters.checkbox.layerfilter.length) {
					for (var i = 0; i < this.check_filters.checkbox.layerfilter.length; i++) {
						var checkbox = document.createElement("input");
						var namelabel = document.createElement("label");

						// Init checkbox
						checkbox.type = "checkbox";
						checkbox.id = "filterlayercheck_box_" + this.number_of_layers;
						checkbox.value = this.check_filters.checkbox.layerfilter[i]["@layername"];
						checkbox.name = this.check_filters.checkbox.layerfilter[i]["@layername"];
						checkbox.checked = (this.check_filters.checkbox.layerfilter[i]["@checked"] == true) ? true : false;
						checkbox.defaultChecked = (this.check_filters.checkbox.layerfilter[i]["@checked"] == true) ? true : false;

						// Create eventhandler for onchange
						/*	var eventhandler = function(e) { this.sender.event_oncheck_handler(this.checkbox); };
						OpenLayers.Event.observe(checkbox, "click",
						OpenLayers.Function.bindAsEventListener(eventhandler, { sender: this, checkbox: checkbox.id }));
						*/
						// Init label
						var labeltext = document.createTextNode(this.check_filters.checkbox.layerfilter[i]["@displayname"]);

						this.number_of_layers += 1;
						// Init icon
						namelabel.appendChild(labeltext);
						namelabel.className = "FilterDataView_layersname_label";
						layers_div.appendChild(document.createElement("br"));
						layers_div.appendChild(checkbox);
						layers_div.appendChild(namelabel);
						var icon = document.createElement("img");
						icon.src = this.check_filters.checkbox.layerfilter[i]["@imageurl"];
						icon.className = "FilterDataView_icon_img";
						layers_div.appendChild(icon);
					}
				} else {
					// Single layer
					var checkbox = document.createElement("input");
					var namelabel = document.createElement("label");

					// Init checkbox
					checkbox.type = "checkbox";
					checkbox.id = "filterlayercheck_box_" + this.number_of_layers;
					checkbox.value = this.check_filters.checkbox.layerfilter["@layername"];
					checkbox.name = this.check_filters.checkbox.layerfilter["@layername"];
					checkbox.checked = (this.check_filters.checkbox.layerfilter["@checked"] == true) ? true : false;
					checkbox.defaultChecked = (this.check_filters.checkbox.layerfilter["@checked"] == true) ? true : false;

					// Create eventhandler for onchange
					/*var eventhandler = function(e) { this.sender.event_oncheck_handler(this.checkbox); };
					OpenLayers.Event.observe(checkbox, "click",
					OpenLayers.Function.bindAsEventListener(eventhandler, { sender: this, checkbox: checkbox.id }));
					*/
					// Init label
					var labeltext = document.createTextNode(this.check_filters.checkbox.layerfilter["@displayname"]);

					this.number_of_layers += 1;
					// Init icon

					namelabel.appendChild(labeltext);
					layers_div.appendChild(document.createElement("br"));
					layers_div.appendChild(checkbox);
					layers_div.appendChild(namelabel);
					var icon = document.createElement("img");
					icon.src = this.check_filters.checkbox.layerfilter["@imageurl"];
					icon.className = "FilterDataView_icon_img";
					layers_div.appendChild(icon);
				}

				// Image show buttom
				try {
					var showbuttom = document.createElement("img");
					showbuttom.type = "image";
					showbuttom.className = "FilterDataView_show_imagebutton";
					var src = "/Viskort/App_Themes/MasteDB/Images/show_button.png";
					showbuttom.src = "/Viskort/App_Themes/MasteDB/Images/show_button.png";
					//showbuttom.onmouseout = showbuttom.src = '/Viskort/App_Themes/MasteDB/Images/show_button.png';
					//showbuttom.onmouseover = showbuttom.src = '/Viskort/App_Themes/MasteDB/Images/search_button_mouseover.png';

					showbuttom.title = "Vis";
					showbuttom.id = "showbuttom_1";
					showbuttom.name = "showbuttom";
					layers_div.appendChild(document.createElement("br"));
					layers_div.appendChild(showbuttom);
					var eventhandler = function(e) { this.sender.click_show(); };
					OpenLayers.Event.observe(showbuttom, "click",
                        OpenLayers.Function.bindAsEventListener(eventhandler, { sender: this }));
					var eventhandler2 = function(e) { this.sender.event_handler_onmouseout(); };
					OpenLayers.Event.observe(showbuttom, "mouseout",
                        OpenLayers.Function.bindAsEventListener(eventhandler2, { sender: this }));
					var eventhandler3 = function(e) { this.sender.event_handler_onmouseover(); };
					OpenLayers.Event.observe(showbuttom, "mouseover",
                        OpenLayers.Function.bindAsEventListener(eventhandler3, { sender: this }));
				} catch (e) {
					alert("error");
				}

			}
		} catch (e) {
		}
	},

	event_oncheck_handler: function(id) {
	},

	event_handler_onmouseout: function() {
		var button = document.getElementById("showbutton_1");
		if (button) {
			button.src = '/Viskort/App_Themes/MasteDB/Images/show_button.png';
		}
	},

	event_handler_onmouseover: function() {
		var button = document.getElementById("showbutton_1");
		if (button) {
			button.src = '/Viskort/App_Themes/MasteDB/Images/search_button_mouseover.png';
		}
	},

	/*
	* Method: findselected_filters
	*
	*/
	findselected_filters: function() {
		var search_filters = new Array();
		var multiSearch = false;
		// Find search_filters for options
		for (var i = 0; i < this.number_of_filters; i++) {
			id = "filterDataView_select_" + (i + 1);
			value = this.get_select_value(id, "index");
			if (value != "notfound" && value.toString().toLowerCase() != "vælg") {
				if (this.select_filters.dropdowns.dropdown.length) {
					search_filters[search_filters.length] = {
						propertyName: this.select_filters.dropdowns.dropdown[i]["@property"],
						compareValue: value
					};
				}
				else {
					search_filters[search_filters.length] = {
						propertyName: this.select_filters.dropdowns.dropdown["@property"],
						compareValue: value
					};
				}
			}
		}

		// Finds search_filters for suboptions
		for (var j = 0; j < this.number_of_filters; j++) {
			id = "sub_filterDataView_select_" + (j + 1);
			value = this.get_select_value(id, "index");
			if (value != "notfound" && value.toString().toLowerCase() != "vælg") {
				if (this.select_filters.dropdowns.dropdown.length) {
					search_filters[search_filters.length] = {
						propertyName: this.select_filters.dropdowns.dropdown[j]["@subproperty"],
						compareValue: value
					};
				} else {
					search_filters[search_filters.length] = {
						propertyName: this.select_filters.dropdowns.dropdown["@subproperty"],
						compareValue: value
					};
				}
			}
		}
		/*if (search_filters.length == 0 && multiSearch) {
		search_filters[search_filters] = "alle";
		}*/
		return search_filters
	},

	/*
	* Method: click_show
	* Handles clickevents for show filters
	*/
	click_show: function() {
		var search_filters = new Array();

		// Find search_filters for options
		search_filters = this.findselected_filters();
		if (search_filters.length == 0) {
			alert("Der skal vælges en tjenestetype i listen før du kan få vist data.");
			return;
		}

		var multisearch = true;
		for (var i = 0; i < search_filters.length; i++) {
			if (search_filters[i].compareValue != "*") {
				multisearch = false;
				break;
			}
		}
		if (multisearch) {
			search_filters = new Array();
		}

		// Create compare filterstop
		var compare_filters = Array();
		for (var i = 0; i < search_filters.length; i++) {
			if (search_filters[i].compareValue != "-1") {
				compare_filters[compare_filters.length] = this.set_Filter_EQUAL_TO(search_filters[i].propertyName, search_filters[i].compareValue);
			}
		}

		// Add boundingbox filter
		//this.map
		/*var boundingbox = this.map.getExtent();
		if (boundingbox) {
		compare_filters[compare_filters.length] = this.set_Filter_BBOX("EPSG:25832", boundingbox);
		}*/

		// Setup filter for layer
		filter = new OpenLayers.Filter.Logical({
			type: OpenLayers.Filter.Logical.AND,
			filters: compare_filters
		});

		// Find layers
		var filter_layers = new Array();
		if (this.number_of_layers.length != 0) {
			if (this.number_of_layers > 1) {
				for (var i = 0; i < this.number_of_layers; i++) {
					var layer_to_filter = this.map.getLayersByName(this.check_filters.checkbox.layerfilter[i]["@layername"])[0];
					if (layer_to_filter && this.checkforRedraw(layer_to_filter)) {
						filter_layers[filter_layers.length] = layer_to_filter;
					}
				}
			} else {
				var layer_to_filter = this.map.getLayersByName(this.check_filters.checkbox.layerfilter["@layername"])[0];
				if (layer_to_filter && this.checkforRedraw(layer_to_filter)) {
					filter_layers[0] = layer_to_filter;
				}
			}
		}
		if (filter_layers.length == 0) {
			alert("Vælg venligst eksisterende og/eller planlagte positioner \nfor at positionerne kan vises på kortet");
		}

		// Add filters
		for (var i = 0; i < filter_layers.length; i++) {
			filter_layers[i].params.filter = new OpenLayers.Format.XML().write(new OpenLayers.Format.Filter({ version: "1.0.0" }).write(filter));
		}

		// Update map need check
		for (var i = 0; i < filter_layers.length; i++) {
			if (filter_layers[i].visibility = true) {
				filter_layers[i].redraw();
			}
		}

		// Parameters for updating listviewer
		var parameter_list = document.getElementById("Featurelist_parameters");
		if (parameter_list) {

			var bbox = this.map.getExtent();
			var str = "E_min;" + Math.round(bbox.left) + "#N_min;" + Math.round(bbox.bottom) + "#E_max;" + Math.round(bbox.right) + "#N_max;" + Math.round(bbox.top) + "#";

			if (this.address_markers_layer.markers.length == 1) {
				str += "E_point;" + Math.round(this.address_markers_layer.markers[0].lonlat.lon) + "#";
				str += "N_point;" + Math.round(this.address_markers_layer.markers[0].lonlat.lat) + "#";
			} else {
				str += "E_point;0#";
				str += "N_point;0#";
			}

			// filters
			for (var i = 0; i < search_filters.length; i++) {
				str += search_filters[i].propertyName + ";" + search_filters[i].compareValue + "#";
			}

			// layers
			for (var i = 0; i < filter_layers.length; i++) {
				var id = filter_layers[i].mapConfigId;

				if (this.check_filters.checkbox.layerfilter.length) {
					for (var j = 0; j < this.check_filters.checkbox.layerfilter.length; j++) {
						var mapconfigid = this.check_filters.checkbox.layerfilter[j]["@id"];
						if (mapconfigid == id) {
							if (this.check_filters.checkbox.layerfilter[i]["@useasfilter"]) {
								var spname = this.check_filters.checkbox.layerfilter[j]["@spname"];
								str += spname + ";" + true + "#";
							}
						}
					}
				} else {
					var mapconfigid = this.check_filters.checkbox.layerfilter["@id"];
					if (mapconfigid == id) {
						if (this.check_filters.checkbox.layerfilter["@useasfilter"]) {
							var spname = this.check_filters.checkbox.layerfilter["@spname"];
							str += spname + ";" + true + "#";
						}
					}
				}
			}

			/* activefilters = str.split("#");
			// Check storeprocedure parameters
			for (var i = 0; i < this.jsonparameters.Query.param.length; i++) {
			var parameter = this.jsonparameters.Query.param[i]["@name"];
			var found = false;
			for (var j = 0; j < activefilters.length; j++) {
			if (activefilters[j].match(parameter)) {
			found = true;
			break;
			}
			}
			if (!found) {
			str += parameter + ";null#";
			found = false;
			}
			}
			*/

			// Parameters_list for the listbox
			var index = str.lastIndexOf("#");
			str = str.substr(0, index);
			parameter_list.value = str;

			// Update the list if it's TabPanel is active
			if (FeatursListUP && MapTabContainer) {
				var tab = $find(MapTabContainer);
				var active = tab.get_activeTab().get_id();
				var tabClientID = active.substring(active.lastIndexOf('_') + 1);
				if (tabClientID == "ListTabPanel") {
					__doPostBack(FeatursListUP);
				}
			}
		}
	},

	/**
	* Method: set_Filter_EQUAL_TO
	* Creates a equal filter
	*/
	set_Filter_EQUAL_TO: function(propertyName, compareValue) {
		var filter = new OpenLayers.Filter.Comparison({
			type: OpenLayers.Filter.Comparison.EQUAL_TO,
			property: propertyName,
			value: compareValue
		});
		return filter
	},

	/**
	* Method: set_Filter_BBOX
	* Creates a bbox filter
	*/
	set_Filter_BBOX: function(map_projection, bounds) {
		var filter = new OpenLayers.Filter.Spatial({
			type: OpenLayers.Filter.Spatial.BBOX,
			value: bounds,
			projection: map_projection
		});
		return filter;
	},

	checkforRedraw: function(layer) {
		for (var i = 0; i < this.number_of_layers; i++) {
			var checkbox = document.getElementById("filterlayercheck_box_" + i);
			if (checkbox && checkbox.value == layer.name) {
				if (checkbox.checked) {
					layer.setVisibility(true);
					return true;
				} else {
					layer.setVisibility(false);
					return false;
				}
			}
		}
		return false;
	},

	get_select_value: function(id, item) {
		var select = document.getElementById(id);
		if (select) {
			if (item == "text") {
				return select[select.selectedIndex].text;
			}
			else {
				return select[select.selectedIndex].value;
			}
		} else {
			return "notfound";
		}
	},

	showHelpWindow: function(cont) {
		// get body
		var bodyTag = document.getElementsByTagName("body");
		// create the background div
		var backgroundDiv = document.createElement("div");
		backgroundDiv.className = "ModalBackground";
		// create the content div
		var contentDiv = document.createElement("div");
		contentDiv.className = "ModalContent";
		// create the 'close' image div and attache a 'click' eventhandler
		var imageDiv = document.createElement("div");
		imageDiv.className = "ModalClose";
		var eventhandler = function(e) { this.sender.closeHelpWindow(backgroundDiv, contentDiv); };
		OpenLayers.Event.observe(imageDiv, "click", OpenLayers.Function.bindAsEventListener(eventhandler, { sender: this }));
		// define the content text
		var content = document.createElement("div");
		if (cont == "address") {
			content.innerHTML =
				"<b>Søg via adresse</b>" +
				"<br /><br />" +
				"I adressefeltet kan du indtaste gadenavn, husnummer, postnummer og by og trykke søg. Du behøver ikke at skrive hele adressen. Hvis der findes flere adresser med samme navn, vil der komme en liste med mulige adresser, som du kan vælge ud fra. Når du har søgt på en adresse, vil kortet zoome til området og vise lokalitet med et grønt \"drage\"-ikon." +
				"<br /><br />" +
				"Du kan også søge ved at vælge en region og herefter kommune." +
				"<br /><br />" +
				"Det er en god ide at afgrænse et mindre område inden du vælger at få vist data om antennernes placering, så kun relevante antennepositioner fremgår på kortet.";
		}
		else if (cont == "filters") {
			content.innerHTML =
				"<b>Valg af information om antennerne</b>" +
				"<br /><br />" +
				"Når du har afgrænset hvilket område du ønsker oplysninger om, kan du vælge hvilken tjenestetype og teknologi du vil have vist på kortet eller på listen, samt om det skal være eksisterende eller planlagte antennepositioner eller både eksisterende og planlagte antennepositioner. Søgningen afsluttes ved at klikke på \"Vis\", hvorefter antennernes placering vises på kortet. Ved at klikke på fanebladet \"Liste\", vises en liste med de antenner der fremgår på kortet." +
				"<br /><br />" +
				"På kortet kan du klikke på en given antenneposition for at få oplysninger om navnet på antenneejeren, placeringen af antennepositionen, samt angivelse af hvilken teknologi, antennen anvendes til." +
				"<br /><br />" +
				"Hvis du vil se regionsgrænser eller kommunegrænser, kan du tilvælge visning af disse ved at åbne kortindholdet i kortets øverste højre hjørne og vælge disse. Oversigtskortet i kortets nederste højre hjørne viser et lidt større kortudsnit end det valgte.";
		}
		else if (cont == "mapList") {
			content.innerHTML =
				"<b>Søg via kort</b>" +
				"<br /><br />" +
				"Øverst i kortets venstre side findes en navigationsbar. De fire øverste pile flytter kortet mod henholdsvis nord, syd, øst eller vest. Baren under pilene bruges til at zoome ud og ind i kortet ved at klikke med musen på \"+\" eller \"-\", eller ved at trække baren op eller ned. Du kan også zoome på kortet ved at klikke på tastaturets \"+\" eller \"-\". Tastaturets piletaster vil rykke kortet mod henholdsvis nord, syd, øst eller vest." +
				"<br /><br />" +
				"Du kan også navigere i kortet ved at bruge musens andre funktioner. Hvis du bruger hjulet på musen vil kortet zoome ind og ud når musen er indenfor kortets grænser. Ved at holde venstre museknap nede kan du rykke kortet i en ønsket retning. Hvis du holder tastaturets \"shift-tast\" nede, samtidig med at holde venstre museknap nede kan du markere et udsnit i kortet, hvorefter der vil blive zoomet til dette udsnit." +
				"<br /><br />" +
				"<b>Søg via liste</b>" +
				"<br /><br />" +
				"Du kan vælge listevisning ved at klikke på \"Liste\" over kortet. I listen vises kortets antennepositioner som tekst. Listen indeholder oplysninger om antennepositionens adresse, teknologitype, antennepositionens afstand fra søgeadressen hvis der er søgt på dette, samt om det er en eksisterende eller planlagt antenneposition. Ved at holde musen over i-ikonet ud for hver linje, kommer der informationer om ejeren af antennepositionen. Du kan sortere visningen ved at klikke på kolonnernes overskrifter.";
		}
		// add the 'close' div to the content div
		contentDiv.appendChild(imageDiv);
		// add content to the content div
		contentDiv.appendChild(content);
		// add the content div to the body
		bodyTag[0].appendChild(contentDiv);
		// add the background div to the body
		bodyTag[0].appendChild(backgroundDiv);
		// find div height and width and adjust correct screen placement using minus margins
		contentDiv.style.marginLeft = "-" + contentDiv.clientWidth / 2 + "px";
		contentDiv.style.marginTop = "-" + contentDiv.clientHeight / 2 + "px";
	},

	closeHelpWindow: function(backgroundDiv, contentDiv) {
		// get body
		var bodyTag = document.getElementsByTagName("body");
		// remove the content div
		bodyTag[0].removeChild(contentDiv);
		// remove the background div
		bodyTag[0].removeChild(backgroundDiv);
	},

	CLASS_NAME: "VisKort.Component.FilterDataView"
});