//Pdf help dialogue box
function showHelp()                                             
{
	var dialogue = showModelessDialog("pdftips.htm",'',"status:no;help:no;dialogWidth:300px;dialogHeight:500px");
}

//Show dialogue with larger equipment image
function viewImage(strFilename, intWidth, intHeight) 
{
	intWidth+=40;
	intHeight+=40;
	if (intWidth>550) intWidth=550;
	if (intHeight>550) intHeight=550;
	var dialogue = showModelessDialog(strFilename,'','status:no;help:no;dialogWidth:' + intWidth + 'px;dialogHeight:' + intHeight + 'px');
}

//This array and function are required so that the menu will load faster.  The images must be swopped for the correct ones
/*
var ImgArr=['img_1','images/1.gif',
			'img_2','images/2.gif',
			'img_3','images/3.jpg']; 
*/
  
function SwapImgs()
{ 
	var M_A,M_Al,i; 
	if(typeof(window.ImgArr)!='undefined')
	{ 
		M_A=window.ImgArr;M_Al=M_A.length; 
		for (i=0;i<M_Al;i+=2)
		{
			if(document.images[M_A[i]] != null)
			{
				document.images[M_A[i]].src=M_A[i+1];
			}
		}
	}
} 

//This changes the main table height to match window size so that
//the blue strip on the left is not short 
function setTableHeight()
{
	var iTablOffHeight,iTopRowHeight,iRowHeight,iDivOffHeight,iDocHeight; 
	if(typeof(window.oTable)!='undefined' && 
		typeof(window.oTopRow)!='undefined' && 
		typeof(window.oMainRow)!='undefined' && 
		typeof(window.oPageDiv)!='undefined')
	{
		iTablOffHeight = window.oTable.offsetHeight;
	 	iTopRowHeight = window.oTopRow.clientHeight;
	 	iRowHeight = window.oMainRow.clientHeight;
		iDivOffHeight = window.oPageDiv.offsetHeight;
		iDocHeight = window.document.body.clientHeight;
		if(iTablOffHeight < iDocHeight)
		{ 
		  	window.oMainRow.height = iDocHeight - iTopRowHeight;
		}
		else
		{
		 	if(iDocHeight < iDivOffHeight + iTopRowHeight)
			{
			 	window.oMainRow.height = iDivOffHeight;
			}
			else
			{
			 	window.oMainRow.height = iDocHeight - iTopRowHeight;
			}
		}
	}
}

//This event is for resizing the table when the window resizes
window.attachEvent = ('onresize', setTableHeight);

