jQuery(document).ready(function($) {
  var dialogDiv = $("#dialog");
  
  $(".bio_link").click(function(e){
    
    var name = this.innerHTML.split(',');
    
    $('<img class=".plz_wait" src="/images/interface/wait.gif" alt="">').css({
      float:"right",
      position:"relative",
      left:"-50%"  
    });
    
    
    dialogDiv.load(this.href,function(){
      dialogDiv.dialog("open");
      $("#ui-dialog-title-dialog").html(name[1]+" "+name[0]);
    });
    e.preventDefault();
  });
  
  $(".modal_link").click(function(e){
    e.preventDefault();
    e.returnValue = false;
    console.log("popupDialog",this.href)
    var title = this.rel;
        dialogDiv.load(this.href,function(){
          console.log("popupDialog","got content - openning dialog...");
      dialogDiv.dialog("open");
          $("#ui-dialog-title-dialog").html(title);
        });
    });
  
  $(".board-bio-link").click(function(e){
    var title = $(".board-bio-title").html().split(",")[0];
    
    dialogDiv.load(this.href,function(){
      dialogDiv.dialog("open");
      $("#ui-dialog-title-dialog").html(title);
    });
    
    e.preventDefault();
  });
  
});
