function resize() {

	var items = document.getElementById('items').offsetHeight;
	var lreviews = document.getElementById('lreviews').offsetHeight;
//	var ads = document.getElementById('ads').offsetHeight;
	
//	var menu = items + lreviews + ads;
	var menu = items + lreviews;
	
	document.getElementById('displaycontainer').style.height = 0;
	document.getElementById('displaycontent').style.height = 0;
	
	var search = document.getElementById('search').offsetHeight;
	var topfiller = document.getElementById('topfiller').offsetHeight;
	var displaycontent = document.getElementById('displaycontent').contentWindow.document.body.scrollHeight;
	var bottomfiller = document.getElementById('bottomfiller').offsetHeight;
	
	var content = search + topfiller + displaycontent + bottomfiller;

	if (content > menu){
		document.getElementById('menu').style.height = content;
		document.getElementById('content').style.height = content;
		document.getElementById('displaycontainer').style.height = displaycontent;
		document.getElementById('displaycontent').style.height = displaycontent;
	}
	else{
		document.getElementById('menu').style.height = menu;
		document.getElementById('content').style.height = menu;
		document.getElementById('displaycontainer').style.height = menu - search - topfiller - bottomfiller;
		document.getElementById('displaycontent').style.height = menu - search - topfiller - bottomfiller;
	}
}

function resizeWindow(width, height) {
	resizeTo(width, height);
	height = height - 50;
	window.innerWidth = width;
	window.innerHeight = height;
}

function openImage(article_id, number) {
	var url = "openimage.php?article_id=" + article_id + "&number=" + number;
	var params = "'resizable=1, width=1, height=1'";
	window.open(url, article_id, params);
}

function openAuthor(author_id) {
	var url = "openauthor.php?author_id=" + author_id;
	window.open(url, "author_id", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width=500, height=350");
}
