var num=0;
var workarr=Array();
var gclassname;
function recurse(ref)
{
	while(ref){
		if(ref.className==gclassname){
			workarr[num++]=ref;
		}
		if(ref.hasChildNodes()){
			recurse(ref.firstChild);
		}
		ref=ref.nextSibling;
	}
}

function findfirst(ref,cn)
{
	ref=ref.firstChild;
	while(ref){
		if(ref.className==cn){
			return ref;
		}
		ref=ref.nextSibling;
	}
	return NULL;
}

function findall(classname)
{
	num=0;
	gclassname=classname;
	els=document.documentElement;
	recurse(els);
}

function reparse()
{

findall("boxbottom");
total=0;
for(i=0;i<num;i++){
	//alert("vok");
	ref_bottom=workarr[i];
	ref_bottomi=findfirst(ref_bottom,"boxbottomi");
	ref_bottomt=findfirst(ref_bottom,"boxbottomt");
	nah=ref_bottomt.offsetHeight+15;
	ref_bottom.style.height=nah+"px";
	ref_bottomi.style.height=nah+"px";
	ref_bottomt.style.marginTop=-nah+"px";
	total+=nah;
	if(i==0) headh=nah;
	//alert(nah);
	
}
if(document.getElementById("dynscroll")){
	k=380-headh;
	//alert(headh);
	document.getElementById("dynscroll").style.height=k+"px";
}
}
reparse();

