function findPosX(objid)
{
	var obj = document.getElementById(objid);
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

var toppo = 22; // Total number of boxes to check

var stretcher = new Array();
for (s=0;s<=toppo;s++) {
stretcher[s] = "QA_"+s;
}

function stretchit() {
	for (i=0;i<=toppo;i++) {
		if (document.getElementById(stretcher[i])) {
		var Xnow = findPosX(stretcher[i]);
			if (Xnow < 100) {
			document.getElementById(stretcher[i]).style.width = "96%";
			}
		}		
	}	
}

function bumpDown() {
var switchoff = 0;
var rightbot = 0;
var j = 1;
var leftbot = document.getElementById('lefty').offsetHeight;
	if (switchoff == 0) {
		for (k=0;k<=toppo;k++) {
			if (k > 1) {
			j = k-1;
			}
			if (document.getElementById(stretcher[k])) {
			rightbot = rightbot+document.getElementById(stretcher[k]).offsetHeight;
				if (rightbot > leftbot) {
					if (document.getElementById(stretcher[j])) {
					document.getElementById(stretcher[j]).style.width = "96%";
					switchoff++;
					}
				}
			}		
		}
	}
}

function bodyStretch() {
var boxHeight = document.getElementById('resbox').offsetHeight;
var heightPadded = boxHeight + 150;
document.getElementById('bod').style.height = heightPadded+"px";
}

function popitup(url) {
newwindow=window.open(url,'name','height=400,width=660,scrollbars=yes');
if (window.focus) {newwindow.focus()}
return false;
}
