if(window.innerWidth) {
	var mttg_adaptor = function() {
		this.height = 0;
		this.width = 0;
	
		this.adapt = function (h,w) {
			divAll       = document.getElementById('divAll');
			divObenLinks = document.getElementById('divObenLinks');
			divBG4       = document.getElementById('divBG4');
			divBG3       = document.getElementById('divBG3');
			divBG2       = document.getElementById('divBG2');
			divContentBG = document.getElementById('divContentBG');
		
			if( this.width != w ) {
				if( divAll ) divAll.style.left = Math.max((w-800)/2,0);
				if( divObenLinks ) divObenLinks.style.width = Math.max((w-800)/2,0);
				if( divBG4 ) divBG4.style.width = Math.max((w-750)/2,0);
				if( divBG3 ) divBG3.style.left = Math.max(((w-800)/2)+154,0);
				if( divBG2 ) divBG2.style.left = Math.max(((w-800)/2),0);

				if( divAll && divObenLinks && divBG2 && divBG3 && divBG4 )
					this.width = w;
			}
			
			if( this.height != h ) {
				if( divContentBG ) divContentBG.style.minHeight = h-124;
				if( divBG3 ) divBG3.style.height = h - 496;
				if( divBG2 ) divBG2.style.height = h - 496;

				if( divContentBG && divBG2 && divBG3 )
					this.height = h;
			}
		}
	}

	var mttg_scroll_adaptor = function() {
		this.ypos = 0;
		this.height = 0;
	
		this.adapt = function (y, h) {
			divBG3       = document.getElementById('divBG3');
			divBG2       = document.getElementById('divBG2');
		
			if( divBG3 ) {
				if( this.ypos != y ) {
					divBG3.style.paddingTop    = 496-y;
					divBG3.style.top = Math.min(0,496-y);
				}
				if( this.ypos != y || this.height != h )
					divBG3.style.height = h - Math.min(0,496-y);
			}
			if( divBG2 ) {
				if( this.ypos != y ) {
				divBG2.style.paddingTop    = 496-y;
				divBG2.style.top = Math.min(0,496-y);
				}
				if( this.ypos != y || this.height != h )
					divBG2.style.height = h - Math.min(0,496-y);
			}
	
			if( divBG3 && divBG2 ) {
				this.ypos = y;
				this.height = h;
			}
		}
	}
	
	mttg_adaptPositions = new mttg_adaptor();
	mttg_adaptBannerPositions = new mttg_scroll_adaptor();
	
	window.onresize = function() { mttg_adaptPositions.adapt(window.innerHeight,window.innerWidth); }
	
	tmp = function() { 
		divAll       = document.getElementById('divAll');
		divObenLinks = document.getElementById('divObenLinks');
		divBG4       = document.getElementById('divBG4');
		divBG3       = document.getElementById('divBG3');
		divBG2       = document.getElementById('divBG2');
		divContentBG = document.getElementById('divContentBG');
		divAllAndEveryThing = document.getElementById('divAllAndEveryThing');
		
		mttg_adaptPositions.adapt(window.innerHeight,window.innerWidth); 

		if( divAllAndEveryThing ) 
			divAllAndEveryThing.onscroll = function() { mttg_adaptBannerPositions.adapt(divAllAndEveryThing.scrollTop, window.innerHeight); }
		if( !(divAll && divObenLinks && divBG4 && divBG3 && divBG2 && divContentBG) )
			setTimeout(tmp,10);
	};
	tmp();
}

var newsTicker;
function startup(doTicker) {
	if( doTicker == 1 && document.getElementById('divTickerFrame') && document.getElementById('divTickerContent') ) {
		newsTicker = new Ticker('divTickerContent',16,1,0);
		newsTicker.start();
		setInterval("toBottom('divTickerFrame','divTickerContent')",50);
	}
}


