var aToolTipContent = 'Kein Tooltip definiert!';
function setToolTipFrame(toolTipContentText, width, height){
    if(width == null && height == null)
    {
      var aToolTipContent = '<div class="aToolTipContentFrame"><div class="content">' + 
          toolTipContentText +
      '</div></div>'; 
      return aToolTipContent;
    }
    else if(width == null)
    {
      var aToolTipContent = '<div class="aToolTipContentFrame" style="height:'+ height + ';"><div class="content">' + 
      toolTipContentText +
      '</div></div>'; 
      return aToolTipContent;
      
    }
    else if(height == null)
    {
      var aToolTipContent = '<div class="aToolTipContentFrame" style="width:'+ width + ';"><div class="content">' + 
      toolTipContentText +
      '</div></div>'; 
      return aToolTipContent;
    }
    else
    {
      var aToolTipContent = '<div class="aToolTipContentFrame" style="width:'+ width + ';height:'+ height + ';"><div class="content">' + 
      toolTipContentText +
      '</div></div>'; 
      return aToolTipContent;
    }
    
}
function setAToolTipBoxStandardMouseOver(toolTipContentText, aToolTipLinkCSSClass, xOffset, yOffset)
{
  if(xOffset == null ) xOffset = 0;
  if(yOffset == null ) yOffset = 0;
  setAToolTipBox(toolTipContentText, aToolTipLinkCSSClass, null, null, bClickIt, xOffset, yOffset);
}

function setAToolTipBoxStandardClickIt(toolTipContentText, aToolTipLinkCSSClass, xOffset, yOffset)
{
  if(xOffset == null ) xOffset = 0;
  if(yOffset == null ) yOffset = 0;
  setAToolTipBox(toolTipContentText, aToolTipLinkCSSClass, null, null, true, xOffset, yOffset);
}
/*
 * 
 * Wenn offset über dem Auslöser liegt, gibt es Probleme: Flackern des Tooltipps! --> Dann aToolTip wieder zurückschieben.
 */
function setAToolTipBox(toolTipContentText, aToolTipLinkCSSClass, width, height, bClickIt, xOffset, yOffset)
{
  if(xOffset == null ) xOffset = 0; 
  if(yOffset == null ) yOffset = 0;
  if(bClickIt == null) bClickIt = false;

  $(function(){
    //var toolTipContentText = '<img src="/gfx/_client/info_images/uebersicht_warenbestandwerte_small.jpg">';
    var strTipContent = 'Kein Inhalt gesetzt !';
    if(width == null && height == null)
    {
      strTipContent = setToolTipFrame(toolTipContentText); 
    }
    else if(width == null)
    {
      strTipContent = setToolTipFrame(toolTipContentText, null, height); 
    }
    else if(height == null)
    {
      strTipContent = setToolTipFrame(toolTipContentText, width); 
    }
    else
    {
      strTipContent = setToolTipFrame(toolTipContentText, width, height); 
    }
    
       $('a.' + aToolTipLinkCSSClass).aToolTip({  
         clickIt: bClickIt,                      // set to true for click activated tooltip  
         closeTipBtn: 'aToolTipCloseBtn',    // you can set custom class name for close button on tooltip  
         fixed: true,                        // Set true to activate fixed position  
         inSpeed: 800,                       // Speed tooltip fades in  
         outSpeed: 100,                      // Speed tooltip fades out  
         tipContent: strTipContent,      // Pass in content or it will use objects 'title' attribute  
         toolTipClass: 'aToolTip',           // Set custom class for tooltip  
         xOffset: xOffset,                      // x Position  
         yOffset: yOffset                        // y position  
     }); 
     });
}
