$(function(){ 
  $(".dialog").each(function(){

    var myTitle = $(this).attr("title");
    var myClass = $(this).attr("id");

    $.ajax({
      type: "get",
      url: $(this).attr("href"),
      success: function(data) {
        $("<div class='" + myClass + "'/>").append(data).dialog({
          autoOpen: false,
          modal: true,
          title: myTitle,
          width: 650,
          height: 'auto'
        }).children("div").append("<div class='close' style='margin-top: 1em'><a href='#' class='close'>Close this window</a></div>");  
        $(".close a").click(function(){
          $(".ui-dialog-content").dialog("close");
          return false;
        });   
      }
    });
  }).click(function(){
    $(".ui-dialog-content." + $(this).attr("id")).dialog("open");
    return false;
  });  
  
  $(".repeat").click(function(){
    $(".ui-dialog-content.DST").dialog("open");
    return false;
  });

  $("#news_ticker ul").newsticker().show();
})