<!--
// KPMG Canada Javascript v1.7
// Author: Kevin Sczepanski
// Date: August 16, 2005 16:50


//initialize Page
function initPage()
{
	topHighlight(topSection);
	leftHighlight(leftNavSelect);
	highlightUtilityNav('utility'+topSection,'on');
	// added by GM re utility auto-close function
	getUtilityBarCoords();
}

//highlight topNav
function topHighlight(navId)
{
	var tip = document.getElementById('nav' + navId);
	if (tip)
	{
		tip.style.color = topNavonColor;
  	}
}

//toggle utilityBar Flyout
function toggleUtilityBar(flydownId)
{
	if (flydownId == "Contact") flydownId = "1";
	var navUtility = "utility" + utilityLinks[flydownId][0];
	if (utilityLinks[flydownId][1] == "on")
	{
		resetUtilityBar();
		// added by GM re utility auto-close function
		loadingUtility = 0;
	}
	else
	{
		flydown = navUtility + "Flydown";
		resetUtilityBar();
		show(flydown);
		highlightUtilityNav(navUtility,'on');
		utilityLinks[flydownId][1] = "on";
		// added by GM re utility auto-close function
		loadingUtility = 1;
	}
}

//reset utilityBar
function resetUtilityBar()
{
	for(var i = 0; i < utilityLinks.length; i++)
	{
	var navUtility = "utility" + utilityLinks[i][0];
	var flyDown = navUtility + "Flydown";
	var flyDownHide = document.getElementById(flyDown);
	if (flyDownHide)
		{ 
		highlightUtilityNav(navUtility,'off');
		flyDownHide.style.visibility = "hidden";
		current="";
		utilityLinks[i][1] = "off";
    	}
  	}
	// added by GM re utility auto-close function
	loadingUtility = 0;
}

// ********** START OF ADDITIONAL CODE TO AUTO-CLOSE UTILITY BAR **********
// document variables
var intUtilLeftX;
var intUtilRightX;
var intUtilTopY;
var intUtilBottomY;
var intUtilListLeftX;
var intUtilListRightX;
var intUtilListTopY;
var intUtilListBottomY;
var loadingUtility = 0;
var selectingList = 0;

//establish onclick event handler		
document.onclick = autoCloseUtility;

//function used onLoad to establish utility box coordinates
function getUtilityBarCoords()
{
	//Netscape code
	if (document.getBoxObjectFor)
	{
		var objBO = document.getBoxObjectFor(document.getElementById('utilityContactFlydown'));
		intUtilLeftX = objBO.x;
		intUtilRightX = intUtilLeftX + objBO.width;
		intUtilTopY = objBO.y;
		intUtilBottomY = intUtilTopY + objBO.height;
		objBO = document.getBoxObjectFor(document.getElementById('jumpContacts'));
		intUtilListLeftX = objBO.x;
		intUtilListRightX = intUtilLeftX + objBO.width;
		intUtilListTopY = objBO.y;
		intUtilListBottomY = intUtilTopY + objBO.height;
	}
	//Internet Explorer code
	else if (document.getElementById('utilityContactFlydown').getBoundingClientRect)
	{
		var objRect = document.getElementById('utilityContactFlydown').getBoundingClientRect();
		intUtilLeftX = objRect.left;
		intUtilRightX = objRect.right;
		intUtilTopY = objRect.top;
		intUtilBottomY = objRect.bottom;
		objRect = document.getElementById('jumpContacts').getBoundingClientRect();
		intUtilListLeftX = objRect.left;
		intUtilListRightX = objRect.right;
		intUtilListTopY = objRect.top;
		intUtilListBottomY = objRect.bottom;
	}
}

