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