root/trunk/max-javahotpot-tutorial/tutorial/jmatch2.htm

Revision 35, 30.6 kB (checked in by max, 8 months ago)

mario.izquierdo
max-javahotpot-tutorial (3.1.max1)

  • New release
Line 
1 <?xml version="1.0"?>
2        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
3        <html xmlns="http://www.w3.org/1999/xhtml"
4              xml:lang="en"><head><meta name="author" content="Created with Hot Potatoes by Half-Baked Software, registered to Ismail Ali Gago."></meta><meta name="keywords" content="Hot Potatoes, Hot Potatoes, Half-Baked Software, Windows, University of Victoria"></meta>
5
6 <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" />
7 <meta name="DC:Creator" content="Ismail Ali Gago" />
8 <meta name="DC:Creator" content="UNREGISTERED" />
9 <meta name="DC:Title" content="Ejercicio de emparejamiento realizado con JMatch" />
10
11
12 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
13
14 <title>
15 Ejercicio de emparejamiento realizado con JMatch
16 </title>
17
18 <!-- Made with executable version 6.0 Release 2 Build 0 -->
19
20 <!-- The following insertion allows you to add your own code directly to this head tag from the configuration screen -->
21
22
23
24 <style type="text/css">
25
26
27 /* This is the CSS stylesheet used in the exercise. */
28 /* Elements in square brackets are replaced by data based on configuration settings when the exercise is built. */
29
30
31 body{
32         font-family: Geneva,Arial;
33         background-color: #ffffff;
34         color: #000000;
35  
36         margin-right: 5%;
37         margin-left: 5%;
38         font-size: small;
39 }
40
41 p{
42         text-align: left;
43         margin: 0px;
44         font-size: small;
45 }
46
47 div,span,td{
48         font-size: small;
49         color: #000000;
50 }
51
52 .RTLText{
53         text-align: right;
54         font-size: 150%;
55         direction: rtl;
56         font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", Geneva,Arial;
57 }
58
59 .CentredRTLText{
60         text-align: center;
61         font-size: 150%;
62         direction: rtl;
63         font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", Geneva,Arial;
64 }
65
66 button p.RTLText{
67         text-align: center;
68 }
69
70 .RTLGapBox{
71         text-align: right;
72         font-size: 150%;
73         direction: rtl;
74         font-family: "Times New Roman", Geneva,Arial;
75 }
76
77 .Guess{
78         font-weight: bold;
79 }
80
81 .CorrectAnswer{
82         font-weight: bold;
83 }
84
85 div.Titles{
86         padding: 10px;
87         text-align: center;
88         color: #003300;
89 }
90
91 button{
92         display: inline;
93 }
94
95 .ExerciseTitle{
96         font-size: large;
97         color: #003300;
98 }
99
100 .ExerciseSubtitle{
101         color: #003300;
102 }
103
104 div#Timer{
105         padding: 6px;
106         margin-left: auto;
107         margin-right: auto;
108         text-align: center;
109 }
110
111 span#TimerText{
112         padding: 6px;
113         border-width: 1px;
114         border-style: solid;
115         font-weight: bold;
116         display: none;
117 }
118
119 span.Instructions{
120
121 }
122
123 div.ExerciseText{
124
125 }
126
127 .FeedbackText{
128         color: #003300;
129 }
130
131 span.LeftItem{
132         font-size: small;
133         color: #000000;
134 }
135
136 span.RightItem{
137         font-weight: bold;
138         font-size: small;
139         color: #000000;
140 }
141
142 span.CorrectMark{
143
144 }
145
146 div.Feedback {
147         background-color: #ffffff;
148         left: 33%;
149         width: 34%;
150         top: 33%;
151         z-index: 1;
152         border-style: solid;
153         border-width: 1px;
154         padding: 5px;
155         text-align: center;
156         color: #003300;
157         position: absolute;
158         display: none;
159         font-size: small;
160 }
161
162
163 [inclReading]
164 div.LeftContainer{
165         border-style: none;
166         padding: 2px 0px 2px 0px;
167         float: left;
168         width: 49.8%;
169         margin-bottom: 0px;
170 }
171
172 div.RightContainer{
173         border-style: none;
174         padding: 2px 0px 2px 0px;
175         float: right;
176         width: 49.8%;
177         margin-bottom: 0px;
178 }
179
180 .ReadingText{
181
182 }
183 [/inclReading]
184
185 div.ExerciseDiv{
186         color: #000000;
187 }
188
189 /* JMatch flashcard styles */
190 table.FlashcardTable{
191         background-color: transparent;
192         color: #000000;
193         border-color: #000000;
194         margin-left: 5%;
195         margin-right: 5%;
196         margin-top: 2em;
197         margin-bottom: 2em;
198         width: 90%;
199         position: relative;
200         align: center;
201         padding: 0px;
202 }
203
204 table.FlashcardTable tr{
205         border-style: none;
206         margin: 0px;
207         padding: 0px;
208         background-color: #aaddaa;
209 }
210
211 table.FlashcardTable td.Showing{
212         font-size: large;
213         text-align: center;
214         width: 50%;
215         display: table-cell;
216         padding: 2em;
217         margin: 0px;
218         border-style: solid;
219         border-width: 1px;
220         color: #000000;
221         background-color: #aaddaa;
222 }
223
224 table.FlashcardTable td.Hidden{
225         display: none;
226 }
227
228 /* JMix styles */
229 div#SegmentDiv{
230         margin-top: 2em;
231         margin-bottom: 2em;
232         text-align: center;
233 }
234
235 a.ExSegment{
236         font-size: medium;
237         font-weight: bold;
238         text-decoration: none;
239         color: #000000;
240 }
241
242 span.RemainingWordList{
243         font-style: italic;
244 }
245
246 div.DropLine {
247         position: absolute;
248         text-align: center;
249         border-bottom-style: solid;
250         border-bottom-width: 1px;
251         border-bottom-color: #003300;
252         width: 80%;
253 }
254
255 /* JCloze styles */
256
257 input{
258         font-family: Geneva,Arial;
259         font-size: larger;
260 }
261
262 .ClozeWordList{
263         text-align: center;
264         font-weight: bold;
265 }
266
267 div.ClozeBody{
268         text-align: left;
269         margin-top: 2em;
270         margin-bottom: 2em;
271         line-height: 2.0
272 }
273
274 span.GapSpan{
275         font-weight: bold;
276 }
277
278 /* JCross styles */
279
280 table.CrosswordGrid{
281         margin: auto auto 1em auto;
282         border-collapse: collapse;
283         padding: 0px;
284 }
285
286 table.CrosswordGrid td{
287         width: 1.5em;
288         height: 1.5em;
289         text-align: center;
290         vertical-align: middle;
291         font-size: large;
292         padding: 0px;
293         margin: 0px;
294         border-style: solid;
295         border-width: 1px;
296         border-color: #000000;
297 }
298
299 table.CrosswordGrid td.BlankCell{
300         background-color: #000000;
301         color: #000000;
302 }
303
304 table.CrosswordGrid td.LetterOnlyCell{
305         text-align: center;
306         vertical-align: middle;
307         background-color: #ffffff;
308         color: #000000;
309         font-weight: bold;
310 }
311
312 table.CrosswordGrid td.NumLetterCell{
313         text-align: left;
314         vertical-align: top;
315         background-color: #ffffff;
316         color: #000000;
317         padding: 1px;
318         font-weight: bold;
319 }
320
321 .NumLetterCellText{
322         cursor: pointer;
323 }
324
325 .GridNum{
326         vertical-align: super;
327         font-size: x-small;
328         font-weight: bold;
329         text-decoration: none;
330         color: #000000;
331 }
332
333 table#Clues{
334         margin: auto;
335         vertical-align: top;
336 }
337
338 table#Clues td{
339         vertical-align: top;
340 }
341
342 table.ClueList{
343   margin: auto;
344 }
345
346 td.ClueNum{
347         text-align: right;
348         font-weight: bold;
349         vertical-align: top;
350 }
351
352 td.Clue{
353         text-align: left;
354 }
355
356 div#ClueEntry{
357         text-align: left;
358         margin-bottom: 1em;
359 }
360
361 /* Keypad styles */
362
363 div.Keypad{
364         text-align: center;
365 }
366
367 div.Keypad button{
368         font-family: Geneva,Arial;
369         font-size: 120%;
370         background-color: #ffffff;
371         color: #000000;
372         width: 2em;
373 }
374
375 /* JQuiz styles */
376
377 div.QuestionNavigation{
378         text-align: center;
379 }
380
381 .QNum{
382         margin: 0em 1em 0.5em 1em;
383         font-weight: bold;
384         vertical-align: middle;
385 }
386
387 textarea{
388         font-family: Geneva,Arial;
389         font-size: larger;
390 }
391
392 .QuestionText{
393
394 }
395
396 .Answer{
397         font-size: 120%;
398         letter-spacing: 0.1em;
399 }
400
401 .Highlight{
402         color: #000000;
403         background-color: #ffff00;
404         font-weight: bold;
405         font-size: 120%;
406 }
407
408 ol.QuizQuestions{
409         text-align: left;
410         list-style-type: none;
411 }
412
413 li.QuizQuestion{
414         padding: 1em;
415         border-style: solid;
416         border-width: 0px 0px 1px 0px;
417 }
418
419 ol.MCAnswers{
420         text-align: left;
421         list-style-type: upper-alpha;
422         padding: 1em;
423 }
424
425 ol.MCAnswers li{
426         margin-bottom: 1em;
427 }
428
429 ol.MSelAnswers{
430         text-align: left;
431         list-style-type: lower-alpha;
432         padding: 1em;
433 }
434
435 div.ShortAnswer{
436         padding: 1em;
437 }
438
439 div.StdDiv{
440         background-color: #aaddaa;
441         text-align: center;
442         font-size: small;
443         color: #000000;
444         padding: 8px;
445         border-style: solid;
446         border-width: 1px 1px 1px 1px;
447         border-color: #000000;
448         margin: 1px;
449 }
450
451 .FuncButton {
452         text-align: center;
453         border-style: solid;
454
455         border-left-color: #d4eed4;
456         border-top-color: #d4eed4;
457         border-right-color: #556e55;
458         border-bottom-color: #556e55;
459         color: #000000;
460         background-color: #aaddaa;
461
462         border-width: 2px;
463         padding: 3px 6px 3px 6px;
464         cursor: pointer;
465 }
466
467 .FuncButtonUp {
468         color: #aaddaa;
469         text-align: center;
470         border-style: solid;
471
472         border-left-color: #d4eed4;
473         border-top-color: #d4eed4;
474         border-right-color: #556e55;
475         border-bottom-color: #556e55;
476
477         background-color: #000000;
478         color: #aaddaa;
479         border-width: 2px;
480         padding: 3px 6px 3px 6px;
481         cursor: pointer;
482 }
483
484 .FuncButtonDown {
485         color: #aaddaa;
486         text-align: center;
487         border-style: solid;
488
489         border-left-color: #556e55;
490         border-top-color: #556e55;
491         border-right-color: #d4eed4;
492         border-bottom-color: #d4eed4;
493         background-color: #000000;
494         color: #aaddaa;
495
496         border-width: 2px;
497         padding: 3px 6px 3px 6px;
498         cursor: pointer;
499 }
500
501 /*BeginNavBarStyle*/
502
503 div.NavButtonBar{
504         background-color: #006600;
505         text-align: center;
506         margin: 2px 0px 2px 0px;
507         clear: both;
508         font-size: small;
509 }
510
511 .NavButton {
512         border-style: solid;
513        
514         border-left-color: #7fb27f;
515         border-top-color: #7fb27f;
516         border-right-color: #003300;
517         border-bottom-color: #003300;
518         background-color: #006600;
519         color: #ffffff;
520
521         border-width: 2px;
522         cursor: pointer;       
523 }
524
525 .NavButtonUp {
526         border-style: solid;
527
528         border-left-color: #7fb27f;
529         border-top-color: #7fb27f;
530         border-right-color: #003300;
531         border-bottom-color: #003300;
532         color: #006600;
533         background-color: #ffffff;
534
535         border-width: 2px;
536         cursor: pointer;       
537 }
538
539 .NavButtonDown {
540         border-style: solid;
541
542         border-left-color: #003300;
543         border-top-color: #003300;
544         border-right-color: #7fb27f;
545         border-bottom-color: #7fb27f;
546         color: #006600;
547         background-color: #ffffff;
548
549         border-width: 2px;
550         cursor: pointer;       
551 }
552
553 /*EndNavBarStyle*/
554
555 a{
556         color: #0000cc;
557 }
558
559 a: visited{
560         color: #0000ff;
561 }
562
563 a:hover{
564         color: #0000cc;
565 }
566
567 div.CardStyle {
568         position: absolute;
569         font-family: Geneva,Arial;
570         font-size: small;
571         padding: 5px;
572         border-style: solid;
573         border-width: 1px;
574         color: #000000;
575         background-color: #aaddaa;
576         left: -50px;
577         top: -50px;
578         overflow: visible;
579 }
580
581 .rtl{
582         text-align: right;
583         font-size: large;
584 }
585
586
587 </style>
588
589 <script type="text/javascript">
590
591 //<![CDATA[
592
593 <!--
594
595
596 function Client(){
597 //if not a DOM browser, hopeless
598         this.min = false; if (document.getElementById){this.min = true;};
599
600         this.ua = navigator.userAgent;
601         this.name = navigator.appName;
602         this.ver = navigator.appVersion; 
603
604 //Get data about the browser
605         this.mac = (this.ver.indexOf('Mac') != -1);
606         this.win = (this.ver.indexOf('Windows') != -1);
607
608 //Look for Gecko
609         this.gecko = (this.ua.indexOf('Gecko') > 1);
610         if (this.gecko){
611                 this.geckoVer = parseInt(this.ua.substring(this.ua.indexOf('Gecko')+6, this.ua.length));
612                 if (this.geckoVer < 20020000){this.min = false;}
613         }
614        
615 //Look for Firebird
616         this.firebird = (this.ua.indexOf('Firebird') > 1);
617        
618 //Look for Safari
619         this.safari = (this.ua.indexOf('Safari') > 1);
620         if (this.safari){
621                 this.gecko = false;
622         }
623        
624 //Look for IE
625         this.ie = (this.ua.indexOf('MSIE') > 0);
626         if (this.ie){
627                 this.ieVer = parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, this.ua.length));
628                 if (this.ieVer < 5.5){this.min = false;}
629         }
630        
631 //Look for Opera
632         this.opera = (this.ua.indexOf('Opera') > 0);
633         if (this.opera){
634                 this.operaVer = parseFloat(this.ua.substring(this.ua.indexOf('Opera')+6, this.ua.length));
635                 if (this.operaVer < 7.04){this.min = false;}
636         }
637         if (this.min == false){
638                 alert('Your browser may not be able to handle this page.');
639         }
640        
641 //Special case for the horrible ie5mac
642         this.ie5mac = (this.ie&&this.mac&&(this.ieVer<6));
643 }
644
645 var C = new Client();
646
647 //for (prop in C){
648 //      alert(prop + ': ' + C[prop]);
649 //}
650
651
652
653 //CODE FOR HANDLING NAV BUTTONS AND FUNCTION BUTTONS
654
655 //[strNavBarJS]
656 function NavBtnOver(Btn){
657         if (Btn.className != 'NavButtonDown'){Btn.className = 'NavButtonUp';}
658 }
659
660 function NavBtnOut(Btn){
661         Btn.className = 'NavButton';
662 }
663
664 function NavBtnDown(Btn){
665         Btn.className = 'NavButtonDown';
666 }
667 //[/strNavBarJS]
668
669 function FuncBtnOver(Btn){
670         if (Btn.className != 'FuncButtonDown'){Btn.className = 'FuncButtonUp';}
671 }
672
673 function FuncBtnOut(Btn){
674         Btn.className = 'FuncButton';
675 }
676
677 function FuncBtnDown(Btn){
678         Btn.className = 'FuncButtonDown';
679 }
680
681 function FocusAButton(){
682         if (document.getElementById('CheckButton1') != null){
683                 document.getElementById('CheckButton1').focus();
684         }
685         else{
686                 if (document.getElementById('CheckButton2') != null){
687                         document.getElementById('CheckButton2').focus();
688                 }
689                 else{
690                         document.getElementsByTagName('button')[0].focus();
691                 }
692         }
693 }
694
695
696
697
698 //CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX
699
700 var topZ = 1000;
701
702 function ShowMessage(Feedback){
703         var Output = Feedback + '<br /><br />';
704         document.getElementById('FeedbackContent').innerHTML = Output;
705         var FDiv = document.getElementById('FeedbackDiv');
706         topZ++;
707         FDiv.style.zIndex = topZ;
708         FDiv.style.top = TopSettingWithScrollOffset(30) + 'px';
709 //IE can't focus a hidden div; Moz needs to focus before display to avoid jumping
710         if (C.gecko){
711                 document.getElementById('FeedbackOKButton').focus();
712         }
713         FDiv.style.display = 'block';
714
715         ShowElements(false, 'input');
716         ShowElements(false, 'select');
717         ShowElements(false, 'object');
718         if (C.ie){
719                 document.getElementById('FeedbackOKButton').focus();
720         }
721        
722 //
723 }
724
725 function ShowElements(Show, TagName){
726 //Special for IE bug -- hide all the form elements that will show through the popup
727         if (C.ie){
728                 var Els = document.getElementsByTagName(TagName);
729                 for (var i=0; i<Els.length; i++){
730                         if (Show == true){
731                                 Els[i].style.display = 'inline';
732                         }
733                         else{
734                                 Els[i].style.display = 'none';
735                         }
736                 }
737         }
738 }
739
740 function HideFeedback(){
741         document.getElementById('FeedbackDiv').style.display = 'none';
742         ShowElements(true, 'input');
743         ShowElements(true, 'select');
744         ShowElements(true, 'object');
745         if (Finished == true){
746                 Finish();
747         }
748 }
749
750
751 //GENERAL UTILITY FUNCTIONS AND VARIABLES
752
753 //PAGE DIMENSION FUNCTIONS
754 function PageDim(){
755 //Get the page width and height
756         this.W = 600;
757         this.H = 400;
758         this.W = document.getElementsByTagName('body')[0].clientWidth;
759         this.H = document.getElementsByTagName('body')[0].clientHeight;
760 }
761
762 var pg = null;
763
764 function GetPageXY(El) {
765         var XY = {x: 0, y: 0};
766         while(El){
767                 XY.x += El.offsetLeft;
768                 XY.y += El.offsetTop;
769                 El = El.offsetParent;
770         }
771         return XY;
772 }
773
774 function GetScrollTop(){
775         if (document.documentElement && document.documentElement.scrollTop){
776                 return document.documentElement.scrollTop;
777         }
778         else{
779                 if (document.body){
780                         return document.body.scrollTop;
781                 }
782                 else{
783                         return window.pageYOffset;
784                 }
785         }
786 }
787
788 function GetViewportHeight(){
789         if (window.innerWidth){
790                 return window.innerWidth;
791         }
792         else{
793                 return document.getElementsByTagName('body')[0].clientHeight;
794         }
795 }
796
797 function TopSettingWithScrollOffset(TopPercent){
798         var T = Math.floor(GetViewportHeight() * (TopPercent/100));
799         return GetScrollTop() + T;
800 }
801
802 //CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
803 var InTextBox = false;
804
805 function SuppressBackspace(e){
806         if (InTextBox == true){return;}
807         if (C.ie) {
808                 thisKey = window.event.keyCode;
809         }
810         else {
811                 thisKey = e.keyCode;
812         }
813
814         var Suppress = false;
815
816         if (thisKey == 8) {
817                 Suppress = true;
818         }
819
820         if (Suppress == true){
821                 if (C.ie){
822                         window.event.returnValue = false;       
823                         window.event.cancelBubble = true;
824                 }
825                 else{
826                         e.preventDefault();
827                 }
828         }
829 }
830
831 if (C.ie){
832         document.attachEvent('onkeydown',SuppressBackspace);
833         window.attachEvent('onkeydown',SuppressBackspace);
834 }
835 else{
836         window.addEventListener('keypress',SuppressBackspace,false);
837 }
838
839 function ReduceItems(InArray, ReduceToSize){
840         var ItemToDump=0;
841         var j=0;
842         while (InArray.length > ReduceToSize){
843                 ItemToDump = Math.floor(InArray.length*Math.random());
844                 InArray.splice(ItemToDump, 1);
845         }
846 }
847
848 function Shuffle(InArray){
849         Temp = new Array();
850         var Len = InArray.length;
851
852         var j = Len;
853
854         for (var i=0; i<Len; i++){
855                 Temp[i] = InArray[i];
856         }
857
858         for (i=0; i<Len; i++){
859                 Num = Math.floor(j  *  Math.random());
860                 InArray[i] = Temp[Num];
861
862                 for (var k=Num; k < j; k++) {
863                         Temp[k] = Temp[k+1];
864                 }
865                 j--;
866         }
867         return InArray;
868 }
869
870 function WriteToInstructions(Feedback) {
871 //      Feedback = '<span class="FeedbackText">' + Feedback + '</span>';
872         document.getElementById('InstructionsDiv').innerHTML = Feedback;
873
874 }
875
876
877
878
879 function EscapeDoubleQuotes(InString){
880         return InString.replace(/"/g, '&quot;')
881 }
882
883 function FocusAButton(){
884         if (document.getElementById('CheckButton1') != null){
885                 document.getElementById('CheckButton1').focus();
886         }
887         else{
888                 document.getElementsByTagName('button')[0].focus();
889         }
890 }
891
892 function TrimString(InString){
893         var x = 0;
894
895         if (InString.length != 0) {
896                 while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){
897                         InString = InString.substring(0, InString.length - 1)
898                 }
899
900                 while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){
901                         InString = InString.substring(1, InString.length)
902                 }
903
904                 while (InString.indexOf('  ') != -1) {
905                         x = InString.indexOf('  ')
906                         InString = InString.substring(0, x) + InString.substring(x+1, InString.length)
907                  }
908
909                 return InString;
910         }
911
912         else {
913                 return '';
914         }
915 }
916
917 function FindLongest(InArray){
918         if (InArray.length < 1){return -1;}
919
920         var Longest = 0;
921         for (var i=1; i<InArray.length; i++){
922                 if (InArray[i].length > InArray[Longest].length){
923                         Longest = i;
924                 }
925         }
926         return Longest;
927 }
928
929 //UNICODE CHARACTER FUNCTIONS
930 function IsCombiningDiacritic(CharNum){
931         var Result = (((CharNum >= 0x0300)&&(CharNum <= 0x370))||((CharNum >= 0x20d0)&&(CharNum <= 0x20ff)));
932         Result = Result || (((CharNum >= 0x3099)&&(CharNum <= 0x309a))||((CharNum >= 0xfe20)&&(CharNum <= 0xfe23)));
933         return Result;
934 }
935
936 function IsCJK(CharNum){
937         return ((CharNum >= 0x3000)&&(CharNum < 0xd800));
938 }
939
940 //SETUP FUNCTIONS
941 //BROWSER WILL REFILL TEXT BOXES FROM CACHE IF NOT PREVENTED
942 function ClearTextBoxes(){
943         var NList = document.getElementsByTagName('input');
944         for (var i=0; i<NList.length; i++){
945                 if (NList[i].id.indexOf('Guess') > -1){
946                         NList[i].value = '';
947                 }
948                 if (NList[i].id.indexOf('Chk') > -1){
949                         NList[i].checked = '';
950                 }
951         }
952 }
953
954 //EXTENSION TO ARRAY OBJECT
955 function Array_IndexOf(Input){
956         var Result = -1;
957         for (var i=0; i<this.length; i++){
958                 if (this[i] == Input){
959                         Result = i;
960                 }
961         }
962         return Result;
963 }
964 Array.prototype.indexOf = Array_IndexOf;
965
966 //IE HAS RENDERING BUG WITH BOTTOM NAVBAR
967 function RemoveBottomNavBarForIE(){
968         if (C.ie){
969                 if (document.getElementById('BottomNavBar') != null){
970                         document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar'));
971                 }
972         }
973 }
974
975
976
977
978 //HOTPOTNET-RELATED CODE
979
980 var HPNStartTime = (new Date()).getTime();
981 var SubmissionTimeout = 30000;
982 var Detail = ''; //Global that is used to submit tracking data
983
984 function Finish(){
985 //If there's a form, fill it out and submit it
986         if (document.store != null){
987                 Frm = document.store;
988                 Frm.starttime.value = HPNStartTime;
989                 Frm.endtime.value = (new Date()).getTime();
990                 Frm.mark.value = Score;
991                 Frm.detail.value = Detail;
992                 Frm.submit();
993         }
994 }
995
996
997
998 function Card(ID, OverlapTolerance){
999         this.elm=document.getElementById(ID);
1000         this.name=ID;
1001         this.css=this.elm.style;
1002         this.elm.style.left = 0 +'px';
1003         this.elm.style.top = 0 +'px';
1004         this.HomeL = 0;
1005         this.HomeT = 0;
1006         this.tag=-1;
1007         this.index=-1;
1008         this.OverlapTolerance = OverlapTolerance;
1009 }
1010
1011 function CardGetL(){return parseInt(this.css.left)}
1012 Card.prototype.GetL=CardGetL;
1013
1014 function CardGetT(){return parseInt(this.css.top)}
1015 Card.prototype.GetT=CardGetT;
1016
1017 function CardGetW(){return parseInt(this.elm.offsetWidth)}
1018 Card.prototype.GetW=CardGetW;
1019
1020 function CardGetH(){return parseInt(this.elm.offsetHeight)}
1021 Card.prototype.GetH=CardGetH;
1022
1023 function CardGetB(){return this.GetT()+this.GetH()}
1024 Card.prototype.GetB=CardGetB;
1025
1026 function CardGetR(){return this.GetL()+this.GetW()}
1027 Card.prototype.GetR=CardGetR;
1028
1029 function CardSetL(NewL){this.css.left = NewL+'px'}
1030 Card.prototype.SetL=CardSetL;
1031
1032 function CardSetT(NewT){this.css.top = NewT+'px'}
1033 Card.prototype.SetT=CardSetT;
1034
1035 function CardSetW(NewW){this.css.width = NewW+'px'}
1036 Card.prototype.SetW=CardSetW;
1037
1038 function CardSetH(NewH){this.css.height = NewH+'px'}
1039 Card.prototype.SetH=CardSetH;
1040
1041 function CardInside(X,Y){
1042         var Result=false;
1043         if(X>=this.GetL()){if(X<=this.GetR()){if(Y>=this.GetT()){if(Y<=this.GetB()){Result=true;}}}}
1044         return Result;
1045 }
1046 Card.prototype.Inside=CardInside;
1047
1048 function CardSwapColours(){
1049         var c=this.css.backgroundColor;
1050         this.css.backgroundColor=this.css.color;
1051         this.css.color=c;
1052 }
1053 Card.prototype.SwapColours=CardSwapColours;
1054
1055 function CardHighlight(){
1056         this.css.backgroundColor='#000000';
1057         this.css.color='#aaddaa';
1058 }
1059 Card.prototype.Highlight=CardHighlight;
1060
1061 function CardUnhighlight(){
1062         this.css.backgroundColor='#aaddaa';
1063         this.css.color='#000000';
1064 }
1065 Card.prototype.Unhighlight=CardUnhighlight;
1066
1067 function CardOverlap(OtherCard){
1068         var smR=(this.GetR()<(OtherCard.GetR()+this.OverlapTolerance))? this.GetR(): (OtherCard.GetR()+this.OverlapTolerance);
1069         var lgL=(this.GetL()>OtherCard.GetL())? this.GetL(): OtherCard.GetL();
1070         var HDim=smR-lgL;
1071         if (HDim<1){return 0;}
1072         var smB=(this.GetB()<OtherCard.GetB())? this.GetB(): OtherCard.GetB();
1073         var lgT=(this.GetT()>OtherCard.GetT())? this.GetT(): OtherCard.GetT();
1074         var VDim=smB-lgT;
1075         if (VDim<1){return 0;}
1076         return (HDim*VDim);     
1077 }