/*  ================================
     Sitewide JavaScript
    ================================ */

var thunderPopup;

function openPopup(wURL, wWidth, wHeight)
{
thunderPopup = window.open (wURL, "wThunderPopup", "location=0,status=0,toolbar=0,scrollbars=0,resizable=0,menubar=0,directories=0,copyhistory=0,width="+wWidth+",height="+wHeight);
}

var quoteBank;
quoteBank = 0;

	function getQuote()
	{
		var randomQuote;
		if(quoteBank==0)
		{
			randomQuote = Math.floor(Math.random()*2)+1;
			if(randomQuote==1) makeQuote("70% of CIOs think long-term strategic thinking and planning is the leadership competency most critical to their role.","CIO, 2009");
			if(randomQuote==2) makeQuote("While 90% of surveyed companies have undertaken significant organizational change within the last 2 years, only 5% have avoided substantial disruptions and finished on time.", "Gartner, 2001");
		}
		else if(quoteBank==1)
		{
			randomQuote = Math.floor(Math.random()*7)+1;
			if(randomQuote==1) makeQuote("70% of CIOs think long-term strategic thinking and planning is the leadership competency most critical to their role.","CIO, 2009");
			if(randomQuote==2) makeQuote("Only 11% of leaders feel that strategic planning is worth the effort.", "Mankins & Steele in Harvard Business Review, 2006");
			if(randomQuote==3) makeQuote("While 90% of surveyed companies have undertaken significant organizational change within the last 2 years, only 5% have avoided substantial disruptions and finished on time.", "Gartner, 2001");
			if(randomQuote==4) makeQuote("29% of projects are completed on time, on budget, and to scope specifications.", "Standish Group");
			if(randomQuote==5) makeQuote("Innovation will be one of the top three drivers of growth in the next few years say more than 70% of leaders in one study. However, only 27% say that innovation is fully integrated into the strategic planning process.", "McKinsey Quarterly, 2008");
			if(randomQuote==6) makeQuote("By 2013, more than 40% of business outcomes will be outside one enterprise&apos;s control.", "Gartner, 2008");
			if(randomQuote==7) makeQuote("Only 38% of change initiatives are completely or mostly successful improving performance.", "McKinsey, 2006");
		}
		else if(quoteBank==2)
		{
			randomQuote = Math.floor(Math.random()*7)+1;
			if(randomQuote==1) makeQuote("75% of CEOs believe that employee education is critical for future enterprise success.","IBM, 2004");
			if(randomQuote==2) makeQuote("The most significant barrier to innovation is too little collaboration. ","Accenture survey, 2006");
			if(randomQuote==3) makeQuote("Employees most frequently cite lack of cooperation among work units and excessive bureaucracy as factors behind unsuccessful change efforts.","Katzenbach, 2007");
			if(randomQuote==4) makeQuote("It costs about one year's salary to replace a manager, executive or specialized knowledge worker.","Saratoga Institute");
			if(randomQuote==5) makeQuote("Silos that discourage collaboration and resource sharing are a major barrier to successful talent management. ","McKinsey Quarterly, 2007");
			if(randomQuote==6) makeQuote("Almost 80% of senior executives surveyed said that effective coordination across geographic, functional, and product lines was crucial for growth, but only 25% said their organizations were effective sharing knowledge across those lines. ","McKinsey, 2005");
			if(randomQuote==7) makeQuote("38% of employees admit to ignoring &ldquo;the rules&rdquo; in favor of getting something done. ","Katzenbach, 2007");
		}
		else if(quoteBank==3)
		{
			randomQuote = Math.floor(Math.random()*7)+1;
			if(randomQuote==1) makeQuote("CIOs' #1 concern is attracting, developing, and retaining IT professionals (51%). Their second concern is aligning IT and business (42%).","Society for Info Management in InformationWeek, 10/07");
			if(randomQuote==2) makeQuote("CFOs' #1 internal, company-specific concern is attracting and retaining qualified employees. ","Duke University / CFO Global Business Outlook Survey, 2008");
			if(randomQuote==3) makeQuote("Leaders' #1 HR concern is talent retention (72%) followed by leadership development (60%). ","HR Executive, 2007");
			if(randomQuote==4) makeQuote("The most critical challenge to innovation is acquiring and developing the right talent. ","The Conference Board, 2007 ");
			if(randomQuote==5) makeQuote("34 of 35 senior executives would have stayed with their company rather than leave if someone from senior management had talked to them. Each executive took an average of 15 people with them when they left.","HR Executive, 2007");
			if(randomQuote==6) makeQuote("Only 34% of CEOs spend time managing leadership talent. ","Global Leadership Forecast");
			if(randomQuote==7) makeQuote("80% of companies are not well prepared for their CEOs' departure. ","Corporate Leadership Council, 2004");
			if(randomQuote==8) makeQuote("72% of CIOs polled believe they have the wrong people on staff or not enough of the right people to get the job done. ","Gartner, 2008");
		}
		else if(quoteBank==4)
		{
			randomQuote = Math.floor(Math.random()*7)+1;
			if(randomQuote==1) makeQuote("Employees are three times more likely to describe their job environment as &quot;positive&quot; if they have managers who are proactive about tapping the informal organization for ideas.","Katzenbach, 2007");
			if(randomQuote==2) makeQuote("Operating income for organizations with high employee engagement improved by 19%. It declined 33% over the same period for companies with low employee engagement. ","Towers Perrin, 2008");
			if(randomQuote==3) makeQuote("89% of managers believe that employees leave because they want more money. In reality, 88% of employees leave for reasons other than money. ","Harvard Management Update & The 7 Hidden Reasons Employees Leave ");
			if(randomQuote==4) makeQuote("Only 36% of employees believe their leaders act with honesty and integrity.","Harris Interactive, 2005");
			if(randomQuote==5) makeQuote("85% of high-stakes business initiatives fail when execs avoid discussing difficult issues such as realistic deadlines, resources, sponsorship, and accountability. ","VitalSmarts & The Concours Group");
			if(randomQuote==6) makeQuote("76% of executives voted talent retention as their #1 priority in post-merger integration.","Mercer");
			if(randomQuote==7) makeQuote("High-trust organizations outperform low-trust organizations in total return to shareholders by 286% (stock price plus dividends).","Watson Wyatt, 2002");
		}
		else if(quoteBank==5)
		{
			randomQuote = Math.floor(Math.random()*7)+1;
			if(randomQuote==1) makeQuote("Thanks again for doing such a great job in helping us plan and then facilitate the offsite meeting. Your experience and coordination made it look easy. We could not have done this without your help and guidance.","VP, technology services organization");
			if(randomQuote==2) makeQuote("I've never seen such uniform positive responses. It's a home run. Congratulations!","Director, energy generation company");
			if(randomQuote==3) makeQuote("Working with Partnering Resources was a true pleasure! We emerged with an energized management team with a common vision and clear agenda. This will serve as the foundation for our company's efforts for the next several years. Truly a first class operation.","CEO, technology company");
			if(randomQuote==4) makeQuote("When I inherited a new division, Partnering Resources designed and facilitated a strategic offsite session to help leaders in the new division get on board quickly. Through structured dialogue and well-chosen activities, we discussed the vision and strategy for the organization, engaged the leaders, and increased their understanding of our goals. In one day, we boosted the leaders' commitment to the organization.","CIO, insurance company");
			if(randomQuote==5) makeQuote("This has been the most positive experience I have had in my sixteen years. This morning, I came to work with a different attitude. Please convey my thanks to all who were involved.","Manager, energy company");
			if(randomQuote==6) makeQuote("I really want to express my pleasure with these meetings. I have to admit I was skeptical coming in, but I have been singing their praises ever since. I think the candor of the group was very open and honest even under a situation that none of us had previously experienced. I have been in many meetings of this sort, and I am amazed at the dynamic that evolved in the short time we were allotted.","Software developer, financial services organization");
			if(randomQuote==7) makeQuote("Thanks so much for your hard work and diligence over the past few weeks working with me and the process redesign team. The milestone meeting today showed what great work the team has done with your direction.","VP, insurance company");
			if(randomQuote==8) makeQuote("Partnering Resources is a terrific resource for staff development. They took teams that were already performing effectively and helped them to leverage the strengths of each individual in the group to deliver greater success for the organization. In each case, my employees became better able to solve their own problems as well as make better decisions and implement them quickly. Partnering Resources delivered huge value for the investment and I will definitely use them again.","VP, software company");
		}
	}
	
	function makeQuote(a, b)
	{
		var quoteContainer;
		quoteContainer = document.getElementById("mainContainer").getElementsByTagName("blockquote")[0];
		if(quoteContainer)
		{
			var totalQuote;
			totalQuote = a;
			
			if(totalQuote.length < 100)
			{
				// Current style properties OK
			}
			else if (totalQuote.length < 200)
			{
				quoteContainer.style.paddingTop = "35px";
				quoteContainer.style.paddingLeft = "20px";
				quoteContainer.style.fontSize = "15px";
				quoteContainer.style.lineHeight = "16px";
				quoteContainer.style.width = "240px";
			}
			else if (totalQuote.length < 300)
			{
				quoteContainer.style.paddingTop = "25px";
				quoteContainer.style.paddingLeft = "15px";
				quoteContainer.style.fontSize = "14px";
				quoteContainer.style.lineHeight = "15px";
				quoteContainer.style.width = "280px";
			}
			else if (totalQuote.length < 400)
			{
				quoteContainer.style.paddingTop = "15px";
				quoteContainer.style.paddingLeft = "10px";
				quoteContainer.style.fontSize = "12px";
				quoteContainer.style.lineHeight = "13px";
				quoteContainer.style.width = "300px";
			}
			else
			{
				quoteContainer.style.paddingTop = "15px";
				quoteContainer.style.paddingLeft = "10px";
				quoteContainer.style.fontSize = "13px";
				quoteContainer.style.lineHeight = "14px";
				quoteContainer.style.width = "320px";
			}

			if(b)
			{
				totalQuote = totalQuote + "<cite>"+b+"</cite>";
				quoteContainer.innerHTML = totalQuote;
			}
		}
	}

	// Detected and set from HTML
	var isIE6;
	isIE6 = false;

	function sitewidePageLoaded()
	{
		// All pages on load
		navInit();
	}

