
function showLayer(whichLayer,positionElement,scroll){
	//lets generic this up a little have to change all of the rest of the fuctions to do the same
	//show a layer and then position it if present
	if(whichLayer.style.visibility == "visible"){
		hideLayer(whichLayer);
		return;
	}
	whichLayer.style.visibility='visible';
	if(positionElement){//optional argument
		tempY = getRealTop(positionElement);
		tempX = getRealLeft(positionElement);
		whichLayer.style.pixelTop = tempY;
		whichLayer.style.pixelLeft = tempX;
		if(scroll){//if you want to scroll to it
			if(document.body.scrollTop > tempY){ //only scroll to it if it is not visible
				window.scrollTo(tempX,tempY);
			}
		}
	}//end if position Element
}//end function show layer

function hideLayer(whichLayer){
	whichLayer.style.visibility='hidden';
}//end function hideLayer



function getRealLeft(tempObj) {
    xPos = tempObj.offsetLeft;
    tempEl = tempObj.offsetParent;
    while (tempEl != null) {
        xPos += tempEl.offsetLeft;
        tempEl = tempEl.offsetParent;
    }
    return xPos;
}

function getRealTop(tempObj) {
    yPos = tempObj.offsetTop;
    tempEl = tempObj.offsetParent;
    while (tempEl != null) {
        yPos += tempEl.offsetTop;
        tempEl = tempEl.offsetParent;
    }
    return yPos;
}

