Correcting references in the OPAC to files in intranet-tmpl (Bug 3574).
[koha.git] / koha-tmpl / opac-tmpl / prog / en / lib / greybox / GreyBox_v5_5 / static_files / help.js
1 var tmpl_header = AJS.join('', [
2     '<div id="top"> <img src="static_files/logo.gif" alt="" /> <br />',
3     '<span style="font-weight: bold; color: #333">A pop-up window that doesn\'t suck.</span>',
4     '</div>'
5 ]);
6
7 function insertHeader() {
8     AJS.DI(tmpl_header);
9 }
10
11 var LINKS = {
12     'installation': 'installation.html',
13     'examples': 'examples.html',
14     'nrm_usage': 'normal_usage.html',
15     'adv_usage': 'advance_usage.html',
16     'cmpr': 'compressing_greybox.html',
17     'about': 'about.html'
18 }
19
20 function insertMenu(current_page) {
21     var menu = AJS.UL({id: 'menu'});
22     var create_item = function(cls, name) {
23         var item = AJS.LI({'class': cls});
24         AJS.ACN(item, AJS.A({href: LINKS[cls]}, name));
25         return item;
26     }
27     var items = [
28         create_item('installation', 'Installation'),
29         create_item('examples', 'Examples'),
30         create_item('nrm_usage', 'Normal usage'),
31         create_item('adv_usage', 'Advance usage'),
32         create_item('cmpr', 'Compressing GreyBox'),
33         create_item('about', 'About')
34     ];
35
36     AJS.map(items, function(item) {
37         if(item.className == current_page) {
38             AJS.addClass(AJS.$bytc('a', null, item)[0], 'current');
39         }
40         AJS.ACN(menu, item);
41     });
42     AJS.DI(menu);
43 }
44
45 function insertCode() {
46     var code = AJS.join('\n', arguments);
47     var result = '<pre><code>';
48     code = code.replace(/</g, '&lt;').replace(/>/g, '&gt;');
49     result += code;
50     result += '</code></pre>';
51     document.write(result);
52 }