/*  ================================
     Template-Specific JavaScript
    ================================ */

	function template1Loaded()
	{
		for(var imgButton in document.getElementById("photoButtons").getElementsByTagName("img"))
		{
			document.getElementById("photoButtons").getElementsByTagName("img")[imgButton].onmouseover = function(e) { this.src=this.src.replace("-off.jpg","-on.jpg"); }
			document.getElementById("photoButtons").getElementsByTagName("img")[imgButton].onmouseout = function(e) { this.src=this.src.replace("-on.jpg","-off.jpg"); }
		}
		// Per template on load
		sitewidePageLoaded();
	}

	function template2Loaded()
	{
		sitewidePageLoaded();
		getQuote();
	}

	function showResult(y)
	{
//		y.parentNode.getElementsByTagName("em")[0].style.display = "block";
		y.parentNode.className = "singleResultActive";
	}

	function hideResult(y)
	{
//		y.parentNode.getElementsByTagName("em")[0].style.display = "none";
		y.parentNode.className = "singleResult";
	}

	function oldShowResult(x, y)
	{
		y.style.borderColor = "#000";
		y.alt = x;
		y.title = x;
		document.getElementById("resultsText").innerHTML = x;
	}

	function oldHideResult(y)
	{
		y.style.borderColor = "#fff";
		document.getElementById("resultsText").innerHTML = "Roll over a client's logo to see a description of their results.";
	}

