function getBrowserWidth() {
        var width;

        if ( self.innerHeight ) {
                width = self.innerWidth;
        }
        else if ( document.documentElement && document.documentElement.clientHeight ) {
                width = document.documentElement.clientWidth;
        }
        else if ( document.body ) {
                width = document.body.clientWidth;
        }

        return width;
}

function getBrowserHeight() {
        var height;

        if ( self.innerHeight ) {
                height = self.innerHeight;
        }
        else if ( document.documentElement && document.documentElement.clientHeight ) {
                height = document.documentElement.clientHeight;
        }
        else if ( document.body ) {
                height = document.body.clientHeight;
        }

        return height;
}

function toggleLanguage( wantedLanguage, category, page ) {
        var currentLanguage = location.pathname.match(/\/\w\w\//);
        if ( '/'+wantedLanguage+'/' != currentLanguage ) {
                location.href = '/'+wantedLanguage+'/'+category+"__"+page+".html";
        }
}

function fitContentToPane() {
	var marginBottom = 200;
	// IE6 needs special treatment ...
	if ( /msie|MSIE 6/.test(navigator.userAgent) ) {
		marginBottom = 220;
	}
        document.getElementById('content').style.height = (getBrowserHeight()-marginBottom)+"px";
}

function bootstrap() {
	fitContentToPane();

	window.onresize = fitContentToPane;
}

