
// JS function for uncrypting spam-protected emails:
function UnCryptMailto(s) { //
	var n=0;
	var r="";
	for(var i=0; i < s.length; i++) {
		n=s.charCodeAt(i);
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(1));
	}
	return r;
}


// JS function for uncrypting spam-protected emails:
function linkTo_UnCryptMailto(s) { //
	location.href=UnCryptMailto(s);
}

function showGallery() {
	var galleryHeight = document.getElementById('property').offsetHeight;
  galleryHeight = galleryHeight + 252;
  document.getElementById('gallery').style.height = galleryHeight + "px";
  document.getElementById("gallery").style.visibility = "visible";
  document.getElementById("gallery").style.display = "block";
  
  try {
	  // refresh gallery on open
		galleryImageFlow.init({ 
			ImageFlowID:'myImageFlow',
			reflections: true, 
	        reflectionP: 0.5,
	        reflectPath: '/scripts/',
	        reflectionGET: '&bgc=333333',
	        imagePath: '..',
	        aspectRatio: 1.118,
	        xStep: 480,
	        onClick: function() {return false;},
	        percentLandscape: 280,
	        percentOther: 150,
	        captions: true,
	        circular: true,
	        buttons: true
		});

  } catch(e) {
	  // ignore
  }
}

function unshowGallery() {
  document.getElementById("gallery").style.visibility = "hidden";
  document.getElementById("gallery").style.display = "none";
}

function showVideo() {
  var galleryHeight = document.getElementById('property').offsetHeight;
  galleryHeight = galleryHeight + 252;
  document.getElementById('video').style.height = galleryHeight + "px";
  document.getElementById("video").style.visibility = "visible";
  document.getElementById("video").style.display = "block";
  }

function unshowVideo() {
  document.getElementById("video").style.visibility = "hidden";
  document.getElementById("video").style.display = "none";
}

function click (e) {
	  if (!e)
	    e = window.event;
	  if ((e.type && e.type == "contextmenu") || (e.button && e.button == 2) || (e.which && e.which == 3)) {
	    if (window.opera)
	      window.alert("Sorry: Diese Funktion ist deaktiviert.");
	    return false;
	  }
}
if (document.layers) document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = click;
document.oncontextmenu = click;
