function LogObject(obj,console_on)
{

  var props = new Array();
  for (var i in obj)
  {
    props.push(i);
  }

  props.sort();
  if(console_on)
  {
    console.log(props.join("\n"));
  }
  else
  {
    return props.join("\n");
  }
}
var ToolTipRegistrar = {

  marker:new Array()
};
function ToolTip(parentContainer, sourceElement, baseClassName, currentClassName, product_id, width, max_height, left_anchor)
{
  var id = "";
  var hide_timeout = -1;
  this.hidden = true;
  var left_position = undefined;
  this.MoveTo = function(event, parent, position)
  {
    var top,left;
    var pPosition =
      $('product_' + id + '_tool_tip')
        .parent(parent)
        .cumulativeOffset();

    var trTop =
        $('product_' + id ).cumulativeOffset()[1] +
        Math.round($('product_' + id).offsetHeight) -
        pPosition[1];


    var trLeft =
        $('product_' + id ).cumulativeOffset()[0] +
        Math.round($('product_' + id).offsetWidth/2) -
        pPosition[0];
    if('object' == typeof position)
    {
      top = position.top + "px";
      left = position.left + "px";
    }
    else
    {
      top = (event.clientY + document.viewport.getScrollOffsets().top - pPosition[1]);
      left = (event.clientX + document.viewport.getScrollOffsets().left - pPosition[0] + 10);
    }
    if
    (
      $('product_' + id + '_tool_tip').parent(parent).offsetHeight
      <
      trTop + $('product_' + id + '_tool_tip').select('.content_wrapper')[0].offsetHeight
    )
    {
      trTop =
        $('product_' + id + '_tool_tip').parent(parent).offsetHeight -
        $('product_' + id + '_tool_tip').select('.content_wrapper')[0].offsetHeight;
    }
    if
    (
      $('product_' + id + '_tool_tip').parent(parent).offsetWidth
      <
      trLeft + $('product_' + id + '_tool_tip').select('.content_wrapper')[0].offsetWidth
    )
    {
      trLeft =
        $('product_' + id + '_tool_tip').parent(parent).offsetWidth -
        $('product_' + id + '_tool_tip').select('.content_wrapper')[0].offsetWidth;
    }
    if('undefined' != typeof left_position)
    {
      trLeft = left_position;
    }
    $('product_' + id + '_tool_tip')
      .setStyle
      ({
        /*left: left+'px',*/
        left: trLeft+'px',
        top: trTop+'px'
      });
  };
  this.Show = function(event, parent)
  {
    if(-1 != hide_timeout)
    {
      window.clearTimeout(hide_timeout);
      hide_timeout = -1;
    }
    $('product_' + id + '_tool_tip').setStyle({display: "block"});
    $('product_' + id + '_tool_tip').setStyle({visibility: "visible"});

    if (this.hidden)
    {
      this.hidden = false;
      this.MoveTo(event, parent);
    }
  };
  function HideToolTip()
  {
    this.hidden = true;
    $('product_' + id + '_tool_tip').setStyle({display: "none"});
    hide_timeout = -1;
  }
  this.Hide = function()
  {
    hide_timeout = window.setTimeout(
      function (){HideToolTip()},
      600
    );
  };
  this.Build = function(parentContainer, sourceElement, baseClassName, currentClassName, product_id, current_width, max_height, left_anchor)
  {
    if('undefined' != typeof left_anchor)
    {
      left_position = left_anchor.cumulativeOffset()[0] - sourceElement.parent('.' + parentContainer).cumulativeOffset()[0]+5;
    }

    ToolTipRegistrar.marker[product_id]= this;
    var pre_trace =
      sourceElement
        .parent('.container_box')
        .cumulativeOffset();
    $('product_' + product_id + '_tool_tip').setStyle
      ({
        width: current_width + "px"
      });
    var parent_height =
      sourceElement
        .parent('.container_box')
        .offsetHeight;
    id = this.id = product_id;
    var height = $('product_' + product_id + '_tool_tip')
      .select('.content_wrapper')[0]
      .offsetHeight - 8;
    var width = $('product_' + product_id + '_tool_tip')
      .select('.content_wrapper')[0]
      .offsetWidth - 18;

    var top = sourceElement.parent('tr').offsetTop + Math.round(sourceElement.parent('tr').offsetHeight/2);
    if (height + sourceElement.parent('tr').offsetTop + Math.round(sourceElement.parent('tr').offsetHeight/2) > parent_height)
    {
      top = sourceElement.parent('tr').offsetTop + Math.round(sourceElement.parent('tr').offsetHeight/2) - height;
    }

    $('product_' + this.id + '_tool_tip')
      .hover
      (
        this.Show,
        this.Hide,
        {
          enterDelay:300,
          leaveDelay:0
        }
      )

    $('product_' + this.id + '_tool_tip')
      .select('.select_hidder')[0]
      .setStyle
      ({
        height: height + "px",
        width: width + "px"
      });

  };
  this.Build(parentContainer, sourceElement, baseClassName, currentClassName, product_id, width, max_height, left_anchor);
}