function addjustMainLayerSizes() // addjust the sizes of the layers if needed
{
	getBaseLayerRefs(); // get the pointers to the layers
	findLayerSizes(); // find the sizes of the various layers
	addjustSizes(); // adjust the sizes and locations of the various layers
}

function addjustSizes() // if the web page is being viewed on a small screen change the addibutes of the layers
{
	adjustTitle(); // adjust the location of the title
	adjustBackGround(); // adjust the size of the background window
	adjustMain(); // adjust the main display window
	adjustButton(); // adjust the position of the imput button
	adjustMenuInfo(); // adjust the menu info window
	adjustIframe(); // adjust the Iframe window
}


function findLayerSizes() // find the sizes of the various layers
{
	dispTtle_Width=dispTtle.offsetWidth; // width of the title
	dispTtle_Height=dispTtle.offsetHeight; // height of the title
	buttonWidth=dispButton.offsetWidth; // width of the button
}

function adjustTitle() // adjust the location of the title
{
	var avTitleWidth=(WebWidth-menuWidth-dispTtle_Width)/2; // find the position of the left side of the title
	dispTtle.style.left=avTitleWidth+menuWidth;
	dispTtle.style.top=2;
}

function adjustBackGround() // adjust the size of the background window
{
	// find the size of the backgound and position it
	var avBckgnd_width=(WebWidth-menuWidth-backGround_brder); // find the available width of the background
	var avBckgnd_height=(WebHeight-dispTtle_Height-(4*backGround_brder)); // find the available height of the background

	dispBckGnd.style.width=avBckgnd_width; // set the width of the background layer
	dispBckGnd.style.height=avBckgnd_height; // set the height of the background layer
	dispBckGnd.style.top=stripPx(dispTtle.style.top)+stripPx(dispTtle.style.height)+2*backGround_brder; // set the height of the background layer

	dispBckImg.style.width=avBckgnd_width; // set the width of the background image layer
	dispBckImg.style.height=avBckgnd_height; // set the width of the background image layer
	dispBckImg.style.top=stripPx(dispBckGnd.style.top); // set the top of the background image layer
	
	dispBckGnd_Width=avBckgnd_width; // get the width of the background layer for future reference
	dispBckGnd_Height=avBckgnd_height; // get the height of the background layer for future reference

	dispBckGnd.style.left=menuWidth; // set the position of the left hand side
}

function adjustMain() // adjust the main display window
{
	// find the size and position of the main window and position it
	var avMain_width=(stripPx(dispBckGnd.style.width)-(2*backGround_brder)); // find the available width of the main window
	var avMain_height=(stripPx(dispBckImg.style.height)-(2*backGround_brder)); // find the available height of the main window

	dispMain_Width=avMain_width; // get the width of the background layer for future reference
	dispMain_Height=avMain_height; // get the height of the background layer for future reference
		
	dispMain.style.width=avMain_width; // set the width of the main layer
	dispMain.style.left=stripPx(dispBckGnd.style.left)+backGround_brder; // set the position of the left hand side
//	dispMain.style.height=stripPx(dispBckGnd.style.height)-backGround_brder;

	// need to set the top of the choice bar so that the display window can be adjusted properly
	dispChoiceBar.style.top=stripPx(dispBckGnd.style.top)+backGround_brder;
	dispChoiceBar.style.width=stripPx(dispMain.style.width)

	if(isChoiceBarDisplayed){ // adjust the height of the display layer taking into account the choice bar
		dispMain.style.top=stripPx(dispBckGnd.style.top)+stripPx(dispChoiceBar.style.top)+backGround_brder;
		dispMain.style.height=avMain_height-stripPx(dispChoiceBar.style.height);
	} else { // the choice bar is not present therefore make as tall as possible
		dispMain.style.height=avMain_height; // set the height of the main layer which is full height
		dispMain.style.top=stripPx(dispBckGnd.style.top)+backGround_brder; // set the pos of the top of the layer top
	}
}

function adjustIframe() // adjust the Iframe window
{
	var avIframe_width=(dispBckGnd_Width-(2*Iframe_border)); // find the available width of the Iframe window
	var avIframe_height=(dispBckGnd_Height-(2*Iframe_border)); // find the available height of the Iframe window

	dispIframe_src.style.width=avIframe_width; // main Iframe width
	dispIframe_src.style.height=avIframe_height; // main Iframe height

	dispIframe.style.left=stripPx(dispBckGnd.style.left)+Iframe_border; // set the position of the left hand side
	dispIframe.style.top=stripPx(dispBckGnd.style.top)+Iframe_border; // set the pos of the top
}

function adjustButton() // adjust the position of the imput button
{
	dispButton.style.top=stripPx(dispBckGnd.style.top)+backGround_brder; // button top
	dispButton.style.left=stripPx(dispBckGnd.style.left)+dispBckGnd_Width-buttonWidth; // left position
}

function adjustMenuInfo() // adjust the menu info window
{
	var avMenuInfo_width=menuWidth-(2*backGround_brder); // find the available width of the Menu Info window

	dispMenuInfo.style.width=avMenuInfo_width; // main Iframe width

	dispMenuInfo.style.top=WebHeight-stripPx(dispMenuInfo.style.height)-2*backGround_brder; // info box top
	dispMenuInfo.style.left=backGround_brder; // info box left location
}