//displays the first ul in the container when called in rollover script init()
function navOn(temp) {	
	//safe function to show an element with a specified id
	var x=temp.getElementsByTagName('ul');
	if(x[0]){x[0].style.display = 'block';}
	
	var y=temp.getElementsByTagName('a');
	AddClassName(y[0], "navIsOn", true)
}

//displays the first ul in the container when called in rollover script init()
function navOff(temp) {
    //safe function to hide an element with a specified id
	var x=temp.getElementsByTagName('ul');
	if(x[0]){x[0].style.display = 'none';}
	
	var y=temp.getElementsByTagName('a');
	y[0].style.backgroundColor = "";
	RemoveClassName(y[0], "navIsOn");
}

//loads the onmouseover/onmouseout actions onto all the nav elements
function navInit(){
	x = document.getElementById('topnav').getElementsByTagName('li');
    for (var i=0;i<x.length;i++)
	{
	    x[i].onmouseover = function () {navOn(this);}
		x[i].onmouseout = function () {navOff(this);}
	}
}

// http://snippets.dzone.com/posts/show/2630
// ----------------------------------------------------------------------------
// HasClassName
//
// Description : returns boolean indicating whether the object has the class name
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to add
//
function HasClassName(objElement, strClass)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // get uppercase class for comparison purposes
      var strClassUpper = strClass.toUpperCase();

      // find all instances and remove them
      for ( var i = 0; i < arrList.length; i++ )
         {

         // if class found
         if ( arrList[i].toUpperCase() == strClassUpper )
            {

            // we found it
            return true;

            }

         }

      }

   // if we got here then the class name is not there
   return false;

   }
