// JavaScript Document

var dcount = 0;		//Debug Counter
var width  = $(window).width();

function mydebug(debugstring){
	
	if(!document.all && !(typeof(console) == 'undefined'))
	{
		console.log(dcount++ +' | ' + debugstring);
		}
	
	}

function resize()
{
	mydebug("resize");	
	
	var ratio = 1067/1600;		//feste Bildmaße einstellen (hoehe/breite)
	
	t = $("#background");
	var browserwidth = $(window).width();
	var browserheight = $(window).height();
	var offset;

	if ((browserheight/browserwidth) > ratio){
		t.height(browserheight);
		t.width(browserheight / ratio);
	} else {
		t.width(browserwidth);
		t.height(browserwidth * ratio);
	}
	
	//zentrieren
	t.css('left', (browserwidth - t.width())/2);
	t.css('top', (browserheight - t.height())/2);
	
	}

$(document).ready(function(){
						   
	resize();
	
    $(window).resize(
		function(){resize();}
		);
})
