Moving </head><body> into body of templates so that js and css can be embedded per...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / subscription-add.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Serials</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 </head>
5 <body>
6 <!-- TMPL_INCLUDE NAME="header.inc" -->
7 <!--TMPL_INCLUDE NAME="menu-serials.inc" -->
8
9 <div id="doc3" class="yui-t2">
10    
11    <div id="bd">
12         <div id="yui-main">
13         <div class="yui-b"><div class="yui-g">
14
15 <!-- Additions to enable Calendar system -->
16 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-system.css" />
17 <!-- End of additions -->
18
19 <!-- Additions to enable Calendar system -->
20 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar.js"></script>
21 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-en.js"></script>
22 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-setup.js"></script>
23 <!-- End of additions -->
24
25 <script type="text/javascript" language="javascript">
26 <!--
27
28 // the english words used in display purposes
29 var text = new Array('Number','Volume','Issue','Month','Week','Starting with:','Rollover at:','Choose Hemisphere:','Northern','Southern',
30 'Autumn','Winter','Spring','Summer','Fall','Season','Year');
31 var is_season = 0;
32 var is_hemisphere = 1;
33
34 // common pre defined number patterns
35 function num_pattern() {
36 var patternchoice = document.getElementById("numberpattern").value;
37     switch(patternchoice){
38     case "2":
39         document.f.add1.value=1;
40         document.f.add2.value=1;
41         document.f.add3.value=1;
42         document.f.every1.value=12;
43         document.f.every2.value=1;
44         document.f.every3.value=1;
45         document.f.whenmorethan1.value=9999999;
46         document.f.whenmorethan2.value=12;
47         document.f.whenmorethan3.value=4;
48         document.f.setto1.value=0;
49         document.f.setto2.value=1;
50         document.f.setto3.value=1;
51         document.f.lastvalue1.value=1;
52         document.f.lastvalue2.value=1;
53         document.f.lastvalue3.value=1;
54         document.f.numberingmethod.value= 'Vol {X}, No {Y}, Issue {Z}';
55         moreoptions(text[1],text[0],text[2]);
56         display_table(0); // toggle info box on (1) or off (0)
57         break;
58     case "3":
59         document.f.add1.value=1;
60         document.f.add2.value=1;
61         document.f.add3.value='';
62         document.f.every1.value=12;
63         document.f.every2.value=1;
64         document.f.every3.value='';
65         document.f.whenmorethan1.value=9999999;
66         document.f.whenmorethan2.value=12;
67         document.f.whenmorethan3.value='';
68         document.f.setto1.value=0;
69         document.f.setto2.value=1;
70         document.f.setto3.value='';
71         document.f.lastvalue1.value=1;
72         document.f.lastvalue2.value=1;
73         document.f.lastvalue3.value='';
74         document.f.numberingmethod.value= 'Vol {X}, No {Y}';
75         moreoptions(text[1],text[0]);
76         display_table(0);
77         break;
78     case "4":
79         document.f.add1.value=1;
80         document.f.add2.value=1;
81         document.f.add3.value='';
82         document.f.every1.value=12;
83         document.f.every2.value=1;
84         document.f.every3.value='';
85         document.f.whenmorethan1.value=9999999;
86         document.f.whenmorethan2.value=12;
87         document.f.whenmorethan3.value='';
88         document.f.setto1.value=0;
89         document.f.setto2.value=1;
90         document.f.setto3.value='';
91         document.f.lastvalue1.value=1;
92         document.f.lastvalue2.value=1;
93         document.f.lastvalue3.value='';
94         document.f.numberingmethod.value= 'Vol {X}, Issue {Y}';
95         moreoptions(text[1],text[2]);
96         display_table(0);
97         break;
98     case "5":
99         document.f.add1.value=1;
100         document.f.add2.value=1;
101         document.f.add3.value='';
102         document.f.every1.value=12;
103         document.f.every2.value=1;
104         document.f.every3.value='';
105         document.f.whenmorethan1.value=9999999;
106         document.f.whenmorethan2.value=12;
107         document.f.whenmorethan3.value='';
108         document.f.setto1.value=0;
109         document.f.setto2.value=1;
110         document.f.setto3.value='';
111         document.f.lastvalue1.value=1;
112         document.f.lastvalue2.value=1;
113         document.f.lastvalue3.value='';
114         document.f.numberingmethod.value= 'No {X}, Issue {Y}';
115         moreoptions(text[0],text[2]);
116         display_table(0);
117         break;
118     case "6":
119         var d = new Date();
120         var sYear = d.getFullYear();
121         document.f.add1.value=1;
122         document.f.add2.value='1';
123         document.f.add3.value='';
124         document.f.every1.value=4;
125         document.f.every2.value='1';
126         document.f.every3.value='';
127         document.f.whenmorethan1.value=9999999;
128         document.f.whenmorethan2.value='4';
129         document.f.whenmorethan3.value='';
130         document.f.setto1.value=0;
131         document.f.setto2.value='1';
132         document.f.setto3.value='';
133         document.f.lastvalue1.value=sYear;
134         document.f.lastvalue2.value='1';
135         document.f.lastvalue3.value='';
136         document.f.periodicity.value='8';
137         document.f.numberingmethod.value='{Y} {X}';
138         moreoptions_seasons(text[15],sYear);
139         display_table(0);
140         is_season = 1;
141         break;
142     case "7":
143         display_table(1);
144         document.getElementById("more_options").innerHTML = '';
145         document.f.irreg_check.value=1; 
146         break;
147     case "8":
148         var d = new Date();
149         var sYear = d.getFullYear();
150         document.f.add1.value=1;
151         document.f.add2.value=1;
152         document.f.add3.value='';
153         document.f.every1.value=12;
154         document.f.every2.value=1;
155         document.f.every3.value='';
156         document.f.whenmorethan1.value=9999999;
157         document.f.whenmorethan2.value=12;
158         document.f.whenmorethan3.value='';
159         document.f.setto1.value=0;
160         document.f.setto2.value=1;
161         document.f.setto3.value='';
162         document.f.lastvalue1.value=sYear;
163         document.f.lastvalue2.value='1';
164         document.f.lastvalue3.value='';
165         document.f.periodicity.value=1;
166         document.f.numberingmethod.value='{X}/{Y}';
167         display_table(0);
168         break;
169     default:
170         document.f.add1.value=1;
171         document.f.add2.value='';
172         document.f.add3.value='';
173         document.f.every1.value=1;
174         document.f.every2.value='';
175         document.f.every3.value='';
176         document.f.whenmorethan1.value=9999999;
177         document.f.whenmorethan2.value='';
178         document.f.whenmorethan3.value='';
179         document.f.setto1.value=0;
180         document.f.setto2.value='';
181         document.f.setto3.value='';
182         document.f.lastvalue1.value=1;
183         document.f.lastvalue2.value='';
184         document.f.lastvalue3.value='';
185         document.f.numberingmethod.value='{X}';
186         moreoptions_daily_check(text[0]);
187         document.f.irreg_check.value=1;
188         display_table(0);
189         break;
190     }
191 }
192
193 function display_table(n) {
194     if(n==1){
195         document.getElementById("basetable").style.display = 'block';
196     } else {
197         document.getElementById("basetable").style.display = 'none';
198     }
199 }
200
201 function modify_num_pattern() {
202     document.getElementById("numberpattern").value = '<!-- TMPL_VAR NAME="numberpattern" -->';
203     num_pattern();
204     
205     document.f.add1.value='<!-- TMPL_VAR NAME="add1" -->';
206     document.f.add2.value='<!-- TMPL_VAR NAME="add2" -->';
207     document.f.add3.value='<!-- TMPL_VAR NAME="add3" -->';
208     document.f.every1.value='<!-- TMPL_VAR NAME="every1" -->';
209     document.f.every2.value='<!-- TMPL_VAR NAME="every2" -->';
210     document.f.every3.value='<!-- TMPL_VAR NAME="every3" -->';
211     document.f.whenmorethan1.value='<!-- TMPL_VAR NAME="whenmorethan1" -->';
212     document.f.whenmorethan2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
213     document.f.whenmorethan3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
214     document.f.setto1.value='<!-- TMPL_VAR NAME="setto1" -->';
215     document.f.setto2.value='<!-- TMPL_VAR NAME="setto2" -->';
216     document.f.setto3.value='<!-- TMPL_VAR NAME="setto3" -->';
217     document.f.lastvalue1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
218     document.f.lastvalue2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
219     document.f.lastvalue3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
220     document.f.numberingmethod.value='<!-- TMPL_VAR NAME="numberingmethod" -->';
221
222     var more_strY;
223     var more_strZ;
224     <!-- TMPL_IF NAME="add2" -->
225     if(<!-- TMPL_VAR NAME="add2" --> > 0){
226         more_strY="Y";
227     }
228     <!-- /TMPL_IF -->
229     <!-- TMPL_IF NAME="add3" -->
230     if(<!-- TMPL_VAR NAME="add3" --> > 0){
231         more_strZ="Z";
232     }
233     <!-- /TMPL_IF -->
234
235     document.f.lastvaluetemp1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
236     if(more_strY){
237         document.f.lastvaluetemp2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
238     document.f.whenmorethantemp2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
239     }
240     if(more_strZ){
241         document.f.lastvaluetemp3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
242     document.f.whenmorethantemp3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
243     }
244 }
245
246 // a pre check with more options to see if 'number' and '1/day' are chosen
247 function moreoptions_daily_check(x) {
248     var periodicity = document.f.periodicity.value;
249     var errortext='';
250     if(periodicity == 1){
251         document.getElementById("irregularity").innerHTML = '';
252         var daynames = new Array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
253         errortext = "Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>";
254         for(var j=0;j<daynames.length;j++){
255             errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+daynames[j]+" &nbsp; ";
256         }
257         var error = errortext;
258         moreoptions(x);
259         document.getElementById("irregularity").innerHTML = error;
260     } else {
261         document.getElementById("irregularity").innerHTML = '';
262         document.getElementById("more_options").innerHTML = '';
263         moreoptions(x);
264     }
265 }
266
267 // to dispaly the more options section
268 function moreoptions(x,y,z){
269 document.getElementById("irregularity").innerHTML = '';
270 document.getElementById("more_options").innerHTML = '';
271 var textbox = '';
272     // alert("X: "+x+"Y: "+y+"Z: "+z);
273     if(x){
274         textbox +="<table>\n<tr><td>&nbsp;<\/td><td>"+x+"<\/td>";
275         if(y){
276             textbox +="<td>"+y+"<\/td>";
277             if(z){
278                 textbox +="<td>"+z+"<\/td>";
279             }
280         }
281         textbox +="<\/tr>\n";
282         textbox +="<tr><td>"+text[5]+"<\/td><td><input type='text' name='lastvaluetemp1' size='4' onkeyup='moreoptionsupdate(\"lastvalue1\")'><\/td>\n";
283         if(y){
284             textbox +="<td><input type='text' name='lastvaluetemp2' size='4' onkeyup='moreoptionsupdate(\"lastvalue2\")'><\/td>\n";
285             if(z){
286                 textbox +="<td><input type='text' name='lastvaluetemp3' size='4' onkeyup='moreoptionsupdate(\"lastvalue3\")'><\/td>\n";
287             }
288         }
289         textbox +="<\/tr>\n";
290         if(y){
291             textbox +="<tr><td>"+text[6]+"<\/td>";
292             textbox +="<td><a href='javascript:irregularity_check()'>"+'Irregularity?'+"<\/a><\/td>\n";
293             textbox +="<td><input type='text' name='whenmorethantemp2' size='4' onkeyup='moreoptionsupdate(\"whenmorethan2\",1)'><\/td>\n";
294             if(z){
295                 textbox +="<td><input type='text' name='whenmorethantemp3' size='4' onkeyup='moreoptionsupdate(\"whenmorethan3\",1)'><\/td>\n";
296             }
297             textbox +="<\/tr>";
298         } else {
299           textbox +="<tr> <td>"+'issues expected'+"</td><td><input type='text' name='issuesexpectedtemp1' size='4' onkeyup='moreoptionsupdate(\"issuesexpected1\",0)'><br /><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"</a></td></tr>";
300         }
301         textbox +="<\/table>\n";
302     }
303     document.getElementById("more_options").innerHTML = textbox;
304 }
305
306 function hemispheres(chosen){
307 var selbox = document.getElementById("season1");
308     if(selbox){
309     var selboxselected = selbox.options[selbox.selectedIndex].value;
310     selbox.options.length = 0;
311
312     if (chosen == "1") {
313         selbox.options[selbox.options.length] = new Option(text[11],'1');
314         selbox.options[selbox.options.length] = new Option(text[12],'2');
315         selbox.options[selbox.options.length] = new Option(text[13],'3');
316         selbox.options[selbox.options.length] = new Option(text[14],'4');
317         is_hemisphere = 1;
318         selbox.options[selboxselected-1].selected = true;
319     }
320
321     if (chosen == "2") {
322         selbox.options[selbox.options.length] = new Option(text[13],'1');
323         selbox.options[selbox.options.length] = new Option(text[10],'2');
324         selbox.options[selbox.options.length] = new Option(text[11],'3');
325         selbox.options[selbox.options.length] = new Option(text[12],'4');
326         is_hemisphere = 2;
327         selbox.options[selboxselected-1].selected = true;
328     }
329     }
330 }
331
332 // to dispaly the more options section for seasons
333 function moreoptions_seasons(x,y){
334 document.getElementById("irregularity").innerHTML = '';
335 document.getElementById("more_options").innerHTML = '';
336 var textbox = '';
337     // alert("X: "+x+"Year: "+y);
338     if(x){
339         var hemi_select = parseInt('<!-- TMPL_VAR NAME="hemisphere" -->');
340         textbox +="<table>\n<tr><td>"+ text[7]  +"<\/td><td colspan='2'><select name='hemisphere' onchange='hemispheres(this.options[this.selectedIndex].value)'>";
341         for(var i = 1; i <= 2; i++){
342             textbox +="<option value='"+i+"'";
343             if(i == hemi_select){
344                 textbox += " selected "
345             }
346             textbox +=">"+text[i+7]+"<\/option>";
347         }
348         textbox +="<\/select><\/td><\/tr>\n";
349         textbox +="<tr><td>&nbsp;<\/td><td>"+x+"<\/td>";
350         textbox +="<td>"+text[16]+"<\/td>";
351         textbox +="<\/tr>\n";
352         textbox +="<tr><td>"+text[5]+"<\/td><td><select name='lastvaluetemp2' id='season1' onchange='moreoptionsupdate(\"lastvalue2\")'>";
353         for(var j = 1; j <= 4; j++){
354             textbox +="<option value='"+j+"'>"+text[j+10]+"<\/option>";
355         }
356         textbox +="<\/select><\/td><td><select name='lastvaluetemp1' onchange='moreoptionsupdate(\"lastvalue1\")'>";
357         for(var k = parseInt(y); k <= parseInt(y)+15; k++){
358             textbox +="<option value='"+k+"'>"+k+"<\/option>";
359         }
360         textbox +="<\/select><\/td><\/tr>\n";
361         textbox +="<tr><td>"+text[6]+"<\/td>";
362         textbox +="<td><a href='javascript:irregularity_check()'>"+'Irregularity?'+"<\/a><\/td>\n";
363         textbox +="<td><input type='text' name='whenmorethantemp2' size='4' onkeyup='moreoptionsupdate(\"whenmorethan2\",1)'><\/td>\n";
364                 textbox +="<\/tr><\/table>\n";
365     }
366     document.getElementById("more_options").innerHTML = textbox;
367 }
368
369 function irregularity_check(){
370     document.f.irreg_check.value = 1; // Irregularity button now pushed
371     var periodicity = document.f.periodicity.value;
372     var rollover = document.f.issuesexpected1.value;
373     if(document.f.whenmorethantemp2){
374       rollover = document.f.whenmorethantemp2.value;
375     }
376     if(document.f.whenmorethantemp3){
377         rollover = document.f.whenmorethantemp3.value;
378     }
379     var error='';
380     var toobig;
381     var expected; 
382     var errortext = "<b>Warning irregularity detected<\/b><br \/>";
383     switch(periodicity){
384     case "12":
385         if(rollover < 730) expected =730;
386         if(rollover > 730) {
387             expectedover=730;
388             toobig=1;
389         }
390         break;
391     case "1":
392         if(rollover < 365) expected =365;
393         if(rollover > 365) {
394             expectedover=365;
395             toobig=1;
396         }
397         break;
398     case "13":
399         if(rollover < 156) expected =156;
400         if(rollover > 156) {
401             expectedover=156;
402             toobig=1;
403         }
404         break;
405     case "2":
406         if(rollover < 52) expected =52;
407         if(rollover > 52){
408             expectedover=52;
409             toobig=1;
410         }
411         break;
412     case "3":
413         if(rollover < 26) expected =26;
414         if(rollover > 26){
415             expectedover=26;
416             toobig=1;
417         }
418         break;
419     case "4":
420         if(rollover < 17) expected =17;
421         if(rollover > 17){
422             expectedover=17;
423             toobig=1;
424         }
425         break;
426     case "5":
427         if(rollover < 12) expected =12;
428         if(rollover > 12){
429             expectedover=12;
430             toobig=1;
431         }
432         break;
433     case "6":
434         if(rollover < 6) expected =6;
435         if(rollover > 6){
436             expectedover=6;
437             toobig=1;
438         }
439         break;
440     case "7":
441         if(rollover < 4) expected =4;
442         if(rollover > 4){
443             expectedover=4;
444             toobig=1;
445         }
446         break;
447     case "8":
448         if(rollover < 4) expected =4;
449         if(rollover > 4){
450             expectedover=4;
451             toobig=1;
452         }
453         break;
454     case "9":
455         if(rollover < 2) expected =2;
456         if(rollover > 2){
457             expectedover=2;
458             toobig=1;
459         }
460         break;
461     case "10":
462         if(rollover < 1) expected =1;
463         if(rollover > 1){
464             expectedover=1;
465             toobig=1;
466         }
467         break;
468     default:
469         break;
470     }
471     if(expected){
472         if(expected == 365 || expected==730){
473             var daynames = new Array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
474             errortext += "Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>";
475             for(var j=0;j<daynames.length;j++){
476                 errortext +="<input type=\"checkbox\" name=\"irregular\" id=\"irregular"+(j+1)+"\" value=\""+(j+1)+"\" />"+daynames[j]+" &nbsp; ";
477             }
478             error=errortext;
479         } else {
480             errortext +=expected+" issues expected "+rollover+" were entered. <br \/>Please indicate which date(s) an issue is not expected<br \/>";
481             var count=0;
482             for(var i=rollover;i<expected;i++){
483                 errortext +="<select name=\"irregular\" id=\"irregular"+count+"\" onchange=\"display_example(expected)\">\n";
484                 errortext +=irregular_options(periodicity);
485                 errortext +="<\/select>\n";
486                 count++;
487             }
488             error=errortext;
489         }
490     }
491     if(toobig){
492         errortext +=expectedover+" issues expected "+rollover+" were entered.<br \/> You seem to have indicated more issues per year than expected.";
493         error=errortext;
494     }
495     if(error.length ==0){
496         error=_('No irregularities noticed');
497     }
498     display_example(expected);
499     document.getElementById("irregularity").innerHTML = error;
500 }
501
502 function irregular_options(periodicity){
503     var titles;
504     var count;
505 <!-- TMPL_IF NAME="weekarrayjs" -->
506     var weeks = new Array(<!-- TMPL_VAR NAME="weekarrayjs" -->); 
507 <!-- /TMPL_IF -->
508     var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
509     var seasons = new Array('Autumn','Winter','Spring','Summer','Fall');
510     var errortext='';
511     if(periodicity == 1) {
512         expected = 366;
513         titles = "Day";
514         count = 1;
515     }
516     if(periodicity == 2 || periodicity == 3 || periodicity == 4) { 
517         expected = 52;
518     <!-- TMPL_IF NAME="weekarrayjs" -->
519         titles = weeks;
520         count = <!-- TMPL_VAR NAME="weekno" -->;
521     <!-- TMPL_ELSE -->
522         titles = "Week";
523         count = 1;
524     <!-- /TMPL_IF -->
525     }
526     if(periodicity == 5 || periodicity == 6 || periodicity == 7 || periodicity == 8 || periodicity == 9) {
527         if(periodicity == 8) {
528             is_season = 1; // setting up from edit page
529         } 
530         if(is_season){
531             titles = seasons;
532             expected = 4;
533             if(is_hemisphere == 2){
534                 count = 2;
535             } else {
536                 count = 1;
537             }
538         } else {
539             titles = months;
540             expected = 12;
541             count = 1;
542         }
543     }
544     for(var j=1;j<=expected;j++){
545         if(isArray(titles)){
546             if(count>expected){
547                 count = count-expected;
548             }
549             if(is_season && is_hemisphere == 1){
550                 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j]+"<\/option>\n";
551 // alert("value: "+((count*3)-2)+" title: "+titles[j]);
552             } else if(is_season && is_hemisphere == 2){
553                 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j-1]+"<\/option>\n";
554 // alert("value: "+((count*3)-2)+" title: "+titles[j-1]);
555             } else {
556                 errortext +="<option value='"+count+"'>"+titles[j-1]+"<\/option>\n";
557             }
558             count++;
559         } else {
560             errortext +="<option value='"+j+"'>"+titles+" "+j+"<\/option>\n";
561         }
562     }
563     return errortext;
564 }
565
566 function irregular_order(){
567     var irregular = '<!-- TMPL_VAR NAME="irregularity" -->';
568     var periodicity = document.f.periodicity.value;
569     var irregarray = irregular.split(',');
570     if(periodicity ==1){
571         for(j=0;j<irregarray.length;j++){
572         document.getElementById("irregular"+irregarray[j]).checked = true; 
573         }
574     } else {
575         for(i=0;i<irregarray.length;i++){    
576             document.getElementById("irregular"+i).value = irregarray[i];
577         }
578     }
579 }
580
581 function display_example(expected){
582     var startfrom1 = parseInt(document.f.lastvalue1.value);
583     var startfrom2 = parseInt(document.f.lastvalue2.value);
584     var startfrom3 = parseInt(document.f.lastvalue3.value);
585     var every1 = parseInt(document.f.every1.value);
586     var every2 = parseInt(document.f.every2.value);
587     var every3 = parseInt(document.f.every3.value);
588     var numberpattern = document.f.numberingmethod.value;
589     var whenmorethan2 = parseInt(document.f.whenmorethan2.value);
590     var whenmorethan3 = parseInt(document.f.whenmorethan3.value);
591     var setto2 = parseInt(document.f.setto2.value);
592     var setto3 = parseInt(document.f.setto3.value);
593     var displaytext = "Based on the information<br \/>entered the Numbering Pattern<br \/>will look like this<br \/>\n";
594     if(startfrom3>0){
595         var count=startfrom3-1;
596         var count2=startfrom2;
597         for(var i=0;i<12;i++){
598             if(count>=whenmorethan3){
599                 count=setto3;
600                 if(count2>=whenmorethan2){
601                     startfrom1++;
602                     count2=setto2;
603                 } else {
604                     count2++;
605                 }
606             } else {
607                 count++;
608             }
609             displaytext += numberpattern.replace(/{Z}/,count)+'\n';
610             displaytext = displaytext.replace(/{Y}/,count2)+'<br \/>\n';
611             displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
612
613         }
614     }
615     if(startfrom2>0 && !startfrom3){
616         var count=startfrom2-1;
617         for(var i=0;i<12;i++){
618             if(count>=whenmorethan2){
619                 startfrom1++;
620                 count=setto2;
621             } else {
622                 count++;
623             }
624
625             if(is_season){
626                 if(is_hemisphere == 2){
627                     if(count == 1) {
628                         displaytext += numberpattern.replace(/{Y}/,text[count+12])+'\n';
629                     } else {
630                         displaytext += numberpattern.replace(/{Y}/,text[count+8])+'\n';
631                     }
632                 } else {
633                 displaytext += numberpattern.replace(/{Y}/,text[count+10])+'\n';
634                 }
635             } else {
636                 displaytext += numberpattern.replace(/{Y}/,count)+'\n';
637             }
638             displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
639         }
640     }
641     if(startfrom1>0 && !startfrom2 && !startfrom3){
642         var offset=eval(document.f.issuesexpected1.value);
643         if (!offset){
644             offset = 12 
645         }
646         for(var i=startfrom1;i<(startfrom1+offset);i+=every1){
647             displaytext += numberpattern.replace(/{X}/,i)+'<br \/>\n';
648         }
649     }
650     displaytext = "<div style='padding: 5px; background-color: #CCCCCC'>"+displaytext+"<\/div>";
651     document.getElementById("displayexample").innerHTML = displaytext;
652 }
653
654 function isArray(obj) {
655 if (obj.constructor.toString().indexOf("Array") == -1)
656     return false;
657 else
658     return true;
659 }
660
661 function moreoptionsupdate(fieldnames,rollover){
662     fieldname = fieldnames;
663     fld = fieldname.length;
664     fld = fld-1;
665     fieldnametempnumber = fieldname.substr(fld);
666     //alert(fieldnametempnumber);
667     fieldnametemp = fieldname.slice(0,-1)+"temp"+fieldnametempnumber;
668     // alert(fieldnametemp);
669     eval("document.f."+fieldname+".value = document.f."+fieldnametemp+".value");
670 //     alert (fieldname+" : "+eval("document.f."+fieldname+".value") +' '+fieldnametemp+' : ' +eval("document.f."+fieldnametemp+".value"));
671     if(rollover){
672         eval("document.f.every"+(fieldnametempnumber-1)+".value = document.f."+fieldnametemp+".value");
673     }
674 }
675
676
677 function check_input(e){
678     var unicode=e.charCode? e.charCode : e.keyCode
679     if (unicode!=8 && unicode !=46 && unicode!=9 && unicode !=13){ // if key isn't backspace or delete
680         if (unicode<48||unicode>57) { // if not a number
681             alert(_("Needs to be entered in digit form -eg 10"));
682             return false // disable key press
683         }
684     }
685 }
686
687 -->
688 </script>
689
690 <!-- TMPL_IF name="mod" -->
691     <h1>Modify a subscription</h1>
692     <form method="post" name="f">
693         <input type="hidden" name="op" value="modsubscription" />
694         <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
695 <!-- TMPL_ELSE -->
696     <h1>Add a subscription (Serial Holdings Record)</h1>
697     <form method="post" action="/cgi-bin/koha/serials/subscription-add.pl" name="f">
698         <input type="hidden" name="op" value="addsubscription" />
699 <!-- /TMPL_IF -->
700 <input type="hidden" name="user" value="<!-- TMPL_VAR name="loggedinusername" -->" />
701 <input type="hidden" name="irreg_check" value="0" />
702 <input type="hidden" name="issuesexpected1" value="0" />
703
704     <h2>Subscription information for subscription #<!--TMPL_VAR name="subscriptionid"--></h2>
705     <table>
706         <tr>
707             <td>Librarian:</td>
708             <td><!-- TMPL_VAR name="loggedinusername" --></td>
709         </tr>
710         <tr>
711             <td><label>Supplier:</label></td>
712             <td><input type="text" name="aqbooksellerid" value="<!-- TMPL_VAR name="aqbooksellerid" -->" size="8" /> (<input type="text" name="aqbooksellername" value="<!-- TMPL_VAR name="aqbooksellername" -->" disabled="disabled" readonly="readonly" />) <a href="#" onclick="FindAcqui(f)">Search for a Supplier</a></td>
713         </tr>
714         <tr>
715             <td><label>Biblio</label></td>
716             <td>
717                 <input type="text" name="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size="8" /> 
718                 (<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled="disabled" readonly="readonly" />)
719                 <a href="#" onclick="Plugin(f)">Search for Biblio</a> <!--TMPL_UNLESS Name="mod"--> |
720                 <a href="#" onclick="Create_biblio(f)">Create Biblio</a><!--/TMPL_UNLESS-->
721             </td>
722         </tr>
723         <tr>
724             <td><label>Call Number</label></td>
725             <td><input type="text" name="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20" /></td>
726         </tr>
727         <tr>
728             <td>Branch</td>
729             <td>
730                 <select name="branchcode">
731                     <option value="">Any branch</option>
732                     <!-- TMPL_LOOP name="branchloop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
733                                 <!-- TMPL_ELSE -->
734                                 <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
735                                 <!-- /TMPL_IF -->
736                     <!-- /TMPL_LOOP -->
737                 </select> (select a branch)
738             </td>
739         </tr>
740         <tr>
741             <td><label>Notes</label></td>
742             <td><textarea name="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea></td>
743         </tr>
744         <tr>
745             <td><label>Management Notes</label></td>
746             <td><textarea name="internalnotes" cols="30" rows="2"><!-- TMPL_VAR name="internalnotes" --></textarea></td>
747         </tr>
748         <tr>
749             <td>Patron alert with </td>
750             <td>
751                 <select name="letter">
752                     <option value="">un-activated</option>
753                 <!-- TMPL_LOOP name="letterloop" -->
754                                 <!-- TMPL_IF name="selected" -->
755                     <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="lettername" --></option>
756 <!-- TMPL_ELSE -->
757                     <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="lettername" --></option>
758 <!-- /TMPL_IF -->
759                 <!-- /TMPL_LOOP -->
760                 </select> (select a letter &amp; patrons will be able to "follow" this subscription and recieve a mail on every new issue)
761             </td>
762         </tr>
763         <tr>
764             <td><b>Warning:</b></td>
765             <td>
766                 <ul>
767                     <li>Remember you <b>must</b> have created a biblio <b>before</b> creating a subscription</li>
768                     <li>You also must have selected a supplier if you want to ask for late issues</li>
769                 </ul>
770             </td>
771         </tr>
772     </table>
773 <div id="subscription_form_planning">
774     <h2>Planning</h2>
775     <table>
776         <tr>
777             <td>First Issue ETA:</td>
778             <td>
779                 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button2" style="cursor: pointer;" alt="" />
780                 <input type="text" name="firstacquidate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="acqui_date" />
781                 <!-- both scripts for calendar must follow the input field --> 
782                 <script type="text/javascript">
783                     Calendar.setup({
784                         inputField:"acqui_date",
785                         ifFormat       :   "%d/%m/%Y",
786                         button         :   "button2",
787                         align          :   "Tl"
788                     });
789                 </script>
790                 <script type="text/javascript">
791                     Calendar.setup({
792                         inputField     :   "acqui_date",
793                         ifFormat       :   "%d/%m/%Y",
794                         button         :   "acqui_date",
795                         align          :   "Tl"
796                     });
797                 </script>
798             </td>
799             <td rowspan="5">
800                 <div id="displayexample"></div>
801             </td>
802         </tr>
803         <tr>
804             <td>Frequency: (*)</td>
805             <td>
806                 <select name="periodicity" size="1" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1);num_pattern;">
807                 <option value="" selected="selected">-- please choose --</option>
808                 <!-- TMPL_IF name="periodicity16" -->
809                 <option value="16" selected="selected">Without Periodicity</option>
810                 <!-- TMPL_ELSE -->
811                     <option value="16">Without Periodicity</option>
812                 <!-- /TMPL_IF -->
813                 <!-- TMPL_IF name="periodicity48" -->
814                 <option value="48" selected="selected">Unknown</option>
815                 <!-- TMPL_ELSE -->
816                 <option value="48">Unknown</option>
817                 <!-- /TMPL_IF -->
818                 <!-- TMPL_IF name="periodicity32" -->
819                 <option value="32" selected="selected">Irregular</option>
820                 <!-- TMPL_ELSE -->
821                     <option value="32">Irregular</option>
822                 <!-- /TMPL_IF -->
823
824                 <!-- TMPL_IF name="periodicity12" -->
825                     <option value="12" selected="selected">2/day</option>
826                 <!-- TMPL_ELSE -->
827                     <option value="12">2/day</option>
828                 <!-- /TMPL_IF -->
829                 <!-- TMPL_IF name="periodicity1" -->
830                     <option value="1" selected="selected">1/day</option>
831                 <!-- TMPL_ELSE -->
832                     <option value="1">1/day</option>
833                 <!-- /TMPL_IF -->
834                 <!-- TMPL_IF name="periodicity13" -->
835                     <option value="13" selected="selected">3/week</option>
836                 <!-- TMPL_ELSE -->
837                     <option value="13">3/week</option>
838                 <!-- /TMPL_IF -->
839                 <!-- TMPL_IF name="periodicity2" -->
840                     <option value="2" selected="selected">1/week</option>
841                 <!-- TMPL_ELSE -->
842                     <option value="2">1/week</option>
843                 <!-- /TMPL_IF -->
844                 <!-- TMPL_IF name="periodicity3" -->
845                     <option value="3" selected="selected">1/2 weeks (2/month)</option>
846                 <!-- TMPL_ELSE -->
847                     <option value="3">1/2 weeks (2/months)</option>
848                 <!-- /TMPL_IF -->
849                 <!-- TMPL_IF name="periodicity4" -->
850                     <option value="4" selected="selected">1/3 weeks</option>
851                 <!-- TMPL_ELSE -->
852                     <option value="4">1/3 weeks</option>
853                 <!-- /TMPL_IF -->
854                 <!-- TMPL_IF name="periodicity5" -->
855                     <option value="5" selected="selected">1/month</option>
856                 <!-- TMPL_ELSE -->
857                     <option value="5">1/month</option>
858                 <!-- /TMPL_IF -->
859                 <!-- TMPL_IF name="periodicity6" -->
860                     <option value="6" selected="selected">1/2 months (6/year)</option>
861                 <!-- TMPL_ELSE -->
862                     <option value="6">1/2 months (6/year)</option>
863                 <!-- /TMPL_IF -->
864                 <!-- TMPL_IF name="periodicity7" -->
865                     <option value="7" selected="selected">1/3 months (1/quarter)</option>
866                 <!-- TMPL_ELSE -->
867                     <option value="7">1/3 months (1/quarter)</option>
868                 <!-- /TMPL_IF -->
869                 <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
870                 <!-- TMPL_IF name="periodicity8" -->
871                     <option value="8" selected="selected">1/quarter (seasonal)</option>
872                 <!-- TMPL_ELSE -->
873                     <option value="8">1/quarter (seasonal)</option>
874                 <!-- /TMPL_IF -->
875
876                 <!-- TMPL_IF name="periodicity9" -->
877                     <option value="9" selected="selected">2/years</option>
878                 <!-- TMPL_ELSE -->
879                     <option value="9">2/year</option>
880                 <!-- /TMPL_IF -->
881                 <!-- TMPL_IF name="periodicity10" -->
882                     <option value="10" selected="selected">1/year</option>
883                 <!-- TMPL_ELSE -->
884                     <option value="10">1/year</option>
885                 <!-- /TMPL_IF -->
886                 <!-- TMPL_IF name="periodicity11" -->
887                     <option value="11" selected="selected">1/2 years</option>
888                 <!-- TMPL_ELSE -->
889                     <option value="11">1/2 years</option>
890                 <!-- /TMPL_IF -->
891                 </select>
892                 Manual History :<input type="checkbox" name="manualhist" value="1" />
893             </td>
894         </tr>
895         <tr>
896             <td>Numbering Pattern:</td>
897             <td>
898                 <select name="numbering_pattern" size="1" id="numberpattern" onchange="num_pattern()">
899                     <option value="" selected="selected">-- please choose --</option>
900                     <!-- TMPL_IF name="numberpattern1" -->
901                         <option value="1" selected="selected">Number</option>
902                     <!-- TMPL_ELSE -->
903                         <option value="1">Number</option>
904                     <!-- /TMPL_IF -->
905                     <!-- TMPL_IF name="numberpattern2" -->
906                         <option value="2" selected="selected">Volume, Number, Issue</option>
907                     <!-- TMPL_ELSE -->
908                         <option value="2">Volume, Number, Issue</option>
909                     <!-- /TMPL_IF -->
910                     <!-- TMPL_IF name="numberpattern3" -->
911                         <option value="3" selected="selected">Volume, Number</option>
912                     <!-- TMPL_ELSE -->
913                         <option value="3">Volume, Number</option>
914                     <!-- /TMPL_IF -->
915                     <!-- TMPL_IF name="numberpattern4" -->
916                         <option value="4" selected="selected">Volume, Issue</option>
917                     <!-- TMPL_ELSE -->
918                         <option value="4">Volume, Issue</option>
919                     <!-- /TMPL_IF -->
920                     <!-- TMPL_IF name="numberpattern5" -->
921                         <option value="5" selected="selected">Number, Issue</option>
922                     <!-- TMPL_ELSE -->
923                         <option value="5">Number, Issue</option>
924                     <!-- /TMPL_IF -->
925                     <!-- TMPL_IF name="numberpattern6" -->
926                         <option value="6" selected="selected">Seasonal only</option>
927                     <!-- TMPL_ELSE -->
928                         <option value="6">Seasonal only</option>
929                     <!-- /TMPL_IF -->
930                     <!-- TMPL_IF name="numberpattern8" -->
931                         <option value="8" selected="selected">Year/Number</option>
932                     <!-- TMPL_ELSE -->
933                         <option value="8">Year/Number</option>
934                     <!-- /TMPL_IF -->          
935                     <!-- TMPL_IF name="numberpattern7" -->
936                         <option value="7" selected="selected">None of the above</option>
937                     <!-- TMPL_ELSE -->
938                         <option value="7">None of the above</option>
939                     <!-- /TMPL_IF -->
940                 </select>
941                 <div id="more_options"></div>
942                 <div id="irregularity"></div>
943             </td>
944         </tr>
945         <tr>
946             <td>Begins On: (*)</td>
947             <td>
948                 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt=""  />
949                 <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="beginning_date" />
950                 <!-- both scripts for calendar must follow the input field --> 
951                 <script type="text/javascript">
952                     Calendar.setup({
953                         inputField   : "beginning_date",
954                         ifFormat     : "%d/%m/%Y",
955                         button       : "button1",
956                         align        : "Tl"
957                     });
958                 </script>
959                 <script type="text/javascript">
960                     Calendar.setup({
961                         inputField   : "beginning_date",
962                         ifFormat     : "%d/%m/%Y",
963                         button       : "beginning_date",
964                         align        : "Tl"
965                     });
966                 </script>
967             </td>
968         </tr>
969         <tr>
970             <td>Subscription length</td>
971             <td>
972                 <select name="subtype">
973                     <!-- TMPL_LOOP NAME="subtype" -->
974                         <!-- TMPL_IF NAME="selected" -->
975                         <option value="<!-- TMPL_VAR NAME="name" -->" selected="selected">
976                         <!-- TMPL_ELSE -->
977                         <option value="<!-- TMPL_VAR NAME="name" -->">
978                         <!-- /TMPL_IF -->
979                         <!-- TMPL_VAR NAME="name" -->
980                         </option>
981                     <!-- /TMPL_LOOP -->
982                 </select>
983                 <input type="text" name="sublength" value="<!-- TMPL_VAR name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (*) (enter amount in numerals)
984             </td>
985         </tr>
986     <tr>
987         <td>Numbering calculation</td>
988         <td>Numbering formula: <input type="text" name="numberingmethod" id="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->" /></td>
989     </tr>
990     <tr>
991     <td colspan="3">
992         <div id="basetable" style="display: none;">
993             <table class="small">
994                 <tr>
995                     <th>&nbsp;</th>
996                     <th>X</th>
997                     <th>Y</th>
998                     <th>Z</th>
999                 </tr>
1000                 <tr>
1001                     <td>Add</td>
1002                     <td>
1003                         <input type="text" name="add1" value="<!-- TMPL_VAR name="add1" -->" />
1004                     </td>
1005                     <td>
1006                         <input type="text" name="add2" value="<!-- TMPL_VAR name="add2" -->" />
1007                     </td>
1008                     <td>
1009                         <input type="text" name="add3" value="<!-- TMPL_VAR name="add3" -->" />
1010                     </td>
1011                 </tr>
1012                 <tr>
1013                     <td>once every</td>
1014                     <td><input type="text" name="every1" value="<!-- TMPL_VAR name="every1" -->" /></td>
1015                     <td><input type="text" name="every2" value="<!-- TMPL_VAR name="every2" -->" /></td>
1016                     <td><input type="text" name="every3" value="<!-- TMPL_VAR name="every3" -->" /></td>
1017                 </tr>
1018                 <tr>
1019                     <td>When more than</td>
1020                     <td><input type="text" name="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->" /></td>
1021                     <td><input type="text" name="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->" /></td>
1022                     <td><input type="text" name="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->" /></td>
1023                 </tr>
1024                 <!-- TMPL_IF name="mod" -->
1025                 <tr>
1026                     <td>The loop is for instance</td>
1027                     <td><input type="text" name="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->" /></td>
1028                     <td><input type="text" name="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->" /></td>
1029                     <td><input type="text" name="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->" /></td>
1030                 </tr>
1031                 <!-- /TMPL_IF -->
1032                 <tr>
1033                     <td>Set back to</td>
1034                     <td><input type="text" name="setto1" value="<!-- TMPL_VAR name="setto1" -->" /></td>
1035                     <td><input type="text" name="setto2" value="<!-- TMPL_VAR name="setto2" -->" /></td>
1036                     <td><input type="text" name="setto3" value="<!-- TMPL_VAR name="setto3" -->" /></td>
1037                 </tr>
1038                 <tr>
1039                     <td>
1040                         <!-- TMPL_IF name="mod" -->
1041                             Last value
1042                         <!-- TMPL_ELSE -->
1043                             Begins with
1044                         <!-- /TMPL_IF -->
1045                     </td>
1046                     <td><input type="text" name="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->" /></td>
1047                     <td><input type="text" name="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->" /></td>
1048                     <td><input type="text" name="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->" /></td>
1049                 </tr>
1050             </table>
1051         </div>
1052         </td></tr>
1053     </table>
1054 </div>
1055 <!--TMPL_IF Name="history"-->
1056 <div id="subscription_form_history">
1057     <h2>History</h2>
1058     <table>
1059         <tr>
1060           <td>Starting date:</td>
1061           <td><input type="text" name="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->" /> (the date of the 1st subscription)</td>
1062         </tr>
1063         <tr>
1064           <td>Ending date:</td>
1065           <td><input type="text" name="enddate" value="<!-- TMPL_VAR name="enddate" -->" />(if empty : subscription still active)</td>
1066         </tr>
1067         <tr>
1068             <td>Recieved issues</td>
1069             <td><textarea name="recievedlist" cols="60" rows="5"><!-- TMPL_VAR name="recievedlist" --></textarea></td>
1070         </tr>
1071         <tr>
1072             <td>Missing issues</td>
1073             <td><textarea name="missinglist" cols="60" rows="5"><!-- TMPL_VAR name="missinglist" --></textarea></td>
1074         </tr>
1075         <tr>
1076             <td>Opac's notes</td>
1077             <td><textarea name="opacnote" cols="60" rows="5"><!-- TMPL_VAR name="opacnote" --></textarea></td>
1078         </tr>
1079         <tr>
1080             <td>Librarian notes</td>
1081             <td><textarea name="librariannote" cols="60" rows="5"><!-- TMPL_VAR name="librariannote" --></textarea></td>
1082         </tr>
1083     </table>
1084 </div>
1085 <!--/TMPL_IF-->
1086 <!-- TMPL_IF name="mod" -->
1087     <input type="button" value="Save subscription" onclick="Check(this.form)" accesskey="w" />
1088 <!-- TMPL_ELSE -->
1089     <input type="button" value="Add subscription" onclick="Check(this.form)" accesskey="w" />
1090 <!-- /TMPL_IF -->
1091 </form>
1092
1093 <script language="JavaScript" type="text/javascript">
1094 function Create_biblio(f)
1095 {
1096    window.open('/cgi-bin/koha/cataloguing/addbiblio.pl?mode=popup','FindABibIndex','width=1024,height=768,toolbar=no,scrollbars=yes');
1097 }
1098
1099 function Plugin(f)
1100 {
1101          window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
1102 }
1103
1104 function FindAcqui(f)
1105 {
1106          window.open('acqui-search.pl','FindASupplier','width=800,height=400,toolbar=no,scrollbars=yes');
1107 }
1108
1109 function Find_ISSN(f)
1110 {
1111          window.open('issn-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
1112 }
1113
1114
1115 function Check(f) {
1116     if (f.startdate.value.length != 0 && f.sublength.value > 0) {
1117         if (f.irreg_check.value == 1) {
1118             document.f.submit();
1119         } else {
1120             if(f.numbering_pattern.value == ''){
1121                 alert("need to choose a numbering pattern");
1122             } else {
1123                 alert("need to check for irregularity by clicking 'Irregularity?'");
1124             }
1125         }
1126     } else {
1127         alert('field marked with * are mandatory');
1128     }
1129     return false;
1130 }
1131 </script>
1132 <!-- TMPL_IF name="mod" -->
1133 <script type="text/javascript">
1134 window.onload = modify_num_pattern();
1135     <!-- TMPL_IF name="hemisphere" -->
1136     window.onload = hemispheres(<!-- TMPL_VAR NAME="hemisphere" -->);
1137     <!-- /TMPL_IF -->
1138 </script>
1139 <!-- /TMPL_IF -->
1140 <!-- TMPL_IF name="irregularity" -->
1141 <script type="text/javascript">
1142 window.onload = irregularity_check();
1143 window.onload = irregular_order();
1144 </script>
1145 <!-- /TMPL_IF -->
1146
1147 </div>
1148 </div>
1149 </div>
1150
1151 <!-- TMPL_INCLUDE NAME="mainmenu.inc" -->
1152 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->