var images = new Array('innen_bild1', 'innen_bild2', 'start_bild1', 'start_bild2', 'start_bild3');
window.onload = window.onresize = function () {
    var width = document.body.offsetWidth;
    var height = document.body.offsetHeight;
    var content = document.getElementById('content');
    var quicklinks = document.getElementById('quicklinks');
    var languages = document.getElementById('languages');
    for (var i = 0; i < images.length; i++) {
        var obj = document.getElementById(images[i]);
        if (obj)
            obj.style.display = (height < 580 || width < 1000) ? 'none' : '';
    }
    content.style.right = (width < 1000) ? 0 : '';
    content.style.bottom = (height < 580) ? '85px' : '';
    if (languages) languages.style.right = (width < 1000) ? '10px' : '';
    if (/\bcontent\b/.test(document.getElementsByTagName('body')[0].className)) {
        quicklinks.style.display = (width < 1000) ? 'none' : '';
    } else {
        quicklinks.style.display = (height < 525) ? 'none' : '';
    }
}

function validateForm(form) {
	var fields = form.getElementsByTagName('label')
	for (i = 0; i < fields.length; i++) {
		var span = fields[i].getElementsByTagName('span')[0]
		if (span) {
			var label = span.firstChild.data
			label = label.replace(/^\s*/, '')
			label = label.replace(/\s*$/, '')
			if (label.charAt(label.length - 1) == '*' && ! fields[i].getElementsByTagName('input')[0].value) {
				alert('Fehler: ' + label.substring(0, label.length -1) + ' nicht eingegeben')
				fields[i].getElementsByTagName('input')[0].focus()
				return false
			}
		}
	}
	return true
}

function SubMenuHover(id,source)
{
	var obj = document.getElementById(id);
	if(obj)
	{
   obj.src=source;



	}
}

var busywaiter = window.setInterval(function() {
	if (document.body) {
		window.clearInterval(busywaiter);
		var nameEQ = "fontsize=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0) == ' ') c = c.substring(1, c.length);
			if (c.indexOf(nameEQ) == 0) return document.body.style.fontSize = c.substring(nameEQ.length, c.length);
		}
	}
}, 1);

function changeFontSize(factor) {
	if (document.body.currentStyle)
		var fontsize = document.body.currentStyle['fontSize'];
	else if (window.getComputedStyle)
		var fontsize = document.defaultView.getComputedStyle(document.body, null).getPropertyValue('font-size');

	fontsize = /(\d+)(.+)/.exec(fontsize);
	document.body.style.fontSize = (parseInt(fontsize[1]) + factor) + fontsize[2];

	document.cookie = "fontsize=" + document.body.style.fontSize + "; path=/";
	return false;
}

function popup (url) {
 fenster = window.open(url, "fenster1", "width=800,height=700,status=yes,scrollbars=yes,resizable=yes");
 fenster.focus();
}



