<!--
// Object Renderer

function GetAnswerValueText ( aName )
{
  var c , i ;
  for ( c = 0 ; c < answers.length ; c++ )
    if ( answers[c].name == aName )
    {
      if ( answers[c].type == numericType )
      {
	if ( answers[c].currentValue != NO_VALUE_NUMERIC )
	  return ( answers[c].currentValue ) ;
      }
      else
      {
        i = GetAnswerValueIndex ( c ) ;
        if ( i >= 0 )
          return ( answers[c].values[i].text ) ;
      }
    }
  return ( "" ) ;
}

function HandleEmbedded ( aText )
{
  var s = "" ;
  var c , cc , ss ;
  do
  {
    c = aText.indexOf("{");
    if ( c == -1 )
    {
      s += aText ;
      aText = "" ;
    }
    else
    {
      s += aText.substring(0,c);
      aText = aText.substring(c+1,aText.length) ;
      c = aText.indexOf("}");
      if ( c == -1 )
        aText = "" ;
      else
      {
	ss = aText.substring(0,c) ;
        aText = aText.substring(c+1,aText.length) ;
	s += GetAnswerValueText ( ss ) ;
      }
    }
  }
  while ( aText.length > 0 ) ;
  return ( s ) ;
}

function Build_Report ()
{
  var s ;

  s = '<table border="0" cellspacing="0" cellpadding="0" width="100%">' +
        '<tr class="bluehead">' +
          '<td>&nbsp;' + question . text + '</td>' +
          '<td align="right">' ;

  s +=      '<a href="javascript:parent.SingleQuestionChat()">' +
              '<img src="../../attarImages/toolchat.gif" alt="Get Question Text" width="21" height="21" border="0" valign="middle" />' +
            '</a>' +
            '<img src="../../attarImages/tiny.gif" border="0" height="1" width="5" />' ;

  if ( question.overviewID != 0 )
    s +=    '<a href="javascript:parent.ShowOverview(' + question.overviewID + ')">' +
              '<img src="../../attarImages/toolnav.gif" alt="Show Navigation View" width="21" height="21" border="0" valign="middle" />' +
            '</a>' +
            '<img src="../../attarImages/tiny.gif" border="0" height="1" width="5" />' ;
  s +=      '<a href="javascript:parent.ShowHelp()">' +
              '<img src="../../attarImages/toolhelp.gif" alt="Help" width="21" height="21" border="0" valign="middle" />' +
            '</a>' +
            '<img src="../../attarImages/tiny.gif" border="0" height="1" width="5" />' +
          '</td>' +
        '</tr>' +
      '</table>' ;

  s = WrapTable ( "../../attarImages/bhead" , "../../attarImages/tiny.gif" , 4 , s ) ;

  s += GetPadTable ( 8 ) +
       '<span id="values">' +
       HandleEmbedded ( question.values[0].display ) +
       '</span>' +
       GetPadTable ( 8 ) +
       BuildExitBtn ( ) +
       GetPadTable ( 8 ) +
       Build_InlineAttachment ( 0 ) ;
  return ( s ) ;
}

function BuildReport_AsText ()
{
  var s = question . text + "\n\n" +
          question.values[0].display ;
  return ( s ) ;
}

-->