// 
// HasClassName
// ----------------------------------------------------------------------------


// ----------------------------------------------------------------------------
// AddClassName
//
// Description : adds a class to the class attribute of a DOM element
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to add
//
function AddClassName(objElement, strClass, blnMayAlreadyExist)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // if the new class name may already exist in list
      if ( blnMayAlreadyExist )
         {

         // get uppercase class for comparison purposes
         var strClassUpper = strClass.toUpperCase();

         // find all instances and remove them
         for ( var i = 0; i < arrList.length; i++ )
            {

            // if class found
            if ( arrList[i].toUpperCase() == strClassUpper )
               {

               // remove array item
               arrList.splice(i, 1);

               // decrement loop counter as we have adjusted the array's contents
               i--;

               }

            }

         }

      // add the new class to end of list
      arrList[arrList.length] = strClass;

      // add the new class to beginning of list
      //arrList.splice(0, 0, strClass);
      
      // assign modified class name attribute
      objElement.className = arrList.join(' ');

      }
   // if there was no class
   else
      {

      // assign modified class name attribute      
      objElement.className = strClass;
   
      }

   }
// 
// AddClassName
// ----------------------------------------------------------------------------


// ----------------------------------------------------------------------------
// RemoveClassName
//
// Description : removes a class from the class attribute of a DOM element
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to remove
//
function RemoveClassName(objElement, strClass)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // get uppercase class for comparison purposes
      var strClassUpper = strClass.toUpperCase();

      // find all instances and remove them
      for ( var i = 0; i < arrList.length; i++ )
         {

         // if class found
         if ( arrList[i].toUpperCase() == strClassUpper )
            {

            // remove array item
            arrList.splice(i, 1);

            // decrement loop counter as we have adjusted the array's contents
            i--;

            }

         }

      // assign modified class name attribute
      objElement.className = arrList.join(' ');

      }
   // if there was no class
   // there is nothing to remove

   }
// 
// RemoveClassName
// ----------------------------------------------------------------------------