var mainHeight=0;
sceene=function(){
	var scrollHeight;
	var tempHeight=0;
	var adjustHeight=0;
	var topHeight=0;
	document.getElementById("inner").style.display="block";
	for(var i=0;i<document.getElementById("middle").children.length;i++){
		tempHeight=tempHeight+document.getElementById("middle").children[i].offsetHeight;
	}
	if(tempHeight>mainHeight && mainHeight!=0){
		adjustHeight=tempHeight-mainHeight;
	}
	for(var j=0;j<document.getElementById("top").children.length;j++){
		topHeight=topHeight+document.getElementById("top").children[j].offsetHeight;
	}
	var ancestorItem=getElementsByClassName("current_page_ancestor",document.getElementById("menu")); 
	if(ancestorItem.length>0){
		topHeight=topHeight+ancestorItem[0].children.item(1).offsetHeight;
	}else{
		var currentItem=getElementsByClassName("current_page_item",document.getElementById("menu")); 
		if(currentItem.length>0){
			if(currentItem[0].children.length>1){
				topHeight=topHeight+currentItem[0].children.item(1).offsetHeight;
			}
		}
	}
	document.body.style.height="100%";
	document.getElementById("top").style.height=topHeight+"px";
	if(css().browser=="ie ie9"||css().browser=="ie ie8"||css().browser=="ie ie7"||css().browser=="ie ie6"){scrollHeight=document.body.parentNode.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";
		mainHeight=scrollHeight-(document.getElementById("top").offsetHeight+document.getElementById("bottom").offsetHeight);
		document.getElementById("middle").style.height=mainHeight+"px";
	}else{
		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);
	}
	document.getElementById('strip').style.height=scrollHeight+"px";
	if(document.getElementById('sceene').offsetWidth<1120){
		document.getElementById('strip').style.display="none";
	}else{
		document.getElementById('strip').style.display="block";
	}
	if(document.getElementById('wpabar')!=undefined){
		if(css().browser=="ie ie8"||css().browser=="ie ie7"||css().browser=="ie ie6"){
			document.body.style.backgroundPosition="center 28px";
		}else if(css().browser=="gecko"){
			document.body.style.backgroundPosition="center 28px";
		}else{
			document.body.parentNode.style.margin="28px 0 0 0";
			document.body.style.padding="0 0 0 0 !important";
		}
		document.getElementById('strip').style.top="28px";
	}
};
window.onload=sceene;

adjust=function(){
	if(document.getElementById('sceene').offsetWidth<1120){
		document.getElementById('strip').style.display="none";
	}else{
		document.getElementById('strip').style.display="block";
	}
};
window.onresize=adjust;

