function CitySelection( formName , cityBoxName, selectedCityBoxName, provinceSelector) {
	
	this.form = document.forms[formName]; //naam formulier
	this.cityBox = this.form[cityBoxName]; //naam van de plaatsen box
	this.selectedCityBox = this.form[selectedCityBoxName]; //naam geselecteerde plaatsen box
	this.provinceSelector = this.form[provinceSelector]; //naam provincie dropdown
	this.exists = function() {
		alert("cities");
	};
	this.searchCities = function() {
		var province = this.provinceSelector.options[ this.provinceSelector.selectedIndex ].value; 
		//disable city box
		this.cityBox.disabled = true;
		//clear option
		this.cityBox.options.length = 0;
		// set loading
		this.cityBox.options[0] = new Option( 'Bezig met laden..' );
		//make ajax request
		requestURI = '/public/js/Ajax/cfm/searchCities.cfm?province='+ province;
		http("GET", requestURI , this.searchResponse);
	};
	this.searchResponse = function( obj ) {
		this.cityBox.options.length = 0;
		if(obj.length) {
			for(i=0;i < obj.length; i++) {
				this.cityBox.options[i] = new Option(obj[i].city,obj[i].city_id);
			}
		}
		this.cityBox.disabled = false;
	};
	this.addCity = function(text) {
		var selectedOption = this.cityBox.options[this.cityBox.selectedIndex];
		var isSelected = false;
		for(y=0;y < this.selectedCityBox.options.length; y++) {
			if(this.selectedCityBox.options[y].value == selectedOption.value){
				isSelected = true;
			}	
		}
		if( !isSelected ) {
			if(!text){
				this.selectedCityBox.options[this.selectedCityBox.options.length] = new Option(selectedOption.text,selectedOption.value);
			}
			else{
				this.selectedCityBox.options[this.selectedCityBox.options.length] = new Option(selectedOption.text,selectedOption.text);
			}
			isSelected = false;
		}
	};
	this.removeCity = function() {
		for(i=0;i < f.selected_cities.options.length; i++) {
			if( this.selectedCityBox.options[i].selected ) {
				this.selectedCityBox.options[i] = null;
			}
		}
	};
	this.selectAll = function( name ) {
		if(name == "selected") {
			for(i=0;i < this.selectedCityBox.options.length ; i++) {
				this.selectedCityBox.options[i].selected = true;
			}
		} else {
			for(i=0;i < this.cityBox.options.length ; i++) {
				this.cityBox.options[i].selected = true;
			}
		}
	};
	return this;
}
