function preloadImages() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
preloadImages('./images/ProntoBackground.png','./images/ProntoCommercialLogo.png', './images/TopLeftCorner.png','./images/TopFrame.png',
'./images/TopRightCorner.png','./images/LeftFrame.png','./images/RightFrame.png','./images/BottomLeftCorner.png',
'./images/BottomRightCorner.png','./images/BottomFrame.png',
'./images/menu/MenuBar.png','./images/menu/MenuSeparator_2x34.gif','./images/menu/MenuBackgroundSelected8x34.png','./images/menu/MenuBackgroundHover8x34.png',
'./images/menu/MenuHome_59x34.png','./images/menu/MenuHome_hover_59x34.png','./images/menu/MenuHome_selected_59x34.png',
'./images/menu/MenuEnd_112x34.png','./images/menu/MenuEnd_hover_112x34.png','./images/menu/MenuEnd_selected_112x34.png',
'./images/Contract.jpg','./images/SignContract.gif','./images/signor.jpg',
'./images/EmailIcon.png','./images/PhoneIcon.png','./images/FaxIcon.png','./images/OfficeIcon.png');
function SetContentHeight() 
{
  var myWidth = 0, myHeight = 0, divHeight = 0;
  var ContentDIVelement, LeftFrameElement, RightFrameElement;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    //myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    //myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  LeftFrameElement = document.getElementById("LeftFrame");
  RightFrameElement = document.getElementById("RightFrame");
  ContentDIVelement = document.getElementById("ContentDIV");
  myHeight -= 160; //160 pixels is approximate height of header
  divHeight = document.getElementById("ContentDIV").offsetHeight;
  if(divHeight > myHeight) /* only resize if div is bigger than viewable window height (less header size of 150px) */
  {
	myHeight = myHeight + "px";
	ContentDIVelement.style.height = myHeight;
	LeftFrameElement.style.height = myHeight;
	RightFrameElement.style.height = myHeight;
  }
  if(divHeight < myHeight)
  {
	myHeight = divHeight + "px";
	ContentDIVelement.style.height = myHeight;
	LeftFrameElement.style.height = myHeight;
	RightFrameElement.style.height = myHeight;
  }
}

function CheckForActive(PageName)
{	

// refer to the menu tabs in ../include/top.php and ../css/ProntoTabs.css

	if((PageName == 'index.htm') || (PageName.length == 0) || (PageName == 'MenuTest.htm'))
	{
		document.getElementById('index').style.background='url(./images/menu/MenuHome_selected_59x34.png)';
		document.getElementById('index-span').style.color='#000';
	}
	else
	if(PageName == 'CommercialLoans.htm')
	{
		document.getElementById('Lending').style.background='url(./images/menu/MenuBackgroundSelected8x34.png) top left repeat-x';
		document.getElementById('Lending-span').style.color='#000';
	}
	else
	if(PageName == 'SBLCfinancing.htm')
	{
		document.getElementById('SBLC').style.background='url(./images/menu/MenuBackgroundSelected8x34.png) top left repeat-x';
		document.getElementById('SBLC-span').style.color='#000';
	}
	else
	if(PageName == 'BankInstruments.htm')
	{
		document.getElementById('LOC').style.background='url(./images/menu/MenuBackgroundSelected8x34.png) top left repeat-x';
		document.getElementById('LOC-span').style.color='#000';
	}
	else
	if(PageName == 'ProofOfFunds.htm')
	{
		document.getElementById('POF').style.background='url(./images/menu/MenuBackgroundSelected8x34.png) top left repeat-x';
		document.getElementById('POF-span').style.color='#000';
	}
	else
	if(PageName == 'FundingRequest.htm')
	{
		document.getElementById('FundingRequest').style.background='url(./images/menu/MenuEnd_selected_112x34.png)';
		document.getElementById('FundingRequest-span').style.color='#000';
	}
	else
	if(PageName == 'FundingRequestAction.php')
	{
		document.getElementById('FundingRequest').style.background='url(./images/menu/MenuEnd_selected_112x34.png)';
		document.getElementById('FundingRequest-span').style.color='#000';
	}
	else
	if(PageName == 'PrivatePlacementProgram.htm')
	{
		document.getElementById('PPP').style.background='url(./images/menu/MenuBackgroundSelected8x34.png) top left repeat-x';
		document.getElementById('PPP-span').style.color='#000';
	}
	else
	if(PageName == 'LeaseBankInstrument.htm')
	{
		document.getElementById('Lease').style.background='url(./images/menu/MenuBackgroundSelected8x34.png) top left repeat-x';
		document.getElementById('Lease-span').style.color='#000';
	}
}
function ShowNewTabs(Directory)
{
	var PageName;
	var Page=window.location.pathname;
	//alert(Page);
	var PageN=Page.lastIndexOf("\\");
	if (PageN < 1)
		PageN=Page.lastIndexOf("/");
		
 	PageName=Page.substr(PageN + 1);
	CheckForActive(PageName);
}
