<!--

function insertAdvert(adLocation, insertPoint, preHTML, postHTML, extraArgs) {
  $.get("/ajxtxt.php?get_ad="+adLocation+"&li=1&"+extraArgs, null, function(data) {
    var adhtml = preHTML+data+postHTML;
    $(adhtml).insertAfter(insertPoint);
  } );
  return;
}
function getPortAdInsertLocation(tableDataRows, tableRows, dataClass) {
  var numRows = $(tableDataRows).length;
  var insertPoint = null;
  if(numRows > 0) {
    var insertAfterNum = 2;
    if(numRows == 1) {
      insertAfterNum = 1;
    }
    var counter = 0;
    $(tableRows).each(function(index) {
      if($(this).attr('class') == dataClass) {
        counter++;
        if(counter == insertAfterNum) {
	  insertPoint = this;
	  return insertPoint;
        }
      }
    });
  }
  return insertPoint;
}
function getPortAdInsertLocationTicker(tableDataRows, tableRows, dataClass) {
  var numRows = $(tableDataRows).length;
  var counter = 0;
  $(tableRows).each(function(index) {
    if($(this).attr('class') == dataClass) {
      counter++;
    }
  });
  if(counter == 0) {
    return null;
  }
  if(counter > 2) {
      counter = 2;
  }
  var insertPoint = null;
  var adVals = new Array(2);
  var insertAfterNum=Math.floor(Math.random()*counter);
  counter = 0;
  $(tableRows).each(function(index) {
    if($(this).attr('class') == dataClass) {
      if(counter == insertAfterNum) {
        var ticker = $(this).attr('title');
        insertPoint = this;
        adVals[0] = this;
	adVals[1] = ticker;
      }
      counter++;
    }
  });
  return adVals;
}
-->

