﻿var DefaultLayout = Class.create({
    initialize: function(){
        this.screenHeight = document.viewport.getHeight();
		this.containerElement = $("container");
		this.contentElement = $("content");
		//this.footerImgElement = $("footer-images");
		this.containerHeight = 0
		this.contentHeight = 0
		this.calculateSpace();
		this.reposition();
    },
	
	calculateSpace: function() {
		this.containerHeight = this.screenHeight - 200;
		this.contentHeight = this.containerHeight - 104;
	},
	
	reposition: function() {
		var containerCss = this.containerHeight + "px";
		this.containerElement.style.height = containerCss;
		var contentCss = this.contentHeight + "px";
		this.contentElement.style.height = contentCss;
		//var footerImgCss = "";
		//footerImgCss = Math.round(this.contentElement.getWidth() / 2) + 263 - 235 + "px";
		//this.footerImgElement.style.padding = "0 0 0 " + footerImgCss;
	}
});

document.observe('dom:loaded', function(){
    new DefaultLayout();
});

Event.observe(window, 'resize', function(){
	new DefaultLayout();
});
