﻿


window.onresize = function  resize(){


	var maxh = 807
	var maxw = 1210
	var img =  document.body.style.backgroundImage;//document.getElementById('bg-img') ;//
	var cc =  document.getElementById('content');

	var img = document.getElementById('bg-img');
	var viewportwidth;
	var viewportheight;
	
	if (typeof window.innerWidth != 'undefined') 
	{
		viewportwidth = window.innerWidth;
		viewportheight = window.innerHeight;
	}
	
  // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
    else if (typeof document.documentElement != 'undefined'     && typeof document.documentElement.clientWidth !=     'undefined' && document.documentElement.clientWidth != 0)
    {
    	viewportwidth = document.documentElement.clientWidth;
    	viewportheight = document.documentElement.clientHeight
    }


	if (viewportwidth  >= 1610)
	{
		img.style.height = 'auto';
		img.style.width = (viewportwidth  + 'px') ;
		cc.style.marginTop = (160 + 'px');
	}
	else if ((viewportwidth  >= 1210) && (viewportwidth  < 1610 ))
	{
		img.style.height = 'auto';
		img.style.width = (viewportwidth  + 'px') ;
		cc.style.marginTop = (130 + 'px');
	}
	else
	{
		img.style.height = ('auto');
		img.style.width = (1210 + 'px') ;
		cc.style.marginTop = (120 + 'px');

	};
	
	if (viewportheight  > img.height)
	{
		img.style.width = 'auto';
		img.style.height = (viewportheight + 'px') ;
		cc.style.marginTop = (90 + 'px');

	};
	if ((viewportheight  < 850) && (viewportwidth  < 1250))
	{
		cc.style.marginTop = (40 + 'px');

	};

} 

function anpassen()
{
	var img = document.getElementById('bg-img');
	var viewportwidth;
	var viewportheight;
	var cc =  document.getElementById('content');

	
	if (typeof window.innerWidth != 'undefined') 
	{
		viewportwidth = window.innerWidth;
		viewportheight = window.innerHeight;
	}
	
  // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
    else if (typeof document.documentElement != 'undefined'     && typeof document.documentElement.clientWidth !=     'undefined' && document.documentElement.clientWidth != 0)
    {
    	viewportwidth = document.documentElement.clientWidth;
    	viewportheight = document.documentElement.clientHeight
    }


	if (viewportwidth  >= 1610)
	{
		img.style.height = 'auto';
		img.style.width = (viewportwidth  + 'px') ;
		cc.style.marginTop = (160 + 'px');
	}
	else if ((viewportwidth  >= 1210) && (viewportwidth  < 1610 ))
	{
		img.style.height = 'auto';
		img.style.width = (viewportwidth  + 'px') ;
		cc.style.marginTop = (130 + 'px');
	}
	else
	{
		img.style.height = ('auto');
		img.style.width = (1210 + 'px') ;
		cc.style.marginTop = (120 + 'px');

	};
	
	if (viewportheight  > img.height)
	{
		img.style.width = 'auto';
		img.style.height = (viewportheight + 'px') ;
		cc.style.marginTop = (90 + 'px');

	};
	if ((viewportheight  < 850) && (viewportwidth  < 1250))
	{
		cc.style.marginTop = (40 + 'px');

	};

}


