function colorBorders() 
{
  /* Color the bar on the right side the correct color 
     according to the page. */
  var url   = window.location.toString().split("/");
  var page = url[url.length - 1].toString().split("#");
  if (page[0] == "energy.aspx")
  {
    document.getElementById('divAboveImage').style.borderLeft = '160px solid #7D7141';
    document.getElementById('mainDiv').style.borderLeft = '160px solid #B4B078';
    document.getElementById('horiBarLight').style.borderLeft = '160px solid #B4B078';
  }
  if (page[0] == "software.aspx")
  {
    document.getElementById('divAboveImage').style.borderLeft = '160px solid #5A2C00';
    document.getElementById('mainDiv').style.borderLeft = '160px solid #976536';
    document.getElementById('horiBarLight').style.borderLeft = '160px solid #976536';
  }
}

function validateEmail()
{
  var validEmail = /^[a-zA-Z0-9\.\-]+\@[a-zA-Z0-9\.\-]+\.(com|net|org|gov)$/;
  var email = document.getElementById('ctl00_ctl00_cphBreaksAndImages_cphContent_txtEmail').value;
  var verEmail = document.getElementById('ctl00_ctl00_cphBreaksAndImages_cphContent_txtVerifyEmail').value;
  
  if (email != verEmail)
  {
    alert('Email addresses do not match.');
    return false;
  }
  
  if (!validEmail.test(email))
  {
    alert('Email address is invalid.');
    return false;
  }
  
  return true;
}

function openWindow(loc)
{
  window.open(loc, "wnd");
}
