
	var posx;
	var posy;
	var onoff = 0;
	var popUpActive = 0;

	function setPopUpActive(number) {
		popUpActive = number;
	}

	function changeDistrict(districtId) {
		var addrstring = window.location.href;
		var districtStart = addrstring.indexOf('district=');
		if (districtStart > -1) { //change existing district parameter
			var districtEnd = addrstring.indexOf('&', districtStart);
			if (districtEnd == -1) {
				districtEnd = addrstring.length;
			}
			addrstring = addrstring.substring(0, districtStart + 9) + districtId + addrstring.substring(districtEnd, addrstring.length);
		} else { //add new district parameter
			if ((addrstring.indexOf("?") == -1) ) {
				if (addrstring.charAt(addrstring.length - 1) == "/" ) {
					addrstring = addrstring.slice(0, addrstring.length - 1) + '?';
				} else {
					addrstring = addrstring + '?';
				}
			} else {
				addrstring = addrstring + '&';
			}
			addrstring = addrstring + 'district=' + districtId;
		}
		top.window.location.href = addrstring;
	}

 	function getMouse(e,popupname) {
		posx = 0;
		posy = 0;
		var ev = (!e) ? window.event : e; //Moz:IE
		if (ev.pageX) {
			posx = ev.pageX;
			posy = ev.pageY;
		} //Mozilla or compatible
		else if (ev.clientX) {
			posx = ev.clientX;
			posy = ev.clientY + (document.documentElement.scrollTop || document.body.scrollTop);
		}//IE or compatible
		else {
			return false;
		}//old browsers
		posy = posy - 65;
		document.getElementById(popupname).style.top = posy + "px";
		setVisible(popupname);
	}

	function setVisible(elemid) {
	  if (document.all) {
		document.all[elemid].style.display = "block";
	  } else if (document.getElementById) {
		document.getElementById(elemid).style.display = "block";
	  }
	}

	function setHidden(elemid) {
		setTimeout("hidePopUp('"+elemid+"')", 1000);
	}

	function hidePopUp(elemid) {
		if (popUpActive == 0) {
			if (document.all) {
				document.all[elemid].style.display = "none";
			} else if (document.getElementById) {
				document.getElementById(elemid).style.display = "none";
			}
		}
	}

	function changeHTML(htmlcode, stOfferId, stVoucherType, ndOfferId, ndVoucherType, itemname) {
		htmlcode = '<table width="200"><tr><td>' + htmlcode;
		if (stOfferId > 0) {
			htmlcode = htmlcode + '<br/><br/><a class="content_link_arrow_darkgreen" href="/plusclub/gutschein/detail/' + stOfferId + '">' + stVoucherType + '</a>';
		}
		if (ndOfferId > 0) {
			htmlcode = htmlcode + ' | <a class="content_link_arrow_darkgreen" href="/plusclub/gutschein/detail/' + ndOfferId + '">' + ndVoucherType + '</a>';
		}
		htmlcode = htmlcode + '</td></tr></table>';
		document.getElementById(itemname).innerHTML = htmlcode;
	}
