/*-----------------------------------------------------------------------------
 common.js

 JavaScript code used by Solid Logic's web site.

 Change history (most recent first):

  <1>  01/15/03  Thomas C. Eaton  Created.

 Copyright © 2003 by Solid Logic Computer Solutions Inc.  All rights reserved.
------------------------------------------------------------------------------*/

/*******************************************************************************
 Changes the background color of the specified element.
 
 id      a string representing the ID of the element whose background color
         will be changed.
 color   a string representing the new background color.
*******************************************************************************/
  
function changeBackgroundColor(id, color) {
  document.getElementById(id).style.backgroundColor = color
}

/*******************************************************************************
 Creates an e-mail address.  Creating an e-mail this way prevents webots from
 harvesting and spamming the e-mail address.
 
 recipient  a string representing the e-mail name of the recipient.
 domain     a string representing the domain in which the recipient's e-mail
            box resides.
*******************************************************************************/

function createEmailAddress(recipient, domain) {
  return "mailto:" + recipient + "@" + domain
}

/*******************************************************************************
  Creates an e-mail URL that enables the sender to request to more information
  about Solid Logic's balanced scorecard solutions.
*******************************************************************************/

function requestBalancedScorecardPresentation() {
  return createEmailAddress("results", "slogic.com")
    + "?subject=" + escape("Tell Me About Solid Logic's Balanced Scorecard Solutions")
    + "&body=" + escape("Please tell me how balanced scorecards implemented by Solid Logic can help my business deliver predictable and profitable results.")
      + "%0D%0A%0D%0A"
      + escape("Name:") + "%0D%0A"
      + escape("Company name:") + "%0D%0A"
      + escape("Telephone number:") + "%0D%0A"
      + escape("E-Mail address:")
}

/*******************************************************************************
  Creates an e-mail URL that enables the sender to request to be notified of
  upcoming CPM presentations.
*******************************************************************************/

function requestCPMPresentation() {
  return createEmailAddress("results", "slogic.com")
    + "?subject=" + escape("Notify Me of Upcoming CPM Presentations")
    + "&body=" + escape("Please notify me of upcoming corporate performance management presentations from Solid Logic.")
      + "%0D%0A%0D%0A"
      + escape("Name:") + "%0D%0A"
      + escape("Company name:") + "%0D%0A"
      + escape("Telephone number:") + "%0D%0A"
      + escape("E-Mail address:")
}

/*******************************************************************************
  Creates an e-mail URL that enables the sender to request more information
  about Solid Logic's Hyperion solutions.
*******************************************************************************/

function requestHyperionPresentation() {
  return createEmailAddress("results", "slogic.com")
    + "?subject=" + escape("Tell Me About Solid Logic's Hyperion Solutions")
    + "&body=" + escape("Please tell me how Solid Logic can help me get the most out of my investment in Hyperion technologies.")
    + "%0D%0A%0D%0A"
    + escape("Name:") + "%0D%0A"
    + escape("Company name:") + "%0D%0A"
    + escape("Telephone number:") + "%0D%0A"
    + escape("E-mail address:")
}

/*******************************************************************************
  Creates an e-mail URL that sends an application for the specified position
  to Solid Logic.
  
  position  a string representing the name of the position for which the sender
            is applying.
*******************************************************************************/

function applyForPosition(position) {
  return createEmailAddress("careers", "slogic.com")
    + "?subject=" + escape("Application for Position of " + position)
}
