var mainHeight=0;
sceene=function(){
	var scrollHeight;
	var tempHeight=0;
	var adjustHeight=0;
	for(var i=0;i<document.getElementById("middle").children.length;i++){
		tempHeight=tempHeight+document.getElementById("middle").children[i].offsetHeight;
	}
	if(tempHeight>mainHeight){
		adjustHeight=tempHeight-mainHeight;
	}
	document.body.style.height="100%";
	document.getElementById("inner").style.display="block";
	if(css().browser=="ie ie8"||css().browser=="ie ie7"||css().browser=="ie ie6"){scrollHeight=document.body.scrollHeight+adjustHeight;}
	if(css().browser=="webkit safari"){scrollHeight=document.body.scrollHeight+adjustHeight;}
	if(css().browser=="gecko"){scrollHeight=document.body.parentNode.scrollHeight+adjustHeight;}
	if(document.getElementById('wpabar')!=undefined){scrollHeight=scrollHeight-28;}
	document.getElementById("middle").style.height="auto";
	if(scrollHeight>document.body.offsetHeight){
		document.getElementById("sceene").style.height="auto";
		document.getElementById("middle").style.height=scrollHeight-(document.getElementById("top").offsetHeight+document.getElementById("bottom").offsetHeight)+"px";
		mainHeight=scrollHeight-(document.getElementById("top").offsetHeight+document.getElementById("bottom").offsetHeight);
	}else{
		if(css().browser=="webkit safari"){scrollHeight+=1;}
		document.getElementById("sceene").style.height="100%";
		document.getElementById("middle").style.height=scrollHeight-(document.getElementById("top").offsetHeight+document.getElementById("bottom").offsetHeight)+"px";
		mainHeight=scrollHeight-(document.getElementById("top").offsetHeight+document.getElementById("bottom").offsetHeight);
	}
	if(document.getElementById('wpabar')!=undefined){
		document.body.parentNode.style.margin="28px 0 0 0";
		document.body.style.padding="0 0 0 0 !important";
	}
};
window.onload=sceene;

