

function moveElements () 
{
	breite = 0;
	if (window.innerWidth) 
	{
		breite =  window.innerWidth-18;
	} 
	else if (document.body && document.body.offsetWidth) 
	{
		breite = document.body.offsetWidth-1;
	} 
	
	if (breite)
	{
		handyhandlink = breite - 592;
		if (handyhandlink < 820)
		{
			handyhandlink = 820;
		}		
		document.getElementById("rightbox").style.marginLeft = handyhandlink+"px";
	}
}

function moveVertical()
{
	var y = 0;
	if (typeof window.pageYOffset != 'undefined')
	{
		y = window.pageYOffset;
	}
	else if (typeof document.documentElement.scrollTop != 'undefined' && document.documentElement.scrollTop > 0)
	{
		y = document.documentElement.scrollTop;
	}
	else if (typeof document.body.scrollTop != 'undefined')
	{
		y = document.body.scrollTop;
	}

	if (navigator.appName == "Netscape")
	{
		//y = y - 18;
	}
	
	if (y <= 160)
	{
		y = 160;
	}
	browserversion = navigator.appVersion;
	if (browserversion.search(/MSIE 6.0/)>-1)
	{
		document.getElementById("rightbox").style.paddingTop = y+"px";		
	}
	else
	{
		document.getElementById("rightbox").style.bottom = "-"+y+"px";	
	}
}

function checkMobileNumber(submitbutton,inputfield,hidelayer,showlayer)
{
	inputfield = document.getElementById(inputfield);
	
	if (inputfield.value)
	{
		mobilenr = inputfield.value;
		if (isNaN(mobilenr))
		{
			document.getElementById(hidelayer).className = "hidden";
			document.getElementById(showlayer).className = "visible";
		}
		else
		{
			if (mobilenr.toString().length > 15)
			{
				document.getElementById(hidelayer).className = "hidden";
				document.getElementById(showlayer).className = "visible";
			}
			else
			{
				submitbutton.submit();
			}
		}
	}
	else
	{
		document.getElementById(hidelayer).className = "hidden";
		document.getElementById(showlayer).className = "visible";
	}
}

window.onload = moveElements;
window.onresize = moveElements;
window.onscroll = moveVertical;