
fractalMapTooltip.rowEven = fractalMap.styleColour( [0,0,0] );
fractalMapTooltip.rowOdd = fractalMap.styleColour( [48,48,48] );
fractalMapTooltip.text = fractalMap.styleColour( [255,255,255] );

fractalMapTooltip.getTooltip = function() {

	var s; 
	var i = 0;

	// The width of the returned table - modify here to adjust
	var width = 250;
	
	s = '<TABLE id="outerTable" cellpadding="0" cellspacing="0" border="1" width="' + width + '"><TR><TD>';

	// The title row - display's the position in the hierarchy (implement titleRow())
	s += '<TABLE cellpadding="0" cellspacing="0" border="0" width="' + width + '">';
	s += this.titleRow();
	s += '</TABLE>';

        s += '</TD></TR><TR><TD>';

	// The colour row - displays the value associated with the field used to colour the map
	s += '<TABLE style="padding-left: 2px;" cellpadding="0" cellspacing="0" border="0" width="' + width + '">';
	s += this.colourRow();
	s += '</TABLE>';

        s += '</TD></TR><TR><TD>';

	// The main section - displays the values of the specified fields
	s += '<TABLE cellpadding="0" cellspacing="0" border="0" width="' + width + '">';

s += this.formatRow( i++, "REAL32TIME32PRICE32CHANGE32132DAY32PERCENT" );

s += this.formatRow( i++, "LAST32PRICE" );

s += this.formatRow( i++, "VOLUME" );

s += this.formatRow( i++, "RSI32932DAY" );

s += this.formatRow( i++, "MOVING32AVG3220032DAY" );

s += this.formatRow( i++, "FIELD2" );

s += this.formatRow( i++, "ALPHA" );

s += this.formatRow( i++, "EPS32GROWTH" );

	// The help section - displays help at bottom of the tooltip (implement helpRow()).
	s += this.helpRow();
	s += '</TABLE>';

	s += '</TD></TR></TABLE>';

	return s;
}

fractalMapTooltip.titleRow = function() {

	var s='';
	var d;

	var heightSeparatorRow = 1;
	var colourSeparatorRow = "#990000";
	var colourHeader = "#EE0000";

	// Check hiearchy name
	if (this.getOption('hierarchy') == 'default') {
      
      

	    // This is the root node
	    s = '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Project: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 0) + '</TD></TR></table></td></tr>';
      d = this.GetDepth();
      
	if (d >= 1) {
  
    s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
    s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Region: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 1) + '</TD></TR></table></td></tr>';
	}
      
	if (d >= 2) {
  
    s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
    s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Index: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 2) + '</TD></TR></table></td></tr>';
	}
      
	if (d >= 3) {
  
    s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
    s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Industry Sector: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 3) + '</TD></TR></table></td></tr>';
	}
      
	if (d >= 4) {
  
    s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
    s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Industry Group: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 4) + '</TD></TR></table></td></tr>';
	}
      
	    // Leaf Level
      
      if (d == 5) {
	      s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
	      s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Name: </I></FONT></TD><TD align="right" colspan="2">' + this.GetFieldValueString('NAME') + '</TD></TR></table></td></tr>';
	      
      }
        

      return s;
    }
      
	// Check hiearchy name
	if (this.getOption('hierarchy') == 'opt1') {
      
      

	    // This is the root node
	    s = '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Project: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 0) + '</TD></TR></table></td></tr>';
      d = this.GetDepth();
      
	if (d >= 1) {
  
    s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
    s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Industry Sector: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 1) + '</TD></TR></table></td></tr>';
	}
      
	if (d >= 2) {
  
    s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
    s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Industry Group: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 2) + '</TD></TR></table></td></tr>';
	}
      
	if (d >= 3) {
  
    s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
    s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Industry Subgroup: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 3) + '</TD></TR></table></td></tr>';
	}
      
	    // Leaf Level
      
      if (d == 4) {
	      s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
	      s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Name: </I></FONT></TD><TD align="right" colspan="2">' + this.GetFieldValueString('NAME') + '</TD></TR></table></td></tr>';
	      
      }
        

      return s;
    }
      
	// Check hiearchy name
	if (this.getOption('hierarchy') == 'opt2') {
      
      

	    // This is the root node
	    s = '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Project: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 0) + '</TD></TR></table></td></tr>';
      d = this.GetDepth();
      
	if (d >= 1) {
  
    s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
    s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Index: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 1) + '</TD></TR></table></td></tr>';
	}
      
	if (d >= 2) {
  
    s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
    s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Industry Sector: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 2) + '</TD></TR></table></td></tr>';
	}
      
	if (d >= 3) {
  
    s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
    s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Industry Group: </I></FONT></TD><TD align="right" colspan="2">' + this.GetAncestorFieldValueString('NAME', 3) + '</TD></TR></table></td></tr>';
	}
      
	    // Leaf Level
      
      if (d == 4) {
	      s += this.separatorRowHeightColour(heightSeparatorRow, colourSeparatorRow);
	      s += '<tr><td><table style="padding-left: 2px; padding-right: 2px;" cellpadding="0" cellspacing="0" border="0" width="250"><TR><TD align="left"><FONT color=' + colourHeader + '"><I>Name: </I></FONT></TD><TD align="right" colspan="2">' + this.GetFieldValueString('NAME') + '</TD></TR></table></td></tr>';
	      
      }
        

      return s;
    }
      
	return s;
}

