function windowWidth(){
    if (window.innerWidth){
        if (document.body.offsetWidth){
            if (window.innerWidth!=document.body.offsetWidth)
                return document.body.offsetWidth;
            }
        return (window.innerWidth);                     // Mozilla
    }

    if (document.documentElement.clientWidth)
        return document.documentElement.clientWidth;    // IE6

    if (document.body.clientWidth)
        return document.body.clientWidth;               // IE DHTML-compliant any other
}

function showElements() {
	var allElems = document.getElementsByTagName('*');
	for (var i = 0; i < allElems.length; i++) {
		var thisElem = allElems[i];
		if (thisElem.className && thisElem.className == 'js') {
		thisElem.style.visibility = 'visible';
		}
	}
}

function moveRight() {
		var x = document.getElementById('banner').style.backgroundPosition;
		x = x.replace(/px 0px/g, "");
	if(x >= -2508+windowWidth()) {
		x = x-4;
		document.getElementById('banner').style.backgroundPosition = x + "px 0px";
		if(scrollenAktiv && x >= -2508+windowWidth()) setTimeout("moveRight()",5);
	}
}

function moveRightProjekt() {
		var x = document.getElementById('banner').style.backgroundPosition;
		x = x.replace(/px 0px/g, "");
		x = x-4;
		document.getElementById('banner').style.backgroundPosition = x + "px 0px";
		if(scrollenAktiv) setTimeout("moveRightProjekt()",5);
}

function moveRightWeb() {
		var x = document.getElementById('banner').style.backgroundPosition;
		x = x.replace(/px 0px/g, "");
	if(x >= -1462+windowWidth()) {
		x = x-4;
		document.getElementById('banner').style.backgroundPosition = x + "px 0px";
		if(scrollenAktiv && x >= -1462+windowWidth()) setTimeout("moveRightWeb()",5);
	}
}
	
function moveLeft() {
	var x = document.getElementById('banner').style.backgroundPosition;
		x = x.replace(/px 0px/g, "");
	if(x <= -4) {
		x++;
		x = x+4;
		document.getElementById('banner').style.backgroundPosition = x + "px 0px";
		if(scrollenAktiv && x <= -4) setTimeout("moveLeft()",5);
	}
}

function moveLeftProjekt() {
	var x = document.getElementById('banner').style.backgroundPosition;
		x = x.replace(/px 0px/g, "");
		x++;
		x = x+4;
		document.getElementById('banner').style.backgroundPosition = x + "px 0px";
		if(scrollenAktiv) setTimeout("moveLeftProjekt()",5);
}

function setBannerPos(site) {
	if (site == 'whois' && windowWidth()<1964)
		document.getElementById('banner').style.backgroundPosition = '-545px 0px';
	else if (site == 'private' && windowWidth()<2509) {
		if (windowWidth()>1674)
			document.getElementById('banner').style.backgroundPosition = windowWidth()-2510 + 'px 0px';
		else
			document.getElementById('banner').style.backgroundPosition = '-835px 0px';
	}
	else if (site == 'kontakt' && windowWidth()<2509) {
		if (windowWidth()>1469)
			document.getElementById('banner').style.backgroundPosition = windowWidth()-2510 + 'px 0px';
		else
			document.getElementById('banner').style.backgroundPosition = '-1040px 0px';
	}
	else if (site == 'impressum' && windowWidth()<2509) 
		document.getElementById('banner').style.backgroundPosition = windowWidth()-2510 + 'px 0px'; 
}
