I don't know if this will help or not but I remember a case where I needed to do something similar - ie get a javascript function to do something client side from within a dnn module. I believe the way I solved it was to manually assign the ClientID for the control and then reference this from within the javascript function.
The example below is dynamically creating a hyperlink on the page and then assigning it's navigateURL to be the popup calender that comes with DNN..
hypDateControl.NavigateUrl = " popupCal('Cal','" & Me.ClientID & "_" & textBoxFilterValue.ClientID & "','M/d/yyyy','January,February,March,April,May,June,July,August,September,October,November,December','Sun,Mon,Tue,Wed,Thu,Fri,Sat','Today','Close','Calendar',0);"