// a common PullDownMenu
var activeAndOpen;
function openAPullDown(id) {

	if(document.getElementById(id).style.display != 'block')
	{
		if (activeAndOpen != null)
		{
			document.getElementById(activeAndOpen).style.display = 'none';
			document.getElementById(activeAndOpen).style.height = '0';
		}
		document.getElementById(id).style.display = 'block';
		document.getElementById(id).style.height = 'auto';
		activeAndOpen = id;
	}
	else
	{
		document.getElementById(id).style.display = 'none';
		document.getElementById(id).style.height = '0';
		if (activeAndOpen != null)
		{
			document.getElementById(activeAndOpen).style.display = 'none';
			document.getElementById(activeAndOpen).style.height = '0';
			activeAndOpen = null;
		}
	}
}

// Author: Harald Klotzberg
// Set Active item in Dropdowns

function setActiveItem(target, item) {

	if ((item != null) && (target != null)) {

		document.getElementById(target).innerHTML = item;

		if ("selectedCountry" == target) {
			fillCountryFormOnChange();
		}

		if ("selectedRadius" == target) {
			fillRadiusFormOnChange();
		}

		if ("selectedObjType" == target) {
			fillObjectTypeOnChange();
		}

		if ("selectedApplicationArea" == target) {
			fillApplicationAreaOnChange();
		}

		if ("selectedProdType" == target) {
			fillProdTypeOnChange();
		}

		if ("selectedResultsAtATime" == target) {
			fillResultsAtATimeOnChange();
		}

		if ("selectedProdSurface" == target) {
			fillProdSurfaceOnChange();
		}

		if ("selectedProdColor" == target) {
			fillProdColorOnChange();
		}

		if ("selectedObjectRegion" == target) {
			fillObjectRegionOnChange();
		}
	}

}
