/**
 * This is showinmain.js for the showinmain module. All Javascript
 * functions are declared here
 *
 * @version $Id: showinmain.js,v 1.2 2002/06/30 13:35:12 jflowers Exp $
 * @author Jim Flowers <jflowers@ezo.net>
 * @module showinmain
 * @modulegroup content_handling
 * @package phpWebSite
*/
function upsize(what, trim, vsize)
{
var docIframes=document.getElementsByTagName('IFRAME');
var theIframe=docIframes[0];
var theTitleRow=theIframe.parentNode.parentNode.parentNode.firstChild;
var theHeaderTableFirstRow 
	=theIframe.parentNode.parentNode.parentNode.parentNode.
	parentNode.parentNode.parentNode.parentNode.parentNode.
	parentNode.parentNode.firstChild;
var docTables=document.getElementsByTagName('TABLE');
var leftColTable=docTables[0];

	switch(what)
	{
	case 0: // phpwebsite and similar themes
	    theIframe.height=leftColTable.offsetHeight -
		theHeaderTableFirstRow.offsetHeight-theTitleRow.offsetHeight-trim;
	    break;
	case 1: // use element walkUp for all cascaded table themes

	    switch(vsize)
	    {
	    case 0: // fit in current window
	        result=walkUp(theIframe)
	        if(browser.isIE6up && (document.childNodes.length > 1))
		    theIframe.height = document.documentElement.clientHeight - result[0] - 5
	        else if(browser.isIE5up)
		    theIframe.height = document.body.clientHeight - result[0]
	        else if(browser.isNS6up)
		    theIframe.height = self.innerHeight - theIframe.offsetTop
		scrollTo(0,0)
	        break
	    case 1: // match current document body
	        result=walkUp(theIframe)
		theIframe.height = theIframe.offsetHeight + result[1]
		break;
	    default:
		theIframe.height = vsize
	    } // end switch(vsize)
	case 2: // use <DIV>s
		break;
	case 9: // show borders for case 0 theme
		leftColTable.border=9;
		leftColTable.borderColor="red";
		theHeaderTableFirstRow.parentNode.parentNode.border=6;
		theHeaderTableFirstRow.parentNode.parentNode.borderColor="blue";
		theTitleRow.parentNode.parentNode.border=6;
		theTitleRow.parentNode.parentNode.borderColor="green";
		if(theIframe.style)
			{
			leftColTable.style.backgroundColor="yellow";
			}
		break;
	default: ;
	} /* end switch() */
} /* end upsize() */

