﻿
function zentriere() {
 var viewportwidth;
 woffset = $(window).scrollLeft();
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth;
 }
 // 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;
 }
 // older versions of IE
 else
 {
    viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
 }

	if(viewportwidth >= 980) {
		document.getElementById("footerwrap").style.left= "50%";
		document.getElementById("footerwrap").style.marginLeft = "-480px";
		document.getElementById("footerwrap").style.background.position = "left";		
		document.body.style.background.position = "center";		
	}else{
		document.getElementById("footerwrap").style.left= "0.001%"; /* .001 */
		document.getElementById("footerwrap").style.width="960px";
		
		document.getElementById("footerwrap").style.marginLeft 	= (-woffset) + "px";
//		document.getElementById("footerwrap").style.background.position = "left";
		//document.body.style.background.position = "left";		


	}

//	document.getElementById("flink").innerHTML="vp:" + viewportwidth + " " + woffset;
}

window.onload = zentriere;
window.onresize = zentriere;

$(window).scroll( function () {zentriere();} );



