function refreshRules () {
  Behaviour.apply();
}

function reloadPage() {
  window.location.reload(true);
}

var headrules = {
  '#ask_question' : function(element){
    element.onsubmit = function(){
      //alert("hot damn!");
      $('structure').value=document.SDA.getMolDescription();
    }
  },
  '#start_applet' : function(element){
    element.onclick = function(){
      var ax = new Ajax.Updater('applet', element.href, {method: 'get', onComplete: refreshRules});
      return false;
    }
  }
};

if (undefined===window.myrules) {
  Behaviour.register(headrules);
} else {Behaviour.register(headrules);Behaviour.register(myrules);}
