// JavaScript Document

// * Dependencies * 

// this function requires the following snippets:

// JavaScript/readable_MM_functions/findObj

//

// Accepts a variable number of arguments, in triplets as follows:

// arg 1: simple name of a layer object, such as "Layer1"

// arg 2: ignored (for backward compatibility)

// arg 3: 'hide' or 'show'

// repeat...

//

// Example: showHideLayers(Layer1,'','show',Layer2,'','hide');

ActiveMenu = '';
MouseIsOver = 'no';

SecondaryNavsArray = Array('secondarynav_AboutBRTRC','secondarynav_ContractVehicles','secondarynav_Careers','secondarynav_Clients','secondarynav_Philanthropy');

function showMenu(Menu) {
	MouseIsOver = 'yes';
	if (ActiveMenu != '') {showHideLayers(ActiveMenu,'','hide');}
	showHideLayers(Menu,'','show');
	ActiveMenu = Menu;
	return true;
}

function hideMenu(Menu) {
	MouseIsOver = 'no';
	showHideLayers(ActiveMenu,'','hide');
	temp = setTimeout('endActive()',1000);
	return true;
}

function endActive() {
	if (MouseIsOver == 'no') {
		ActiveMenu = '';
	}
}

/*
This function, called when someone uses a tab key while on the page,
displays the subnav bar for the current section. If someone continues
with a mouse, then the changes this function made will eventually
be undone (which is what should happen since this only needs to do
something when tabbing is used to navigate the page.
*/
function MakeAccessible() {
	/* This is not needed now that the secondary nav is in the left nav.
	MouseIsOver = 'yes';
	showHideLayers(CurrentSectionForTabbing,'','show');
	ActiveMenu = CurrentSectionForTabbing;
	return true;
	*/
}

// * Dependencies * 

// this function requires the following snippets:

// JavaScript/readable_MM_functions/findObj

//

// Accepts a variable number of arguments, in triplets as follows:

// arg 1: simple name of a layer object, such as "Layer1"

// arg 2: ignored (for backward compatibility)

// arg 3: 'hide' or 'show'

// repeat...

//

// Example: showHideLayers(Layer1,'','show',Layer2,'','hide');

function showHideLayers()

{ 

  var i, visStr, obj, args = showHideLayers.arguments;

  for (i=0; i<(args.length-2); i+=3)

  {

    if ((obj = findObj(args[i])) != null)

    {

      visStr = args[i+2];

      if (obj.style)

      {

        obj = obj.style;

        if(visStr == 'show') {
			visStr = 'visible';
			posStr = '0px';
		}

        else if(visStr == 'hide') {
			visStr = 'hidden';
			posStr = '-10000px';
		}
      }

    obj.visibility = visStr;
	obj.left = posStr;
	obj.top = '35px';

    }

  }

}



// Example: obj = findObj("image1");

function findObj(theObj, theDoc)

{

  var p, i, foundObj;

  

  if(!theDoc) theDoc = document;

  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)

  {

    theDoc = parent.frames[theObj.substring(p+1)].document;

    theObj = theObj.substring(0,p);

  }

  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];

  for (i=0; !foundObj && i < theDoc.forms.length; i++) 

    foundObj = theDoc.forms[i][theObj];

  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 

    foundObj = findObj(theObj,theDoc.layers[i].document);

  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

  

  return foundObj;

}



function PopUpCtrWin(url, winname, w, h) {
	var popLeft = (screen.width - w) / 2;
	var popTop = (screen.height - h) / 2;
	var options = "width=" + w + ",height=" + h + ",";
        options += "resizable=no,scrollbars=no,status=no,left=" +popLeft+ ",top=" +popTop+ ",";
        options += "menubar=no,toolbar=no,location=no,directories=no";
	var newWin = window.open(url, winname, options);
        newWin.focus();
}

function LaunchPortfolio() {
	w = 770;
	h = 510;
	var popLeft = (screen.width - w) / 2;
	var popTop = (screen.height - h) / 2;
	var options = "width=" + w + ",height=" + h + ",";
        options += "resizable=no,scrollbars=no,status=no,left=" +popLeft+ ",top=" +popTop+ ",";
        options += "menubar=no,toolbar=no,location=no,directories=no";
	portfolioWin = window.open('http://www.techmarketing.brtrc.com/tmg/portfolio/','BRTRC_Portfolio',options);
	setTimeout('VerifyPopup();', 2000);
}

function VerifyPopup() {
	nonPopupDestination = "http://www.techmarketing.brtrc.com/tmg/portfolio/";
	if(typeof(portfolioWin) != "undefined" && typeof(portfolioWin) != null) {
		if(portfolioWin != null) {
			if (portfolioWin.closed) {document.location = nonPopupDestination;}
		}
		else {document.location = nonPopupDestination;}
	}
	else {document.location = nonPopupDestination;}
}