﻿var VestigingLayout = Class.create({
    initialize: function(){
        this.screenHeight = document.viewport.getHeight();
        this.screenWidth = document.viewport.getWidth();
		this.containerElement = $("container");
		this.contentElement = $("content");
		this.contentTxtElement = $("content-txt");
		this.containerHeight = 0
		this.contentHeight = 0
		this.contentTxtWidth = 0
		this.calculateSpace();
		this.reposition();
    },
	
	calculateSpace: function() {
		this.containerHeight = this.screenHeight - 186;
		this.contentHeight = this.containerHeight - 30;
		this.contentTxtWidth = this.screenWidth - 491;
	},
	
	reposition: function() {
		var containerCss = this.containerHeight + "px";
		this.containerElement.style.height = containerCss;
		var contentCss = this.contentHeight + "px";
		this.contentElement.style.height = contentCss;
		var contentTxtCss = this.contentTxtWidth + "px";
		this.contentTxtElement.style.width = contentTxtCss;
	}
});

document.observe('dom:loaded', function(){
    new VestigingLayout();
});

Event.observe(window, 'resize', function(){
	new VestigingLayout();
});