/* KD JS 01 */

/* SEITE */
/* find Position */
function findPos(obj) {
	var curleft = curtop = 0;
	if(obj) {
		if (obj.offsetParent) {
			do {
				curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);
		}
	}
	return [curleft,curtop];
}

/* Window Resize: Inhalt */
function resize() { 

  var ref_Heigh;
  if (self.innerHeight)  {
    // all except Explorer
    ref_Heigh = self.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) {
    // Explorer 6 Strict Mode
    ref_Heigh = document.documentElement.clientHeight;
  } else if (document.body)  {
    // other Explorers
    ref_Heigh = document.body.clientHeight;
  }

  var azh = 40;
	azh  += document.getElementById('header').offsetHeight; 
	azh  += document.getElementById('navi').offsetHeight; 
	if(document.getElementById('contentTitel')) {
		azh  += document.getElementById('contentTitel').offsetHeight;
	}
	azh  += document.getElementById('footer').offsetHeight; 
	azh  += document.getElementById('bottom').offsetHeight; 
	azh  += -8; // paddings 
  
  var abzugshoehe = azh;
  var newHeight = ref_Heigh - abzugshoehe;
  var ele_aa = document.getElementById('content');
  if(ele_aa) { 
	   var scrolli = document.getElementById('scroller');
	  // alert(ele_aa.scrollHeight+'\n'+ele_aa.style.height);
	  scrolli.style.display = (ele_aa.scrollHeight>(newHeight+50))? 'block' : 'none';
	  ele_aa.style.height = eval(newHeight)+'px';
  }  else {
	scrolli.style.display = 'none';
  }
  
  
} // endfunction resize

/* Scroller */
function scrolltoTop() {
	var objDiv = document.getElementById('content');
	objDiv.scrollTop = 0;
}

/*******************************************************************/

/* photographer text */
function switchLNG(inLNG) { 
	document.getElementById('txt_de').style.display = 'none';
	document.getElementById('txt_en').style.display = 'none';
	document.getElementById('txt_'+inLNG).style.display = 'block';
}

/* no right click */
function click(evt) { 
	var msg = 'Copyright © Konstantin Dahlem. All rights reserved.The material on this site may not be copied, reproduced and may not be distributed, publicly performed, except with the prior express permission of Konstantin Dahlem';
	if (navigator.appName.indexOf("Microsoft") != -1) { 
		if (event.button==2) { 
			alert(msg);
			return false;
		}
	}
	if (navigator.appName.indexOf("Netscape") != -1) { 
		if ( evt.which == 3 ) {
			alert(msg);
			return false;
		}
	}
}
if (navigator.appName.indexOf("Netscape") != -1) { document.captureEvents( Event.MOUSEDOWN ) ; }
document.onmousedown = click; 