// JavaScript Document

function iFrameHeight(iframeid) {
 // used by iframes to adjust size to content
 if(document.getElementById && !(document.all))
 {
   h = document.getElementById(iframeid).contentDocument.body.scrollHeight;
   document.getElementById(iframeid).style.height = h;
 }
 else if(document.all)
 {
   h = document.frames(iframeid).document.body.scrollHeight;
   document.all[iframeid].style.height=h;
 }
}

function showInfo(url, w, h) {
	window.open(url, '', 'scrollbars=auto,status=0,toolbar=0,location=0,width=' + w + ',height=' + h);
	return false;
}
function zxcPos(zxcobj){
	zxclft=zxcobj.offsetLeft;
	zxctop=zxcobj.offsetTop;
	while(zxcobj.offsetParent!=null){
		zxcpar=zxcobj.offsetParent;
		zxclft+=zxcpar.offsetLeft;
		zxctop+=zxcpar.offsetTop;
		zxcobj=zxcpar;
	}
	return [zxclft,zxctop];
}

function getComputedWidth(theElt){
        if(theElt.offsetWidth != 'null'){
                tmphght = theElt.offsetWidth;
        }
        else{
                docObj = theElt;
                var tmphght1 = document.defaultView.getComputedStyle(docObj, "").getPropertyValue("width");
                tmphght = tmphght1.split('px');
                tmphght = tmphght[0];
        }
        return tmphght;
}

function getComputedHeight(theElt){
        if(theElt.offsetWidth != 'null'){
                tmphght = theElt.offsetHeight;
        }
        else{
                docObj = theElt;
                var tmphght1 = document.defaultView.getComputedStyle(docObj, "").getPropertyValue("height");
                tmphght = tmphght1.split('px');
                tmphght = tmphght[0];
        }
        return tmphght;
}

function showInfoBox(el, msg) {
	iPos = zxcPos(el);
	var ib = document.getElementById('infoBlock');
	//ib.style.left = iPos[0] + getComputedWidth(el);
	ib.style.left = iPos[0];
	ib.style.top = iPos[1] + getComputedHeight(el);
	ib.innerHTML = msg;
	ib.style.visibility = 'visible';
}

function hideInfoBox() {
	var ib = document.getElementById('infoBlock');
	ib.style.visibility = 'hidden';
}
