currentLocation  = location.pathname;
currentDirectory = currentLocation.split("/");
function setPageDescShowDisplayStyle() {
  $('pageDesc').setStyle({display: 'block'});
}

//if (currentDirectory[1] == "home") {
  Event.observe(window, 'load', function() { new Effect.Appear('pageDesc', {duration: 2}); });
//} /*else {
	Event.observe(window, 'load', setPageDescShowDisplayStyle);
//}


function showPrintPage() {
  printwinow = window.open("/assessment/printform.php", "printform", "status = 0, toolbar = 0, menubar = 0, resizeable = 1, scrollbars = 1, width = 830, height = 800");
  printwindow.moveTo(0, 0);
}


/*
function toggleCourseListing(descId, headingId) {
  var descId    = document.getElementById(descId);
  var headingId = document.getElementById(headingId);
  
  new Effect.toggle(descId, 'blind', {duration: 2})
  
  if (descId.style.display == 'block') {
    descId.style.display = 'none';
    headingId.style.backgroundImage = 'url(/images/up.gif)';
	  headingId.style.backgroundPosition = 'center right';
	  headingId.style.backgroundRepeat   = 'no-repeat';

  } else {
    descId.style.display = 'block';
    headingId.style.backgroundImage = 'url(/images/up.gif)';
    headingId.style.backgroundPosition = 'center right';
    headingId.style.backgroundRepeat   = 'no-repeat';
  }
}
*/
function toggleDisplay(id) {
  var e = document.getElementById(id);
  if (e.style.display == 'block') {
     e.style.display = 'none';
  } else {
    e.style.display = 'block';
  }
}

function displayReadMore() {
  $('clearRock').innerHTML = "Employers increasingly are using coaching and mentoring to retain "; 
  $('clearRock').innerHTML += "high-potential and frontline employees, according to a ClearRock survey ";
  $('clearRock').innerHTML +=  "on the most popular ways to retain these employees. ";
  $('clearRock').innerHTML += "The top five ways employers try to retain high-potential employees are:"; 
  $('clearRock').innerHTML += " selecting them more carefully; providing better training; coaching; "; 
  $('clearRock').innerHTML += "better compensation and benefits; and improved orientation and ";
  $('clearRock').innerHTML += "assimilation programs. The top five methods for retaining frontline ";
  $('clearRock').innerHTML += "employees are: selecting them more carefully; better orientation and ";
  $('clearRock').innerHTML += "assimilation programs; exit interviews; improved training; and ";
  $('clearRock').innerHTML += "better compensation and benefits.";
}

/**
 * Code retrieved from: http://web-graphics.com/mtarchive/001659.php
 */
function backToTop() {
    var x1 = x2 = x3 = 0;
    var y1 = y2 = y3 = 0;

    if (document.documentElement) {
        x1 = document.documentElement.scrollLeft || 0;
        y1 = document.documentElement.scrollTop || 0;
    }

    if (document.body) {
        x2 = document.body.scrollLeft || 0;
        y2 = document.body.scrollTop || 0;
    }

    x3 = window.scrollX || 0;
    y3 = window.scrollY || 0;

    var x = Math.max(x1, Math.max(x2, x3));
    var y = Math.max(y1, Math.max(y2, y3));

    window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));

    if (x > 0 || y > 0) {
        window.setTimeout("backToTop()", 25);
    }
}
