1 /**********************************************************************
2 Copyright (C) FrontAccounting, LLC.
3 Released under the terms of the GNU General Public License, GPL,
4 as published by the Free Software Foundation, either version 3
5 of the License, or (at your option) any later version.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
10 ***********************************************************************/
12 'a, button': function(e) { // traverse menu
13 e.onkeydown = function(ev) {
14 ev = ev||window.event;
15 key = ev.keyCode||ev.which;
16 if(key==37 || key==38 || key==39 || key==40) {
17 move_focus(key, e, document.links);
18 ev.returnValue = false;
23 'a.repopts_link': function(e) {
24 e.onclick = function() {
27 JsHttpRequest.request(this, null);
31 'a.repclass_link': function(e) {
32 e.onclick = function() {
34 showClass(this.id.substring(5)); // id=classX
40 function set_options(e)
42 var replinks = document.getElementsBySelector('a.repopts_link');
43 for(var i in replinks)
44 replinks[i].style.fontWeight = replinks[i]==e ? 'bold' : 'normal';
47 function showClass(pClass) {
48 var classes = document.getElementsBySelector('.repclass');
49 for(var i in classes) {
51 cl.style.display = (cl.id==('TAB_'+pClass)) ? "block" : "none";
53 var classlinks = document.getElementsBySelector('a.repclass_link');
54 for(var i in classlinks)
55 classlinks[i].style.fontWeight = classlinks[i].id == ('class'+pClass) ?
58 set_options(); // clear optionset links
59 document.getElementById('rep_form').innerHTML = '';
63 Behaviour.register(replinks);