function ReportAbuse(){
  this.report = function (tipster, bslip, callel){
	  if (tipster == '') {
		  alert('Please first log in to report this.');
		  return;
	  }
    $('#report_el').remove();
    $(document.body).append('<div id="report_el"><div class="header"><div id="report_close">x</div>Report abuse</div><iframe src="report_abuse_form.php?tipster='+tipster+'&bslip='+bslip+'"></iframe>');
    this.el = $('#report_el');
    this.el.find('#report_close').click(function(){
      ra.close()
      });
    this.el.css('top', $(callel).offset().top);
    this.el.show();
  }
  this.close = function (){
    this.el.hide();
  }
  this.submit = function (){
    alert($.param($('form')));
  }
}
var ra;
$(function (){
  ra = new ReportAbuse();
  window.closeReport = function(){ra.close()};
});