//function called onClick - closes utility box if click is outside
function autoCloseUtility()
{

	//get coordinates of mouseclick location
	var intX = event.clientX;
	var intY = event.clientY;

	//determine whether utility bar is being loaded by this click
	if (loadingUtility == 0)
	{
		//determine whether click activated utility box drop-down menu
		if (intX >= intUtilListLeftX && intX <= intUtilListRightX && intY >= intUtilListTopY && intY <= intUtilListBottomY)
		{
			selectingList = 2;
		}
		else if (selectingList > 0)
		{
			selectingList -= 1;
		}

		//unless list selection is being made, reset utility bar if click is outside utility box
		if (selectingList == 0)
		{
			if (intX < intUtilLeftX || intX > intUtilRightX)
			{
				resetUtilityBar();
				highlightUtilityNav('utility'+topSection,'on');
			}
			else if (intY < intUtilTopY || intY > intUtilBottomY)
			{
				resetUtilityBar();
				highlightUtilityNav('utility'+topSection,'on');
			}
		}
	}
	else
	{
		//if utility box was loading, it is now complete
		loadingUtility = 0;	
		selectingList = 0;
	}
}

// ********** END OF ADDITIONAL CODE TO AUTO-CLOSE UTILITY BAR **********

//highlight utilityBar Navigation toggle
function highlightUtilityNav(navId,pos)
{
	var tip = document.getElementById(navId);
	
	if (pos == "on") {
	    if (tip) {
		tip.className = "UtilityNavbarOn";
  	    }
	}
	if (pos == "off") {
	    if (tip) {
		tip.className = "UtilityNavbar";
  	    }
	}
}

//highlight LeftNav
function leftHighlight(navId)
{
	var tip = document.getElementById('left' + navId);
	if (tip)
	{
		tip.style.color = leftNavonColor;
  	}
}

//show elements
function show(name)
{
	current = name;
	var tip = document.getElementById(name);
	if (tip)
	{
		tip.style.visibility = "visible";
	}
}

//hide elements
function hide(name)
{
	var tip = document.getElementById(name);
	if (tip)
	{
		tip.style.visibility = "hidden";
		current = "";
	}
}

//show contact us
function showContact()
{
	topPage();
	resetUtilityBar();
	show('utilityContactFlydown');
	highlightUtilityNav('utilityContact','on');
}

//show utlityBar menu
function showUtilityMenu(menu)
{
    showMenu = menu + "Flydown";
	topPage();
	resetUtilityBar();
	show(showMenu);
	highlightUtilityNav(menu,'on');
}

//activate jumpMenu
function jumpMenu(flydown)
{
	location=document[flydown].menu.options[document[flydown].menu.selectedIndex].value;
}

//activate jumpLanguage
function jumpLang(flydown)
{
	var langSelection = document[flydown].menu.options[document[flydown].menu.selectedIndex].value;
	if (langSelection == 'F')
	{
        //Find .aspx extensions and change to .html
		var strNewPathName = "";
		var strPathName = location.pathname;
		var intDot = strPathName.indexOf('.aspx');
		if (intDot >= 0)
		{
		    strNewPathName = strPathName.substring(0,intDot) + '.html';
		}
        //Now redirect to new location
		location = 'http://www.choixconcurrentiels.com' + strNewPathName;
	}
	else 
	{
		if (langSelection == 'E')
		{
			location.reload();
		}
		else
		{
			window.open('http://www.competitivealternatives.com/languages/release_' + langSelection.toLowerCase() + '.pdf','','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1');
			resetUtilityBar();
		}
	}
}

//activate jumpPublication
function jumpPublication(selection, target)
{
    newLink = document[selection].menu.options[document[selection].menu.selectedIndex].value;
    newWindow = window.open(newLink, target);
}

//search form submit
function submitSearch()
{
	if (document.searchForm.txtSearchString.value.length == 0)
	{
		return false;
//		document.forms['searchForm'].submit();
	}
} 

//------------------------------------------------------------------------------------------------------------

//disable status bar
//document.onmouseover=hidestatus;
//document.onmouseout=hidestatus;

function hidestatus()
{
	if (metaLanguage=="French") {window.status='KPMG au Canada'}
	else {window.status='KPMG in Canada'}
	return true;
	
	if (document.layers)
	{
		document.captureEvents(Event.mouseover | Event.mouseout)
	}
}

//refresh browser
function refresh()
{
	window.location.reload( false );
}

//return to top of page
function topPage()
{
	window.location = pageURL + '#';
}

// ----------------------------------------------------------------------------------------

//Macromedia Functions
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//-->
