
function page_load() {
	for (var i = 0; i < load_funcs.length; i++) {
		cmd = load_funcs[i] + "()";
		eval(cmd);
	}
}

function page_resize() {	
	for (var i = 0; i < resize_funcs.length; i++) {
		cmd = resize_funcs[i] + "()";
		eval(cmd);
	}
}

function grid_init() {
	var viewport = new Viewport();
	
	grid_id = 'layout_grid';
	grid = document.getElementById(grid_id);
	
	if (grid != null) {
		grid.style.height = viewport.windowY + "px";
	
	}

	bottom_id = 'main_bottom';
	bottom = document.getElementById(bottom_id);
	
	if (bottom != null) {
		bottom.style.top = "0px";
	
		//alert(bottom.offsetTop + "-" + viewport.pageY);
	
		//if ( (bottom.offsetTop + 30) < viewport.pageY) {
		//	bottom.style.top = (viewport.pageY - (bottom.offsetTop + 30)) + "px";

		if ( (bottom.offsetTop + 30) < grid.offsetHeight) {
			bottom.style.top = (grid.offsetHeight - (bottom.offsetTop + 30)) + "px";

		
		}	
	}
	
}

function news_size(){
//for now just the news box headline height should be a max-height
	var maxh = 30;
	headline_id = 'newbar_box_headline_';
	for (i=1; i<5; i++){
		element = document.getElementById(headline_id+i);
		if (element.offsetHeight>maxh){
			element.style.height=maxh+"px";
		}
	}
}
