// JavaScript Document

/**
 * getVar( varName )
 * Extracts a get var from the get string
 * @param (string) Contains the name of the variable that you would like to extract
 * @return (string) The value assigned to the variable  **/ function getVar( varName ) {
  var getString = window.location.search.substring(1);
  var vars = getString.split("&");
  var varCount = vars.length;
  var retVal = false;
  for( var i = 0; i < varCount; i++ )
  {
    var valuePair = vars[i].split("=");
    if( valuePair[0] == varName )
    {
      retVal = valuePair[1];
    } // end of if
  } // end of for
  return retVal;
} // end of function

/**
 * setCookie()
 * Sets a tracking cookie so we can track affiliates
 * @return void
 **/
function setCookie()
{
  var afid = getVar( "afid" );
  var url =
"http://bright.securesites.com/affiliate_cookie_setter.html?afid=" + afid;
  document.write("<iframe style=\"display: none;\" src=\"" + url + "\"></iframe>"); } // end of function
