//set up the namespace
if (!com) var com = {};
if (!com.activestate) com.activestate = {};

com.activestate.popup = {

  generate_popup: function(thickbox_id, popup_url) {

        // error checking 
        if (!popup_url) {
            alert("Error: must pass in a popup_url to generate_popup!");
            return;
        }
        if (!thickbox_id) {
            alert("Error: must pass in a thickbox_id generate_popup!");
            return;
        }
 

        // create the hidden thickbox link that is triggered via it's click event
        
       var escaped_query = "?height=420&width=470";
        $("body").append("<a id='trigger_" + thickbox_id + "' href='" + popup_url + escaped_query + "'style='display:none' class='thickbox'>trigger thickbox</a>");
       // }

tb_init('a.thickbox');
        
        return false;
    }
    
};