MyIndo.prototype.captcha_html = function(captcha)
{
    $('captcha_html').update(captcha.html);
    $('captcha_id').value = captcha.id;
};
MyIndo.prototype.captcha_refresh = function()
{
    modalLoader.open();
	new Ajax.Request(myindo.site_url('dc/captcha'),{
		method : 'post',
		parameters: {myjson: 'myjson', kirim: 'kirim'},
		requestHeaders: {Accept: 'application/json'},
		onSuccess: function(transport) {
		      modalLoader.close();
		      rt = transport.responseText;
		      if (rt.isJSON()) {
		          var json = rt.evalJSON();
		          myindo.captcha_html(json.captcha);
		      };	     
		}
    });
};       
        
document.observe("dom:loaded", function(){
    if ($('captcha_html'))
    $('captcha_html').observe('click',function(){
        myindo.captcha_refresh();
    });
});
