function on(imgName) {
	if (document.images) {
		document [imgName].src = eval(imgName + "b.src");
	}
}

function off(imgName) {
	if (document.images) {
		document [imgName].src = eval(imgName + "a.src");
	}
}

function roadmap (target) {
	openwin = window.open(target, "Straßenkarte", "top=50,left=171,width=640,height=640,resizable=0,directories=0,alwaysRaised=1,dependent=1,location=0,menubar=0,personalbar=0,scrollbars=0,status=0,toolbar=0,scrollable=0");
}

function floorplan (target) {
	openwin = window.open(target, "Grundriss", "top=50,left=0,width=560,height=720,resizable=0,directories=0,alwaysRaised=1,dependent=1,location=0,menubar=0,personalbar=0,scrollbars=1,status=0,toolbar=0,scrollable=1");
}

function zoomImage (target) {
	var preview = '';
	if ( target ) {
		var x = (screen.availWidth / 2) - 400;
		var y = (screen.availHeight / 2) - 300;

		preview = window.open("/preview-image.shtml?"+ target, "Zoom", "top=50,left=0,width=380,height=380,resizable=0,directories=0,alwaysRaised=1,dependent=1,location=0,menubar=0,personalbar=0,scrollbars=1,status=0,toolbar=0,scrollable=1");
		preview.moveTo(x,y);
		preview.focus();
	}
	else {
		preview.close();
	}
}

function switchImage(mainImage,imgName) {
	if (document.images) {
		document [mainImage].src = eval(imgName + "b.src");
		document [mainImage].width = eval(imgName + "b.width");
		document [mainImage].height = eval(imgName + "b.height");
		document [mainImage].title = eval(imgName + "b.title");
		document [mainImage].alt = eval(imgName + "b.title");
	}
}

function checkCategorie (id) {
	// Id 30 = Kaufen/Neubau
	// Id 32 = Mieten/FeWo
	// Id 33 = Kaufen/FeWo
	if (id == 30) {
		if (document.SelectionForm.CityId) {
			document.SelectionForm.CityId.disabled = 1;
			document.SelectionForm.CityId.value = 0;
		}
		if (document.SelectionForm.DistrictId) {
			document.SelectionForm.DistrictId.disabled = 1;
			document.SelectionForm.DistrictId.value = 0;
		}
	}
	else if (id != 30) {
		if (document.SelectionForm.CityId) {
			document.SelectionForm.CityId.disabled = 0;
		}
		if (document.SelectionForm.DistrictId) {
			document.SelectionForm.DistrictId.disabled = 0;
		}
	}
}

function ChangeDistrictId (CityId, QueryCityId) {
	if (CityId == QueryCityId) {
		document.SelectionForm.DistrictId.disabled = 0;
	}
	else {
		document.SelectionForm.DistrictId.selectedIndex = 0;
		document.SelectionForm.DistrictId.disabled = 1;
	}
}

function ChangeCategorieGroupId (CategorieGroupId) {
	if (CategorieGroupId == 1) {
		document.SelectionForm.RentalCold.disabled = 0;

		document.SelectionForm.PurchasePrice.selectedIndex = 0;
		document.SelectionForm.PurchasePrice.disabled = 1;
	}
	else if (CategorieGroupId == 2) {
		document.SelectionForm.RentalCold.selectedIndex = 0;
		document.SelectionForm.RentalCold.disabled = 1;

		document.SelectionForm.PurchasePrice.disabled = 0;
	}
	else if (CategorieGroupId == 3) {
		document.SelectionForm.RentalCold.disabled = 0;
		document.SelectionForm.PurchasePrice.disabled = 0;
	}
}

function switchImpress () {

	document.getElementById('Impress').style.display = 'block';
	document.getElementById('Impress-Link').style.display = 'none';

	return false;
}

