function preventDoublePosting(element, formID) {
    
    element.value = 'Formular wird gesendet...';
    element.disabled = true;
    
    document.forms[formID].submit();
    
    return true;
    
    }

function changeFontSize(direction) {

	var divs = document.getElementsByTagName("*");
	var as = document.getElementsByTagName("a");
	var Alles = divs;
/*	Alles = divs.concat(as);*/
	
	var oldsize = new Array();
	
	for (i = 0; i < Alles.length; i++) {
		
		if (window.getComputedStyle) {
			oldsize = window.getComputedStyle(Alles[i], null).fontSize;
		} else if (element.currentStyle) {	
			oldsize = Alles[i].currentStyle.fontSize;
		}
		
		var newsize = Number(oldsize.match(/\d+/));
		
		if (direction == 'up') {
			newsize = newsize + 1; }
		if (direction == 'down') {
			newsize = newsize - 1; }
		
		Alles[i].style.fontSize = newsize + 'px';
				
/*		divs[i].innerHTML = oldsize; */
		}
	
}

function MExtend(id) {
	   document.getElementById(id).style.overflow = 'visible'; }
	   
    function MReduce(id) {
	   document.getElementById(id).style.overflow = 'hidden'; }

function getWindowWidth () {

    var WindowWidth = false;
    
    if (screen.availWidth !== undefined) {
        WindowWidth = screen.availWidth; }
    
    if (window.innerWidth !== undefined) {
        WindowWidth = window.innerWidth; }
        
    if (document.body.offsetWidth !== undefined) {
        WindowWidth = document.body.offsetWidth; }
    
    return WindowWidth;
    }
    
function getWindowHeight () {

    var WindowHeight = false;
    
    if (screen.availHeight !== undefined) {
        WindowHeight = screen.availHeight; }
    
    if (window.innerHeight !== undefined) {
        WindowHeight = window.innerHeight; }
        
    if (document.body.offsetHeight !== undefined) {
        WindowHeight = document.body.offsetHeight; }
    
    return WindowHeight;
    }	   
	   
function ShowImage(id, slideshow) {
		
	pTop = window.pageYOffset;
	pLeft = window.pageXOffset;
	
	document.getElementById('images').style.display = 'block';
	document.getElementById('images').style.position = 'absolute';
	document.getElementById('images').style.top = (pTop + 25) + 'px';
	document.getElementById('images').style.left = (pLeft + 25) + 'px';
	document.getElementById('images').style.width = (getWindowWidth() - 100) + 'px';

	add = '';
	if (slideshow == true) {
		add = '&slideshow=1'; }

	ajaxDirect('images_content', '/images/img.php?id='+id+add); 
	
	/*document.getElementById('images').innerHTML = '<img src="/images/cms_fullsize/'+id+'.jpg">';*/
	
	return false;
	}
	
function showMe(ID) {
	
	if (document.getElementById(ID).style.display == 'block') {
		document.getElementById(ID).style.display = 'none';
		return true; }
	
	document.getElementById(ID).style.display = 'block';
	return true; }

function delayMe(link, category, action) {
  try {
    _gaq.push(['_trackEvent', category, action]);

    setTimeout('document.location = "' + link + '"', 100)
  }catch(err){}
}
