advise on how to get this to work

advise on how to get this to work

hello,
i have this javascript in my template

  1. <script type="text/javascript"> $(document).ready(function(){ $('#no_password').change(function(){ if ($(this).attr('checked')) { $('.show-if-password').hide(); load_captcha(function(){ $('.show-if-no-password').show(); }); } else { $('.show-if-no-password').hide(); $('.show-if-password').show(); } }).change(); }); function load_captcha(callback) { // Gets image and audio URLs by Ajax call $.getJSON('/get-captcha/', function(json){ // Error message if (json.error) { alert(json.error); return; } // Success message var img = $('img#captcha'); if (img.length === 0) { var img = $('<img id="captcha" alt="captcha" title="captcha" />'); img.attr('src', json.img_src); img.appendTo('#captcha-container'); $('#sound-captcha').attr('onclick', function(){ play(json.sound_src); // '${sound_captcha}' }); } // Calls the callback function back callback(); }); } </script> 

http://pastie.org/1204883

basically when a user clicks the '[x] Check this box if you don't have a password or you forgot it.' i want to remove the 'Password' input field and replace it by the 'captcha' image and captcha input field. what am i missing?

here is the python code that builds all the namespaces ${xxx} http://pastie.org/1197919 if it will be of use.

thanks