Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Berry <bryan@olenepal.org>2010-02-03 02:20:09 (GMT)
committer Bryan Berry <bryan@olenepal.org>2010-02-03 02:20:09 (GMT)
commitffc835ecb431bbad966436b9975445dde82a794d (patch)
treeec7f6017aa9c0f83208b87639547d27c906648e0
parent17f93b229aa0d82e5da19427281eecd1221bb4dd (diff)
parent2fb81ddc795ea45d5f4a873208390035f0141e04 (diff)
Merge branch 'master' of gitorious@git.sugarlabs.org:karma/mainline
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.22858~47
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.2671~48
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.63800~48
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.64159~48
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.68631~47
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.69489~44
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.76672~0
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.81271~47
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.83946~48
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.92952~44
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.98113~48
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/.tmp_index.html.98765~49
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/cheetah.wavbin0 -> 63020 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/correct.oggbin0 -> 12811 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/crocodile.wavbin0 -> 69164 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/dinosaura.wavbin0 -> 73772 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/giraffe.wavbin0 -> 66092 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/incorrect.oggbin0 -> 12683 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/kangaroo.wavbin0 -> 71468 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/octopus.wavbin0 -> 66860 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/panda.wavbin0 -> 67628 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/rhinoceros.wavbin0 -> 79916 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/whale.wavbin0 -> 64556 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/audio/zebra.wavbin0 -> 62252 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/check.pngbin0 -> 9052 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/cheetah.pngbin0 -> 100544 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/cheetah0.pngbin0 -> 7552 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/cheetah1.pngbin0 -> 11455 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/cheetah2.pngbin0 -> 11667 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/cheetah3.pngbin0 -> 8650 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/cheetah4.pngbin0 -> 17331 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/cheetah5.pngbin0 -> 12606 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/cheetah6.pngbin0 -> 14298 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/cheetah7.pngbin0 -> 9027 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/cheetah8.pngbin0 -> 8864 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/confirm.pngbin0 -> 3382 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/correct.pngbin0 -> 6263 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/crocodile.pngbin0 -> 106547 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/crocodile0.pngbin0 -> 6905 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/crocodile1.pngbin0 -> 6676 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/crocodile2.pngbin0 -> 5643 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/crocodile3.pngbin0 -> 9240 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/crocodile4.pngbin0 -> 13351 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/crocodile5.pngbin0 -> 18923 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/crocodile6.pngbin0 -> 20104 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/crocodile7.pngbin0 -> 18484 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/crocodile8.pngbin0 -> 10250 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur.pngbin0 -> 75806 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur0.pngbin0 -> 2584 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur1.pngbin0 -> 3529 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur2.pngbin0 -> 5553 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur3.pngbin0 -> 16144 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur4.pngbin0 -> 14065 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur5.pngbin0 -> 10220 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur6.pngbin0 -> 7808 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur7.pngbin0 -> 14155 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur8.pngbin0 -> 4475 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/giraffe.pngbin0 -> 108712 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/giraffe0.pngbin0 -> 4047 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/giraffe1.pngbin0 -> 19670 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/giraffe2.pngbin0 -> 4975 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/giraffe3.pngbin0 -> 15009 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/giraffe4.pngbin0 -> 25549 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/giraffe5.pngbin0 -> 14401 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/giraffe6.pngbin0 -> 1790 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/giraffe7.pngbin0 -> 17868 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/giraffe8.pngbin0 -> 5750 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/help.pngbin0 -> 106419 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/incorrect.pngbin0 -> 8029 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo.pngbin0 -> 105544 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo0.pngbin0 -> 21008 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo1.pngbin0 -> 13647 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo2.pngbin0 -> 13535 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo3.pngbin0 -> 4475 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo4.pngbin0 -> 11797 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo5.pngbin0 -> 13066 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo6.pngbin0 -> 5653 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo7.pngbin0 -> 14249 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo8.pngbin0 -> 10043 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/octopus.pngbin0 -> 149629 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/octopus0.pngbin0 -> 9268 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/octopus1.pngbin0 -> 7293 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/octopus2.pngbin0 -> 7293 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/octopus3.pngbin0 -> 21522 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/octopus4.pngbin0 -> 23146 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/octopus5.pngbin0 -> 14923 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/octopus6.pngbin0 -> 19702 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/octopus7.pngbin0 -> 22267 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/octopus8.pngbin0 -> 23011 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/panda.pngbin0 -> 262728 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/panda0.pngbin0 -> 29542 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/panda1.pngbin0 -> 27447 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/panda2.pngbin0 -> 30993 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/panda3.pngbin0 -> 31002 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/panda4.pngbin0 -> 24962 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/panda5.pngbin0 -> 26053 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/panda6.pngbin0 -> 30006 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/panda7.pngbin0 -> 30090 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/panda8.pngbin0 -> 30004 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros.pngbin0 -> 91312 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros0.pngbin0 -> 12118 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros1.pngbin0 -> 11614 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros2.pngbin0 -> 12860 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros3.pngbin0 -> 16340 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros4.pngbin0 -> 12065 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros5.pngbin0 -> 14120 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros6.pngbin0 -> 1764 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros7.pngbin0 -> 8268 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros8.pngbin0 -> 6760 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/volImage.pngbin0 -> 3282 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/whale.pngbin0 -> 65782 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/whale0.pngbin0 -> 3963 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/whale1.pngbin0 -> 1633 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/whale2.pngbin0 -> 1213 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/whale3.pngbin0 -> 15470 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/whale4.pngbin0 -> 16353 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/whale5.pngbin0 -> 16066 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/whale6.pngbin0 -> 4105 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/whale7.pngbin0 -> 5463 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/whale8.pngbin0 -> 4654 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/zebra.pngbin0 -> 99018 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/zebra0.pngbin0 -> 10890 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/zebra1.pngbin0 -> 13908 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/zebra2.pngbin0 -> 17385 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/zebra3.pngbin0 -> 14687 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/zebra4.pngbin0 -> 20622 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/zebra5.pngbin0 -> 11026 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/zebra6.pngbin0 -> 5131 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/zebra7.pngbin0 -> 4534 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/assets/image/zebra8.pngbin0 -> 3336 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/css/lesson.css306
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/index.html47
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/js/jquery-1.4.js5999
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/js/lesson.js359
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/js/ui.core.js519
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/js/ui.draggable.js766
-rwxr-xr-xexamples/lessons/6_English_VocabularyAnimals/js/ui.droppable.js282
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.22858~47
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.2671~48
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.63800~48
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.64159~48
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.68631~47
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.69489~44
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.76672~0
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.83946~48
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.92952~44
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.98113~48
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/.tmp_index.html.98765~49
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/bulbul.wavbin0 -> 69164 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/correct.oggbin0 -> 12811 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/crane.wavbin0 -> 53804 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/egret.wavbin0 -> 59180 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/incorrect.oggbin0 -> 12683 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/kingfisher.wavbin0 -> 68396 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/ostrich.wavbin0 -> 67628 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/penguin.wavbin0 -> 68396 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/swan.wavbin0 -> 66860 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/swift.wavbin0 -> 66860 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/vulture.wavbin0 -> 61484 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/audio/woodpecker.wavbin0 -> 75308 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bulbul.pngbin0 -> 222759 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bulbul0.pngbin0 -> 18169 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bulbul1.pngbin0 -> 16796 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bulbul2.pngbin0 -> 15915 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bulbul3.pngbin0 -> 23252 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bulbul4.pngbin0 -> 20730 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bulbul5.pngbin0 -> 17204 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bulbul6.pngbin0 -> 13440 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bulbul7.pngbin0 -> 16129 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/bulbul8.pngbin0 -> 17627 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/check.pngbin0 -> 9052 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/confirm.pngbin0 -> 3382 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/correct.pngbin0 -> 6263 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/crane.pngbin0 -> 239425 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/crane0.pngbin0 -> 15648 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/crane1.pngbin0 -> 17299 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/crane2.pngbin0 -> 14797 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/crane3.pngbin0 -> 20511 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/crane4.pngbin0 -> 22977 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/crane5.pngbin0 -> 23039 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/crane6.pngbin0 -> 24618 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/crane7.pngbin0 -> 26371 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/crane8.pngbin0 -> 24912 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/egret.pngbin0 -> 91235 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/egret0.pngbin0 -> 4273 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/egret1.pngbin0 -> 5484 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/egret2.pngbin0 -> 3418 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/egret3.pngbin0 -> 8481 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/egret4.pngbin0 -> 14353 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/egret5.pngbin0 -> 6408 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/egret6.pngbin0 -> 13343 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/egret7.pngbin0 -> 15573 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/egret8.pngbin0 -> 7176 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/help.pngbin0 -> 101156 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/incorrect.pngbin0 -> 8029 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/kingfisher.pngbin0 -> 130854 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/kingfisher0.pngbin0 -> 7961 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/kingfisher1.pngbin0 -> 19229 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/kingfisher2.pngbin0 -> 7262 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/kingfisher3.pngbin0 -> 15821 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/kingfisher4.pngbin0 -> 16066 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/kingfisher5.pngbin0 -> 4787 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/kingfisher6.pngbin0 -> 15579 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/kingfisher7.pngbin0 -> 8944 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/kingfisher8.pngbin0 -> 2935 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/ostrich.pngbin0 -> 67573 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/ostrich0.pngbin0 -> 3456 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/ostrich1.pngbin0 -> 3921 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/ostrich2.pngbin0 -> 4876 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/ostrich3.pngbin0 -> 11685 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/ostrich4.pngbin0 -> 8605 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/ostrich5.pngbin0 -> 6893 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/ostrich6.pngbin0 -> 5491 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/ostrich7.pngbin0 -> 10369 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/ostrich8.pngbin0 -> 6215 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/penguin.pngbin0 -> 164397 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/penguin0.pngbin0 -> 7853 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/penguin1.pngbin0 -> 13324 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/penguin2.pngbin0 -> 8477 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/penguin3.pngbin0 -> 9477 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/penguin4.pngbin0 -> 19935 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/penguin5.pngbin0 -> 9852 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/penguin6.pngbin0 -> 16887 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/penguin7.pngbin0 -> 21043 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/penguin8.pngbin0 -> 16998 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swan.pngbin0 -> 93090 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swan0.pngbin0 -> 4266 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swan1.pngbin0 -> 4105 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swan2.pngbin0 -> 2726 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swan3.pngbin0 -> 11736 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swan4.pngbin0 -> 15359 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swan5.pngbin0 -> 8918 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swan6.pngbin0 -> 13050 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swan7.pngbin0 -> 11215 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swan8.pngbin0 -> 11674 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swift.pngbin0 -> 41412 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swift0.pngbin0 -> 1740 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swift1.pngbin0 -> 7848 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swift2.pngbin0 -> 1933 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swift3.pngbin0 -> 1660 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swift4.pngbin0 -> 11275 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swift5.pngbin0 -> 2478 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swift6.pngbin0 -> 1318 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swift7.pngbin0 -> 4757 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/swift8.pngbin0 -> 1166 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/volImage.pngbin0 -> 3282 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/vulture.pngbin0 -> 167624 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/vulture0.pngbin0 -> 8729 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/vulture1.pngbin0 -> 18300 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/vulture2.pngbin0 -> 18950 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/vulture3.pngbin0 -> 16700 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/vulture4.pngbin0 -> 19329 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/vulture5.pngbin0 -> 13355 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/vulture6.pngbin0 -> 21387 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/vulture7.pngbin0 -> 13704 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/vulture8.pngbin0 -> 19415 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/woodpecker.pngbin0 -> 263380 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/woodpecker0.pngbin0 -> 13239 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/woodpecker1.pngbin0 -> 22625 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/woodpecker2.pngbin0 -> 24977 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/woodpecker3.pngbin0 -> 17045 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/woodpecker4.pngbin0 -> 20257 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/woodpecker5.pngbin0 -> 24506 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/woodpecker6.pngbin0 -> 22651 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/woodpecker7.pngbin0 -> 23743 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/assets/image/woodpecker8.pngbin0 -> 22538 bytes
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/css/lesson.css306
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/index.html46
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/js/jquery-1.4.js5999
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/js/lesson.js359
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/js/ui.core.js519
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/js/ui.draggable.js766
-rwxr-xr-xexamples/lessons/6_English_VocabularyBirds/js/ui.droppable.js282
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/.tmp_index.html.61417~48
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/.tmp_index.html.63800~48
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/.tmp_index.html.83946~48
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/.tmp_index.html.90016~48
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/.tmp_index.html.92952~44
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/audio/correct.oggbin0 -> 12811 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/audio/incorrect.oggbin0 -> 12683 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/background.pngbin0 -> 168942 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/check.pngbin0 -> 9052 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/correct.pngbin0 -> 6263 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ele0.pngbin0 -> 25472 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ele1.pngbin0 -> 24027 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ele2.pngbin0 -> 19609 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ele3.pngbin0 -> 13695 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ele4.pngbin0 -> 21984 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ele5.pngbin0 -> 25218 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/house0.pngbin0 -> 21548 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/house1.pngbin0 -> 11138 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/house2.pngbin0 -> 14157 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/house3.pngbin0 -> 25566 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/house4.pngbin0 -> 42386 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/house5.pngbin0 -> 30378 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/incorrect.pngbin0 -> 8029 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ship0.pngbin0 -> 12498 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ship1.pngbin0 -> 27285 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ship2.pngbin0 -> 5274 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ship3.pngbin0 -> 26818 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ship4.pngbin0 -> 25655 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/ship5.pngbin0 -> 11066 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/css/lesson.css229
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/css/ui.scoreboard.css62
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/index.html48
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/js/lesson.js213
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/js/ui.core.js519
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/js/ui.draggable.js766
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/js/ui.droppable.js282
-rwxr-xr-xexamples/lessons/6_English_alphabeticalOrder/js/ui.scoreboard.js107
-rwxr-xr-xexamples/lessons/6_English_months/.tmp_index.html.63800~48
-rwxr-xr-xexamples/lessons/6_English_months/.tmp_index.html.69489~44
-rwxr-xr-xexamples/lessons/6_English_months/.tmp_index.html.83946~48
-rwxr-xr-xexamples/lessons/6_English_months/.tmp_index.html.92952~44
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/April.wavbin0 -> 44144 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/August.wavbin0 -> 55172 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/December.wavbin0 -> 33120 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/February.wavbin0 -> 55172 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/January.wavbin0 -> 55172 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/July.wavbin0 -> 44144 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/June.wavbin0 -> 55172 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/March.wavbin0 -> 33120 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/May.wavbin0 -> 44144 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/November.wavbin0 -> 44144 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/October.wavbin0 -> 55172 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/September.wavbin0 -> 66196 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/correct.oggbin0 -> 12811 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/audio/incorrect.oggbin0 -> 12683 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/April.pngbin0 -> 9508 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/August.pngbin0 -> 16369 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/December.pngbin0 -> 19515 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/February.pngbin0 -> 4600 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/January.pngbin0 -> 14276 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/July.pngbin0 -> 26118 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/June.pngbin0 -> 41134 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/March.pngbin0 -> 18077 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/May.pngbin0 -> 13529 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/November.pngbin0 -> 32208 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/October.pngbin0 -> 16852 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/September.pngbin0 -> 13230 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/check.pngbin0 -> 9052 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/correct.pngbin0 -> 1464 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/incorrect.pngbin0 -> 1526 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_April.pngbin0 -> 3918 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_August.pngbin0 -> 4472 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_December.pngbin0 -> 3981 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_February.pngbin0 -> 1980 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_January.pngbin0 -> 4402 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_July.pngbin0 -> 2980 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_June.pngbin0 -> 5683 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_March.pngbin0 -> 2159 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_May.pngbin0 -> 3069 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_November.pngbin0 -> 4621 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_October.pngbin0 -> 3127 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/small_September.pngbin0 -> 3464 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_English_months/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_English_months/css/lesson.css246
-rwxr-xr-xexamples/lessons/6_English_months/index.html45
-rwxr-xr-xexamples/lessons/6_English_months/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_English_months/js/jquery.watermarkinput.js81
-rwxr-xr-xexamples/lessons/6_English_months/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_English_months/js/lesson.js227
-rwxr-xr-xexamples/lessons/6_English_months/js/ui.core.js519
-rwxr-xr-xexamples/lessons/6_English_months/js/ui.draggable.js766
-rwxr-xr-xexamples/lessons/6_English_months/js/ui.droppable.js282
-rwxr-xr-xexamples/lessons/6_English_syllables/.tmp_index.html.38007~41
-rwxr-xr-xexamples/lessons/6_English_syllables/.tmp_index.html.42094~44
-rwxr-xr-xexamples/lessons/6_English_syllables/.tmp_index.html.54401~44
-rwxr-xr-xexamples/lessons/6_English_syllables/.tmp_index.html.71755~47
-rwxr-xr-xexamples/lessons/6_English_syllables/.tmp_index.html.88163~44
-rwxr-xr-xexamples/lessons/6_English_syllables/.tmp_index.html.99197~47
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/audio/correct.oggbin0 -> 12811 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/audio/incorrect.oggbin0 -> 12683 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/bgContainer.pngbin0 -> 68896 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/bg_footer.pngbin0 -> 185 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/bg_header.pngbin0 -> 307 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/bg_title_block.pngbin0 -> 366 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/computer_base.pngbin0 -> 5140 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/computer_body.pngbin0 -> 4239 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/computer_top.pngbin0 -> 4936 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/help.pngbin0 -> 122707 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/player_base.pngbin0 -> 5765 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/player_body.pngbin0 -> 4904 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/player_top.pngbin0 -> 5540 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/title_block_lt.pngbin0 -> 1337 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/assets/image/title_block_rt.pngbin0 -> 1362 bytes
-rwxr-xr-xexamples/lessons/6_English_syllables/css/lesson.css295
-rwxr-xr-xexamples/lessons/6_English_syllables/index.html44
-rwxr-xr-xexamples/lessons/6_English_syllables/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_English_syllables/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_English_syllables/js/lesson.js359
-rwxr-xr-xexamples/lessons/6_English_syllables/js/lesson.js~359
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/.tmp_index.html.3663~0
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/.tmp_index.html.63800~48
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/.tmp_index.html.69489~44
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/.tmp_index.html.83946~48
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/.tmp_index.html.92952~44
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/audio/correct.oggbin0 -> 12811 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/audio/incorrect.oggbin0 -> 12683 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/backImage.pngbin0 -> 26097 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/bear.pngbin0 -> 7172 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/bird.pngbin0 -> 9721 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/check.pngbin0 -> 9052 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/cock.pngbin0 -> 44517 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/comma.pngbin0 -> 324 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/correct.pngbin0 -> 6263 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/cow.pngbin0 -> 11564 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/crow.pngbin0 -> 8687 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/domestic.pngbin0 -> 10803 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/dot.pngbin0 -> 276 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/duck.pngbin0 -> 9674 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/eagle.pngbin0 -> 21273 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/egret.pngbin0 -> 13176 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/elephant.pngbin0 -> 23389 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/goat.pngbin0 -> 13524 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/horse.pngbin0 -> 18290 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/incorrect.pngbin0 -> 8029 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/jackel.pngbin0 -> 19215 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/monkey.pngbin0 -> 24417 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/mynah.pngbin0 -> 28073 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/owl.pngbin0 -> 16238 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/parrot.pngbin0 -> 7521 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/pig.pngbin0 -> 14307 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/pigeon.pngbin0 -> 22408 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/rabbit.pngbin0 -> 19176 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/rhino.pngbin0 -> 9735 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/sheep.pngbin0 -> 17723 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/snake.pngbin0 -> 12757 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/sparrow.pngbin0 -> 12474 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/tiger.pngbin0 -> 27565 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/turtle.pngbin0 -> 20708 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/assets/image/wild.pngbin0 -> 10986 bytes
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/css/lesson.css252
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/css/ui.scoreboard.css62
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/index.html49
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/js/jquery-1.4.js5999
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/js/lesson.js298
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/js/ui.core.js519
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/js/ui.draggable.js766
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/js/ui.droppable.js282
-rwxr-xr-xexamples/lessons/6_English_yesNoQuestions/js/ui.scoreboard.js107
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/audio/correct.wavbin0 -> 111176 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/audio/incorrect.wavbin0 -> 77660 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/check.pngbin0 -> 1901 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/correct.pngbin0 -> 6263 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/cross.pngbin0 -> 936 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/gameOver.pngbin0 -> 15508 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/help.pngbin0 -> 51688 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img0.pngbin0 -> 22694 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img0More.pngbin0 -> 92925 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img1.pngbin0 -> 14625 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img1More.pngbin0 -> 98355 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img2.pngbin0 -> 17440 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img2More.pngbin0 -> 111031 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img3.pngbin0 -> 10325 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img3More.pngbin0 -> 78263 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img4.pngbin0 -> 22115 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img4More.pngbin0 -> 88100 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img5.pngbin0 -> 38096 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img5More.pngbin0 -> 63810 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img6.pngbin0 -> 21807 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img6More.pngbin0 -> 158013 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img7.pngbin0 -> 78237 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img7More.pngbin0 -> 102649 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/incorrect.pngbin0 -> 8029 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/css/lesson.css285
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/css/ui.scoreboard.css62
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/index.html46
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/js/lesson.js212
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.core.js519
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.draggable.js766
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.droppable.js282
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.scoreboard.js107
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/.tmp_index.html.46799~46
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/correct.wavbin0 -> 111176 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/incorrect.wavbin0 -> 77660 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bgLeft.pngbin0 -> 12661 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/check.pngbin0 -> 1901 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/gameOver.pngbin0 -> 15508 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/help.pngbin0 -> 61687 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img0.pngbin0 -> 92834 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img1.pngbin0 -> 29653 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img2.pngbin0 -> 45874 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img3.pngbin0 -> 78008 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img4.pngbin0 -> 82002 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img5.pngbin0 -> 77528 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques0.pngbin0 -> 29973 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques1.pngbin0 -> 32515 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques2.pngbin0 -> 28743 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques3.pngbin0 -> 25482 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques4.pngbin0 -> 19551 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques5.pngbin0 -> 29018 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/css/lesson.css273
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/css/ui.scoreboard.css62
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/index.html46
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/js/lesson.js215
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.core.js519
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.draggable.js766
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.droppable.js282
-rwxr-xr-xexamples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.scoreboard.js107
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.10987~54
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.57021~55
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.6785~55
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.72685~54
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.81724~50
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.99718~54
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/audio/correct.oggbin0 -> 12811 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/audio/incorrect.oggbin0 -> 12683 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/a.pngbin0 -> 2903 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/b.pngbin0 -> 2791 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/c.pngbin0 -> 2926 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/correct.pngbin0 -> 1190 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/d.pngbin0 -> 2853 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/ques1def.pngbin0 -> 5984 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/ques2def.pngbin0 -> 5718 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/ques3def.pngbin0 -> 4303 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/ques4def.pngbin0 -> 4353 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/ques5def.pngbin0 -> 9059 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/ques6def.pngbin0 -> 8391 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/ques7def.pngbin0 -> 9473 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/ques8def.pngbin0 -> 4847 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/volume.pngbin0 -> 3267 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/assets/image/wrong.pngbin0 -> 1379 bytes
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/css/lesson.css224
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/index.html54
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_Maths_SetMultipleChoice/js/lesson.js193
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/.tmp_index.html.30266~40
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/.tmp_index.html.38007~41
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/.tmp_index.html.44857~40
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/.tmp_index.html.54401~44
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/.tmp_index.html.94449~52
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/.tmp_index.html.99197~47
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/audio/correct.wavbin0 -> 111176 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/audio/incorrect.wavbin0 -> 77660 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/apple.pngbin0 -> 16416 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/bag.pngbin0 -> 20227 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/balloon.pngbin0 -> 47821 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/bg_footer.pngbin0 -> 185 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/bg_header.pngbin0 -> 307 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/bg_title_block.pngbin0 -> 366 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/book.pngbin0 -> 14826 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/bread.pngbin0 -> 15067 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/cake.pngbin0 -> 29301 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/cap.pngbin0 -> 25245 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/correct.pngbin0 -> 4099 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/doll.pngbin0 -> 41665 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/food.pngbin0 -> 37855 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/grapes.pngbin0 -> 22673 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/help.pngbin0 -> 112701 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/howMuchLeft.pngbin0 -> 2319 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/howMuchNeeded.pngbin0 -> 1808 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/ice.pngbin0 -> 18340 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/incorrect.pngbin0 -> 4832 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/lays.pngbin0 -> 46222 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/leftText.pngbin0 -> 2362 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/mango.pngbin0 -> 42506 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/moneyNeeded.pngbin0 -> 1804 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/moneyOk.pngbin0 -> 1787 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/orange.pngbin0 -> 16867 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/papaya.pngbin0 -> 38920 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/pear.pngbin0 -> 17011 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/pen.pngbin0 -> 24319 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/pomogranate.pngbin0 -> 5922 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/rightText.pngbin0 -> 1606 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/roti.pngbin0 -> 56646 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/rs10.pngbin0 -> 204613 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/rs100.pngbin0 -> 239671 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/rs25.pngbin0 -> 226629 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/rs5.pngbin0 -> 201010 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/rs50.pngbin0 -> 240605 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/title_block_lt.pngbin0 -> 1337 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/assets/image/title_block_rt.pngbin0 -> 1362 bytes
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/css/lesson.css299
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/css/lesson.css~299
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/css/ui.scoreboard.css62
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/index.html52
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/js/lesson.js259
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/js/ui.core.js519
-rwxr-xr-xexamples/lessons/6_Maths_goShopping/js/ui.scoreboard.js107
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/.tmp_index.html.30266~40
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/.tmp_index.html.30807~42
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/.tmp_index.html.38007~41
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/.tmp_index.html.44857~40
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/.tmp_index.html.54401~44
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/.tmp_index.html.99197~47
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/audio/correct.wavbin0 -> 111176 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/audio/incorrect.wavbin0 -> 77660 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-003-660@141.pngbin0 -> 40094 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-012-500@152.pngbin0 -> 64739 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/bg_footer.pngbin0 -> 185 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/bg_header.pngbin0 -> 307 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/bg_title_block.pngbin0 -> 366 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/correct.pngbin0 -> 4099 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/defIntersectLines.pngbin0 -> 4326 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/defParallelLines.pngbin0 -> 3845 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/defParallelNo.pngbin0 -> 6386 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/defParallelYes.pngbin0 -> 6452 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/help.pngbin0 -> 88041 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/imgIntersectLines.pngbin0 -> 5345 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/imgNo.pngbin0 -> 12610 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/imgParallelLines.pngbin0 -> 4173 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/imgYes.pngbin0 -> 10774 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/incorrect.pngbin0 -> 4832 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/infoIntersectLines.pngbin0 -> 5097 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/infoParallelLines.pngbin0 -> 6228 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/ques0.pngbin0 -> 8129 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/ques1.pngbin0 -> 6201 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/ques2.pngbin0 -> 5642 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/ques3.pngbin0 -> 4892 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/ques4.pngbin0 -> 14774 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/ques5.pngbin0 -> 8571 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/ques6.pngbin0 -> 12392 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/ques7.pngbin0 -> 14465 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/ques8.pngbin0 -> 12658 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/ques9.pngbin0 -> 14092 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/title_block_lt.pngbin0 -> 1337 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/title_block_rt.pngbin0 -> 1362 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/assets/image/topText.pngbin0 -> 2187 bytes
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/css/lesson.css262
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/css/ui.scoreboard.css62
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/index.html42
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/js/lesson.js163
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/js/ui.core.js519
-rwxr-xr-xexamples/lessons/6_Maths_parallelLines/js/ui.scoreboard.js107
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/.tmp_index.html.46799~46
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/.tmp_index.html.62537~46
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/audio/correct.wavbin0 -> 111176 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/audio/incorrect.wavbin0 -> 77660 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/borderWall.pngbin0 -> 33182 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/cupBoard.pngbin0 -> 40422 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/help.pngbin0 -> 56003 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/assets/image/tv.pngbin0 -> 19605 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/css/lesson.css300
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/index.html41
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_Maths_quickAddition/js/lesson.js162
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/.tmp_index.html.46799~46
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/.tmp_index.html.5425~41
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/.tmp_index.html.62537~46
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/audio/correct.wavbin0 -> 111176 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/audio/incorrect.wavbin0 -> 77660 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/borderWall.pngbin0 -> 33182 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/cupBoard.pngbin0 -> 40422 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/help.pngbin0 -> 59741 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/assets/image/tv.pngbin0 -> 19605 bytes
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/css/lesson.css300
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/index.html41
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_Maths_quickDivision/js/lesson.js185
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/.tmp_index.html.54396~59
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/.tmp_index.html.76681~56
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/.tmp_index.html.89199~59
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/audio/correct.oggbin0 -> 12811 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/audio/incorrect.oggbin0 -> 12683 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/confirm.pngbin0 -> 1901 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/correct.pngbin0 -> 1883 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/gameOver.pngbin0 -> 15508 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/image1.pngbin0 -> 170559 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/img2title.pngbin0 -> 12774 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/img_think.pngbin0 -> 24290 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/incorrect.pngbin0 -> 1909 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/quesBox.pngbin0 -> 1259 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/assets/image/volume.pngbin0 -> 3267 bytes
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/css/lesson.css302
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/index.html57
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/js/jquery-1.4.js5999
-rwxr-xr-xexamples/lessons/6_Maths_romanNumerals/js/lesson.js288
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/audio/correct.wavbin0 -> 111176 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/audio/incorrect.wavbin0 -> 77660 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/bgAns.pngbin0 -> 2900 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/bgMessage.pngbin0 -> 33310 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/bgQues.pngbin0 -> 54994 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/bgQuestion.pngbin0 -> 34484 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/bg_footer.pngbin0 -> 137 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/bg_header.pngbin0 -> 225 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/bg_title_block.pngbin0 -> 274 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_back.pngbin0 -> 2665 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_back_hover.pngbin0 -> 4038 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_help.pngbin0 -> 2755 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_help_hover.pngbin0 -> 4190 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_next.pngbin0 -> 2773 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_next_hover.pngbin0 -> 3996 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_ole.pngbin0 -> 4842 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_ole_hover.pngbin0 -> 6253 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_play_again.pngbin0 -> 5627 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_play_again_hover.pngbin0 -> 5468 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_play_again_mouse_down.pngbin0 -> 5688 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_start.pngbin0 -> 5127 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_start_hover.pngbin0 -> 4966 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/btn_start_mouse_down.pngbin0 -> 5109 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/check.pngbin0 -> 1901 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/correct.pngbin0 -> 6263 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/gameOver.pngbin0 -> 15508 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/help.pngbin0 -> 85272 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img0.pngbin0 -> 24799 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img0Clicked.pngbin0 -> 64946 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img1.pngbin0 -> 53216 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img1Clicked.pngbin0 -> 68646 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img2.pngbin0 -> 62647 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img2Clicked.pngbin0 -> 61101 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img3.pngbin0 -> 20103 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img3Clicked.pngbin0 -> 60597 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img4.pngbin0 -> 49635 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img4Clicked.pngbin0 -> 70211 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img5.pngbin0 -> 97576 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img5Clicked.pngbin0 -> 71474 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img6.pngbin0 -> 97576 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img6Clicked.pngbin0 -> 60888 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img7.pngbin0 -> 38302 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/img7Clicked.pngbin0 -> 38599 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/incorrect.pngbin0 -> 8029 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/title_block_lt.pngbin0 -> 1057 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/assets/image/title_block_rt.pngbin0 -> 1074 bytes
-rwxr-xr-xexamples/lessons/6_Maths_variables/css/lesson.css248
-rwxr-xr-xexamples/lessons/6_Maths_variables/css/ui.scoreboard.css62
-rwxr-xr-xexamples/lessons/6_Maths_variables/index.html47
-rwxr-xr-xexamples/lessons/6_Maths_variables/js/jquery-1.3.2.min.js19
-rwxr-xr-xexamples/lessons/6_Maths_variables/js/karma.js1018
-rwxr-xr-xexamples/lessons/6_Maths_variables/js/lesson.js191
-rwxr-xr-xexamples/lessons/6_Maths_variables/js/ui.core.js519
-rwxr-xr-xexamples/lessons/6_Maths_variables/js/ui.draggable.js766
-rwxr-xr-xexamples/lessons/6_Maths_variables/js/ui.droppable.js282
-rwxr-xr-xexamples/lessons/6_Maths_variables/js/ui.scoreboard.js107
990 files changed, 64614 insertions, 0 deletions
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.22858~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.22858~
new file mode 100755
index 0000000..a3a5553
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.22858~
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="confirmSection"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.2671~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.2671~
new file mode 100755
index 0000000..833fcad
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.2671~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.63800~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.63800~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.63800~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.64159~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.64159~
new file mode 100755
index 0000000..833fcad
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.64159~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.68631~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.68631~
new file mode 100755
index 0000000..a3a5553
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.68631~
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="confirmSection"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.69489~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.69489~
new file mode 100755
index 0000000..da51ff8
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.69489~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Months</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Months of the Year<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.76672~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.76672~
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.76672~
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.81271~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.81271~
new file mode 100755
index 0000000..a3a5553
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.81271~
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="confirmSection"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.83946~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.83946~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.83946~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.92952~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.92952~
new file mode 100755
index 0000000..77f8df2
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.92952~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Eng Crossword</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Crossword Puzzle <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="acrossImg"></div>
+ <div id="downImg"></div>
+ <div id="crosswordSection">
+
+
+ </div>
+
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.98113~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.98113~
new file mode 100755
index 0000000..833fcad
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.98113~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.98765~ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.98765~
new file mode 100755
index 0000000..c359651
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/.tmp_index.html.98765~
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Yes No Questions</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Yes No Questions <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="tabs"></div>
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/cheetah.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/cheetah.wav
new file mode 100755
index 0000000..f819bdd
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/cheetah.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/correct.ogg b/examples/lessons/6_English_VocabularyAnimals/assets/audio/correct.ogg
new file mode 100755
index 0000000..a0d9e3a
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/correct.ogg
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/crocodile.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/crocodile.wav
new file mode 100755
index 0000000..fcc37d4
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/crocodile.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/dinosaura.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/dinosaura.wav
new file mode 100755
index 0000000..06e7834
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/dinosaura.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/giraffe.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/giraffe.wav
new file mode 100755
index 0000000..895bfb2
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/giraffe.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/incorrect.ogg b/examples/lessons/6_English_VocabularyAnimals/assets/audio/incorrect.ogg
new file mode 100755
index 0000000..4805e55
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/incorrect.ogg
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/kangaroo.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/kangaroo.wav
new file mode 100755
index 0000000..76221ea
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/kangaroo.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/octopus.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/octopus.wav
new file mode 100755
index 0000000..3b2f590
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/octopus.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/panda.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/panda.wav
new file mode 100755
index 0000000..4dc923d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/panda.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/rhinoceros.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/rhinoceros.wav
new file mode 100755
index 0000000..a08bb5e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/rhinoceros.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/whale.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/whale.wav
new file mode 100755
index 0000000..3d1fae0
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/whale.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/zebra.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/zebra.wav
new file mode 100755
index 0000000..023b627
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/audio/zebra.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_footer.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_header.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_title_block.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_mouse_down.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/check.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/check.png
new file mode 100755
index 0000000..84fc229
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/check.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah.png
new file mode 100755
index 0000000..026c35f
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah0.png
new file mode 100755
index 0000000..46128fc
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah1.png
new file mode 100755
index 0000000..5d5089b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah2.png
new file mode 100755
index 0000000..2a6a6ce
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah3.png
new file mode 100755
index 0000000..ee709fc
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah4.png
new file mode 100755
index 0000000..66a89ed
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah5.png
new file mode 100755
index 0000000..2334d3c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah6.png
new file mode 100755
index 0000000..d4ce4d6
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah7.png
new file mode 100755
index 0000000..e4712f4
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah8.png
new file mode 100755
index 0000000..45e068b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/confirm.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/confirm.png
new file mode 100755
index 0000000..cb0b4e2
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/confirm.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/correct.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/correct.png
new file mode 100755
index 0000000..ca9b9db
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile.png
new file mode 100755
index 0000000..17ca28f
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile0.png
new file mode 100755
index 0000000..88731bc
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile1.png
new file mode 100755
index 0000000..79d4742
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile2.png
new file mode 100755
index 0000000..7a3f53b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile3.png
new file mode 100755
index 0000000..8bcf1b7
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile4.png
new file mode 100755
index 0000000..3db2003
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile5.png
new file mode 100755
index 0000000..498b6d9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile6.png
new file mode 100755
index 0000000..5b2ff52
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile7.png
new file mode 100755
index 0000000..8808022
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile8.png
new file mode 100755
index 0000000..ef2bae6
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur.png
new file mode 100755
index 0000000..127e29d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur0.png
new file mode 100755
index 0000000..e9b572b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur1.png
new file mode 100755
index 0000000..8b4f731
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur2.png
new file mode 100755
index 0000000..226d23e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur3.png
new file mode 100755
index 0000000..4a94545
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur4.png
new file mode 100755
index 0000000..4e13670
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur5.png
new file mode 100755
index 0000000..d9e2539
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur6.png
new file mode 100755
index 0000000..f0fd886
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur7.png
new file mode 100755
index 0000000..d18652c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur8.png
new file mode 100755
index 0000000..3a69842
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe.png
new file mode 100755
index 0000000..2ff8d6d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe0.png
new file mode 100755
index 0000000..cdd0c2d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe1.png
new file mode 100755
index 0000000..7dc2405
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe2.png
new file mode 100755
index 0000000..e947271
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe3.png
new file mode 100755
index 0000000..f881320
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe4.png
new file mode 100755
index 0000000..484214e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe5.png
new file mode 100755
index 0000000..49e26fc
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe6.png
new file mode 100755
index 0000000..ffc8cd1
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe7.png
new file mode 100755
index 0000000..d505a14
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe8.png
new file mode 100755
index 0000000..1fb13eb
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/help.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/help.png
new file mode 100755
index 0000000..e7faca5
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/help.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/incorrect.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/incorrect.png
new file mode 100755
index 0000000..49ee2a2
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/incorrect.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo.png
new file mode 100755
index 0000000..22da95d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo0.png
new file mode 100755
index 0000000..c315490
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo1.png
new file mode 100755
index 0000000..a3439d8
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo2.png
new file mode 100755
index 0000000..439cb5d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo3.png
new file mode 100755
index 0000000..3a69842
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo4.png
new file mode 100755
index 0000000..21cf9d3
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo5.png
new file mode 100755
index 0000000..274c132
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo6.png
new file mode 100755
index 0000000..6d498a4
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo7.png
new file mode 100755
index 0000000..58c9350
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo8.png
new file mode 100755
index 0000000..6061eaa
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus.png
new file mode 100755
index 0000000..16576b9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus0.png
new file mode 100755
index 0000000..3479f45
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus1.png
new file mode 100755
index 0000000..076ed8d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus2.png
new file mode 100755
index 0000000..076ed8d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus3.png
new file mode 100755
index 0000000..de27174
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus4.png
new file mode 100755
index 0000000..cf5de59
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus5.png
new file mode 100755
index 0000000..356abaf
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus6.png
new file mode 100755
index 0000000..4917d16
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus7.png
new file mode 100755
index 0000000..b8b22e3
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus8.png
new file mode 100755
index 0000000..986e600
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda.png
new file mode 100755
index 0000000..2c4c9b9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda0.png
new file mode 100755
index 0000000..0beb71f
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda1.png
new file mode 100755
index 0000000..fa250a6
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda2.png
new file mode 100755
index 0000000..de5efbb
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda3.png
new file mode 100755
index 0000000..bfc0878
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda4.png
new file mode 100755
index 0000000..545d8ce
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda5.png
new file mode 100755
index 0000000..5a744c7
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda6.png
new file mode 100755
index 0000000..3a9a5d7
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda7.png
new file mode 100755
index 0000000..77866e9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda8.png
new file mode 100755
index 0000000..bf1f2be
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros.png
new file mode 100755
index 0000000..2ccd3b8
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros0.png
new file mode 100755
index 0000000..64aa29e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros1.png
new file mode 100755
index 0000000..1ec1192
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros2.png
new file mode 100755
index 0000000..e2e5d02
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros3.png
new file mode 100755
index 0000000..db94e99
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros4.png
new file mode 100755
index 0000000..fb65f0c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros5.png
new file mode 100755
index 0000000..e3a6fe3
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros6.png
new file mode 100755
index 0000000..4de7c10
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros7.png
new file mode 100755
index 0000000..1b959f3
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros8.png
new file mode 100755
index 0000000..c5d3ec9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_lt.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_rt.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/volImage.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/volImage.png
new file mode 100755
index 0000000..04ec789
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/volImage.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale.png
new file mode 100755
index 0000000..44f547b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale0.png
new file mode 100755
index 0000000..4ce8c53
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale1.png
new file mode 100755
index 0000000..cf3ac85
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale2.png
new file mode 100755
index 0000000..c929bd2
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale3.png
new file mode 100755
index 0000000..cc88497
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale4.png
new file mode 100755
index 0000000..ce1c5a8
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale5.png
new file mode 100755
index 0000000..d81882e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale6.png
new file mode 100755
index 0000000..68b7e39
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale7.png
new file mode 100755
index 0000000..72697a1
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale8.png
new file mode 100755
index 0000000..fe072af
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra.png
new file mode 100755
index 0000000..0a1ef68
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra0.png
new file mode 100755
index 0000000..95a838d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra1.png
new file mode 100755
index 0000000..369f561
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra2.png
new file mode 100755
index 0000000..c813d08
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra3.png
new file mode 100755
index 0000000..6c719c9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra4.png
new file mode 100755
index 0000000..7b4a4cc
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra5.png
new file mode 100755
index 0000000..cda7488
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra6.png
new file mode 100755
index 0000000..7fb5451
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra7.png
new file mode 100755
index 0000000..7f90469
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra8.png
new file mode 100755
index 0000000..b4a117f
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyAnimals/css/lesson.css b/examples/lessons/6_English_VocabularyAnimals/css/lesson.css
new file mode 100755
index 0000000..0a38c18
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/css/lesson.css
@@ -0,0 +1,306 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: absolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ /*width: 251px;*/
+ padding-right: 5px;
+ padding-top: 5px;
+}
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+a img{
+ border: 0;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0px auto;
+ margin-top: 85px;
+ width: 100%;
+ height: 400px;
+
+}
+ #section{
+ width: 1000px;
+ height: 390px;
+ margin: 5px auto;
+ }
+
+ #topText{
+ margin: 1px auto;
+ height: 25px;
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #0000FF;
+ text-align:center;
+ }
+ #imgAnimalsDisplay{
+ margin: 5px auto;
+ width: 300px;
+ height: 300px;
+ text-align:center;
+ }
+ #animalText{
+ margin: 5px auto;
+ width: 175px;
+ height: 25px;
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #000000;
+ text-align:center;
+
+ }
+
+ /*** 2nd section ****/
+ #infoText{
+ padding: 5px;
+ width: 500px;
+ height: 30px;
+ font: 15px/20px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #000000;
+ text-align:center;
+
+ }
+ .imgVol{
+ float:left;
+ width: 48px;
+ height: 48px;
+ background-image: url(../assets/image/volImage.png);
+ }
+ #imgPuzzleArea{
+ margin-left: 100px;
+ margin-top: 15px;
+ width: 306px;
+ height: 306px;
+ border:1px solid #A8F42D;
+ }
+ .imgPuzzle{
+ float: left;
+ width: 100px;
+ height: 100px;
+ border:1px solid #A8F42D;
+ }
+ .default{
+ background-color: #C8FFC2;
+ }
+
+ #dragImgSection{
+ position:absolute;
+ top: 25%;
+ right: 5%;
+ width: 510px;
+ height: 306px;
+ border:1px solid #A8F42D;
+ }
+ .imgAnim{
+ margin-top: 75px;
+ }
+
+ .drophover{
+ background: #FF9900;
+ }
+
+
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+
+ #confirmSection{
+ position: absolute;
+ top: 20%;
+ left: 42%;
+ width: 580px;
+ height: 350px;
+
+ }
+ #checkAnswer{
+ float:left;
+ margin-top: 50px;
+ width: 100px;
+ height: 92px;
+ }
+
+ #confirmBox{
+ margin-top: 50px;
+ margin-left:30px;
+ width: 300px;
+ height: 250px;
+ border: 2px solid #E2D97F;
+ background-color: #000;
+ opacity: 0.8;
+ -moz-border-radius : 20px;
+ -webkit-border-radius : 20px;
+ border-radius : 20px;
+
+ }
+
+ #confimBtn{
+ margin: 1em auto;
+ width: 120px;
+ height: 35px;
+ background: url(../assets/image/confirm.png);
+ }
+ #dragTxtSection{
+ position: absolute;
+ margin: 0.5em auto;
+ top: 8%;
+ right: 10%;
+ width: 100px;
+ height: 303px;
+ border: 2px solid #FF9900;
+ text-align:center;
+ }
+
+ #help{
+ position:absolute;
+ right: 20%;
+ top: 1%;
+ width: 224px;
+ height: 525px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+ #gameOver{
+ position:absolute;
+ top: 40%;
+ left: 25%;
+ width: 500px;
+ text-align:center;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ color:red;
+ }
+ #gameOverInfo{
+ margin-top: 35px;
+ text-align:center;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#06D946;
+
+ }
+ .specialText{
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF9900;
+ border-bottom: 2px dotted #CCC;
+ } \ No newline at end of file
diff --git a/examples/lessons/6_English_VocabularyAnimals/index.html b/examples/lessons/6_English_VocabularyAnimals/index.html
new file mode 100755
index 0000000..a3a5553
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/index.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="confirmSection"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyAnimals/js/jquery-1.4.js b/examples/lessons/6_English_VocabularyAnimals/js/jquery-1.4.js
new file mode 100755
index 0000000..a448490
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/js/jquery-1.4.js
@@ -0,0 +1,5999 @@
+/*!
+ * jQuery JavaScript Library v1.4
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://docs.jquery.com/License
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Jan 13 15:23:05 2010 -0500
+ */
+(function( window, undefined ) {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
+
+ // Is it a simple selector
+ isSimple = /^.[^:#\[\.,]*$/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // Has the ready events already been bound?
+ readyBound = false,
+
+ // The functions to execute on DOM ready
+ readyList = [],
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ indexOf = Array.prototype.indexOf;
+
+jQuery.fn = jQuery.prototype = {
+ init: function( selector, context ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ match = quickExpr.exec( selector );
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
+ }
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ if ( elem ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $("TAG")
+ } else if ( !context && /^\w+$/.test( selector ) ) {
+ this.selector = selector;
+ this.context = document;
+ selector = document.getElementsByTagName( selector );
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return jQuery( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.isArray( selector ) ?
+ this.setArray( selector ) :
+ jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.4",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = jQuery( elems || null );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Force the current matched set of elements to become
+ // the specified array of elements (destroying the stack in the process)
+ // You should use pushStack() in order to do this, but maintain the stack
+ setArray: function( elems ) {
+ // Resetting the length to 0, then using the native Array push
+ // is a super-fast way to populate an object with array-like properties
+ this.length = 0;
+ push.apply( this, elems );
+
+ return this;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // If the DOM is already ready
+ if ( jQuery.isReady ) {
+ // Execute the function immediately
+ fn.call( document, jQuery );
+
+ // Otherwise, remember the function for later
+ } else if ( readyList ) {
+ // Add the function to the wait list
+ readyList.push( fn );
+ }
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || jQuery(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ // copy reference to target object
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging object literal values or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
+ var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
+ : jQuery.isArray(copy) ? [] : {};
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ window.$ = _$;
+
+ if ( deep ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // Handle when the DOM is ready
+ ready: function() {
+ // Make sure that the DOM is not already loaded
+ if ( !jQuery.isReady ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 13 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If there are functions bound, to execute
+ if ( readyList ) {
+ // Execute all of them
+ var fn, i = 0;
+ while ( (fn = readyList[ i++ ]) ) {
+ fn.call( document, jQuery );
+ }
+
+ // Reset the list of functions
+ readyList = null;
+ }
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyBound ) {
+ return;
+ }
+
+ readyBound = true;
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ return jQuery.ready();
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent("onreadystatechange", DOMContentLoaded);
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return toString.call(obj) === "[object Function]";
+ },
+
+ isArray: function( obj ) {
+ return toString.call(obj) === "[object Array]";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor
+ && !hasOwnProperty.call(obj, "constructor")
+ && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwnProperty.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ noop: function() {},
+
+ // Evalulates a script in a global context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test(data) ) {
+ // Inspired by code by Andrea Giammarchi
+ // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+ var head = document.getElementsByTagName("head")[0] || document.documentElement,
+ script = document.createElement("script");
+
+ script.type = "text/javascript";
+
+ if ( jQuery.support.scriptEval ) {
+ script.appendChild( document.createTextNode( data ) );
+ } else {
+ script.text = data;
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709).
+ head.insertBefore( script, head.firstChild );
+ head.removeChild( script );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction(object);
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( var value = object[0];
+ i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+ }
+ }
+
+ return object;
+ },
+
+ trim: function( text ) {
+ return (text || "").replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+ if ( array.indexOf ) {
+ return array.indexOf( elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length, j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [];
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ if ( !inv !== !callback( elems[ i ], i ) ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var ret = [], value;
+
+ // Go through the array, translating each of the items to their
+ // new value (or values).
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ proxy: function( fn, proxy, thisObject ) {
+ if ( arguments.length === 2 ) {
+ if ( typeof proxy === "string" ) {
+ thisObject = fn;
+ fn = thisObject[ proxy ];
+ proxy = undefined;
+
+ } else if ( proxy && !jQuery.isFunction( proxy ) ) {
+ thisObject = proxy;
+ proxy = undefined;
+ }
+ }
+
+ if ( !proxy && fn ) {
+ proxy = function() {
+ return fn.apply( thisObject || this, arguments );
+ };
+ }
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ if ( fn ) {
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+ }
+
+ // So proxy can be declared as an argument
+ return proxy;
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ var ret = { browser: "" };
+
+ ua = ua.toLowerCase();
+
+ if ( /webkit/.test( ua ) ) {
+ ret = { browser: "webkit", version: /webkit[\/ ]([\w.]+)/ };
+
+ } else if ( /opera/.test( ua ) ) {
+ ret = { browser: "opera", version: /version/.test( ua ) ? /version[\/ ]([\w.]+)/ : /opera[\/ ]([\w.]+)/ };
+
+ } else if ( /msie/.test( ua ) ) {
+ ret = { browser: "msie", version: /msie ([\w.]+)/ };
+
+ } else if ( /mozilla/.test( ua ) && !/compatible/.test( ua ) ) {
+ ret = { browser: "mozilla", version: /rv:([\w.]+)/ };
+ }
+
+ ret.version = (ret.version && ret.version.exec( ua ) || [0, "0"])[1];
+
+ return ret;
+ },
+
+ browser: {}
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+if ( indexOf ) {
+ jQuery.inArray = function( elem, array ) {
+ return indexOf.call( array, elem );
+ };
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch( error ) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+if ( indexOf ) {
+ jQuery.inArray = function( elem, array ) {
+ return indexOf.call( array, elem );
+ };
+}
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+// Mutifunctional method to get and set values to a collection
+// The value/s can be optionally by executed if its a function
+function access( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : null;
+}
+
+function now() {
+ return (new Date).getTime();
+}
+(function() {
+
+ jQuery.support = {};
+
+ var root = document.documentElement,
+ script = document.createElement("script"),
+ div = document.createElement("div"),
+ id = "script" + now();
+
+ div.style.display = "none";
+ div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+ var all = div.getElementsByTagName("*"),
+ a = div.getElementsByTagName("a")[0];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return;
+ }
+
+ jQuery.support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: div.firstChild.nodeType === 3,
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText insted)
+ style: /red/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: a.getAttribute("href") === "/a",
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: div.getElementsByTagName("input")[0].value === "on",
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
+
+ // Will be defined later
+ scriptEval: false,
+ noCloneEvent: true,
+ boxModel: null
+ };
+
+ script.type = "text/javascript";
+ try {
+ script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
+ } catch(e) {}
+
+ root.insertBefore( script, root.firstChild );
+
+ // Make sure that the execution of code works by injecting a script
+ // tag with appendChild/createTextNode
+ // (IE doesn't support this, fails, and uses .text instead)
+ if ( window[ id ] ) {
+ jQuery.support.scriptEval = true;
+ delete window[ id ];
+ }
+
+ root.removeChild( script );
+
+ if ( div.attachEvent && div.fireEvent ) {
+ div.attachEvent("onclick", function click() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ jQuery.support.noCloneEvent = false;
+ div.detachEvent("onclick", click);
+ });
+ div.cloneNode(true).fireEvent("onclick");
+ }
+
+ // Figure out if the W3C box model works as expected
+ // document.body must exist before we can do this
+ // TODO: This timeout is temporary until I move ready into core.js.
+ jQuery(function() {
+ var div = document.createElement("div");
+ div.style.width = div.style.paddingLeft = "1px";
+
+ document.body.appendChild( div );
+ jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+ document.body.removeChild( div ).style.display = 'none';
+ div = null;
+ });
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+ var eventSupported = function( eventName ) {
+ var el = document.createElement("div");
+ eventName = "on" + eventName;
+
+ var isSupported = (eventName in el);
+ if ( !isSupported ) {
+ el.setAttribute(eventName, "return;");
+ isSupported = typeof el[eventName] === "function";
+ }
+ el = null;
+
+ return isSupported;
+ };
+
+ jQuery.support.submitBubbles = eventSupported("submit");
+ jQuery.support.changeBubbles = eventSupported("change");
+
+ // release memory in IE
+ root = script = div = all = a = null;
+})();
+
+jQuery.props = {
+ "for": "htmlFor",
+ "class": "className",
+ readonly: "readOnly",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ rowspan: "rowSpan",
+ colspan: "colSpan",
+ tabindex: "tabIndex",
+ usemap: "useMap",
+ frameborder: "frameBorder"
+};
+var expando = "jQuery" + now(), uuid = 0, windowData = {};
+var emptyObject = {};
+
+jQuery.extend({
+ cache: {},
+
+ expando:expando,
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ "object": true,
+ "applet": true
+ },
+
+ data: function( elem, name, data ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ], cache = jQuery.cache, thisCache;
+
+ // Handle the case where there's no name immediately
+ if ( !name && !id ) {
+ return null;
+ }
+
+ // Compute a unique ID for the element
+ if ( !id ) {
+ id = ++uuid;
+ }
+
+ // Avoid generating a new cache unless none exists and we
+ // want to manipulate it.
+ if ( typeof name === "object" ) {
+ elem[ expando ] = id;
+ thisCache = cache[ id ] = jQuery.extend(true, {}, name);
+ } else if ( cache[ id ] ) {
+ thisCache = cache[ id ];
+ } else if ( typeof data === "undefined" ) {
+ thisCache = emptyObject;
+ } else {
+ thisCache = cache[ id ] = {};
+ }
+
+ // Prevent overriding the named cache with undefined values
+ if ( data !== undefined ) {
+ elem[ expando ] = id;
+ thisCache[ name ] = data;
+ }
+
+ return typeof name === "string" ? thisCache[ name ] : thisCache;
+ },
+
+ removeData: function( elem, name ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
+
+ // If we want to remove a specific section of the element's data
+ if ( name ) {
+ if ( thisCache ) {
+ // Remove the section of cache data
+ delete thisCache[ name ];
+
+ // If we've removed all the data, remove the element's cache
+ if ( jQuery.isEmptyObject(thisCache) ) {
+ jQuery.removeData( elem );
+ }
+ }
+
+ // Otherwise, we want to remove all of the element's data
+ } else {
+ // Clean up the element expando
+ try {
+ delete elem[ expando ];
+ } catch( e ) {
+ // IE has trouble directly removing the expando
+ // but it's ok with using removeAttribute
+ if ( elem.removeAttribute ) {
+ elem.removeAttribute( expando );
+ }
+ }
+
+ // Completely remove the data cache
+ delete cache[ id ];
+ }
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ if ( typeof key === "undefined" && this.length ) {
+ return jQuery.data( this[0] );
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ }
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ } else {
+ return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
+ jQuery.data( this, key, value );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ if ( !elem ) {
+ return;
+ }
+
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( !data ) {
+ return q || [];
+ }
+
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data) );
+
+ } else {
+ q.push( data );
+ }
+
+ return q;
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ), fn = queue.shift();
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function( i, elem ) {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ }
+});
+var rclass = /[\n\t]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rspecialurl = /href|src|style/,
+ rtype = /(button|input)/i,
+ rfocusable = /(button|input|object|select|textarea)/i,
+ rclickable = /^(a|area)$/i,
+ rradiocheck = /radio|checkbox/;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name, fn ) {
+ return this.each(function(){
+ jQuery.attr( this, name, "" );
+ if ( this.nodeType === 1 ) {
+ this.removeAttribute( name );
+ }
+ });
+ },
+
+ addClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.addClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ var classNames = (value || "").split( rspace );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className ) {
+ elem.className = value;
+
+ } else {
+ var className = " " + elem.className + " ";
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
+ elem.className += " " + classNames[c];
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.removeClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ var classNames = (value || "").split(rspace);
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ var className = (" " + elem.className + " ").replace(rclass, " ");
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[c] + " ", " ");
+ }
+ elem.className = className.substring(1, className.length - 1);
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value, isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className, i = 0, self = jQuery(this),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery.data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ if ( value === undefined ) {
+ var elem = this[0];
+
+ if ( elem ) {
+ if ( jQuery.nodeName( elem, "option" ) ) {
+ return (elem.attributes.value || {}).specified ? elem.value : elem.text;
+ }
+
+ // We need to handle select boxes special
+ if ( jQuery.nodeName( elem, "select" ) ) {
+ var index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ if ( option.selected ) {
+ // Get the specifc value for the option
+ value = jQuery(option).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ }
+
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+
+
+ // Everything else, we just grab the value
+ return (elem.value || "").replace(rreturn, "");
+
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction(value);
+
+ return this.each(function(i) {
+ var self = jQuery(this), val = value;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call(this, i, self.val());
+ }
+
+ // Typecast each time if the value is a Function and the appended
+ // value is therefore different each time.
+ if ( typeof val === "number" ) {
+ val += "";
+ }
+
+ if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
+ this.checked = jQuery.inArray( self.val(), val ) >= 0;
+
+ } else if ( jQuery.nodeName( this, "select" ) ) {
+ var values = jQuery.makeArray(val);
+
+ jQuery( "option", this ).each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ this.selectedIndex = -1;
+ }
+
+ } else {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attr: function( elem, name, value, pass ) {
+ // don't set attributes on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery(elem)[name](value);
+ }
+
+ var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
+ // Whether we are setting (or getting)
+ set = value !== undefined;
+
+ // Try to normalize/fix the name
+ name = notxml && jQuery.props[ name ] || name;
+
+ // Only do all the following if this is a node (faster for style)
+ if ( elem.nodeType === 1 ) {
+ // These attributes require special treatment
+ var special = rspecialurl.test( name );
+
+ // Safari mis-reports the default selected property of an option
+ // Accessing the parent's selectedIndex property fixes it
+ if ( name === "selected" && !jQuery.support.optSelected ) {
+ var parent = elem.parentNode;
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ }
+
+ // If applicable, access the attribute via the DOM 0 way
+ if ( name in elem && notxml && !special ) {
+ if ( set ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
+ throw "type property can't be changed";
+ }
+
+ elem[ name ] = value;
+ }
+
+ // browsers index elements by id/name on forms, give priority to attributes.
+ if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
+ return elem.getAttributeNode( name ).nodeValue;
+ }
+
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ if ( name === "tabIndex" ) {
+ var attributeNode = elem.getAttributeNode( "tabIndex" );
+
+ return attributeNode && attributeNode.specified ?
+ attributeNode.value :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+
+ return elem[ name ];
+ }
+
+ if ( !jQuery.support.style && notxml && name === "style" ) {
+ if ( set ) {
+ elem.style.cssText = "" + value;
+ }
+
+ return elem.style.cssText;
+ }
+
+ if ( set ) {
+ // convert the value to a string (all browsers do this but IE) see #1070
+ elem.setAttribute( name, "" + value );
+ }
+
+ var attr = !jQuery.support.hrefNormalized && notxml && special ?
+ // Some attributes require a special call on IE
+ elem.getAttribute( name, 2 ) :
+ elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return attr === null ? undefined : attr;
+ }
+
+ // elem is actually elem.style ... set the style
+ // Using attr for specific style information is now deprecated. Use style insead.
+ return jQuery.style( elem, name, value );
+ }
+});
+var fcleanup = function( nm ) {
+ return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
+ return "\\" + ch;
+ });
+};
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // For whatever reason, IE has trouble passing the window object
+ // around, causing it to be cloned in the process
+ if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
+ elem = window;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // if data is passed, bind to handler
+ if ( data !== undefined ) {
+ // Create temporary function pointer to original handler
+ var fn = handler;
+
+ // Create unique handler function, wrapped around original handler
+ handler = jQuery.proxy( fn );
+
+ // Store data in unique handler
+ handler.data = data;
+ }
+
+ // Init the element's event structure
+ var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
+ handle = jQuery.data( elem, "handle" ), eventHandle;
+
+ if ( !handle ) {
+ eventHandle = function() {
+ // Handle the second event of a trigger and when
+ // an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+
+ handle = jQuery.data( elem, "handle", eventHandle );
+ }
+
+ // If no handle is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !handle ) {
+ return;
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native
+ // event in IE.
+ handle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split( /\s+/ );
+ var type, i=0;
+ while ( (type = types[ i++ ]) ) {
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ handler.type = namespaces.slice(0).sort().join(".");
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = this.special[ type ] || {};
+
+
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = {};
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, handle, false );
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, handle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers );
+ if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
+ modifiedHandler.guid = modifiedHandler.guid || handler.guid;
+ handler = modifiedHandler;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers[ handler.guid ] = handler;
+
+ // Keep track of which events have been used, for global triggering
+ this.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ var events = jQuery.data( elem, "events" ), ret, type, fn;
+
+ if ( events ) {
+ // Unbind all events for the element
+ if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
+ for ( type in events ) {
+ this.remove( elem, type + (types || "") );
+ }
+ } else {
+ // types is actually an event object here
+ if ( types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(/\s+/);
+ var i = 0;
+ while ( (type = types[ i++ ]) ) {
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ var all = !namespaces.length,
+ cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ),
+ namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"),
+ special = this.special[ type ] || {};
+
+ if ( events[ type ] ) {
+ // remove the given handler for the given type
+ if ( handler ) {
+ fn = events[ type ][ handler.guid ];
+ delete events[ type ][ handler.guid ];
+
+ // remove all handlers for the given type
+ } else {
+ for ( var handle in events[ type ] ) {
+ // Handle the removal of namespaced events
+ if ( all || namespace.test( events[ type ][ handle ].type ) ) {
+ delete events[ type ][ handle ];
+ }
+ }
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, namespaces, fn);
+ }
+
+ // remove generic event handler if no more handlers exist
+ for ( ret in events[ type ] ) {
+ break;
+ }
+ if ( !ret ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
+ } else if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
+ }
+ }
+ ret = null;
+ delete events[ type ];
+ }
+ }
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ for ( ret in events ) {
+ break;
+ }
+ if ( !ret ) {
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) {
+ handle.elem = null;
+ }
+ jQuery.removeData( elem, "events" );
+ jQuery.removeData( elem, "handle" );
+ }
+ }
+ },
+
+ // bubbling is internal
+ trigger: function( event, data, elem /*, bubbling */ ) {
+ // Event object or event type
+ var type = event.type || event,
+ bubbling = arguments[3];
+
+ if ( !bubbling ) {
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[expando] ? event :
+ // Object literal
+ jQuery.extend( jQuery.Event(type), event ) :
+ // Just the event type (string)
+ jQuery.Event(type);
+
+ if ( type.indexOf("!") >= 0 ) {
+ event.type = type = type.slice(0, -1);
+ event.exclusive = true;
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // Don't bubble custom events when global (to avoid too much overhead)
+ event.stopPropagation();
+
+ // Only trigger if we've ever bound an event for it
+ if ( this.global[ type ] ) {
+ jQuery.each( jQuery.cache, function() {
+ if ( this.events && this.events[type] ) {
+ jQuery.event.trigger( event, data, this.handle.elem );
+ }
+ });
+ }
+ }
+
+ // Handle triggering a single element
+
+ // don't do events on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // Clean up in case it is reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone the incoming data, if any
+ data = jQuery.makeArray( data );
+ data.unshift( event );
+ }
+
+ event.currentTarget = elem;
+
+ // Trigger the event, it is assumed that "handle" is a function
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) {
+ handle.apply( elem, data );
+ }
+
+ var nativeFn, nativeHandler;
+ try {
+ if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
+ nativeFn = elem[ type ];
+ nativeHandler = elem[ "on" + type ];
+ }
+ // prevent IE from throwing an error for some elements with some event types, see #3533
+ } catch (e) {}
+
+ var isClick = jQuery.nodeName(elem, "a") && type === "click";
+
+ // Trigger the native events (except for clicks on links)
+ if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !isClick ) {
+ this.triggered = true;
+ try {
+ elem[ type ]();
+ // prevent IE from throwing an error for some hidden elements
+ } catch (e) {}
+
+ // Handle triggering native .onfoo handlers
+ } else if ( nativeHandler && elem[ "on" + type ].apply( elem, data ) === false ) {
+ event.result = false;
+ }
+
+ this.triggered = false;
+
+ if ( !event.isPropagationStopped() ) {
+ var parent = elem.parentNode || elem.ownerDocument;
+ if ( parent ) {
+ jQuery.event.trigger( event, data, parent, true );
+ }
+ }
+ },
+
+ handle: function( event ) {
+ // returned undefined or false
+ var all, handlers;
+
+ event = arguments[0] = jQuery.event.fix( event || window.event );
+ event.currentTarget = this;
+
+ // Namespaced event handlers
+ var namespaces = event.type.split(".");
+ event.type = namespaces.shift();
+
+ // Cache this now, all = true means, any handler
+ all = !namespaces.length && !event.exclusive;
+
+ var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
+
+ handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
+
+ for ( var j in handlers ) {
+ var handler = handlers[ j ];
+
+ // Filter the functions by class
+ if ( all || namespace.test(handler.type) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handler;
+ event.data = handler.data;
+
+ var ret = handler.apply( this, arguments );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+
+ }
+ }
+
+ return event.result;
+ },
+
+ props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+
+ fix: function( event ) {
+ if ( event[ expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var doc = document.documentElement, body = document.body;
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
+ event.which = event.charCode || event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( proxy, data, namespaces, live ) {
+ jQuery.extend( proxy, data || {} );
+
+ proxy.guid += data.selector + data.live;
+ jQuery.event.add( this, data.live, liveHandler, data );
+
+ },
+
+ remove: function( namespaces ) {
+ if ( namespaces.length ) {
+ var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
+
+ jQuery.each( (jQuery.data(this, "events").live || {}), function() {
+ if ( name.test(this.type) ) {
+ remove++;
+ }
+ });
+
+ if ( remove < 1 ) {
+ jQuery.event.remove( this, namespaces[0], liveHandler );
+ }
+ }
+ },
+ special: {}
+ },
+ beforeunload: {
+ setup: function( data, namespaces, fn ) {
+ // We only want to do this special case on windows
+ if ( this.setInterval ) {
+ this.onbeforeunload = fn;
+ }
+
+ return false;
+ },
+ teardown: function( namespaces, fn ) {
+ if ( this.onbeforeunload === fn ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+jQuery.Event = function( src ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = now();
+
+ // Mark it as fixed
+ this[ expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+ }
+ // otherwise set the returnValue property of the original event to false (IE)
+ e.returnValue = false;
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+ // Check if mouse(over|out) are still within the same parent element
+ var parent = event.relatedTarget;
+
+ // Traverse up the tree
+ while ( parent && parent !== this ) {
+ // Firefox sometimes assigns relatedTarget a XUL element
+ // which we cannot access the parentNode property of
+ try {
+ parent = parent.parentNode;
+
+ // assuming we've left the element since we most likely mousedover a xul element
+ } catch(e) {
+ break;
+ }
+ }
+
+ if ( parent !== this ) {
+ // set the correct event type
+ event.type = event.data;
+
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+jQuery.event.special.submit = {
+ setup: function( data, namespaces, fn ) {
+ if ( this.nodeName.toLowerCase() !== "form" ) {
+ jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ remove: function( namespaces, fn ) {
+ jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") );
+ jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") );
+ }
+};
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+var formElems = /textarea|input|select/i;
+
+function getVal( elem ) {
+ var type = elem.type, val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( elem.nodeName.toLowerCase() === "select" ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+}
+
+function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery.data( elem, "_change_data" );
+ val = getVal(elem);
+
+ if ( val === data ) {
+ return;
+ }
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery.data( elem, "_change_data", val );
+ }
+
+ if ( elem.type !== "select" && (data != null || val) ) {
+ e.type = "change";
+ return jQuery.event.trigger( e, arguments[1], this );
+ }
+}
+
+jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information/focus[in] is not needed anymore
+ beforeactivate: function( e ) {
+ var elem = e.target;
+
+ if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) {
+ jQuery.data( elem, "_change_data", getVal(elem) );
+ }
+ }
+ },
+ setup: function( data, namespaces, fn ) {
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] );
+ }
+
+ return formElems.test( this.nodeName );
+ },
+ remove: function( namespaces, fn ) {
+ for ( var type in changeFilters ) {
+ jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] );
+ }
+
+ return formElems.test( this.nodeName );
+ }
+};
+
+var changeFilters = jQuery.event.special.change.filters;
+
+}
+
+function trigger( type, elem, args ) {
+ args[0].type = type;
+ return jQuery.event.handle.apply( elem, args );
+}
+
+// Create "bubbling" focus and blur events
+if ( document.addEventListener ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ this.addEventListener( orig, handler, true );
+ },
+ teardown: function() {
+ this.removeEventListener( orig, handler, true );
+ }
+ };
+
+ function handler( e ) {
+ e = jQuery.event.fix( e );
+ e.type = fix;
+ return jQuery.event.handle.call( this, e );
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( jQuery.isFunction( data ) ) {
+ thisObject = fn;
+ fn = data;
+ data = undefined;
+ }
+
+ var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ }) : fn;
+
+ return type === "unload" && name !== "one" ?
+ this.one( type, data, fn, thisObject ) :
+ this.each(function() {
+ jQuery.event.add( this, type, handler, data );
+ });
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+ return this;
+ }
+
+ return this.each(function() {
+ jQuery.event.remove( this, type, fn );
+ });
+ },
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ var event = jQuery.Event( type );
+ event.preventDefault();
+ event.stopPropagation();
+ jQuery.event.trigger( event, data, this[0] );
+ return event.result;
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments, i = 1;
+
+ // link all the functions, so any of them can unbind this click handler
+ while ( i < args.length ) {
+ jQuery.proxy( fn, args[ i++ ] );
+ }
+
+ return this.click( jQuery.proxy( fn, function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ }));
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ },
+
+ live: function( type, data, fn ) {
+ if ( jQuery.isFunction( data ) ) {
+ fn = data;
+ data = undefined;
+ }
+
+ jQuery( this.context ).bind( liveConvert( type, this.selector ), {
+ data: data, selector: this.selector, live: type
+ }, fn );
+
+ return this;
+ },
+
+ die: function( type, fn ) {
+ jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
+ return this;
+ }
+});
+
+function liveHandler( event ) {
+ var stop = true, elems = [], selectors = [], args = arguments,
+ related, match, fn, elem, j, i, data,
+ live = jQuery.extend({}, jQuery.data( this, "events" ).live);
+
+ for ( j in live ) {
+ fn = live[j];
+ if ( fn.live === event.type ||
+ fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) {
+
+ data = fn.data;
+ if ( !(data.beforeFilter && data.beforeFilter[event.type] &&
+ !data.beforeFilter[event.type](event)) ) {
+ selectors.push( fn.selector );
+ }
+ } else {
+ delete live[j];
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ for ( j in live ) {
+ fn = live[j];
+ elem = match[i].elem;
+ related = null;
+
+ if ( match[i].selector === fn.selector ) {
+ // Those two events require additional checking
+ if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) {
+ related = jQuery( event.relatedTarget ).closest( fn.selector )[0];
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, fn: fn });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+ event.currentTarget = match.elem;
+ event.data = match.fn.data;
+ if ( match.fn.apply( match.elem, args ) === false ) {
+ stop = false;
+ break;
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "&")].join(".");
+}
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( fn ) {
+ return fn ? this.bind( name, fn ) : this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+// Prevent memory leaks in IE
+// Window isn't included so as not to unbind existing unload events
+// More info:
+// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
+if ( window.attachEvent && !window.addEventListener ) {
+ window.attachEvent("onunload", function() {
+ for ( var id in jQuery.cache ) {
+ if ( jQuery.cache[ id ].handle ) {
+ // Try/Catch is to handle iframes being unloaded, see #4280
+ try {
+ jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+ } catch(e) {}
+ }
+ }
+ });
+}
+/*!
+ * Sizzle CSS Selector Engine - v1.0
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function(){
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function(selector, context, results, seed) {
+ results = results || [];
+ var origContext = context = context || document;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+ var ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
+ }
+
+ if ( context ) {
+ var ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+ set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray(set);
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ var cur = parts.pop(), pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ throw "Syntax error, unrecognized expression: " + (cur || selector);
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+ } else if ( context && context.nodeType === 1 ) {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+ } else {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function(results){
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort(sortOrder);
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[i-1] ) {
+ results.splice(i--, 1);
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function(expr, set){
+ return Sizzle(expr, null, null, set);
+};
+
+Sizzle.find = function(expr, context, isXML){
+ var set, match;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var type = Expr.order[i], match;
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace(/\\/g, "");
+ set = Expr.find[ type ]( match, context, isXML );
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = context.getElementsByTagName("*");
+ }
+
+ return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+ var old = expr, result = [], curLoop = set, match, anyFound,
+ isXMLFilter = set && set[0] && isXML(set[0]);
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var filter = Expr.filter[ type ], found, item, left = match[1];
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+ } else {
+ curLoop[i] = false;
+ }
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ throw "Syntax error, unrecognized expression: " + expr;
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+var Expr = Sizzle.selectors = {
+ order: [ "ID", "NAME", "TAG" ],
+ match: {
+ ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
+ TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
+ CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+ },
+ leftMatch: {},
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+ attrHandle: {
+ href: function(elem){
+ return elem.getAttribute("href");
+ }
+ },
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !/\W/.test(part),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part){
+ var isPartStr = typeof part === "string";
+
+ if ( isPartStr && !/\W/.test(part) ) {
+ part = part.toLowerCase();
+
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+ } else {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+ "": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = part.toLowerCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+ },
+ "~": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = part.toLowerCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
+ }
+ },
+ find: {
+ ID: function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? [m] : [];
+ }
+ },
+ NAME: function(match, context){
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [], results = context.getElementsByName(match[1]);
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+ TAG: function(match, context){
+ return context.getElementsByTagName(match[1]);
+ }
+ },
+ preFilter: {
+ CLASS: function(match, curLoop, inplace, result, not, isXML){
+ match = " " + match[1].replace(/\\/g, "") + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+ ID: function(match){
+ return match[1].replace(/\\/g, "");
+ },
+ TAG: function(match, curLoop){
+ return match[1].toLowerCase();
+ },
+ CHILD: function(match){
+ if ( match[1] === "nth" ) {
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+ ATTR: function(match, curLoop, inplace, result, not, isXML){
+ var name = match[1].replace(/\\/g, "");
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+ PSEUDO: function(match, curLoop, inplace, result, not){
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+ return false;
+ }
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+ POS: function(match){
+ match.unshift( true );
+ return match;
+ }
+ },
+ filters: {
+ enabled: function(elem){
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+ disabled: function(elem){
+ return elem.disabled === true;
+ },
+ checked: function(elem){
+ return elem.checked === true;
+ },
+ selected: function(elem){
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ elem.parentNode.selectedIndex;
+ return elem.selected === true;
+ },
+ parent: function(elem){
+ return !!elem.firstChild;
+ },
+ empty: function(elem){
+ return !elem.firstChild;
+ },
+ has: function(elem, i, match){
+ return !!Sizzle( match[3], elem ).length;
+ },
+ header: function(elem){
+ return /h\d/i.test( elem.nodeName );
+ },
+ text: function(elem){
+ return "text" === elem.type;
+ },
+ radio: function(elem){
+ return "radio" === elem.type;
+ },
+ checkbox: function(elem){
+ return "checkbox" === elem.type;
+ },
+ file: function(elem){
+ return "file" === elem.type;
+ },
+ password: function(elem){
+ return "password" === elem.type;
+ },
+ submit: function(elem){
+ return "submit" === elem.type;
+ },
+ image: function(elem){
+ return "image" === elem.type;
+ },
+ reset: function(elem){
+ return "reset" === elem.type;
+ },
+ button: function(elem){
+ return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
+ },
+ input: function(elem){
+ return /input|select|textarea|button/i.test(elem.nodeName);
+ }
+ },
+ setFilters: {
+ first: function(elem, i){
+ return i === 0;
+ },
+ last: function(elem, i, match, array){
+ return i === array.length - 1;
+ },
+ even: function(elem, i){
+ return i % 2 === 0;
+ },
+ odd: function(elem, i){
+ return i % 2 === 1;
+ },
+ lt: function(elem, i, match){
+ return i < match[3] - 0;
+ },
+ gt: function(elem, i, match){
+ return i > match[3] - 0;
+ },
+ nth: function(elem, i, match){
+ return match[3] - 0 === i;
+ },
+ eq: function(elem, i, match){
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ } else {
+ throw "Syntax error, unrecognized expression: " + name;
+ }
+ },
+ CHILD: function(elem, match){
+ var type = match[1], node = elem;
+ switch (type) {
+ case 'only':
+ case 'first':
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ if ( type === "first" ) {
+ return true;
+ }
+ node = elem;
+ case 'last':
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ return true;
+ case 'nth':
+ var first = match[2], last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+ if ( first === 0 ) {
+ return diff === 0;
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+ ID: function(elem, match){
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+ TAG: function(elem, match){
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+ CLASS: function(elem, match){
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+ ATTR: function(elem, match){
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+ POS: function(elem, match, i, array){
+ var name = match[2], filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS;
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
+ return "\\" + (num - 0 + 1);
+ }));
+}
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 );
+
+// Provide a fallback method if it does not work
+} catch(e){
+ makeArray = function(array, results) {
+ var ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var i = 0, l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+ } else {
+ for ( var i = 0; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( "sourceIndex" in document.documentElement ) {
+ sortOrder = function( a, b ) {
+ if ( !a.sourceIndex || !b.sourceIndex ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.sourceIndex ? -1 : 1;
+ }
+
+ var ret = a.sourceIndex - b.sourceIndex;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( document.createRange ) {
+ sortOrder = function( a, b ) {
+ if ( !a.ownerDocument || !b.ownerDocument ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.ownerDocument ? -1 : 1;
+ }
+
+ var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
+ aRange.setStart(a, 0);
+ aRange.setEnd(a, 0);
+ bRange.setStart(b, 0);
+ bRange.setEnd(b, 0);
+ var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+function getText( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date).getTime();
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+ }
+ };
+
+ Expr.filter.ID = function(elem, match){
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+ root = form = null; // release memory in IE
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+ Expr.attrHandle.href = function(elem){
+ return elem.getAttribute("href", 2);
+ };
+ }
+
+ div = null; // release memory in IE
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle, div = document.createElement("div");
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && context.nodeType === 9 && !isXML(context) ) {
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(e){}
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ div = null; // release memory in IE
+ })();
+}
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function(match, context, isXML) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ div = null; // release memory in IE
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+var contains = document.compareDocumentPosition ? function(a, b){
+ return a.compareDocumentPosition(b) & 16;
+} : function(a, b){
+ return a !== b && (a.contains ? a.contains(b) : true);
+};
+
+var isXML = function(elem){
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function(selector, context){
+ var tmpSet = [], later = "", match,
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.getText = getText;
+jQuery.isXMLDoc = isXML;
+jQuery.contains = contains;
+
+return;
+
+window.Sizzle = Sizzle;
+
+})();
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ slice = Array.prototype.slice;
+
+// Implement the identical functionality for filter and not
+var winnow = function( elements, qualifier, keep ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return !!qualifier.call( elem, i, elem ) === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+};
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var ret = this.pushStack( "", "find", selector ), length = 0;
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( var n = length; n < ret.length; n++ ) {
+ for ( var r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && jQuery.filter( selector, this ).length > 0;
+ },
+
+ closest: function( selectors, context ) {
+ if ( jQuery.isArray( selectors ) ) {
+ var ret = [], cur = this[0], match, matches = {}, selector;
+
+ if ( cur && selectors.length ) {
+ for ( var i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[selector] ) {
+ matches[selector] = jQuery.expr.match.POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[selector];
+
+ if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
+ ret.push({ selector: selector, elem: cur });
+ delete matches[selector];
+ }
+ }
+ cur = cur.parentNode;
+ }
+ }
+
+ return ret;
+ }
+
+ var pos = jQuery.expr.match.POS.test( selectors ) ?
+ jQuery( selectors, context || this.context ) : null;
+
+ return this.map(function( i, cur ) {
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
+ return cur;
+ }
+ cur = cur.parentNode;
+ }
+ return null;
+ });
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ if ( !elem || typeof elem === "string" ) {
+ return jQuery.inArray( this[0],
+ // If it receives a string, the selector is used
+ // If it receives nothing, the siblings are used
+ elem ? jQuery( elem ) : this.parent().children() );
+ }
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context || this.context ) :
+ jQuery.makeArray( selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, slice.call(arguments).join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [], cur = elem[dir];
+ while ( cur && cur.nodeType !== 9 && (until === undefined || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
+ rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&\w+;/,
+ fcloseTag = function( all, front, tag ) {
+ return rselfClosing.test( tag ) ?
+ all :
+ front + "></" + tag + ">";
+ },
+ wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ area: [ 1, "<map>", "</map>" ],
+ _default: [ 0, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ return self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.getText( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append(this);
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ return this.each(function() {
+ var self = jQuery( this ), contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ clone: function( events ) {
+ // Do the clone
+ var ret = this.map(function() {
+ if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
+ // IE copies events bound via attachEvent when
+ // using cloneNode. Calling detachEvent on the
+ // clone will also remove the events from the orignal
+ // In order to get around this, we use innerHTML.
+ // Unfortunately, this means some modifications to
+ // attributes in IE that are actually only stored
+ // as properties will not be copied (such as the
+ // the name attribute on an input).
+ var html = this.outerHTML, ownerDocument = this.ownerDocument;
+ if ( !html ) {
+ var div = ownerDocument.createElement("div");
+ div.appendChild( this.cloneNode(true) );
+ html = div.innerHTML;
+ }
+
+ return jQuery.clean([html.replace(rinlinejQuery, "")
+ .replace(rleadingWhitespace, "")], ownerDocument)[0];
+ } else {
+ return this.cloneNode(true);
+ }
+ });
+
+ // Copy the events from the original to the clone
+ if ( events === true ) {
+ cloneCopyEvent( this, ret );
+ cloneCopyEvent( this.find("*"), ret.find("*") );
+ }
+
+ // Return the cloned set
+ return ret;
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !/<script/i.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery(this), old = self.html();
+ self.empty().append(function(){
+ return value.call( this, i, old );
+ });
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( !jQuery.isFunction( value ) ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling, parent = this.parentNode;
+
+ jQuery(this).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, value = args[0], scripts = [];
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ return self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ // If we're in a fragment, just use that instead of building a new one
+ if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
+ results = { fragment: args[0].parentNode };
+ } else {
+ results = buildFragment( args, this, scripts );
+ }
+
+ first = results.fragment.firstChild;
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ results.cacheable || this.length > 1 || i > 0 ?
+ results.fragment.cloneNode(true) :
+ results.fragment
+ );
+ }
+ }
+
+ if ( scripts ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+
+ function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+ }
+ }
+});
+
+function cloneCopyEvent(orig, ret) {
+ var i = 0;
+
+ ret.each(function() {
+ if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
+ return;
+ }
+
+ var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var handler in events[ type ] ) {
+ jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+ }
+ }
+ }
+ });
+}
+
+function buildFragment( args, nodes, scripts ) {
+ var fragment, cacheable, cached, cacheresults, doc;
+
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
+ cacheable = true;
+ cacheresults = jQuery.fragments[ args[0] ];
+ if ( cacheresults ) {
+ if ( cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ cached = true;
+ }
+ }
+
+ if ( !fragment ) {
+ doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+}
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [], insert = jQuery( selector );
+
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+ ret = ret.concat( elems );
+ }
+ return this.pushStack( ret, name, insert.selector );
+ };
+});
+
+jQuery.each({
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
+ if ( !keepData && this.nodeType === 1 ) {
+ cleanData( this.getElementsByTagName("*") );
+ cleanData( [ this ] );
+ }
+
+ if ( this.parentNode ) {
+ this.parentNode.removeChild( this );
+ }
+ }
+ },
+
+ empty: function() {
+ // Remove element nodes and prevent memory leaks
+ if ( this.nodeType === 1 ) {
+ cleanData( this.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( this.firstChild ) {
+ this.removeChild( this.firstChild );
+ }
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function() {
+ return this.each( fn, arguments );
+ };
+});
+
+jQuery.extend({
+ clean: function( elems, context, fragment, scripts ) {
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [];
+
+ jQuery.each(elems, function( i, elem ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ return;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" && !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+
+ } else if ( typeof elem === "string" ) {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, fcloseTag);
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( var j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = jQuery.makeArray( div.childNodes );
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+
+ });
+
+ if ( fragment ) {
+ for ( var i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ }
+});
+
+function cleanData( elems ) {
+ for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
+ if ( !jQuery.noData[elem.nodeName.toLowerCase()] && (id = elem[expando]) ) {
+ delete jQuery.cache[ id ];
+ }
+ }
+}
+// exclude the following css properties to add px
+var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+ ralpha = /alpha\([^)]*\)/,
+ ropacity = /opacity=([^)]*)/,
+ rfloat = /float/i,
+ rdashAlpha = /-([a-z])/ig,
+ rupper = /([A-Z])/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+
+ cssShow = { position: "absolute", visibility: "hidden", display:"block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+
+ // cache check for defaultView.getComputedStyle
+ getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
+ // normalize float css property
+ styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn.css = function( name, value ) {
+ return access( this, name, value, true, function( elem, name, value ) {
+ if ( value === undefined ) {
+ return jQuery.curCSS( elem, name );
+ }
+
+ if ( typeof value === "number" && !rexclude.test(name) ) {
+ value += "px";
+ }
+
+ jQuery.style( elem, name, value );
+ });
+};
+
+jQuery.extend({
+ style: function( elem, name, value ) {
+ // don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // ignore negative width and height values #1599
+ if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
+ value = undefined;
+ }
+
+ var style = elem.style || elem, set = value !== undefined;
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name === "opacity" ) {
+ if ( set ) {
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // Set the alpha filter to set the opacity
+ var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
+ var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
+ style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
+ }
+
+ return style.filter && style.filter.indexOf("opacity=") >= 0 ?
+ (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
+ "";
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( rfloat.test( name ) ) {
+ name = styleFloat;
+ }
+
+ name = name.replace(rdashAlpha, fcamelCase);
+
+ if ( set ) {
+ style[ name ] = value;
+ }
+
+ return style[ name ];
+ },
+
+ css: function( elem, name, force, extra ) {
+ if ( name === "width" || name === "height" ) {
+ var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
+
+ function getWH() {
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
+
+ if ( extra === "border" ) {
+ return;
+ }
+
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
+ }
+
+ if ( extra === "margin" ) {
+ val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
+ } else {
+ val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
+ }
+ });
+ }
+
+ if ( elem.offsetWidth !== 0 ) {
+ getWH();
+ } else {
+ jQuery.swap( elem, props, getWH );
+ }
+
+ return Math.max(0, Math.round(val));
+ }
+
+ return jQuery.curCSS( elem, name, force );
+ },
+
+ curCSS: function( elem, name, force ) {
+ var ret, style = elem.style, filter;
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
+ ret = ropacity.test(elem.currentStyle.filter || "") ?
+ (parseFloat(RegExp.$1) / 100) + "" :
+ "";
+
+ return ret === "" ?
+ "1" :
+ ret;
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( rfloat.test( name ) ) {
+ name = styleFloat;
+ }
+
+ if ( !force && style && style[ name ] ) {
+ ret = style[ name ];
+
+ } else if ( getComputedStyle ) {
+
+ // Only "float" is needed here
+ if ( rfloat.test( name ) ) {
+ name = "float";
+ }
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ var defaultView = elem.ownerDocument.defaultView;
+
+ if ( !defaultView ) {
+ return null;
+ }
+
+ var computedStyle = defaultView.getComputedStyle( elem, null );
+
+ if ( computedStyle ) {
+ ret = computedStyle.getPropertyValue( name );
+ }
+
+ // We should always get a number back from opacity
+ if ( name === "opacity" && ret === "" ) {
+ ret = "1";
+ }
+
+ } else if ( elem.currentStyle ) {
+ var camelCase = name.replace(rdashAlpha, fcamelCase);
+
+ ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+ // Remember the original values
+ var left = style.left, rsLeft = elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret;
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( var name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth, height = elem.offsetHeight,
+ skip = elem.nodeName.toLowerCase() === "tr";
+
+ return width === 0 && height === 0 && !skip ?
+ true :
+ width > 0 && height > 0 && !skip ?
+ false :
+ jQuery.curCSS(elem, "display") === "none";
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+var jsc = now(),
+ rscript = /<script(.|\s)*?\/script>/gi,
+ rselectTextarea = /select|textarea/i,
+ rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
+ jsre = /=\?(&|$)/,
+ rquery = /\?/,
+ rts = /(\?|&)_=.*?(&|$)/,
+ rurl = /^(\w+:)?\/\/([^\/?#]+)/,
+ r20 = /%20/g;
+
+jQuery.fn.extend({
+ // Keep a copy of the old load
+ _load: jQuery.fn.load,
+
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" ) {
+ return this._load( url );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf(" ");
+ if ( off >= 0 ) {
+ var selector = url.slice(off, url.length);
+ url = url.slice(0, off);
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = null;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ context:this,
+ complete: function( res, status ) {
+ // If successful, inject the HTML into all the matched elements
+ if ( status === "success" || status === "notmodified" ) {
+ // See if a selector was specified
+ this.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div />")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(res.responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ res.responseText );
+ }
+
+ if ( callback ) {
+ this.each( callback, [res.responseText, status, res] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param(this.serializeArray());
+ },
+ serializeArray: function() {
+ return this.map(function() {
+ return this.elements ? jQuery.makeArray(this.elements) : this;
+ })
+ .filter(function() {
+ return this.name && !this.disabled &&
+ (this.checked || rselectTextarea.test(this.nodeName) ||
+ rinput.test(this.type));
+ })
+ .map(function( i, elem ) {
+ var val = jQuery(this).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray(val) ?
+ jQuery.map( val, function( val, i ) {
+ return { name: elem.name, value: val };
+ }) :
+ { name: elem.name, value: val };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
+ jQuery.fn[o] = function( f ) {
+ return this.bind(o, f);
+ };
+});
+
+jQuery.extend({
+
+ get: function( url, data, callback, type ) {
+ // shift arguments if data argument was omited
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = null;
+ }
+
+ return jQuery.ajax({
+ type: "GET",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get(url, null, callback, "script");
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get(url, data, callback, "json");
+ },
+
+ post: function( url, data, callback, type ) {
+ // shift arguments if data argument was omited
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = {};
+ }
+
+ return jQuery.ajax({
+ type: "POST",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ ajaxSetup: function( settings ) {
+ jQuery.extend( jQuery.ajaxSettings, settings );
+ },
+
+ ajaxSettings: {
+ url: location.href,
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ username: null,
+ password: null,
+ traditional: false,
+ */
+ // Create the request object; Microsoft failed to properly
+ // implement the XMLHttpRequest in IE7 (can't request local files),
+ // so we use the ActiveXObject when it is available
+ // This function can be overriden by calling jQuery.ajaxSetup
+ xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
+ function() {
+ return new window.XMLHttpRequest();
+ } :
+ function() {
+ try {
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
+ } catch(e) {}
+ },
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ script: "text/javascript, application/javascript",
+ json: "application/json, text/javascript",
+ text: "text/plain",
+ _default: "*/*"
+ }
+ },
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajax: function( origSettings ) {
+ var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
+
+ var jsonp, status, data,
+ callbackContext = s.context || s,
+ type = s.type.toUpperCase();
+
+ // convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Handle JSONP Parameter Callbacks
+ if ( s.dataType === "jsonp" ) {
+ if ( type === "GET" ) {
+ if ( !jsre.test( s.url ) ) {
+ s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+ }
+ } else if ( !s.data || !jsre.test(s.data) ) {
+ s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+ }
+ s.dataType = "json";
+ }
+
+ // Build temporary JSONP function
+ if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
+ jsonp = s.jsonpCallback || ("jsonp" + jsc++);
+
+ // Replace the =? sequence both in the query string and the data
+ if ( s.data ) {
+ s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
+ }
+
+ s.url = s.url.replace(jsre, "=" + jsonp + "$1");
+
+ // We need to make sure
+ // that a JSONP style response is executed properly
+ s.dataType = "script";
+
+ // Handle JSONP-style loading
+ window[ jsonp ] = window[ jsonp ] || function( tmp ) {
+ data = tmp;
+ success();
+ complete();
+ // Garbage collect
+ window[ jsonp ] = undefined;
+
+ try {
+ delete window[ jsonp ];
+ } catch(e) {}
+
+ if ( head ) {
+ head.removeChild( script );
+ }
+ };
+ }
+
+ if ( s.dataType === "script" && s.cache === null ) {
+ s.cache = false;
+ }
+
+ if ( s.cache === false && type === "GET" ) {
+ var ts = now();
+
+ // try replacing _= if it is there
+ var ret = s.url.replace(rts, "$1_=" + ts + "$2");
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
+ }
+
+ // If data is available, append data to url for get requests
+ if ( s.data && type === "GET" ) {
+ s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
+ }
+
+ // Watch for a new set of requests
+ if ( s.global && ! jQuery.active++ ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // Matches an absolute URL, and saves the domain
+ var parts = rurl.exec( s.url ),
+ remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
+
+ // If we're requesting a remote document
+ // and trying to load JSON or Script with a GET
+ if ( s.dataType === "script" && type === "GET" && remote ) {
+ var head = document.getElementsByTagName("head")[0] || document.documentElement;
+ var script = document.createElement("script");
+ script.src = s.url;
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ // Handle Script loading
+ if ( !jsonp ) {
+ var done = false;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function() {
+ if ( !done && (!this.readyState ||
+ this.readyState === "loaded" || this.readyState === "complete") ) {
+ done = true;
+ success();
+ complete();
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+ }
+ };
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+
+ // We handle everything using the script element injection
+ return undefined;
+ }
+
+ var requestDone = false;
+
+ // Create the request object
+ var xhr = s.xhr();
+
+ if ( !xhr ) {
+ return;
+ }
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open(type, s.url, s.async, s.username, s.password);
+ } else {
+ xhr.open(type, s.url, s.async);
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ // Set the correct header, if data is being sent
+ if ( s.data || origSettings && origSettings.contentType ) {
+ xhr.setRequestHeader("Content-Type", s.contentType);
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[s.url] ) {
+ xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
+ }
+
+ if ( jQuery.etag[s.url] ) {
+ xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
+ }
+ }
+
+ // Set header so the called script knows that it's an XMLHttpRequest
+ // Only send the header if it's not a remote XHR
+ if ( !remote ) {
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
+ s.accepts[ s.dataType ] + ", */*" :
+ s.accepts._default );
+ } catch(e) {}
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+
+ // close opended socket
+ xhr.abort();
+ return false;
+ }
+
+ if ( s.global ) {
+ trigger("ajaxSend", [xhr, s]);
+ }
+
+ // Wait for a response to come back
+ var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
+ // The request was aborted
+ if ( !xhr || xhr.readyState === 0 ) {
+ // Opera doesn't call onreadystatechange before this point
+ // so we simulate the call
+ if ( !requestDone ) {
+ complete();
+ }
+
+ requestDone = true;
+ if ( xhr ) {
+ xhr.onreadystatechange = jQuery.noop;
+ }
+
+ // The transfer is complete and the data is available, or the request timed out
+ } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
+ requestDone = true;
+ xhr.onreadystatechange = jQuery.noop;
+
+ status = isTimeout === "timeout" ?
+ "timeout" :
+ !jQuery.httpSuccess( xhr ) ?
+ "error" :
+ s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
+ "notmodified" :
+ "success";
+
+ if ( status === "success" ) {
+ // Watch for, and catch, XML document parse errors
+ try {
+ // process the data (runs the xml through httpData regardless of callback)
+ data = jQuery.httpData( xhr, s.dataType, s );
+ } catch(e) {
+ status = "parsererror";
+ }
+ }
+
+ // Make sure that the request was successful or notmodified
+ if ( status === "success" || status === "notmodified" ) {
+ // JSONP handles its own success callback
+ if ( !jsonp ) {
+ success();
+ }
+ } else {
+ jQuery.handleError(s, xhr, status);
+ }
+
+ // Fire the complete handlers
+ complete();
+
+ if ( isTimeout === "timeout" ) {
+ xhr.abort();
+ }
+
+ // Stop memory leaks
+ if ( s.async ) {
+ xhr = null;
+ }
+ }
+ };
+
+ // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
+ // Opera doesn't fire onreadystatechange at all on abort
+ try {
+ var oldAbort = xhr.abort;
+ xhr.abort = function() {
+ if ( xhr ) {
+ oldAbort.call( xhr );
+ if ( xhr ) {
+ xhr.readyState = 0;
+ }
+ }
+
+ onreadystatechange();
+ };
+ } catch(e) { }
+
+ // Timeout checker
+ if ( s.async && s.timeout > 0 ) {
+ setTimeout(function() {
+ // Check to see if the request is still happening
+ if ( xhr && !requestDone ) {
+ onreadystatechange( "timeout" );
+ }
+ }, s.timeout);
+ }
+
+ // Send the data
+ try {
+ xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
+ } catch(e) {
+ jQuery.handleError(s, xhr, null, e);
+ // Fire the complete handlers
+ complete();
+ }
+
+ // firefox 1.5 doesn't fire statechange for sync requests
+ if ( !s.async ) {
+ onreadystatechange();
+ }
+
+ function success() {
+ // If a local callback was specified, fire it and pass it the data
+ if ( s.success ) {
+ s.success.call( callbackContext, data, status, xhr );
+ }
+
+ // Fire the global callback
+ if ( s.global ) {
+ trigger( "ajaxSuccess", [xhr, s] );
+ }
+ }
+
+ function complete() {
+ // Process result
+ if ( s.complete ) {
+ s.complete.call( callbackContext, xhr, status);
+ }
+
+ // The request was completed
+ if ( s.global ) {
+ trigger( "ajaxComplete", [xhr, s] );
+ }
+
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+
+ function trigger(type, args) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
+ }
+
+ // return XMLHttpRequest to allow aborting the request etc.
+ return xhr;
+ },
+
+ handleError: function( s, xhr, status, e ) {
+ // If a local callback was specified, fire it
+ if ( s.error ) {
+ s.error.call( s.context || window, xhr, status, e );
+ }
+
+ // Fire the global callback
+ if ( s.global ) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
+ }
+ },
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Determines if an XMLHttpRequest was successful or not
+ httpSuccess: function( xhr ) {
+ try {
+ // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
+ return !xhr.status && location.protocol === "file:" ||
+ // Opera returns 0 when status is 304
+ ( xhr.status >= 200 && xhr.status < 300 ) ||
+ xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
+ } catch(e) {}
+
+ return false;
+ },
+
+ // Determines if an XMLHttpRequest returns NotModified
+ httpNotModified: function( xhr, url ) {
+ var lastModified = xhr.getResponseHeader("Last-Modified"),
+ etag = xhr.getResponseHeader("Etag");
+
+ if ( lastModified ) {
+ jQuery.lastModified[url] = lastModified;
+ }
+
+ if ( etag ) {
+ jQuery.etag[url] = etag;
+ }
+
+ // Opera returns 0 when status is 304
+ return xhr.status === 304 || xhr.status === 0;
+ },
+
+ httpData: function( xhr, type, s ) {
+ var ct = xhr.getResponseHeader("content-type") || "",
+ xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
+ data = xml ? xhr.responseXML : xhr.responseText;
+
+ if ( xml && data.documentElement.nodeName === "parsererror" ) {
+ throw "parsererror";
+ }
+
+ // Allow a pre-filtering function to sanitize the response
+ // s is checked to keep backwards compatibility
+ if ( s && s.dataFilter ) {
+ data = s.dataFilter( data, type );
+ }
+
+ // The filter can actually parse the response
+ if ( typeof data === "string" ) {
+ // Get the JavaScript object, if JSON is used.
+ if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if (/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
+ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
+ .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
+
+ // Try to use the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ data = window.JSON.parse( data );
+
+ } else {
+ data = (new Function("return " + data))();
+ }
+
+ } else {
+ throw "Invalid JSON: " + data;
+ }
+
+ // If the type is "script", eval it in global context
+ } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
+ jQuery.globalEval( data );
+ }
+ }
+
+ return data;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+
+ var s = [];
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ function add( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction(value) ? value() : value;
+ s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray(a) || a.jquery ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ jQuery.each( a, function buildParams( prefix, obj ) {
+
+ if ( jQuery.isArray(obj) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ jQuery.each( obj, function( k, v ) {
+ buildParams( prefix + "[" + k + "]", v );
+ });
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+ });
+ }
+
+ // Return the resulting serialization
+ return s.join("&").replace(r20, "+");
+ }
+
+});
+var elemdisplay = {},
+ rfxtypes = /toggle|show|hide/,
+ rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ];
+
+jQuery.fn.extend({
+ show: function( speed, callback ) {
+ if ( speed != null ) {
+ return this.animate( genFx("show", 3), speed, callback);
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var old = jQuery.data(this[i], "olddisplay");
+
+ this[i].style.display = old || "";
+
+ if ( jQuery.css(this[i], "display") === "none" ) {
+ var nodeName = this[i].nodeName, display;
+
+ if ( elemdisplay[ nodeName ] ) {
+ display = elemdisplay[ nodeName ];
+
+ } else {
+ var elem = jQuery("<" + nodeName + " />").appendTo("body");
+
+ display = elem.css("display");
+
+ if ( display === "none" ) {
+ display = "block";
+ }
+
+ elem.remove();
+
+ elemdisplay[ nodeName ] = display;
+ }
+
+ jQuery.data(this[i], "olddisplay", display);
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var j = 0, k = this.length; j < k; j++ ) {
+ this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, callback ) {
+ if ( speed != null ) {
+ return this.animate( genFx("hide", 3), speed, callback);
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var old = jQuery.data(this[i], "olddisplay");
+ if ( !old && old !== "none" ) {
+ jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var j = 0, k = this.length; j < k; j++ ) {
+ this[j].style.display = "none";
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2 ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete );
+ }
+
+ return this[ optall.queue === false ? "each" : "queue" ](function() {
+ var opt = jQuery.extend({}, optall), p,
+ hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
+ self = this;
+
+ for ( p in prop ) {
+ var name = p.replace(rdashAlpha, fcamelCase);
+
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ p = name;
+ }
+
+ if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
+ return opt.complete.call(this);
+ }
+
+ if ( ( p === "height" || p === "width" ) && this.style ) {
+ // Store display property
+ opt.display = jQuery.css(this, "display");
+
+ // Make sure that nothing sneaks out
+ opt.overflow = this.style.overflow;
+ }
+
+ if ( jQuery.isArray( prop[p] ) ) {
+ // Create (if needed) and add to specialEasing
+ (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
+ prop[p] = prop[p][0];
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ opt.curAnim = jQuery.extend({}, prop);
+
+ jQuery.each( prop, function( name, val ) {
+ var e = new jQuery.fx( self, opt, name );
+
+ if ( rfxtypes.test(val) ) {
+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+
+ } else {
+ var parts = rfxnum.exec(val),
+ start = e.cur(true) || 0;
+
+ if ( parts ) {
+ var end = parseFloat( parts[2] ),
+ unit = parts[3] || "px";
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ self.style[ name ] = (end || 1) + unit;
+ start = ((end || 1) / e.cur(true)) * start;
+ self.style[ name ] = start + unit;
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ });
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function( clearQueue, gotoEnd ) {
+ var timers = jQuery.timers;
+
+ if ( clearQueue ) {
+ this.queue([]);
+ }
+
+ this.each(function() {
+ // go in reverse order so anything added to the queue during the loop is ignored
+ for ( var i = timers.length - 1; i >= 0; i-- ) {
+ if ( timers[i].elem === this ) {
+ if (gotoEnd) {
+ // force the next step to be the last
+ timers[i](true);
+ }
+
+ timers.splice(i, 1);
+ }
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if ( !gotoEnd ) {
+ this.dequeue();
+ }
+
+ return this;
+ }
+
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, callback ) {
+ return this.animate( props, speed, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? speed : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function() {
+ if ( opt.queue !== false ) {
+ jQuery(this).dequeue();
+ }
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ if ( !options.orig ) {
+ options.orig = {};
+ }
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+ // Set display property to block for height/width animations
+ if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
+ this.elem.style.display = "block";
+ }
+ },
+
+ // Get the current size
+ cur: function( force ) {
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var r = parseFloat(jQuery.css(this.elem, this.prop, force));
+ return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ this.startTime = now();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || "px";
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ var self = this;
+ function t( gotoEnd ) {
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval(jQuery.fx.tick, 13);
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var t = now(), done = true;
+
+ if ( gotoEnd || t >= this.options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ this.options.curAnim[ this.prop ] = true;
+
+ for ( var i in this.options.curAnim ) {
+ if ( this.options.curAnim[i] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ if ( this.options.display != null ) {
+ // Reset the overflow
+ this.elem.style.overflow = this.options.overflow;
+
+ // Reset the display
+ var old = jQuery.data(this.elem, "olddisplay");
+ this.elem.style.display = old ? old : this.options.display;
+
+ if ( jQuery.css(this.elem, "display") === "none" ) {
+ this.elem.style.display = "block";
+ }
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( this.options.hide ) {
+ jQuery(this.elem).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( this.options.hide || this.options.show ) {
+ for ( var p in this.options.curAnim ) {
+ jQuery.style(this.elem, p, this.options.orig[p]);
+ }
+ }
+
+ // Execute the complete function
+ this.options.complete.call( this.elem );
+ }
+
+ return false;
+
+ } else {
+ var n = t - this.startTime;
+ this.state = n / this.options.duration;
+
+ // Perform the easing function, defaults to swing
+ var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
+ var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
+ this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
+ this.now = this.start + ((this.end - this.start) * this.pos);
+
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ var timers = jQuery.timers;
+
+ for ( var i = 0; i < timers.length; i++ ) {
+ if ( !timers[i]() ) {
+ timers.splice(i--, 1);
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style(fx.elem, "opacity", fx.now);
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ jQuery.offset.initialize();
+
+ var offsetParent = elem.offsetParent, prevOffsetParent = elem,
+ doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
+ body = doc.body, defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop, left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+ initialize: function() {
+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
+ html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
+
+ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+ container.innerHTML = html;
+ body.insertBefore( container, body.firstChild );
+ innerDiv = container.firstChild;
+ checkDiv = innerDiv.firstChild;
+ td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
+ // safari subtracts parent border width here which is 5px
+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+ checkDiv.style.position = checkDiv.style.top = "";
+
+ innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+ body.removeChild( container );
+ body = container = innerDiv = checkDiv = table = td = null;
+ jQuery.offset.initialize = jQuery.noop;
+ },
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop, left = body.offsetLeft;
+
+ jQuery.offset.initialize();
+
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0;
+ left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ // set position first, in-case top/left are set even on static elem
+ if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
+ elem.style.position = "relative";
+ }
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0,
+ curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ var props = {
+ top: (options.top - curOffset.top) + curTop,
+ left: (options.left - curOffset.left) + curLeft
+ };
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0;
+ offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0;
+ parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function(val) {
+ var elem = this[0], win;
+
+ if ( !elem ) {
+ return null;
+ }
+
+ if ( val !== undefined ) {
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery(win).scrollLeft(),
+ i ? val : jQuery(win).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ } else {
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+ };
+});
+
+function getWindow( elem ) {
+ return ("scrollTo" in elem && elem.document) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn["inner" + name] = function() {
+ return this[0] ?
+ jQuery.css( this[0], type, false, "padding" ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn["outer" + name] = function( margin ) {
+ return this[0] ?
+ jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
+ elem.document.body[ "client" + name ] :
+
+ // Get document width or height
+ (elem.nodeType === 9) ? // is it a document
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ ) :
+
+ // Get or set width or height on the element
+ size === undefined ?
+ // Get width or height on the element
+ jQuery.css( elem, type ) :
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ this.css( type, typeof size === "string" ? size : size + "px" );
+ };
+
+});
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+
+})(window);
diff --git a/examples/lessons/6_English_VocabularyAnimals/js/karma.js b/examples/lessons/6_English_VocabularyAnimals/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_English_VocabularyAnimals/js/lesson.js b/examples/lessons/6_English_VocabularyAnimals/js/lesson.js
new file mode 100755
index 0000000..489fe72
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/js/lesson.js
@@ -0,0 +1,359 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.ogg'},
+ {'name':'incorrect','file':'incorrect.ogg'},
+ {'name':'cheetah','file':'cheetah.wav'},
+ {'name':'crocodile','file':'crocodile.wav'},
+ {'name':'dinosaur','file':'dinosaura.wav'},
+ {'name':'giraffe','file':'giraffe.wav'},
+ {'name':'kangaroo','file':'kangaroo.wav'},
+ {'name':'octopus','file':'octopus.wav'},
+ {'name':'panda','file':'panda.wav'},
+ {'name':'rhinoceros','file':'rhinoceros.wav'},
+ {'name':'whale','file':'whale.wav'},
+ {'name':'zebra','file':'zebra.wav'}
+ ]});
+
+ k.ready(function(){
+ var i,j,flag;
+ var TOTAL_QUES = 10;
+ var TOTAL_LEVEL = 3;
+ var currentDragObject;
+ var randImages = [];
+ var randPositions = [];
+ var randOtherImages = [];
+ var currentAnimal;
+ var totalCounter;
+ var currentQuestion;
+ var currentDragObject;
+ var arrangedAns = [];
+ var correctAnimalParts = [];
+ var randTexts = []; //for the confirmation sections
+ var checked;
+ var sectionNum; //store the current tab num
+ var flag_checked;
+ var currentQues; //store the current Animal name
+ var currentAnimal; //store the current Animal Image name
+ var correctQuest; //store 1 if the question and image is same
+ var num;
+ var flag_confirm; //whether confirmation dialog box is on the top or not
+ var currentDropObject;
+ var droppedWord;
+ var zIndex; //show current dragged Object at top
+
+ var animals = new Array('cheetah','crocodile','dinosaur','giraffe','kangaroo',
+ 'octopus','panda','rhinoceros','whale','zebra'
+ );
+
+ var genRandTexts=function (){
+ randTexts[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randTexts[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randTexts[i] === randTexts[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+ var genRandImages=function (){
+ randImages[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randImages[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randImages[i] === randImages[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+ var genRandOtherImages = function(){
+ randOtherImages[0] = currentAnimal;
+ for(i=1; i<7; i++){
+ do{
+ flag = 0;
+ randOtherImages[i] = k.rand(0,6);
+ for(j=0; j<i; j++){
+ if(randOtherImages[i] === randOtherImages[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+
+ };
+
+
+ var genRandPositions = function(){ // 15 random positions 8 correct
+ randPositions[0] = k.rand(0,14);
+ for(i=1; i<15; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,14);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+
+ };
+
+ var assignDragTexts = function(txtId){
+ randText = randTexts[i];
+ $('#dragTxtSection').append('<div id="text'+txtId+'" class="dragObjects">'+animals[randText]+'</div>');
+ var dragObjCss = {
+ 'float': 'left','cursor': 'move','width':'100px','height':'25px',
+ 'margin':'0.1em','color':'#5B3CD5',
+ 'font':'20px/30px Helvetica, Geneva, Arial, Verdana, sans-serif'
+ };
+ $('#text'+txtId).css(dragObjCss);
+ };
+
+ var confirmAnswer = function(){
+ genRandTexts();
+ $('#confirmSection').show().html('');
+ $('#confirmSection').append('<div id="confirmBox"></div>');
+ $('#confirmBox').append('<div id="checkAnswer"></div>');
+ $('#confirmBox').append('<div id="word0" class="dropObjects"></div>');
+ var dropObjCss = {
+ 'margin':'7em auto','margin-bottom':'3em','width':'100px','height':'30px',
+ 'border':'1px solid #FF0000'
+ };
+ $('#word0').css(dropObjCss);
+ $('#confirmBox').append('<div id="confimBtn"></div>');
+ $('#confirmSection').append('<div id="dragTxtSection"></div>');
+
+ for(i = 0; i<10; i++){
+ assignDragTexts(i);
+ }
+ drag_drop();
+
+ }
+
+ var check_puzzle_completion = function(){
+ var correct = 0;
+ for(i = 0; i< 9 ;i++){
+ if(arrangedAns[i] === correctAnimalParts[i]){
+ correct++;
+ }
+ }
+ if(correct === 9){
+ //alert("great job its time to show some confirmations");
+ $('#section').addClass('backOpaque');
+ flag_confirm = 0;
+ confirmAnswer();
+
+ }
+ };
+
+ var next_images = function(){
+ currentAnimal = randImages[totalCounter];
+ $('#imgAnimalsDisplay').html('<img src="assets/image/'+animals[currentAnimal]+'.png" />');
+ $('#animalText').html('').append('<div class="imgVol"></div>');
+ $('#animalText').append(animals[currentAnimal]);
+ $('.imgVol').click(function(){
+ k.audio[animals[currentAnimal]].play();
+ });
+ };
+
+ var assignDragPuzzle = function(puzzleId,imgName){
+ $('#dragImgSection').append('<div id="drag'+num+'" class="dragObjects"></div>');
+ var dragObjCss = {
+ 'float': 'left','cursor': 'move','width':'100px','height':'100px',
+ 'border':'1px solid #A8F42D',
+ 'background':'url(assets/image/'+animals[imgName]+puzzleId+'.png)'
+ };
+ $('#drag'+num).css(dragObjCss);
+ if(imgName === currentAnimal){
+ correctAnimalParts[puzzleId] = $('#drag'+num).attr('id');
+ }
+ num++;
+ };
+
+ var assignPuzzle = function(puzzleId){
+ $('#imgPuzzleArea').append('<div id="drop'+puzzleId+'" class="dropObjects"></div>');
+ var dropObjCss = {
+ 'float': 'left','width':'100px','height':'100px',
+ 'border':'1px solid #A8F42D','background': '#C8FFC2'
+ };
+ $('#drop'+puzzleId).css(dropObjCss);
+ };
+
+ var display_game_over = function() {
+ $('#confirmSection').hide();
+ $('#gameOver').show().html('Game Over !!! Congratulations');
+ $('#gameOver').append('<div id="gameOverInfo">You have successfully completed all the vocabulary section</div>');
+ };
+
+ var delay_gameOver = function(){
+ document.delayForm.delayval.value = 1;
+ display_game_over();
+ };
+
+ var next_puzzle = function() {
+ $('#confirmSection').hide();
+ zIndex = 0;
+ $('#section').removeClass('backOpaque');
+ $('#section').html('').append('<div id="infoText"></div>');
+ $('#infoText').append('Listen to the name of the animal.'+
+ 'And drag and drop the pisces to complete the picture of the animal you just heard the name of.');
+ currentAnimal = randImages[totalCounter];
+ $('#infoText').append('<div class="imgVol"></div>');
+ $('.imgVol').click(function(){
+ k.audio[animals[currentAnimal]].play();
+ });
+ $('#section').append('<div id = "imgPuzzleArea"></div>');
+ for(i = 0; i< 9; i++){
+ assignPuzzle(i);
+
+ }
+ $('#section').append('<div id = "dragImgSection"></div>');
+ genRandPositions();
+ genRandOtherImages();
+ var number = 1;
+ num = 0;
+ for(i = 0; i< 15; i++){
+ var randPos = randPositions[i]; //any random pos between 1-15
+ if(randPos<9){
+ assignDragPuzzle(randPos,currentAnimal);
+ }
+ else{
+ randPos = 15-randPos;
+ assignDragPuzzle(randPos,randOtherImages[number]);
+ number++;
+ }
+ }
+ flag_confirm = 1;
+ drag_drop();
+ };
+
+ function game_start(){
+ $('#section').removeClass('backOpaque');
+ $('#linkNext').hide();
+ $('#linkBack').hide();
+ sectionNum = 1;
+ genRandImages();
+ totalCounter = 0;
+ next_puzzle();
+
+ }
+
+ function game(){
+ $('#help').hide();
+ sectionNum = 0;
+ totalCounter = 0;
+ flag_confirm = 1;
+ $('#confirmSection').hide();
+ $('#section').removeClass('backOpaque');
+ $('#linkNext').show();
+ $('#linkBack').hide();
+ $('#gameOver').hide();
+ $('#section').html('').append('<div id="topText">Click on the speaker and listen to the name of the wild animals</div>');
+ $('#section').append('<div id="imgAnimalsDisplay"></div>');
+ $('#section').append('<div id="animalText"></div>');
+ genRandImages();
+ next_images();
+ }
+
+ game();
+
+ function drag_drop(){
+ $('.dragObjects').draggable({ containment: '#content'});
+ $('.dragObjects').bind('dragstart', function(event, ui) {
+ currentDragObject = event.target.id;
+ $('#'+currentDragObject).css({'z-index':zIndex});
+ currentDragAnimal = parseInt(currentDragObject.substring(4));
+ zIndex++;
+ });
+
+ $(".dropObjects").droppable({ tolerence: 'intersect' ,hoverClass: 'drophover'});
+ $('.dropObjects').bind('drop', function(event, ui) {
+ currentDropObject = event.target.id;
+ droppedWord = parseInt(currentDropObject.substring(4));
+
+ if(flag_confirm != 0){
+ arrangedAns[droppedWord] = $('#'+currentDragObject).attr('id');
+ check_puzzle_completion();
+ }
+
+ });
+ $('#confimBtn').click(function(){
+ var dragAnimalText = $('#'+currentDragObject).text();
+ if(dragAnimalText === animals[currentAnimal]){
+ k.audio.correct.play();
+ $('#checkAnswer').html('<img src="assets/image/correct.png" />');
+ totalCounter++;
+ if(totalCounter === TOTAL_QUES){
+ t=setTimeout(function(){delay_gameOver();},1000);
+ }
+ else{
+ $('#linkNext').show();
+ }
+ }
+ else{
+ k.audio.incorrect.play();
+ $('#checkAnswer').html('<img src="assets/image/incorrect.png" />');
+ }
+
+ });
+
+ }
+ $('#linkHelp').click(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+ });
+ $('#linkNext').click(function(){
+ if(sectionNum === 0){ //first level for knowing the animals
+ if(totalCounter === TOTAL_QUES-2){
+ $('#linkBack').show();
+ $('#linkNext').hide();
+ }
+ else{
+ $('#linkNext').show();
+ $('#linkBack').show();
+ }
+ totalCounter++;
+ next_images();
+ }
+ else{
+ $('#linkNext').hide();
+ next_puzzle();
+ }
+ });
+ $('#linkBack').click(function(){
+ if(totalCounter === 1){
+ $('#linkBack').hide();
+ $('#linkNext').show();
+ }
+ else{
+ $('#linkNext').show();
+ $('#linkBack').show();
+ }
+ totalCounter--;
+ next_images();
+ });
+ $('#linkCheck').click(function(){
+ check_answers();
+ });
+ $('#linkStart').click(function(){
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ game();
+ });
+
+ }); //end of k.ready
+}); //end of document.ready \ No newline at end of file
diff --git a/examples/lessons/6_English_VocabularyAnimals/js/ui.core.js b/examples/lessons/6_English_VocabularyAnimals/js/ui.core.js
new file mode 100755
index 0000000..5493e0a
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/js/ui.core.js
@@ -0,0 +1,519 @@
+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+;jQuery.ui || (function($) {
+
+var _remove = $.fn.remove,
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+
+//Helper functions and ui object
+$.ui = {
+ version: "1.7.2",
+
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function(module, option, set) {
+ var proto = $.ui[module].prototype;
+ for(var i in set) {
+ proto.plugins[i] = proto.plugins[i] || [];
+ proto.plugins[i].push([option, set[i]]);
+ }
+ },
+ call: function(instance, name, args) {
+ var set = instance.plugins[name];
+ if(!set || !instance.element[0].parentNode) { return; }
+
+ for (var i = 0; i < set.length; i++) {
+ if (instance.options[set[i][0]]) {
+ set[i][1].apply(instance.element, args);
+ }
+ }
+ }
+ },
+
+ contains: function(a, b) {
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
+ },
+
+ hasScroll: function(el, a) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ($(el).css('overflow') == 'hidden') { return false; }
+
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
+ has = false;
+
+ if (el[scroll] > 0) { return true; }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[scroll] = 1;
+ has = (el[scroll] > 0);
+ el[scroll] = 0;
+ return has;
+ },
+
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
+ },
+
+ isOver: function(y, x, top, left, height, width) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+ },
+
+ keyCode: {
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+};
+
+// WAI-ARIA normalization
+if (isFF2) {
+ var attr = $.attr,
+ removeAttr = $.fn.removeAttr,
+ ariaNS = "http://www.w3.org/2005/07/aaa",
+ ariaState = /^aria-/,
+ ariaRole = /^wairole:/;
+
+ $.attr = function(elem, name, value) {
+ var set = value !== undefined;
+
+ return (name == 'role'
+ ? (set
+ ? attr.call(this, elem, name, "wairole:" + value)
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
+ : (ariaState.test(name)
+ ? (set
+ ? elem.setAttributeNS(ariaNS,
+ name.replace(ariaState, "aaa:"), value)
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
+ : attr.apply(this, arguments)));
+ };
+
+ $.fn.removeAttr = function(name) {
+ return (ariaState.test(name)
+ ? this.each(function() {
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
+ }) : removeAttr.call(this, name));
+ };
+}
+
+//jQuery plugins
+$.fn.extend({
+ remove: function() {
+ // Safari has a native remove event which actually removes DOM elements,
+ // so we have to use triggerHandler instead of trigger (#3037).
+ $("*", this).add(this).each(function() {
+ $(this).triggerHandler("remove");
+ });
+ return _remove.apply(this, arguments );
+ },
+
+ enableSelection: function() {
+ return this
+ .attr('unselectable', 'off')
+ .css('MozUserSelect', '')
+ .unbind('selectstart.ui');
+ },
+
+ disableSelection: function() {
+ return this
+ .attr('unselectable', 'on')
+ .css('MozUserSelect', 'none')
+ .bind('selectstart.ui', function() { return false; });
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ }
+});
+
+
+//Additional selectors
+$.extend($.expr[':'], {
+ data: function(elem, i, match) {
+ return !!$.data(elem, match[3]);
+ },
+
+ focusable: function(element) {
+ var nodeName = element.nodeName.toLowerCase(),
+ tabIndex = $.attr(element, 'tabindex');
+ return (/input|select|textarea|button|object/.test(nodeName)
+ ? !element.disabled
+ : 'a' == nodeName || 'area' == nodeName
+ ? element.href || !isNaN(tabIndex)
+ : !isNaN(tabIndex))
+ // the element and all of its ancestors must be visible
+ // the browser may report that the area is hidden
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
+ },
+
+ tabbable: function(element) {
+ var tabIndex = $.attr(element, 'tabindex');
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
+ }
+});
+
+
+// $.widget is a factory to create jQuery plugins
+// taking some boilerplate code out of the plugin code
+function getter(namespace, plugin, method, args) {
+ function getMethods(type) {
+ var methods = $[namespace][plugin][type] || [];
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
+ }
+
+ var methods = getMethods('getter');
+ if (args.length == 1 && typeof args[0] == 'string') {
+ methods = methods.concat(getMethods('getterSetter'));
+ }
+ return ($.inArray(method, methods) != -1);
+}
+
+$.widget = function(name, prototype) {
+ var namespace = name.split(".")[0];
+ name = name.split(".")[1];
+
+ // create plugin method
+ $.fn[name] = function(options) {
+ var isMethodCall = (typeof options == 'string'),
+ args = Array.prototype.slice.call(arguments, 1);
+
+ // prevent calls to internal methods
+ if (isMethodCall && options.substring(0, 1) == '_') {
+ return this;
+ }
+
+ // handle getter methods
+ if (isMethodCall && getter(namespace, name, options, args)) {
+ var instance = $.data(this[0], name);
+ return (instance ? instance[options].apply(instance, args)
+ : undefined);
+ }
+
+ // handle initialization and non-getter methods
+ return this.each(function() {
+ var instance = $.data(this, name);
+
+ // constructor
+ (!instance && !isMethodCall &&
+ $.data(this, name, new $[namespace][name](this, options))._init());
+
+ // method call
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
+ instance[options].apply(instance, args));
+ });
+ };
+
+ // create widget constructor
+ $[namespace] = $[namespace] || {};
+ $[namespace][name] = function(element, options) {
+ var self = this;
+
+ this.namespace = namespace;
+ this.widgetName = name;
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
+ this.widgetBaseClass = namespace + '-' + name;
+
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
+ this.element = $(element)
+ .bind('setData.' + name, function(event, key, value) {
+ if (event.target == element) {
+ return self._setData(key, value);
+ }
+ })
+ .bind('getData.' + name, function(event, key) {
+ if (event.target == element) {
+ return self._getData(key);
+ }
+ })
+ .bind('remove', function() {
+ return self.destroy();
+ });
+ };
+
+ // add widget prototype
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
+
+ // TODO: merge getter and getterSetter properties from widget prototype
+ // and plugin prototype
+ $[namespace][name].getterSetter = 'option';
+};
+
+$.widget.prototype = {
+ _init: function() {},
+ destroy: function() {
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
+ },
+
+ option: function(key, value) {
+ var options = key,
+ self = this;
+
+ if (typeof key == "string") {
+ if (value === undefined) {
+ return this._getData(key);
+ }
+ options = {};
+ options[key] = value;
+ }
+
+ $.each(options, function(key, value) {
+ self._setData(key, value);
+ });
+ },
+ _getData: function(key) {
+ return this.options[key];
+ },
+ _setData: function(key, value) {
+ this.options[key] = value;
+
+ if (key == 'disabled') {
+ this.element
+ [value ? 'addClass' : 'removeClass'](
+ this.widgetBaseClass + '-disabled' + ' ' +
+ this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
+ }
+ },
+
+ enable: function() {
+ this._setData('disabled', false);
+ },
+ disable: function() {
+ this._setData('disabled', true);
+ },
+
+ _trigger: function(type, event, data) {
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = $.Event(event);
+ event.type = eventName;
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if (event.originalEvent) {
+ for (var i = $.event.props.length, prop; i;) {
+ prop = $.event.props[--i];
+ event[prop] = event.originalEvent[prop];
+ }
+ }
+
+ this.element.trigger(event, data);
+
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
+ }
+};
+
+$.widget.defaults = {
+ disabled: false
+};
+
+
+/** Mouse Interaction Plugin **/
+
+$.ui.mouse = {
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ // Prevent text selection in IE
+ if ($.browser.msie) {
+ this._mouseUnselectable = this.element.attr('unselectable');
+ this.element.attr('unselectable', 'on');
+ }
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+
+ // Restore text selection in IE
+ ($.browser.msie
+ && this.element.attr('unselectable', this._mouseUnselectable));
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ // TODO: figure out why we have to use originalEvent
+ event.originalEvent = event.originalEvent || {};
+ if (event.originalEvent.mouseHandled) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ // preventDefault() is used to prevent the selection of text here -
+ // however, in Safari, this causes select boxes not to be selectable
+ // anymore, so this fix is needed
+ ($.browser.safari || event.preventDefault());
+
+ event.originalEvent.mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+};
+
+$.ui.mouse.defaults = {
+ cancel: null,
+ distance: 1,
+ delay: 0
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_English_VocabularyAnimals/js/ui.draggable.js b/examples/lessons/6_English_VocabularyAnimals/js/ui.draggable.js
new file mode 100755
index 0000000..0402f0e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/js/ui.draggable.js
@@ -0,0 +1,766 @@
+/*
+ * jQuery UI Draggable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * ui.core.js
+ */
+(function($) {
+
+$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
+
+ _init: function() {
+
+ if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
+ this.element[0].style.position = 'relative';
+
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
+
+ this._mouseInit();
+
+ },
+
+ destroy: function() {
+ if(!this.element.data('draggable')) return;
+ this.element
+ .removeData("draggable")
+ .unbind(".draggable")
+ .removeClass("ui-draggable"
+ + " ui-draggable-dragging"
+ + " ui-draggable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+
+ var o = this.options;
+
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
+ return false;
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle)
+ return false;
+
+ return true;
+
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if($.ui.ddmanager)
+ $.ui.ddmanager.current = this;
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css("position");
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.element.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
+ if(o.cursorAt)
+ this._adjustOffsetFromHelper(o.cursorAt);
+
+ //Set a containment if given in the options
+ if(o.containment)
+ this._setContainment();
+
+ //Call plugins and callbacks
+ this._trigger("start", event);
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(this, event);
+
+ this.helper.addClass("ui-draggable-dragging");
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ this._trigger('drag', event, ui);
+ this.position = ui.position;
+ }
+
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
+ dropped = $.ui.ddmanager.drop(this, event);
+
+ //if a drop comes from outside (a sortable)
+ if(this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ var self = this;
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ self._trigger("stop", event);
+ self._clear();
+ });
+ } else {
+ this._trigger("stop", event);
+ this._clear();
+ }
+
+ return false;
+ },
+
+ _getHandle: function(event) {
+
+ var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
+ $(this.options.handle, this.element)
+ .find("*")
+ .andSelf()
+ .each(function() {
+ if(this == event.target) handle = true;
+ });
+
+ return handle;
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options;
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
+
+ if(!helper.parents('body').length)
+ helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
+
+ if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
+ helper.css("position", "absolute");
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
+ if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
+ if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
+ po = { top: 0, left: 0 };
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition == "relative") {
+ var p = this.element.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
+ top: (parseInt(this.element.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var o = this.options;
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
+ ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+
+ if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
+ var ce = $(o.containment)[0]; if(!ce) return;
+ var co = $(o.containment).offset();
+ var over = ($(ce).css("overflow") != 'hidden');
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ } else if(o.containment.constructor == Array) {
+ this.containment = o.containment;
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) pos = this.position;
+ var mod = d == "absolute" ? 1 : -1;
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top // The absolute mouse position
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left // The absolute mouse position
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ var pageX = event.pageX;
+ var pageY = event.pageY;
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
+ if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
+ }
+
+ if(o.grid) {
+ var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY // The absolute mouse position
+ - this.offset.click.top // Click offset (relative to the element)
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX // The absolute mouse position
+ - this.offset.click.left // Click offset (relative to the element)
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
+ //if($.ui.ddmanager) $.ui.ddmanager.current = null;
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function(type, event, ui) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call(this, type, [event, ui]);
+ if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
+ return $.widget.prototype._trigger.call(this, type, event, ui);
+ },
+
+ plugins: {},
+
+ _uiHash: function(event) {
+ return {
+ helper: this.helper,
+ position: this.position,
+ absolutePosition: this.positionAbs, //deprecated
+ offset: this.positionAbs
+ };
+ }
+
+}));
+
+$.extend($.ui.draggable, {
+ version: "1.7.2",
+ eventPrefix: "drag",
+ defaults: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input,option",
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ delay: 0,
+ distance: 1,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false
+ }
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+ start: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options,
+ uiSortable = $.extend({}, ui, { item: inst.element });
+ inst.sortables = [];
+ $(o.connectToSortable).each(function() {
+ var sortable = $.data(this, 'sortable');
+ if (sortable && !sortable.options.disabled) {
+ inst.sortables.push({
+ instance: sortable,
+ shouldRevert: sortable.options.revert
+ });
+ sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+
+ },
+ stop: function(event, ui) {
+
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+ var inst = $(this).data("draggable"),
+ uiSortable = $.extend({}, ui, { item: inst.element });
+
+ $.each(inst.sortables, function() {
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
+ if(this.shouldRevert) this.instance.options.revert = true;
+
+ //Trigger the stop of the sortable
+ this.instance._mouseStop(event);
+
+ this.instance.options.helper = this.instance.options._helper;
+
+ //If the helper has been the original item, restore properties in the sortable
+ if(inst.options.helper == 'original')
+ this.instance.currentItem.css({ top: 'auto', left: 'auto' });
+
+ } else {
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ this.instance._trigger("deactivate", event, uiSortable);
+ }
+
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), self = this;
+
+ var checkPos = function(o) {
+ var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
+ var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
+ var itemHeight = o.height, itemWidth = o.width;
+ var itemTop = o.top, itemLeft = o.left;
+
+ return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
+ };
+
+ $.each(inst.sortables, function(i) {
+
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
+
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+ if(!this.instance.isOver) {
+
+ this.instance.isOver = 1;
+ //Now we fake the start of dragging for the sortable instance,
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+ this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+ this.instance.options.helper = function() { return ui.helper[0]; };
+
+ event.target = this.instance.currentItem[0];
+ this.instance._mouseCapture(event, true);
+ this.instance._mouseStart(event, true, true);
+
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+ this.instance.offset.click.top = inst.offset.click.top;
+ this.instance.offset.click.left = inst.offset.click.left;
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+ inst._trigger("toSortable", event);
+ inst.dropped = this.instance.element; //draggable revert needs that
+ //hack so receive/update callbacks work (mostly)
+ inst.currentItem = inst.element;
+ this.instance.fromOutside = inst;
+
+ }
+
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+ if(this.instance.currentItem) this.instance._mouseDrag(event);
+
+ } else {
+
+ //If it doesn't intersect with the sortable, and it intersected before,
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+ this.instance.cancelHelperRemoval = true;
+
+ //Prevent reverting on this forced stop
+ this.instance.options.revert = false;
+
+ // The out event needs to be triggered independently
+ this.instance._trigger('out', event, this.instance._uiHash(this.instance));
+
+ this.instance._mouseStop(event, true);
+ this.instance.options.helper = this.instance.options._helper;
+
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+ this.instance.currentItem.remove();
+ if(this.instance.placeholder) this.instance.placeholder.remove();
+
+ inst._trigger("fromSortable", event);
+ inst.dropped = false; //draggable revert needs that
+ }
+
+ };
+
+ });
+
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function(event, ui) {
+ var t = $('body'), o = $(this).data('draggable').options;
+ if (t.css("cursor")) o._cursor = t.css("cursor");
+ t.css("cursor", o.cursor);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if (o._cursor) $('body').css("cursor", o._cursor);
+ }
+});
+
+$.ui.plugin.add("draggable", "iframeFix", {
+ start: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+ $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
+ .css({
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+ position: "absolute", opacity: "0.001", zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo("body");
+ });
+ },
+ stop: function(event, ui) {
+ $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data('draggable').options;
+ if(t.css("opacity")) o._opacity = t.css("opacity");
+ t.css('opacity', o.opacity);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if(o._opacity) $(ui.helper).css('opacity', o._opacity);
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function(event, ui) {
+ var i = $(this).data("draggable");
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
+ },
+ drag: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options, scrolled = false;
+
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
+
+ if(!o.axis || o.axis != 'x') {
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+ else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+ else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(!o.axis || o.axis != 'x') {
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(i, event);
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options;
+ i.snapElements = [];
+
+ $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
+ var $t = $(this); var $o = $t.offset();
+ if(this != i.element[0]) i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options;
+ var d = o.snapTolerance;
+
+ var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (var i = inst.snapElements.length - 1; i >= 0; i--){
+
+ var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
+ t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
+
+ //Yes, I know, this is insane ;)
+ if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
+ if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if(o.snapMode != 'inner') {
+ var ts = Math.abs(t - y2) <= d;
+ var bs = Math.abs(b - y1) <= d;
+ var ls = Math.abs(l - x2) <= d;
+ var rs = Math.abs(r - x1) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+ }
+
+ var first = (ts || bs || ls || rs);
+
+ if(o.snapMode != 'outer') {
+ var ts = Math.abs(t - y1) <= d;
+ var bs = Math.abs(b - y2) <= d;
+ var ls = Math.abs(l - x1) <= d;
+ var rs = Math.abs(r - x2) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+ }
+
+ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ };
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function(event, ui) {
+
+ var o = $(this).data("draggable").options;
+
+ var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
+ return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
+ });
+
+ $(group).each(function(i) {
+ this.style.zIndex = o.stack.min + i;
+ });
+
+ this[0].style.zIndex = o.stack.min + group.length;
+
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data("draggable").options;
+ if(t.css("zIndex")) o._zIndex = t.css("zIndex");
+ t.css('zIndex', o.zIndex);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data("draggable").options;
+ if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
+ }
+});
+
+})(jQuery);
diff --git a/examples/lessons/6_English_VocabularyAnimals/js/ui.droppable.js b/examples/lessons/6_English_VocabularyAnimals/js/ui.droppable.js
new file mode 100755
index 0000000..8e7be33
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyAnimals/js/ui.droppable.js
@@ -0,0 +1,282 @@
+/*
+ * jQuery UI Droppable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * ui.core.js
+ * ui.draggable.js
+ */
+(function($) {
+
+$.widget("ui.droppable", {
+
+ _init: function() {
+
+ var o = this.options, accept = o.accept;
+ this.isover = 0; this.isout = 1;
+
+ this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
+ return d.is(accept);
+ };
+
+ //Store the droppable's proportions
+ this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
+
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
+ $.ui.ddmanager.droppables[this.options.scope].push(this);
+
+ (this.options.addClasses && this.element.addClass("ui-droppable"));
+
+ },
+
+ destroy: function() {
+ var drop = $.ui.ddmanager.droppables[this.options.scope];
+ for ( var i = 0; i < drop.length; i++ )
+ if ( drop[i] == this )
+ drop.splice(i, 1);
+
+ this.element
+ .removeClass("ui-droppable ui-droppable-disabled")
+ .removeData("droppable")
+ .unbind(".droppable");
+ },
+
+ _setData: function(key, value) {
+
+ if(key == 'accept') {
+ this.options.accept = value && $.isFunction(value) ? value : function(d) {
+ return d.is(value);
+ };
+ } else {
+ $.widget.prototype._setData.apply(this, arguments);
+ }
+
+ },
+
+ _activate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.addClass(this.options.activeClass);
+ (draggable && this._trigger('activate', event, this.ui(draggable)));
+ },
+
+ _deactivate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ (draggable && this._trigger('deactivate', event, this.ui(draggable)));
+ },
+
+ _over: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
+ this._trigger('over', event, this.ui(draggable));
+ }
+
+ },
+
+ _out: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('out', event, this.ui(draggable));
+ }
+
+ },
+
+ _drop: function(event,custom) {
+
+ var draggable = custom || $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
+
+ var childrenIntersection = false;
+ this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
+ var inst = $.data(this, 'droppable');
+ if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
+ childrenIntersection = true; return false;
+ }
+ });
+ if(childrenIntersection) return false;
+
+ if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('drop', event, this.ui(draggable));
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function(c) {
+ return {
+ draggable: (c.currentItem || c.element),
+ helper: c.helper,
+ position: c.position,
+ absolutePosition: c.positionAbs, //deprecated
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.extend($.ui.droppable, {
+ version: "1.7.2",
+ eventPrefix: 'drop',
+ defaults: {
+ accept: '*',
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: 'default',
+ tolerance: 'intersect'
+ }
+});
+
+$.ui.intersect = function(draggable, droppable, toleranceMode) {
+
+ if (!droppable.offset) return false;
+
+ var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
+ y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
+ var l = droppable.offset.left, r = l + droppable.proportions.width,
+ t = droppable.offset.top, b = t + droppable.proportions.height;
+
+ switch (toleranceMode) {
+ case 'fit':
+ return (l < x1 && x2 < r
+ && t < y1 && y2 < b);
+ break;
+ case 'intersect':
+ return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
+ && x2 - (draggable.helperProportions.width / 2) < r // Left Half
+ && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
+ && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
+ break;
+ case 'pointer':
+ var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
+ isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
+ return isOver;
+ break;
+ case 'touch':
+ return (
+ (y1 >= t && y1 <= b) || // Top edge touching
+ (y2 >= t && y2 <= b) || // Bottom edge touching
+ (y1 < t && y2 > b) // Surrounded vertically
+ ) && (
+ (x1 >= l && x1 <= r) || // Left edge touching
+ (x2 >= l && x2 <= r) || // Right edge touching
+ (x1 < l && x2 > r) // Surrounded horizontally
+ );
+ break;
+ default:
+ return false;
+ break;
+ }
+
+};
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { 'default': [] },
+ prepareOffsets: function(t, event) {
+
+ var m = $.ui.ddmanager.droppables[t.options.scope];
+ var type = event ? event.type : null; // workaround for #2317
+ var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
+
+ droppablesLoop: for (var i = 0; i < m.length; i++) {
+
+ if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
+ for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
+ m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
+
+ m[i].offset = m[i].element.offset();
+ m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
+
+ if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
+
+ }
+
+ },
+ drop: function(draggable, event) {
+
+ var dropped = false;
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(!this.options) return;
+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
+ dropped = this._drop.call(this, event);
+
+ if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ this.isout = 1; this.isover = 0;
+ this._deactivate.call(this, event);
+ }
+
+ });
+ return dropped;
+
+ },
+ drag: function(draggable, event) {
+
+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
+
+ //Run through all droppables and check their positions based on specific tolerance options
+
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(this.options.disabled || this.greedyChild || !this.visible) return;
+ var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
+
+ var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
+ if(!c) return;
+
+ var parentInstance;
+ if (this.options.greedy) {
+ var parent = this.element.parents(':data(droppable):eq(0)');
+ if (parent.length) {
+ parentInstance = $.data(parent[0], 'droppable');
+ parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
+ }
+ }
+
+ // we just moved into a greedy child
+ if (parentInstance && c == 'isover') {
+ parentInstance['isover'] = 0;
+ parentInstance['isout'] = 1;
+ parentInstance._out.call(parentInstance, event);
+ }
+
+ this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
+ this[c == "isover" ? "_over" : "_out"].call(this, event);
+
+ // we just moved out of a greedy child
+ if (parentInstance && c == 'isout') {
+ parentInstance['isout'] = 0;
+ parentInstance['isover'] = 1;
+ parentInstance._over.call(parentInstance, event);
+ }
+ });
+
+ }
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.22858~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.22858~
new file mode 100755
index 0000000..a3a5553
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.22858~
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="confirmSection"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.2671~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.2671~
new file mode 100755
index 0000000..833fcad
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.2671~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.63800~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.63800~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.63800~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.64159~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.64159~
new file mode 100755
index 0000000..833fcad
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.64159~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.68631~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.68631~
new file mode 100755
index 0000000..a3a5553
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.68631~
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="confirmSection"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.69489~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.69489~
new file mode 100755
index 0000000..da51ff8
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.69489~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Months</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Months of the Year<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.76672~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.76672~
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.76672~
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.83946~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.83946~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.83946~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.92952~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.92952~
new file mode 100755
index 0000000..77f8df2
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.92952~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Eng Crossword</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Crossword Puzzle <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="acrossImg"></div>
+ <div id="downImg"></div>
+ <div id="crosswordSection">
+
+
+ </div>
+
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.98113~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.98113~
new file mode 100755
index 0000000..833fcad
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.98113~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Animals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Animals <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.98765~ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.98765~
new file mode 100755
index 0000000..c359651
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/.tmp_index.html.98765~
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Yes No Questions</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Yes No Questions <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="tabs"></div>
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/bulbul.wav b/examples/lessons/6_English_VocabularyBirds/assets/audio/bulbul.wav
new file mode 100755
index 0000000..53e5693
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/bulbul.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/correct.ogg b/examples/lessons/6_English_VocabularyBirds/assets/audio/correct.ogg
new file mode 100755
index 0000000..a0d9e3a
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/correct.ogg
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/crane.wav b/examples/lessons/6_English_VocabularyBirds/assets/audio/crane.wav
new file mode 100755
index 0000000..596a8f3
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/crane.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/egret.wav b/examples/lessons/6_English_VocabularyBirds/assets/audio/egret.wav
new file mode 100755
index 0000000..c2bdbbb
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/egret.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/incorrect.ogg b/examples/lessons/6_English_VocabularyBirds/assets/audio/incorrect.ogg
new file mode 100755
index 0000000..4805e55
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/incorrect.ogg
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/kingfisher.wav b/examples/lessons/6_English_VocabularyBirds/assets/audio/kingfisher.wav
new file mode 100755
index 0000000..ebb2064
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/kingfisher.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/ostrich.wav b/examples/lessons/6_English_VocabularyBirds/assets/audio/ostrich.wav
new file mode 100755
index 0000000..6a45c76
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/ostrich.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/penguin.wav b/examples/lessons/6_English_VocabularyBirds/assets/audio/penguin.wav
new file mode 100755
index 0000000..726187a
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/penguin.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/swan.wav b/examples/lessons/6_English_VocabularyBirds/assets/audio/swan.wav
new file mode 100755
index 0000000..22086f1
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/swan.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/swift.wav b/examples/lessons/6_English_VocabularyBirds/assets/audio/swift.wav
new file mode 100755
index 0000000..26bf222
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/swift.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/vulture.wav b/examples/lessons/6_English_VocabularyBirds/assets/audio/vulture.wav
new file mode 100755
index 0000000..4c75a14
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/vulture.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/audio/woodpecker.wav b/examples/lessons/6_English_VocabularyBirds/assets/audio/woodpecker.wav
new file mode 100755
index 0000000..6bbc63d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/audio/woodpecker.wav
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bg_footer.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bg_header.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bg_title_block.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_back.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_back_hover.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_help.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_help_hover.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_next.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_next_hover.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_ole.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_ole_hover.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again_hover.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_start.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_start_hover.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/btn_start_mouse_down.png b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul.png
new file mode 100755
index 0000000..2108b97
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul0.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul0.png
new file mode 100755
index 0000000..c0365f7
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul1.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul1.png
new file mode 100755
index 0000000..c8448a6
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul2.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul2.png
new file mode 100755
index 0000000..a1f8823
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul3.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul3.png
new file mode 100755
index 0000000..bacedaf
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul4.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul4.png
new file mode 100755
index 0000000..06b5d2f
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul5.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul5.png
new file mode 100755
index 0000000..cb1fd35
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul6.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul6.png
new file mode 100755
index 0000000..ecf1350
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul7.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul7.png
new file mode 100755
index 0000000..f714c18
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul8.png b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul8.png
new file mode 100755
index 0000000..142ec5d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/bulbul8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/check.png b/examples/lessons/6_English_VocabularyBirds/assets/image/check.png
new file mode 100755
index 0000000..84fc229
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/check.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/confirm.png b/examples/lessons/6_English_VocabularyBirds/assets/image/confirm.png
new file mode 100755
index 0000000..cb0b4e2
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/confirm.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/correct.png b/examples/lessons/6_English_VocabularyBirds/assets/image/correct.png
new file mode 100755
index 0000000..ca9b9db
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/crane.png b/examples/lessons/6_English_VocabularyBirds/assets/image/crane.png
new file mode 100755
index 0000000..ec850e9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/crane.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/crane0.png b/examples/lessons/6_English_VocabularyBirds/assets/image/crane0.png
new file mode 100755
index 0000000..5793f79
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/crane0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/crane1.png b/examples/lessons/6_English_VocabularyBirds/assets/image/crane1.png
new file mode 100755
index 0000000..c4e1988
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/crane1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/crane2.png b/examples/lessons/6_English_VocabularyBirds/assets/image/crane2.png
new file mode 100755
index 0000000..fb7ea3e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/crane2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/crane3.png b/examples/lessons/6_English_VocabularyBirds/assets/image/crane3.png
new file mode 100755
index 0000000..994d00d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/crane3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/crane4.png b/examples/lessons/6_English_VocabularyBirds/assets/image/crane4.png
new file mode 100755
index 0000000..6260713
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/crane4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/crane5.png b/examples/lessons/6_English_VocabularyBirds/assets/image/crane5.png
new file mode 100755
index 0000000..903967d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/crane5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/crane6.png b/examples/lessons/6_English_VocabularyBirds/assets/image/crane6.png
new file mode 100755
index 0000000..188b66c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/crane6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/crane7.png b/examples/lessons/6_English_VocabularyBirds/assets/image/crane7.png
new file mode 100755
index 0000000..a21549e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/crane7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/crane8.png b/examples/lessons/6_English_VocabularyBirds/assets/image/crane8.png
new file mode 100755
index 0000000..752a8cb
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/crane8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/egret.png b/examples/lessons/6_English_VocabularyBirds/assets/image/egret.png
new file mode 100755
index 0000000..6614858
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/egret.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/egret0.png b/examples/lessons/6_English_VocabularyBirds/assets/image/egret0.png
new file mode 100755
index 0000000..15b8ff2
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/egret0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/egret1.png b/examples/lessons/6_English_VocabularyBirds/assets/image/egret1.png
new file mode 100755
index 0000000..43afe8e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/egret1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/egret2.png b/examples/lessons/6_English_VocabularyBirds/assets/image/egret2.png
new file mode 100755
index 0000000..3d94056
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/egret2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/egret3.png b/examples/lessons/6_English_VocabularyBirds/assets/image/egret3.png
new file mode 100755
index 0000000..62ad133
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/egret3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/egret4.png b/examples/lessons/6_English_VocabularyBirds/assets/image/egret4.png
new file mode 100755
index 0000000..6fafa76
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/egret4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/egret5.png b/examples/lessons/6_English_VocabularyBirds/assets/image/egret5.png
new file mode 100755
index 0000000..397d6d9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/egret5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/egret6.png b/examples/lessons/6_English_VocabularyBirds/assets/image/egret6.png
new file mode 100755
index 0000000..dc14be9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/egret6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/egret7.png b/examples/lessons/6_English_VocabularyBirds/assets/image/egret7.png
new file mode 100755
index 0000000..dd9a4a8
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/egret7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/egret8.png b/examples/lessons/6_English_VocabularyBirds/assets/image/egret8.png
new file mode 100755
index 0000000..2555f34
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/egret8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/help.png b/examples/lessons/6_English_VocabularyBirds/assets/image/help.png
new file mode 100755
index 0000000..fd24e98
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/help.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/incorrect.png b/examples/lessons/6_English_VocabularyBirds/assets/image/incorrect.png
new file mode 100755
index 0000000..49ee2a2
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/incorrect.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher.png b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher.png
new file mode 100755
index 0000000..611cd5f
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher0.png b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher0.png
new file mode 100755
index 0000000..f602210
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher1.png b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher1.png
new file mode 100755
index 0000000..4b6794d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher2.png b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher2.png
new file mode 100755
index 0000000..d4796e9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher3.png b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher3.png
new file mode 100755
index 0000000..87a416d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher4.png b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher4.png
new file mode 100755
index 0000000..6aba359
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher5.png b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher5.png
new file mode 100755
index 0000000..4000d25
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher6.png b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher6.png
new file mode 100755
index 0000000..8e676f3
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher7.png b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher7.png
new file mode 100755
index 0000000..dbebe29
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher8.png b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher8.png
new file mode 100755
index 0000000..89c2ba4
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/kingfisher8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich.png b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich.png
new file mode 100755
index 0000000..25d6198
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich0.png b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich0.png
new file mode 100755
index 0000000..e2b8296
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich1.png b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich1.png
new file mode 100755
index 0000000..044401f
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich2.png b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich2.png
new file mode 100755
index 0000000..edcc9a0
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich3.png b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich3.png
new file mode 100755
index 0000000..d6155b0
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich4.png b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich4.png
new file mode 100755
index 0000000..e7e46df
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich5.png b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich5.png
new file mode 100755
index 0000000..ce17d44
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich6.png b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich6.png
new file mode 100755
index 0000000..e67e84f
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich7.png b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich7.png
new file mode 100755
index 0000000..fc4bf95
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich8.png b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich8.png
new file mode 100755
index 0000000..27a79a0
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/ostrich8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/penguin.png b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin.png
new file mode 100755
index 0000000..2a79508
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/penguin0.png b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin0.png
new file mode 100755
index 0000000..562214b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/penguin1.png b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin1.png
new file mode 100755
index 0000000..1933512
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/penguin2.png b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin2.png
new file mode 100755
index 0000000..c326eac
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/penguin3.png b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin3.png
new file mode 100755
index 0000000..5ed16ae
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/penguin4.png b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin4.png
new file mode 100755
index 0000000..f849e3c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/penguin5.png b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin5.png
new file mode 100755
index 0000000..6dc42d8
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/penguin6.png b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin6.png
new file mode 100755
index 0000000..2f144cf
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/penguin7.png b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin7.png
new file mode 100755
index 0000000..a32938b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/penguin8.png b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin8.png
new file mode 100755
index 0000000..1154617
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/penguin8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swan.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swan.png
new file mode 100755
index 0000000..8145406
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swan.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swan0.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swan0.png
new file mode 100755
index 0000000..be34cf7
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swan0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swan1.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swan1.png
new file mode 100755
index 0000000..b66d013
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swan1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swan2.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swan2.png
new file mode 100755
index 0000000..b09db30
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swan2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swan3.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swan3.png
new file mode 100755
index 0000000..8e4769d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swan3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swan4.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swan4.png
new file mode 100755
index 0000000..132868c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swan4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swan5.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swan5.png
new file mode 100755
index 0000000..6a04d66
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swan5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swan6.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swan6.png
new file mode 100755
index 0000000..b08e5e8
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swan6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swan7.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swan7.png
new file mode 100755
index 0000000..ba0e316
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swan7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swan8.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swan8.png
new file mode 100755
index 0000000..5b0f2a4
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swan8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swift.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swift.png
new file mode 100755
index 0000000..8574f2e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swift.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swift0.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swift0.png
new file mode 100755
index 0000000..4b0b70d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swift0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swift1.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swift1.png
new file mode 100755
index 0000000..ec0abb6
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swift1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swift2.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swift2.png
new file mode 100755
index 0000000..cc999d4
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swift2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swift3.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swift3.png
new file mode 100755
index 0000000..608db95
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swift3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swift4.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swift4.png
new file mode 100755
index 0000000..8d99ce0
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swift4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swift5.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swift5.png
new file mode 100755
index 0000000..5883f5e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swift5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swift6.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swift6.png
new file mode 100755
index 0000000..ba594c8
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swift6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swift7.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swift7.png
new file mode 100755
index 0000000..7446eef
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swift7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/swift8.png b/examples/lessons/6_English_VocabularyBirds/assets/image/swift8.png
new file mode 100755
index 0000000..f7ef3ee
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/swift8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/title_block_lt.png b/examples/lessons/6_English_VocabularyBirds/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/title_block_rt.png b/examples/lessons/6_English_VocabularyBirds/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/volImage.png b/examples/lessons/6_English_VocabularyBirds/assets/image/volImage.png
new file mode 100755
index 0000000..04ec789
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/volImage.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/vulture.png b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture.png
new file mode 100755
index 0000000..e737642
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/vulture0.png b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture0.png
new file mode 100755
index 0000000..9283190
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/vulture1.png b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture1.png
new file mode 100755
index 0000000..e2c0367
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/vulture2.png b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture2.png
new file mode 100755
index 0000000..e34b454
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/vulture3.png b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture3.png
new file mode 100755
index 0000000..2f7e7c7
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/vulture4.png b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture4.png
new file mode 100755
index 0000000..9556db0
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/vulture5.png b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture5.png
new file mode 100755
index 0000000..fde5f3d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/vulture6.png b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture6.png
new file mode 100755
index 0000000..9c5f6d0
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/vulture7.png b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture7.png
new file mode 100755
index 0000000..e481051
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/vulture8.png b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture8.png
new file mode 100755
index 0000000..a8d5319
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/vulture8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker.png b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker.png
new file mode 100755
index 0000000..2a20d93
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker0.png b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker0.png
new file mode 100755
index 0000000..ca8609c
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker0.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker1.png b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker1.png
new file mode 100755
index 0000000..13e15bd
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker1.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker2.png b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker2.png
new file mode 100755
index 0000000..d9ae9a9
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker2.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker3.png b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker3.png
new file mode 100755
index 0000000..9e90eb7
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker3.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker4.png b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker4.png
new file mode 100755
index 0000000..2ca9358
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker4.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker5.png b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker5.png
new file mode 100755
index 0000000..1f83199
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker5.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker6.png b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker6.png
new file mode 100755
index 0000000..fdf1710
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker6.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker7.png b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker7.png
new file mode 100755
index 0000000..efffcb5
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker7.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker8.png b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker8.png
new file mode 100755
index 0000000..087af3d
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/assets/image/woodpecker8.png
Binary files differ
diff --git a/examples/lessons/6_English_VocabularyBirds/css/lesson.css b/examples/lessons/6_English_VocabularyBirds/css/lesson.css
new file mode 100755
index 0000000..0a38c18
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/css/lesson.css
@@ -0,0 +1,306 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: absolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ /*width: 251px;*/
+ padding-right: 5px;
+ padding-top: 5px;
+}
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+a img{
+ border: 0;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0px auto;
+ margin-top: 85px;
+ width: 100%;
+ height: 400px;
+
+}
+ #section{
+ width: 1000px;
+ height: 390px;
+ margin: 5px auto;
+ }
+
+ #topText{
+ margin: 1px auto;
+ height: 25px;
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #0000FF;
+ text-align:center;
+ }
+ #imgAnimalsDisplay{
+ margin: 5px auto;
+ width: 300px;
+ height: 300px;
+ text-align:center;
+ }
+ #animalText{
+ margin: 5px auto;
+ width: 175px;
+ height: 25px;
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #000000;
+ text-align:center;
+
+ }
+
+ /*** 2nd section ****/
+ #infoText{
+ padding: 5px;
+ width: 500px;
+ height: 30px;
+ font: 15px/20px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #000000;
+ text-align:center;
+
+ }
+ .imgVol{
+ float:left;
+ width: 48px;
+ height: 48px;
+ background-image: url(../assets/image/volImage.png);
+ }
+ #imgPuzzleArea{
+ margin-left: 100px;
+ margin-top: 15px;
+ width: 306px;
+ height: 306px;
+ border:1px solid #A8F42D;
+ }
+ .imgPuzzle{
+ float: left;
+ width: 100px;
+ height: 100px;
+ border:1px solid #A8F42D;
+ }
+ .default{
+ background-color: #C8FFC2;
+ }
+
+ #dragImgSection{
+ position:absolute;
+ top: 25%;
+ right: 5%;
+ width: 510px;
+ height: 306px;
+ border:1px solid #A8F42D;
+ }
+ .imgAnim{
+ margin-top: 75px;
+ }
+
+ .drophover{
+ background: #FF9900;
+ }
+
+
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+
+ #confirmSection{
+ position: absolute;
+ top: 20%;
+ left: 42%;
+ width: 580px;
+ height: 350px;
+
+ }
+ #checkAnswer{
+ float:left;
+ margin-top: 50px;
+ width: 100px;
+ height: 92px;
+ }
+
+ #confirmBox{
+ margin-top: 50px;
+ margin-left:30px;
+ width: 300px;
+ height: 250px;
+ border: 2px solid #E2D97F;
+ background-color: #000;
+ opacity: 0.8;
+ -moz-border-radius : 20px;
+ -webkit-border-radius : 20px;
+ border-radius : 20px;
+
+ }
+
+ #confimBtn{
+ margin: 1em auto;
+ width: 120px;
+ height: 35px;
+ background: url(../assets/image/confirm.png);
+ }
+ #dragTxtSection{
+ position: absolute;
+ margin: 0.5em auto;
+ top: 8%;
+ right: 10%;
+ width: 100px;
+ height: 303px;
+ border: 2px solid #FF9900;
+ text-align:center;
+ }
+
+ #help{
+ position:absolute;
+ right: 20%;
+ top: 1%;
+ width: 224px;
+ height: 525px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+ #gameOver{
+ position:absolute;
+ top: 40%;
+ left: 25%;
+ width: 500px;
+ text-align:center;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ color:red;
+ }
+ #gameOverInfo{
+ margin-top: 35px;
+ text-align:center;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#06D946;
+
+ }
+ .specialText{
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF9900;
+ border-bottom: 2px dotted #CCC;
+ } \ No newline at end of file
diff --git a/examples/lessons/6_English_VocabularyBirds/index.html b/examples/lessons/6_English_VocabularyBirds/index.html
new file mode 100755
index 0000000..b2aa9c1
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/index.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Vocabulary Birds</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Vocabulary: Wild Birds <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="confirmSection"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_VocabularyBirds/js/jquery-1.4.js b/examples/lessons/6_English_VocabularyBirds/js/jquery-1.4.js
new file mode 100755
index 0000000..a448490
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/js/jquery-1.4.js
@@ -0,0 +1,5999 @@
+/*!
+ * jQuery JavaScript Library v1.4
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://docs.jquery.com/License
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Jan 13 15:23:05 2010 -0500
+ */
+(function( window, undefined ) {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
+
+ // Is it a simple selector
+ isSimple = /^.[^:#\[\.,]*$/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // Has the ready events already been bound?
+ readyBound = false,
+
+ // The functions to execute on DOM ready
+ readyList = [],
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ indexOf = Array.prototype.indexOf;
+
+jQuery.fn = jQuery.prototype = {
+ init: function( selector, context ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ match = quickExpr.exec( selector );
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
+ }
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ if ( elem ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $("TAG")
+ } else if ( !context && /^\w+$/.test( selector ) ) {
+ this.selector = selector;
+ this.context = document;
+ selector = document.getElementsByTagName( selector );
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return jQuery( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.isArray( selector ) ?
+ this.setArray( selector ) :
+ jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.4",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = jQuery( elems || null );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Force the current matched set of elements to become
+ // the specified array of elements (destroying the stack in the process)
+ // You should use pushStack() in order to do this, but maintain the stack
+ setArray: function( elems ) {
+ // Resetting the length to 0, then using the native Array push
+ // is a super-fast way to populate an object with array-like properties
+ this.length = 0;
+ push.apply( this, elems );
+
+ return this;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // If the DOM is already ready
+ if ( jQuery.isReady ) {
+ // Execute the function immediately
+ fn.call( document, jQuery );
+
+ // Otherwise, remember the function for later
+ } else if ( readyList ) {
+ // Add the function to the wait list
+ readyList.push( fn );
+ }
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || jQuery(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ // copy reference to target object
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging object literal values or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
+ var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
+ : jQuery.isArray(copy) ? [] : {};
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ window.$ = _$;
+
+ if ( deep ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // Handle when the DOM is ready
+ ready: function() {
+ // Make sure that the DOM is not already loaded
+ if ( !jQuery.isReady ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 13 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If there are functions bound, to execute
+ if ( readyList ) {
+ // Execute all of them
+ var fn, i = 0;
+ while ( (fn = readyList[ i++ ]) ) {
+ fn.call( document, jQuery );
+ }
+
+ // Reset the list of functions
+ readyList = null;
+ }
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyBound ) {
+ return;
+ }
+
+ readyBound = true;
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ return jQuery.ready();
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent("onreadystatechange", DOMContentLoaded);
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return toString.call(obj) === "[object Function]";
+ },
+
+ isArray: function( obj ) {
+ return toString.call(obj) === "[object Array]";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor
+ && !hasOwnProperty.call(obj, "constructor")
+ && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwnProperty.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ noop: function() {},
+
+ // Evalulates a script in a global context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test(data) ) {
+ // Inspired by code by Andrea Giammarchi
+ // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+ var head = document.getElementsByTagName("head")[0] || document.documentElement,
+ script = document.createElement("script");
+
+ script.type = "text/javascript";
+
+ if ( jQuery.support.scriptEval ) {
+ script.appendChild( document.createTextNode( data ) );
+ } else {
+ script.text = data;
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709).
+ head.insertBefore( script, head.firstChild );
+ head.removeChild( script );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction(object);
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( var value = object[0];
+ i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+ }
+ }
+
+ return object;
+ },
+
+ trim: function( text ) {
+ return (text || "").replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+ if ( array.indexOf ) {
+ return array.indexOf( elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length, j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [];
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ if ( !inv !== !callback( elems[ i ], i ) ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var ret = [], value;
+
+ // Go through the array, translating each of the items to their
+ // new value (or values).
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ proxy: function( fn, proxy, thisObject ) {
+ if ( arguments.length === 2 ) {
+ if ( typeof proxy === "string" ) {
+ thisObject = fn;
+ fn = thisObject[ proxy ];
+ proxy = undefined;
+
+ } else if ( proxy && !jQuery.isFunction( proxy ) ) {
+ thisObject = proxy;
+ proxy = undefined;
+ }
+ }
+
+ if ( !proxy && fn ) {
+ proxy = function() {
+ return fn.apply( thisObject || this, arguments );
+ };
+ }
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ if ( fn ) {
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+ }
+
+ // So proxy can be declared as an argument
+ return proxy;
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ var ret = { browser: "" };
+
+ ua = ua.toLowerCase();
+
+ if ( /webkit/.test( ua ) ) {
+ ret = { browser: "webkit", version: /webkit[\/ ]([\w.]+)/ };
+
+ } else if ( /opera/.test( ua ) ) {
+ ret = { browser: "opera", version: /version/.test( ua ) ? /version[\/ ]([\w.]+)/ : /opera[\/ ]([\w.]+)/ };
+
+ } else if ( /msie/.test( ua ) ) {
+ ret = { browser: "msie", version: /msie ([\w.]+)/ };
+
+ } else if ( /mozilla/.test( ua ) && !/compatible/.test( ua ) ) {
+ ret = { browser: "mozilla", version: /rv:([\w.]+)/ };
+ }
+
+ ret.version = (ret.version && ret.version.exec( ua ) || [0, "0"])[1];
+
+ return ret;
+ },
+
+ browser: {}
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+if ( indexOf ) {
+ jQuery.inArray = function( elem, array ) {
+ return indexOf.call( array, elem );
+ };
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch( error ) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+if ( indexOf ) {
+ jQuery.inArray = function( elem, array ) {
+ return indexOf.call( array, elem );
+ };
+}
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+// Mutifunctional method to get and set values to a collection
+// The value/s can be optionally by executed if its a function
+function access( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : null;
+}
+
+function now() {
+ return (new Date).getTime();
+}
+(function() {
+
+ jQuery.support = {};
+
+ var root = document.documentElement,
+ script = document.createElement("script"),
+ div = document.createElement("div"),
+ id = "script" + now();
+
+ div.style.display = "none";
+ div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+ var all = div.getElementsByTagName("*"),
+ a = div.getElementsByTagName("a")[0];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return;
+ }
+
+ jQuery.support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: div.firstChild.nodeType === 3,
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText insted)
+ style: /red/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: a.getAttribute("href") === "/a",
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: div.getElementsByTagName("input")[0].value === "on",
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
+
+ // Will be defined later
+ scriptEval: false,
+ noCloneEvent: true,
+ boxModel: null
+ };
+
+ script.type = "text/javascript";
+ try {
+ script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
+ } catch(e) {}
+
+ root.insertBefore( script, root.firstChild );
+
+ // Make sure that the execution of code works by injecting a script
+ // tag with appendChild/createTextNode
+ // (IE doesn't support this, fails, and uses .text instead)
+ if ( window[ id ] ) {
+ jQuery.support.scriptEval = true;
+ delete window[ id ];
+ }
+
+ root.removeChild( script );
+
+ if ( div.attachEvent && div.fireEvent ) {
+ div.attachEvent("onclick", function click() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ jQuery.support.noCloneEvent = false;
+ div.detachEvent("onclick", click);
+ });
+ div.cloneNode(true).fireEvent("onclick");
+ }
+
+ // Figure out if the W3C box model works as expected
+ // document.body must exist before we can do this
+ // TODO: This timeout is temporary until I move ready into core.js.
+ jQuery(function() {
+ var div = document.createElement("div");
+ div.style.width = div.style.paddingLeft = "1px";
+
+ document.body.appendChild( div );
+ jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+ document.body.removeChild( div ).style.display = 'none';
+ div = null;
+ });
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+ var eventSupported = function( eventName ) {
+ var el = document.createElement("div");
+ eventName = "on" + eventName;
+
+ var isSupported = (eventName in el);
+ if ( !isSupported ) {
+ el.setAttribute(eventName, "return;");
+ isSupported = typeof el[eventName] === "function";
+ }
+ el = null;
+
+ return isSupported;
+ };
+
+ jQuery.support.submitBubbles = eventSupported("submit");
+ jQuery.support.changeBubbles = eventSupported("change");
+
+ // release memory in IE
+ root = script = div = all = a = null;
+})();
+
+jQuery.props = {
+ "for": "htmlFor",
+ "class": "className",
+ readonly: "readOnly",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ rowspan: "rowSpan",
+ colspan: "colSpan",
+ tabindex: "tabIndex",
+ usemap: "useMap",
+ frameborder: "frameBorder"
+};
+var expando = "jQuery" + now(), uuid = 0, windowData = {};
+var emptyObject = {};
+
+jQuery.extend({
+ cache: {},
+
+ expando:expando,
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ "object": true,
+ "applet": true
+ },
+
+ data: function( elem, name, data ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ], cache = jQuery.cache, thisCache;
+
+ // Handle the case where there's no name immediately
+ if ( !name && !id ) {
+ return null;
+ }
+
+ // Compute a unique ID for the element
+ if ( !id ) {
+ id = ++uuid;
+ }
+
+ // Avoid generating a new cache unless none exists and we
+ // want to manipulate it.
+ if ( typeof name === "object" ) {
+ elem[ expando ] = id;
+ thisCache = cache[ id ] = jQuery.extend(true, {}, name);
+ } else if ( cache[ id ] ) {
+ thisCache = cache[ id ];
+ } else if ( typeof data === "undefined" ) {
+ thisCache = emptyObject;
+ } else {
+ thisCache = cache[ id ] = {};
+ }
+
+ // Prevent overriding the named cache with undefined values
+ if ( data !== undefined ) {
+ elem[ expando ] = id;
+ thisCache[ name ] = data;
+ }
+
+ return typeof name === "string" ? thisCache[ name ] : thisCache;
+ },
+
+ removeData: function( elem, name ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
+
+ // If we want to remove a specific section of the element's data
+ if ( name ) {
+ if ( thisCache ) {
+ // Remove the section of cache data
+ delete thisCache[ name ];
+
+ // If we've removed all the data, remove the element's cache
+ if ( jQuery.isEmptyObject(thisCache) ) {
+ jQuery.removeData( elem );
+ }
+ }
+
+ // Otherwise, we want to remove all of the element's data
+ } else {
+ // Clean up the element expando
+ try {
+ delete elem[ expando ];
+ } catch( e ) {
+ // IE has trouble directly removing the expando
+ // but it's ok with using removeAttribute
+ if ( elem.removeAttribute ) {
+ elem.removeAttribute( expando );
+ }
+ }
+
+ // Completely remove the data cache
+ delete cache[ id ];
+ }
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ if ( typeof key === "undefined" && this.length ) {
+ return jQuery.data( this[0] );
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ }
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ } else {
+ return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
+ jQuery.data( this, key, value );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ if ( !elem ) {
+ return;
+ }
+
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( !data ) {
+ return q || [];
+ }
+
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data) );
+
+ } else {
+ q.push( data );
+ }
+
+ return q;
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ), fn = queue.shift();
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function( i, elem ) {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ }
+});
+var rclass = /[\n\t]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rspecialurl = /href|src|style/,
+ rtype = /(button|input)/i,
+ rfocusable = /(button|input|object|select|textarea)/i,
+ rclickable = /^(a|area)$/i,
+ rradiocheck = /radio|checkbox/;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name, fn ) {
+ return this.each(function(){
+ jQuery.attr( this, name, "" );
+ if ( this.nodeType === 1 ) {
+ this.removeAttribute( name );
+ }
+ });
+ },
+
+ addClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.addClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ var classNames = (value || "").split( rspace );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className ) {
+ elem.className = value;
+
+ } else {
+ var className = " " + elem.className + " ";
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
+ elem.className += " " + classNames[c];
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.removeClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ var classNames = (value || "").split(rspace);
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ var className = (" " + elem.className + " ").replace(rclass, " ");
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[c] + " ", " ");
+ }
+ elem.className = className.substring(1, className.length - 1);
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value, isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className, i = 0, self = jQuery(this),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery.data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ if ( value === undefined ) {
+ var elem = this[0];
+
+ if ( elem ) {
+ if ( jQuery.nodeName( elem, "option" ) ) {
+ return (elem.attributes.value || {}).specified ? elem.value : elem.text;
+ }
+
+ // We need to handle select boxes special
+ if ( jQuery.nodeName( elem, "select" ) ) {
+ var index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ if ( option.selected ) {
+ // Get the specifc value for the option
+ value = jQuery(option).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ }
+
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+
+
+ // Everything else, we just grab the value
+ return (elem.value || "").replace(rreturn, "");
+
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction(value);
+
+ return this.each(function(i) {
+ var self = jQuery(this), val = value;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call(this, i, self.val());
+ }
+
+ // Typecast each time if the value is a Function and the appended
+ // value is therefore different each time.
+ if ( typeof val === "number" ) {
+ val += "";
+ }
+
+ if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
+ this.checked = jQuery.inArray( self.val(), val ) >= 0;
+
+ } else if ( jQuery.nodeName( this, "select" ) ) {
+ var values = jQuery.makeArray(val);
+
+ jQuery( "option", this ).each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ this.selectedIndex = -1;
+ }
+
+ } else {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attr: function( elem, name, value, pass ) {
+ // don't set attributes on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery(elem)[name](value);
+ }
+
+ var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
+ // Whether we are setting (or getting)
+ set = value !== undefined;
+
+ // Try to normalize/fix the name
+ name = notxml && jQuery.props[ name ] || name;
+
+ // Only do all the following if this is a node (faster for style)
+ if ( elem.nodeType === 1 ) {
+ // These attributes require special treatment
+ var special = rspecialurl.test( name );
+
+ // Safari mis-reports the default selected property of an option
+ // Accessing the parent's selectedIndex property fixes it
+ if ( name === "selected" && !jQuery.support.optSelected ) {
+ var parent = elem.parentNode;
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ }
+
+ // If applicable, access the attribute via the DOM 0 way
+ if ( name in elem && notxml && !special ) {
+ if ( set ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
+ throw "type property can't be changed";
+ }
+
+ elem[ name ] = value;
+ }
+
+ // browsers index elements by id/name on forms, give priority to attributes.
+ if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
+ return elem.getAttributeNode( name ).nodeValue;
+ }
+
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ if ( name === "tabIndex" ) {
+ var attributeNode = elem.getAttributeNode( "tabIndex" );
+
+ return attributeNode && attributeNode.specified ?
+ attributeNode.value :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+
+ return elem[ name ];
+ }
+
+ if ( !jQuery.support.style && notxml && name === "style" ) {
+ if ( set ) {
+ elem.style.cssText = "" + value;
+ }
+
+ return elem.style.cssText;
+ }
+
+ if ( set ) {
+ // convert the value to a string (all browsers do this but IE) see #1070
+ elem.setAttribute( name, "" + value );
+ }
+
+ var attr = !jQuery.support.hrefNormalized && notxml && special ?
+ // Some attributes require a special call on IE
+ elem.getAttribute( name, 2 ) :
+ elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return attr === null ? undefined : attr;
+ }
+
+ // elem is actually elem.style ... set the style
+ // Using attr for specific style information is now deprecated. Use style insead.
+ return jQuery.style( elem, name, value );
+ }
+});
+var fcleanup = function( nm ) {
+ return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
+ return "\\" + ch;
+ });
+};
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // For whatever reason, IE has trouble passing the window object
+ // around, causing it to be cloned in the process
+ if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
+ elem = window;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // if data is passed, bind to handler
+ if ( data !== undefined ) {
+ // Create temporary function pointer to original handler
+ var fn = handler;
+
+ // Create unique handler function, wrapped around original handler
+ handler = jQuery.proxy( fn );
+
+ // Store data in unique handler
+ handler.data = data;
+ }
+
+ // Init the element's event structure
+ var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
+ handle = jQuery.data( elem, "handle" ), eventHandle;
+
+ if ( !handle ) {
+ eventHandle = function() {
+ // Handle the second event of a trigger and when
+ // an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+
+ handle = jQuery.data( elem, "handle", eventHandle );
+ }
+
+ // If no handle is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !handle ) {
+ return;
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native
+ // event in IE.
+ handle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split( /\s+/ );
+ var type, i=0;
+ while ( (type = types[ i++ ]) ) {
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ handler.type = namespaces.slice(0).sort().join(".");
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = this.special[ type ] || {};
+
+
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = {};
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, handle, false );
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, handle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers );
+ if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
+ modifiedHandler.guid = modifiedHandler.guid || handler.guid;
+ handler = modifiedHandler;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers[ handler.guid ] = handler;
+
+ // Keep track of which events have been used, for global triggering
+ this.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ var events = jQuery.data( elem, "events" ), ret, type, fn;
+
+ if ( events ) {
+ // Unbind all events for the element
+ if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
+ for ( type in events ) {
+ this.remove( elem, type + (types || "") );
+ }
+ } else {
+ // types is actually an event object here
+ if ( types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(/\s+/);
+ var i = 0;
+ while ( (type = types[ i++ ]) ) {
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ var all = !namespaces.length,
+ cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ),
+ namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"),
+ special = this.special[ type ] || {};
+
+ if ( events[ type ] ) {
+ // remove the given handler for the given type
+ if ( handler ) {
+ fn = events[ type ][ handler.guid ];
+ delete events[ type ][ handler.guid ];
+
+ // remove all handlers for the given type
+ } else {
+ for ( var handle in events[ type ] ) {
+ // Handle the removal of namespaced events
+ if ( all || namespace.test( events[ type ][ handle ].type ) ) {
+ delete events[ type ][ handle ];
+ }
+ }
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, namespaces, fn);
+ }
+
+ // remove generic event handler if no more handlers exist
+ for ( ret in events[ type ] ) {
+ break;
+ }
+ if ( !ret ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
+ } else if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
+ }
+ }
+ ret = null;
+ delete events[ type ];
+ }
+ }
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ for ( ret in events ) {
+ break;
+ }
+ if ( !ret ) {
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) {
+ handle.elem = null;
+ }
+ jQuery.removeData( elem, "events" );
+ jQuery.removeData( elem, "handle" );
+ }
+ }
+ },
+
+ // bubbling is internal
+ trigger: function( event, data, elem /*, bubbling */ ) {
+ // Event object or event type
+ var type = event.type || event,
+ bubbling = arguments[3];
+
+ if ( !bubbling ) {
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[expando] ? event :
+ // Object literal
+ jQuery.extend( jQuery.Event(type), event ) :
+ // Just the event type (string)
+ jQuery.Event(type);
+
+ if ( type.indexOf("!") >= 0 ) {
+ event.type = type = type.slice(0, -1);
+ event.exclusive = true;
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // Don't bubble custom events when global (to avoid too much overhead)
+ event.stopPropagation();
+
+ // Only trigger if we've ever bound an event for it
+ if ( this.global[ type ] ) {
+ jQuery.each( jQuery.cache, function() {
+ if ( this.events && this.events[type] ) {
+ jQuery.event.trigger( event, data, this.handle.elem );
+ }
+ });
+ }
+ }
+
+ // Handle triggering a single element
+
+ // don't do events on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // Clean up in case it is reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone the incoming data, if any
+ data = jQuery.makeArray( data );
+ data.unshift( event );
+ }
+
+ event.currentTarget = elem;
+
+ // Trigger the event, it is assumed that "handle" is a function
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) {
+ handle.apply( elem, data );
+ }
+
+ var nativeFn, nativeHandler;
+ try {
+ if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
+ nativeFn = elem[ type ];
+ nativeHandler = elem[ "on" + type ];
+ }
+ // prevent IE from throwing an error for some elements with some event types, see #3533
+ } catch (e) {}
+
+ var isClick = jQuery.nodeName(elem, "a") && type === "click";
+
+ // Trigger the native events (except for clicks on links)
+ if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !isClick ) {
+ this.triggered = true;
+ try {
+ elem[ type ]();
+ // prevent IE from throwing an error for some hidden elements
+ } catch (e) {}
+
+ // Handle triggering native .onfoo handlers
+ } else if ( nativeHandler && elem[ "on" + type ].apply( elem, data ) === false ) {
+ event.result = false;
+ }
+
+ this.triggered = false;
+
+ if ( !event.isPropagationStopped() ) {
+ var parent = elem.parentNode || elem.ownerDocument;
+ if ( parent ) {
+ jQuery.event.trigger( event, data, parent, true );
+ }
+ }
+ },
+
+ handle: function( event ) {
+ // returned undefined or false
+ var all, handlers;
+
+ event = arguments[0] = jQuery.event.fix( event || window.event );
+ event.currentTarget = this;
+
+ // Namespaced event handlers
+ var namespaces = event.type.split(".");
+ event.type = namespaces.shift();
+
+ // Cache this now, all = true means, any handler
+ all = !namespaces.length && !event.exclusive;
+
+ var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
+
+ handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
+
+ for ( var j in handlers ) {
+ var handler = handlers[ j ];
+
+ // Filter the functions by class
+ if ( all || namespace.test(handler.type) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handler;
+ event.data = handler.data;
+
+ var ret = handler.apply( this, arguments );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+
+ }
+ }
+
+ return event.result;
+ },
+
+ props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+
+ fix: function( event ) {
+ if ( event[ expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var doc = document.documentElement, body = document.body;
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
+ event.which = event.charCode || event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( proxy, data, namespaces, live ) {
+ jQuery.extend( proxy, data || {} );
+
+ proxy.guid += data.selector + data.live;
+ jQuery.event.add( this, data.live, liveHandler, data );
+
+ },
+
+ remove: function( namespaces ) {
+ if ( namespaces.length ) {
+ var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
+
+ jQuery.each( (jQuery.data(this, "events").live || {}), function() {
+ if ( name.test(this.type) ) {
+ remove++;
+ }
+ });
+
+ if ( remove < 1 ) {
+ jQuery.event.remove( this, namespaces[0], liveHandler );
+ }
+ }
+ },
+ special: {}
+ },
+ beforeunload: {
+ setup: function( data, namespaces, fn ) {
+ // We only want to do this special case on windows
+ if ( this.setInterval ) {
+ this.onbeforeunload = fn;
+ }
+
+ return false;
+ },
+ teardown: function( namespaces, fn ) {
+ if ( this.onbeforeunload === fn ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+jQuery.Event = function( src ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = now();
+
+ // Mark it as fixed
+ this[ expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+ }
+ // otherwise set the returnValue property of the original event to false (IE)
+ e.returnValue = false;
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+ // Check if mouse(over|out) are still within the same parent element
+ var parent = event.relatedTarget;
+
+ // Traverse up the tree
+ while ( parent && parent !== this ) {
+ // Firefox sometimes assigns relatedTarget a XUL element
+ // which we cannot access the parentNode property of
+ try {
+ parent = parent.parentNode;
+
+ // assuming we've left the element since we most likely mousedover a xul element
+ } catch(e) {
+ break;
+ }
+ }
+
+ if ( parent !== this ) {
+ // set the correct event type
+ event.type = event.data;
+
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+jQuery.event.special.submit = {
+ setup: function( data, namespaces, fn ) {
+ if ( this.nodeName.toLowerCase() !== "form" ) {
+ jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ remove: function( namespaces, fn ) {
+ jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") );
+ jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") );
+ }
+};
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+var formElems = /textarea|input|select/i;
+
+function getVal( elem ) {
+ var type = elem.type, val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( elem.nodeName.toLowerCase() === "select" ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+}
+
+function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery.data( elem, "_change_data" );
+ val = getVal(elem);
+
+ if ( val === data ) {
+ return;
+ }
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery.data( elem, "_change_data", val );
+ }
+
+ if ( elem.type !== "select" && (data != null || val) ) {
+ e.type = "change";
+ return jQuery.event.trigger( e, arguments[1], this );
+ }
+}
+
+jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information/focus[in] is not needed anymore
+ beforeactivate: function( e ) {
+ var elem = e.target;
+
+ if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) {
+ jQuery.data( elem, "_change_data", getVal(elem) );
+ }
+ }
+ },
+ setup: function( data, namespaces, fn ) {
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] );
+ }
+
+ return formElems.test( this.nodeName );
+ },
+ remove: function( namespaces, fn ) {
+ for ( var type in changeFilters ) {
+ jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] );
+ }
+
+ return formElems.test( this.nodeName );
+ }
+};
+
+var changeFilters = jQuery.event.special.change.filters;
+
+}
+
+function trigger( type, elem, args ) {
+ args[0].type = type;
+ return jQuery.event.handle.apply( elem, args );
+}
+
+// Create "bubbling" focus and blur events
+if ( document.addEventListener ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ this.addEventListener( orig, handler, true );
+ },
+ teardown: function() {
+ this.removeEventListener( orig, handler, true );
+ }
+ };
+
+ function handler( e ) {
+ e = jQuery.event.fix( e );
+ e.type = fix;
+ return jQuery.event.handle.call( this, e );
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( jQuery.isFunction( data ) ) {
+ thisObject = fn;
+ fn = data;
+ data = undefined;
+ }
+
+ var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ }) : fn;
+
+ return type === "unload" && name !== "one" ?
+ this.one( type, data, fn, thisObject ) :
+ this.each(function() {
+ jQuery.event.add( this, type, handler, data );
+ });
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+ return this;
+ }
+
+ return this.each(function() {
+ jQuery.event.remove( this, type, fn );
+ });
+ },
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ var event = jQuery.Event( type );
+ event.preventDefault();
+ event.stopPropagation();
+ jQuery.event.trigger( event, data, this[0] );
+ return event.result;
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments, i = 1;
+
+ // link all the functions, so any of them can unbind this click handler
+ while ( i < args.length ) {
+ jQuery.proxy( fn, args[ i++ ] );
+ }
+
+ return this.click( jQuery.proxy( fn, function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ }));
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ },
+
+ live: function( type, data, fn ) {
+ if ( jQuery.isFunction( data ) ) {
+ fn = data;
+ data = undefined;
+ }
+
+ jQuery( this.context ).bind( liveConvert( type, this.selector ), {
+ data: data, selector: this.selector, live: type
+ }, fn );
+
+ return this;
+ },
+
+ die: function( type, fn ) {
+ jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
+ return this;
+ }
+});
+
+function liveHandler( event ) {
+ var stop = true, elems = [], selectors = [], args = arguments,
+ related, match, fn, elem, j, i, data,
+ live = jQuery.extend({}, jQuery.data( this, "events" ).live);
+
+ for ( j in live ) {
+ fn = live[j];
+ if ( fn.live === event.type ||
+ fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) {
+
+ data = fn.data;
+ if ( !(data.beforeFilter && data.beforeFilter[event.type] &&
+ !data.beforeFilter[event.type](event)) ) {
+ selectors.push( fn.selector );
+ }
+ } else {
+ delete live[j];
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ for ( j in live ) {
+ fn = live[j];
+ elem = match[i].elem;
+ related = null;
+
+ if ( match[i].selector === fn.selector ) {
+ // Those two events require additional checking
+ if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) {
+ related = jQuery( event.relatedTarget ).closest( fn.selector )[0];
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, fn: fn });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+ event.currentTarget = match.elem;
+ event.data = match.fn.data;
+ if ( match.fn.apply( match.elem, args ) === false ) {
+ stop = false;
+ break;
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "&")].join(".");
+}
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( fn ) {
+ return fn ? this.bind( name, fn ) : this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+// Prevent memory leaks in IE
+// Window isn't included so as not to unbind existing unload events
+// More info:
+// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
+if ( window.attachEvent && !window.addEventListener ) {
+ window.attachEvent("onunload", function() {
+ for ( var id in jQuery.cache ) {
+ if ( jQuery.cache[ id ].handle ) {
+ // Try/Catch is to handle iframes being unloaded, see #4280
+ try {
+ jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+ } catch(e) {}
+ }
+ }
+ });
+}
+/*!
+ * Sizzle CSS Selector Engine - v1.0
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function(){
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function(selector, context, results, seed) {
+ results = results || [];
+ var origContext = context = context || document;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+ var ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
+ }
+
+ if ( context ) {
+ var ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+ set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray(set);
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ var cur = parts.pop(), pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ throw "Syntax error, unrecognized expression: " + (cur || selector);
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+ } else if ( context && context.nodeType === 1 ) {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+ } else {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function(results){
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort(sortOrder);
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[i-1] ) {
+ results.splice(i--, 1);
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function(expr, set){
+ return Sizzle(expr, null, null, set);
+};
+
+Sizzle.find = function(expr, context, isXML){
+ var set, match;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var type = Expr.order[i], match;
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace(/\\/g, "");
+ set = Expr.find[ type ]( match, context, isXML );
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = context.getElementsByTagName("*");
+ }
+
+ return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+ var old = expr, result = [], curLoop = set, match, anyFound,
+ isXMLFilter = set && set[0] && isXML(set[0]);
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var filter = Expr.filter[ type ], found, item, left = match[1];
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+ } else {
+ curLoop[i] = false;
+ }
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ throw "Syntax error, unrecognized expression: " + expr;
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+var Expr = Sizzle.selectors = {
+ order: [ "ID", "NAME", "TAG" ],
+ match: {
+ ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
+ TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
+ CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+ },
+ leftMatch: {},
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+ attrHandle: {
+ href: function(elem){
+ return elem.getAttribute("href");
+ }
+ },
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !/\W/.test(part),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part){
+ var isPartStr = typeof part === "string";
+
+ if ( isPartStr && !/\W/.test(part) ) {
+ part = part.toLowerCase();
+
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+ } else {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+ "": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = part.toLowerCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+ },
+ "~": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = part.toLowerCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
+ }
+ },
+ find: {
+ ID: function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? [m] : [];
+ }
+ },
+ NAME: function(match, context){
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [], results = context.getElementsByName(match[1]);
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+ TAG: function(match, context){
+ return context.getElementsByTagName(match[1]);
+ }
+ },
+ preFilter: {
+ CLASS: function(match, curLoop, inplace, result, not, isXML){
+ match = " " + match[1].replace(/\\/g, "") + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+ ID: function(match){
+ return match[1].replace(/\\/g, "");
+ },
+ TAG: function(match, curLoop){
+ return match[1].toLowerCase();
+ },
+ CHILD: function(match){
+ if ( match[1] === "nth" ) {
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+ ATTR: function(match, curLoop, inplace, result, not, isXML){
+ var name = match[1].replace(/\\/g, "");
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+ PSEUDO: function(match, curLoop, inplace, result, not){
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+ return false;
+ }
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+ POS: function(match){
+ match.unshift( true );
+ return match;
+ }
+ },
+ filters: {
+ enabled: function(elem){
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+ disabled: function(elem){
+ return elem.disabled === true;
+ },
+ checked: function(elem){
+ return elem.checked === true;
+ },
+ selected: function(elem){
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ elem.parentNode.selectedIndex;
+ return elem.selected === true;
+ },
+ parent: function(elem){
+ return !!elem.firstChild;
+ },
+ empty: function(elem){
+ return !elem.firstChild;
+ },
+ has: function(elem, i, match){
+ return !!Sizzle( match[3], elem ).length;
+ },
+ header: function(elem){
+ return /h\d/i.test( elem.nodeName );
+ },
+ text: function(elem){
+ return "text" === elem.type;
+ },
+ radio: function(elem){
+ return "radio" === elem.type;
+ },
+ checkbox: function(elem){
+ return "checkbox" === elem.type;
+ },
+ file: function(elem){
+ return "file" === elem.type;
+ },
+ password: function(elem){
+ return "password" === elem.type;
+ },
+ submit: function(elem){
+ return "submit" === elem.type;
+ },
+ image: function(elem){
+ return "image" === elem.type;
+ },
+ reset: function(elem){
+ return "reset" === elem.type;
+ },
+ button: function(elem){
+ return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
+ },
+ input: function(elem){
+ return /input|select|textarea|button/i.test(elem.nodeName);
+ }
+ },
+ setFilters: {
+ first: function(elem, i){
+ return i === 0;
+ },
+ last: function(elem, i, match, array){
+ return i === array.length - 1;
+ },
+ even: function(elem, i){
+ return i % 2 === 0;
+ },
+ odd: function(elem, i){
+ return i % 2 === 1;
+ },
+ lt: function(elem, i, match){
+ return i < match[3] - 0;
+ },
+ gt: function(elem, i, match){
+ return i > match[3] - 0;
+ },
+ nth: function(elem, i, match){
+ return match[3] - 0 === i;
+ },
+ eq: function(elem, i, match){
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ } else {
+ throw "Syntax error, unrecognized expression: " + name;
+ }
+ },
+ CHILD: function(elem, match){
+ var type = match[1], node = elem;
+ switch (type) {
+ case 'only':
+ case 'first':
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ if ( type === "first" ) {
+ return true;
+ }
+ node = elem;
+ case 'last':
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ return true;
+ case 'nth':
+ var first = match[2], last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+ if ( first === 0 ) {
+ return diff === 0;
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+ ID: function(elem, match){
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+ TAG: function(elem, match){
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+ CLASS: function(elem, match){
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+ ATTR: function(elem, match){
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+ POS: function(elem, match, i, array){
+ var name = match[2], filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS;
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
+ return "\\" + (num - 0 + 1);
+ }));
+}
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 );
+
+// Provide a fallback method if it does not work
+} catch(e){
+ makeArray = function(array, results) {
+ var ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var i = 0, l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+ } else {
+ for ( var i = 0; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( "sourceIndex" in document.documentElement ) {
+ sortOrder = function( a, b ) {
+ if ( !a.sourceIndex || !b.sourceIndex ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.sourceIndex ? -1 : 1;
+ }
+
+ var ret = a.sourceIndex - b.sourceIndex;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( document.createRange ) {
+ sortOrder = function( a, b ) {
+ if ( !a.ownerDocument || !b.ownerDocument ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.ownerDocument ? -1 : 1;
+ }
+
+ var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
+ aRange.setStart(a, 0);
+ aRange.setEnd(a, 0);
+ bRange.setStart(b, 0);
+ bRange.setEnd(b, 0);
+ var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+function getText( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date).getTime();
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+ }
+ };
+
+ Expr.filter.ID = function(elem, match){
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+ root = form = null; // release memory in IE
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+ Expr.attrHandle.href = function(elem){
+ return elem.getAttribute("href", 2);
+ };
+ }
+
+ div = null; // release memory in IE
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle, div = document.createElement("div");
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && context.nodeType === 9 && !isXML(context) ) {
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(e){}
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ div = null; // release memory in IE
+ })();
+}
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function(match, context, isXML) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ div = null; // release memory in IE
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+var contains = document.compareDocumentPosition ? function(a, b){
+ return a.compareDocumentPosition(b) & 16;
+} : function(a, b){
+ return a !== b && (a.contains ? a.contains(b) : true);
+};
+
+var isXML = function(elem){
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function(selector, context){
+ var tmpSet = [], later = "", match,
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.getText = getText;
+jQuery.isXMLDoc = isXML;
+jQuery.contains = contains;
+
+return;
+
+window.Sizzle = Sizzle;
+
+})();
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ slice = Array.prototype.slice;
+
+// Implement the identical functionality for filter and not
+var winnow = function( elements, qualifier, keep ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return !!qualifier.call( elem, i, elem ) === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+};
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var ret = this.pushStack( "", "find", selector ), length = 0;
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( var n = length; n < ret.length; n++ ) {
+ for ( var r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && jQuery.filter( selector, this ).length > 0;
+ },
+
+ closest: function( selectors, context ) {
+ if ( jQuery.isArray( selectors ) ) {
+ var ret = [], cur = this[0], match, matches = {}, selector;
+
+ if ( cur && selectors.length ) {
+ for ( var i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[selector] ) {
+ matches[selector] = jQuery.expr.match.POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[selector];
+
+ if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
+ ret.push({ selector: selector, elem: cur });
+ delete matches[selector];
+ }
+ }
+ cur = cur.parentNode;
+ }
+ }
+
+ return ret;
+ }
+
+ var pos = jQuery.expr.match.POS.test( selectors ) ?
+ jQuery( selectors, context || this.context ) : null;
+
+ return this.map(function( i, cur ) {
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
+ return cur;
+ }
+ cur = cur.parentNode;
+ }
+ return null;
+ });
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ if ( !elem || typeof elem === "string" ) {
+ return jQuery.inArray( this[0],
+ // If it receives a string, the selector is used
+ // If it receives nothing, the siblings are used
+ elem ? jQuery( elem ) : this.parent().children() );
+ }
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context || this.context ) :
+ jQuery.makeArray( selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, slice.call(arguments).join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [], cur = elem[dir];
+ while ( cur && cur.nodeType !== 9 && (until === undefined || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
+ rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&\w+;/,
+ fcloseTag = function( all, front, tag ) {
+ return rselfClosing.test( tag ) ?
+ all :
+ front + "></" + tag + ">";
+ },
+ wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ area: [ 1, "<map>", "</map>" ],
+ _default: [ 0, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ return self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.getText( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append(this);
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ return this.each(function() {
+ var self = jQuery( this ), contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ clone: function( events ) {
+ // Do the clone
+ var ret = this.map(function() {
+ if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
+ // IE copies events bound via attachEvent when
+ // using cloneNode. Calling detachEvent on the
+ // clone will also remove the events from the orignal
+ // In order to get around this, we use innerHTML.
+ // Unfortunately, this means some modifications to
+ // attributes in IE that are actually only stored
+ // as properties will not be copied (such as the
+ // the name attribute on an input).
+ var html = this.outerHTML, ownerDocument = this.ownerDocument;
+ if ( !html ) {
+ var div = ownerDocument.createElement("div");
+ div.appendChild( this.cloneNode(true) );
+ html = div.innerHTML;
+ }
+
+ return jQuery.clean([html.replace(rinlinejQuery, "")
+ .replace(rleadingWhitespace, "")], ownerDocument)[0];
+ } else {
+ return this.cloneNode(true);
+ }
+ });
+
+ // Copy the events from the original to the clone
+ if ( events === true ) {
+ cloneCopyEvent( this, ret );
+ cloneCopyEvent( this.find("*"), ret.find("*") );
+ }
+
+ // Return the cloned set
+ return ret;
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !/<script/i.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery(this), old = self.html();
+ self.empty().append(function(){
+ return value.call( this, i, old );
+ });
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( !jQuery.isFunction( value ) ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling, parent = this.parentNode;
+
+ jQuery(this).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, value = args[0], scripts = [];
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ return self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ // If we're in a fragment, just use that instead of building a new one
+ if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
+ results = { fragment: args[0].parentNode };
+ } else {
+ results = buildFragment( args, this, scripts );
+ }
+
+ first = results.fragment.firstChild;
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ results.cacheable || this.length > 1 || i > 0 ?
+ results.fragment.cloneNode(true) :
+ results.fragment
+ );
+ }
+ }
+
+ if ( scripts ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+
+ function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+ }
+ }
+});
+
+function cloneCopyEvent(orig, ret) {
+ var i = 0;
+
+ ret.each(function() {
+ if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
+ return;
+ }
+
+ var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var handler in events[ type ] ) {
+ jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+ }
+ }
+ }
+ });
+}
+
+function buildFragment( args, nodes, scripts ) {
+ var fragment, cacheable, cached, cacheresults, doc;
+
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
+ cacheable = true;
+ cacheresults = jQuery.fragments[ args[0] ];
+ if ( cacheresults ) {
+ if ( cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ cached = true;
+ }
+ }
+
+ if ( !fragment ) {
+ doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+}
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [], insert = jQuery( selector );
+
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+ ret = ret.concat( elems );
+ }
+ return this.pushStack( ret, name, insert.selector );
+ };
+});
+
+jQuery.each({
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
+ if ( !keepData && this.nodeType === 1 ) {
+ cleanData( this.getElementsByTagName("*") );
+ cleanData( [ this ] );
+ }
+
+ if ( this.parentNode ) {
+ this.parentNode.removeChild( this );
+ }
+ }
+ },
+
+ empty: function() {
+ // Remove element nodes and prevent memory leaks
+ if ( this.nodeType === 1 ) {
+ cleanData( this.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( this.firstChild ) {
+ this.removeChild( this.firstChild );
+ }
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function() {
+ return this.each( fn, arguments );
+ };
+});
+
+jQuery.extend({
+ clean: function( elems, context, fragment, scripts ) {
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [];
+
+ jQuery.each(elems, function( i, elem ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ return;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" && !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+
+ } else if ( typeof elem === "string" ) {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, fcloseTag);
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( var j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = jQuery.makeArray( div.childNodes );
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+
+ });
+
+ if ( fragment ) {
+ for ( var i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ }
+});
+
+function cleanData( elems ) {
+ for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
+ if ( !jQuery.noData[elem.nodeName.toLowerCase()] && (id = elem[expando]) ) {
+ delete jQuery.cache[ id ];
+ }
+ }
+}
+// exclude the following css properties to add px
+var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+ ralpha = /alpha\([^)]*\)/,
+ ropacity = /opacity=([^)]*)/,
+ rfloat = /float/i,
+ rdashAlpha = /-([a-z])/ig,
+ rupper = /([A-Z])/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+
+ cssShow = { position: "absolute", visibility: "hidden", display:"block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+
+ // cache check for defaultView.getComputedStyle
+ getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
+ // normalize float css property
+ styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn.css = function( name, value ) {
+ return access( this, name, value, true, function( elem, name, value ) {
+ if ( value === undefined ) {
+ return jQuery.curCSS( elem, name );
+ }
+
+ if ( typeof value === "number" && !rexclude.test(name) ) {
+ value += "px";
+ }
+
+ jQuery.style( elem, name, value );
+ });
+};
+
+jQuery.extend({
+ style: function( elem, name, value ) {
+ // don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // ignore negative width and height values #1599
+ if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
+ value = undefined;
+ }
+
+ var style = elem.style || elem, set = value !== undefined;
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name === "opacity" ) {
+ if ( set ) {
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // Set the alpha filter to set the opacity
+ var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
+ var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
+ style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
+ }
+
+ return style.filter && style.filter.indexOf("opacity=") >= 0 ?
+ (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
+ "";
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( rfloat.test( name ) ) {
+ name = styleFloat;
+ }
+
+ name = name.replace(rdashAlpha, fcamelCase);
+
+ if ( set ) {
+ style[ name ] = value;
+ }
+
+ return style[ name ];
+ },
+
+ css: function( elem, name, force, extra ) {
+ if ( name === "width" || name === "height" ) {
+ var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
+
+ function getWH() {
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
+
+ if ( extra === "border" ) {
+ return;
+ }
+
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
+ }
+
+ if ( extra === "margin" ) {
+ val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
+ } else {
+ val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
+ }
+ });
+ }
+
+ if ( elem.offsetWidth !== 0 ) {
+ getWH();
+ } else {
+ jQuery.swap( elem, props, getWH );
+ }
+
+ return Math.max(0, Math.round(val));
+ }
+
+ return jQuery.curCSS( elem, name, force );
+ },
+
+ curCSS: function( elem, name, force ) {
+ var ret, style = elem.style, filter;
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
+ ret = ropacity.test(elem.currentStyle.filter || "") ?
+ (parseFloat(RegExp.$1) / 100) + "" :
+ "";
+
+ return ret === "" ?
+ "1" :
+ ret;
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( rfloat.test( name ) ) {
+ name = styleFloat;
+ }
+
+ if ( !force && style && style[ name ] ) {
+ ret = style[ name ];
+
+ } else if ( getComputedStyle ) {
+
+ // Only "float" is needed here
+ if ( rfloat.test( name ) ) {
+ name = "float";
+ }
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ var defaultView = elem.ownerDocument.defaultView;
+
+ if ( !defaultView ) {
+ return null;
+ }
+
+ var computedStyle = defaultView.getComputedStyle( elem, null );
+
+ if ( computedStyle ) {
+ ret = computedStyle.getPropertyValue( name );
+ }
+
+ // We should always get a number back from opacity
+ if ( name === "opacity" && ret === "" ) {
+ ret = "1";
+ }
+
+ } else if ( elem.currentStyle ) {
+ var camelCase = name.replace(rdashAlpha, fcamelCase);
+
+ ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+ // Remember the original values
+ var left = style.left, rsLeft = elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret;
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( var name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth, height = elem.offsetHeight,
+ skip = elem.nodeName.toLowerCase() === "tr";
+
+ return width === 0 && height === 0 && !skip ?
+ true :
+ width > 0 && height > 0 && !skip ?
+ false :
+ jQuery.curCSS(elem, "display") === "none";
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+var jsc = now(),
+ rscript = /<script(.|\s)*?\/script>/gi,
+ rselectTextarea = /select|textarea/i,
+ rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
+ jsre = /=\?(&|$)/,
+ rquery = /\?/,
+ rts = /(\?|&)_=.*?(&|$)/,
+ rurl = /^(\w+:)?\/\/([^\/?#]+)/,
+ r20 = /%20/g;
+
+jQuery.fn.extend({
+ // Keep a copy of the old load
+ _load: jQuery.fn.load,
+
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" ) {
+ return this._load( url );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf(" ");
+ if ( off >= 0 ) {
+ var selector = url.slice(off, url.length);
+ url = url.slice(0, off);
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = null;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ context:this,
+ complete: function( res, status ) {
+ // If successful, inject the HTML into all the matched elements
+ if ( status === "success" || status === "notmodified" ) {
+ // See if a selector was specified
+ this.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div />")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(res.responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ res.responseText );
+ }
+
+ if ( callback ) {
+ this.each( callback, [res.responseText, status, res] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param(this.serializeArray());
+ },
+ serializeArray: function() {
+ return this.map(function() {
+ return this.elements ? jQuery.makeArray(this.elements) : this;
+ })
+ .filter(function() {
+ return this.name && !this.disabled &&
+ (this.checked || rselectTextarea.test(this.nodeName) ||
+ rinput.test(this.type));
+ })
+ .map(function( i, elem ) {
+ var val = jQuery(this).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray(val) ?
+ jQuery.map( val, function( val, i ) {
+ return { name: elem.name, value: val };
+ }) :
+ { name: elem.name, value: val };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
+ jQuery.fn[o] = function( f ) {
+ return this.bind(o, f);
+ };
+});
+
+jQuery.extend({
+
+ get: function( url, data, callback, type ) {
+ // shift arguments if data argument was omited
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = null;
+ }
+
+ return jQuery.ajax({
+ type: "GET",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get(url, null, callback, "script");
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get(url, data, callback, "json");
+ },
+
+ post: function( url, data, callback, type ) {
+ // shift arguments if data argument was omited
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = {};
+ }
+
+ return jQuery.ajax({
+ type: "POST",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ ajaxSetup: function( settings ) {
+ jQuery.extend( jQuery.ajaxSettings, settings );
+ },
+
+ ajaxSettings: {
+ url: location.href,
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ username: null,
+ password: null,
+ traditional: false,
+ */
+ // Create the request object; Microsoft failed to properly
+ // implement the XMLHttpRequest in IE7 (can't request local files),
+ // so we use the ActiveXObject when it is available
+ // This function can be overriden by calling jQuery.ajaxSetup
+ xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
+ function() {
+ return new window.XMLHttpRequest();
+ } :
+ function() {
+ try {
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
+ } catch(e) {}
+ },
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ script: "text/javascript, application/javascript",
+ json: "application/json, text/javascript",
+ text: "text/plain",
+ _default: "*/*"
+ }
+ },
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajax: function( origSettings ) {
+ var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
+
+ var jsonp, status, data,
+ callbackContext = s.context || s,
+ type = s.type.toUpperCase();
+
+ // convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Handle JSONP Parameter Callbacks
+ if ( s.dataType === "jsonp" ) {
+ if ( type === "GET" ) {
+ if ( !jsre.test( s.url ) ) {
+ s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+ }
+ } else if ( !s.data || !jsre.test(s.data) ) {
+ s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+ }
+ s.dataType = "json";
+ }
+
+ // Build temporary JSONP function
+ if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
+ jsonp = s.jsonpCallback || ("jsonp" + jsc++);
+
+ // Replace the =? sequence both in the query string and the data
+ if ( s.data ) {
+ s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
+ }
+
+ s.url = s.url.replace(jsre, "=" + jsonp + "$1");
+
+ // We need to make sure
+ // that a JSONP style response is executed properly
+ s.dataType = "script";
+
+ // Handle JSONP-style loading
+ window[ jsonp ] = window[ jsonp ] || function( tmp ) {
+ data = tmp;
+ success();
+ complete();
+ // Garbage collect
+ window[ jsonp ] = undefined;
+
+ try {
+ delete window[ jsonp ];
+ } catch(e) {}
+
+ if ( head ) {
+ head.removeChild( script );
+ }
+ };
+ }
+
+ if ( s.dataType === "script" && s.cache === null ) {
+ s.cache = false;
+ }
+
+ if ( s.cache === false && type === "GET" ) {
+ var ts = now();
+
+ // try replacing _= if it is there
+ var ret = s.url.replace(rts, "$1_=" + ts + "$2");
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
+ }
+
+ // If data is available, append data to url for get requests
+ if ( s.data && type === "GET" ) {
+ s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
+ }
+
+ // Watch for a new set of requests
+ if ( s.global && ! jQuery.active++ ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // Matches an absolute URL, and saves the domain
+ var parts = rurl.exec( s.url ),
+ remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
+
+ // If we're requesting a remote document
+ // and trying to load JSON or Script with a GET
+ if ( s.dataType === "script" && type === "GET" && remote ) {
+ var head = document.getElementsByTagName("head")[0] || document.documentElement;
+ var script = document.createElement("script");
+ script.src = s.url;
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ // Handle Script loading
+ if ( !jsonp ) {
+ var done = false;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function() {
+ if ( !done && (!this.readyState ||
+ this.readyState === "loaded" || this.readyState === "complete") ) {
+ done = true;
+ success();
+ complete();
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+ }
+ };
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+
+ // We handle everything using the script element injection
+ return undefined;
+ }
+
+ var requestDone = false;
+
+ // Create the request object
+ var xhr = s.xhr();
+
+ if ( !xhr ) {
+ return;
+ }
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open(type, s.url, s.async, s.username, s.password);
+ } else {
+ xhr.open(type, s.url, s.async);
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ // Set the correct header, if data is being sent
+ if ( s.data || origSettings && origSettings.contentType ) {
+ xhr.setRequestHeader("Content-Type", s.contentType);
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[s.url] ) {
+ xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
+ }
+
+ if ( jQuery.etag[s.url] ) {
+ xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
+ }
+ }
+
+ // Set header so the called script knows that it's an XMLHttpRequest
+ // Only send the header if it's not a remote XHR
+ if ( !remote ) {
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
+ s.accepts[ s.dataType ] + ", */*" :
+ s.accepts._default );
+ } catch(e) {}
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+
+ // close opended socket
+ xhr.abort();
+ return false;
+ }
+
+ if ( s.global ) {
+ trigger("ajaxSend", [xhr, s]);
+ }
+
+ // Wait for a response to come back
+ var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
+ // The request was aborted
+ if ( !xhr || xhr.readyState === 0 ) {
+ // Opera doesn't call onreadystatechange before this point
+ // so we simulate the call
+ if ( !requestDone ) {
+ complete();
+ }
+
+ requestDone = true;
+ if ( xhr ) {
+ xhr.onreadystatechange = jQuery.noop;
+ }
+
+ // The transfer is complete and the data is available, or the request timed out
+ } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
+ requestDone = true;
+ xhr.onreadystatechange = jQuery.noop;
+
+ status = isTimeout === "timeout" ?
+ "timeout" :
+ !jQuery.httpSuccess( xhr ) ?
+ "error" :
+ s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
+ "notmodified" :
+ "success";
+
+ if ( status === "success" ) {
+ // Watch for, and catch, XML document parse errors
+ try {
+ // process the data (runs the xml through httpData regardless of callback)
+ data = jQuery.httpData( xhr, s.dataType, s );
+ } catch(e) {
+ status = "parsererror";
+ }
+ }
+
+ // Make sure that the request was successful or notmodified
+ if ( status === "success" || status === "notmodified" ) {
+ // JSONP handles its own success callback
+ if ( !jsonp ) {
+ success();
+ }
+ } else {
+ jQuery.handleError(s, xhr, status);
+ }
+
+ // Fire the complete handlers
+ complete();
+
+ if ( isTimeout === "timeout" ) {
+ xhr.abort();
+ }
+
+ // Stop memory leaks
+ if ( s.async ) {
+ xhr = null;
+ }
+ }
+ };
+
+ // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
+ // Opera doesn't fire onreadystatechange at all on abort
+ try {
+ var oldAbort = xhr.abort;
+ xhr.abort = function() {
+ if ( xhr ) {
+ oldAbort.call( xhr );
+ if ( xhr ) {
+ xhr.readyState = 0;
+ }
+ }
+
+ onreadystatechange();
+ };
+ } catch(e) { }
+
+ // Timeout checker
+ if ( s.async && s.timeout > 0 ) {
+ setTimeout(function() {
+ // Check to see if the request is still happening
+ if ( xhr && !requestDone ) {
+ onreadystatechange( "timeout" );
+ }
+ }, s.timeout);
+ }
+
+ // Send the data
+ try {
+ xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
+ } catch(e) {
+ jQuery.handleError(s, xhr, null, e);
+ // Fire the complete handlers
+ complete();
+ }
+
+ // firefox 1.5 doesn't fire statechange for sync requests
+ if ( !s.async ) {
+ onreadystatechange();
+ }
+
+ function success() {
+ // If a local callback was specified, fire it and pass it the data
+ if ( s.success ) {
+ s.success.call( callbackContext, data, status, xhr );
+ }
+
+ // Fire the global callback
+ if ( s.global ) {
+ trigger( "ajaxSuccess", [xhr, s] );
+ }
+ }
+
+ function complete() {
+ // Process result
+ if ( s.complete ) {
+ s.complete.call( callbackContext, xhr, status);
+ }
+
+ // The request was completed
+ if ( s.global ) {
+ trigger( "ajaxComplete", [xhr, s] );
+ }
+
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+
+ function trigger(type, args) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
+ }
+
+ // return XMLHttpRequest to allow aborting the request etc.
+ return xhr;
+ },
+
+ handleError: function( s, xhr, status, e ) {
+ // If a local callback was specified, fire it
+ if ( s.error ) {
+ s.error.call( s.context || window, xhr, status, e );
+ }
+
+ // Fire the global callback
+ if ( s.global ) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
+ }
+ },
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Determines if an XMLHttpRequest was successful or not
+ httpSuccess: function( xhr ) {
+ try {
+ // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
+ return !xhr.status && location.protocol === "file:" ||
+ // Opera returns 0 when status is 304
+ ( xhr.status >= 200 && xhr.status < 300 ) ||
+ xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
+ } catch(e) {}
+
+ return false;
+ },
+
+ // Determines if an XMLHttpRequest returns NotModified
+ httpNotModified: function( xhr, url ) {
+ var lastModified = xhr.getResponseHeader("Last-Modified"),
+ etag = xhr.getResponseHeader("Etag");
+
+ if ( lastModified ) {
+ jQuery.lastModified[url] = lastModified;
+ }
+
+ if ( etag ) {
+ jQuery.etag[url] = etag;
+ }
+
+ // Opera returns 0 when status is 304
+ return xhr.status === 304 || xhr.status === 0;
+ },
+
+ httpData: function( xhr, type, s ) {
+ var ct = xhr.getResponseHeader("content-type") || "",
+ xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
+ data = xml ? xhr.responseXML : xhr.responseText;
+
+ if ( xml && data.documentElement.nodeName === "parsererror" ) {
+ throw "parsererror";
+ }
+
+ // Allow a pre-filtering function to sanitize the response
+ // s is checked to keep backwards compatibility
+ if ( s && s.dataFilter ) {
+ data = s.dataFilter( data, type );
+ }
+
+ // The filter can actually parse the response
+ if ( typeof data === "string" ) {
+ // Get the JavaScript object, if JSON is used.
+ if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if (/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
+ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
+ .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
+
+ // Try to use the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ data = window.JSON.parse( data );
+
+ } else {
+ data = (new Function("return " + data))();
+ }
+
+ } else {
+ throw "Invalid JSON: " + data;
+ }
+
+ // If the type is "script", eval it in global context
+ } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
+ jQuery.globalEval( data );
+ }
+ }
+
+ return data;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+
+ var s = [];
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ function add( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction(value) ? value() : value;
+ s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray(a) || a.jquery ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ jQuery.each( a, function buildParams( prefix, obj ) {
+
+ if ( jQuery.isArray(obj) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ jQuery.each( obj, function( k, v ) {
+ buildParams( prefix + "[" + k + "]", v );
+ });
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+ });
+ }
+
+ // Return the resulting serialization
+ return s.join("&").replace(r20, "+");
+ }
+
+});
+var elemdisplay = {},
+ rfxtypes = /toggle|show|hide/,
+ rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ];
+
+jQuery.fn.extend({
+ show: function( speed, callback ) {
+ if ( speed != null ) {
+ return this.animate( genFx("show", 3), speed, callback);
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var old = jQuery.data(this[i], "olddisplay");
+
+ this[i].style.display = old || "";
+
+ if ( jQuery.css(this[i], "display") === "none" ) {
+ var nodeName = this[i].nodeName, display;
+
+ if ( elemdisplay[ nodeName ] ) {
+ display = elemdisplay[ nodeName ];
+
+ } else {
+ var elem = jQuery("<" + nodeName + " />").appendTo("body");
+
+ display = elem.css("display");
+
+ if ( display === "none" ) {
+ display = "block";
+ }
+
+ elem.remove();
+
+ elemdisplay[ nodeName ] = display;
+ }
+
+ jQuery.data(this[i], "olddisplay", display);
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var j = 0, k = this.length; j < k; j++ ) {
+ this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, callback ) {
+ if ( speed != null ) {
+ return this.animate( genFx("hide", 3), speed, callback);
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var old = jQuery.data(this[i], "olddisplay");
+ if ( !old && old !== "none" ) {
+ jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var j = 0, k = this.length; j < k; j++ ) {
+ this[j].style.display = "none";
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2 ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete );
+ }
+
+ return this[ optall.queue === false ? "each" : "queue" ](function() {
+ var opt = jQuery.extend({}, optall), p,
+ hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
+ self = this;
+
+ for ( p in prop ) {
+ var name = p.replace(rdashAlpha, fcamelCase);
+
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ p = name;
+ }
+
+ if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
+ return opt.complete.call(this);
+ }
+
+ if ( ( p === "height" || p === "width" ) && this.style ) {
+ // Store display property
+ opt.display = jQuery.css(this, "display");
+
+ // Make sure that nothing sneaks out
+ opt.overflow = this.style.overflow;
+ }
+
+ if ( jQuery.isArray( prop[p] ) ) {
+ // Create (if needed) and add to specialEasing
+ (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
+ prop[p] = prop[p][0];
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ opt.curAnim = jQuery.extend({}, prop);
+
+ jQuery.each( prop, function( name, val ) {
+ var e = new jQuery.fx( self, opt, name );
+
+ if ( rfxtypes.test(val) ) {
+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+
+ } else {
+ var parts = rfxnum.exec(val),
+ start = e.cur(true) || 0;
+
+ if ( parts ) {
+ var end = parseFloat( parts[2] ),
+ unit = parts[3] || "px";
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ self.style[ name ] = (end || 1) + unit;
+ start = ((end || 1) / e.cur(true)) * start;
+ self.style[ name ] = start + unit;
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ });
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function( clearQueue, gotoEnd ) {
+ var timers = jQuery.timers;
+
+ if ( clearQueue ) {
+ this.queue([]);
+ }
+
+ this.each(function() {
+ // go in reverse order so anything added to the queue during the loop is ignored
+ for ( var i = timers.length - 1; i >= 0; i-- ) {
+ if ( timers[i].elem === this ) {
+ if (gotoEnd) {
+ // force the next step to be the last
+ timers[i](true);
+ }
+
+ timers.splice(i, 1);
+ }
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if ( !gotoEnd ) {
+ this.dequeue();
+ }
+
+ return this;
+ }
+
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, callback ) {
+ return this.animate( props, speed, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? speed : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function() {
+ if ( opt.queue !== false ) {
+ jQuery(this).dequeue();
+ }
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ if ( !options.orig ) {
+ options.orig = {};
+ }
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+ // Set display property to block for height/width animations
+ if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
+ this.elem.style.display = "block";
+ }
+ },
+
+ // Get the current size
+ cur: function( force ) {
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var r = parseFloat(jQuery.css(this.elem, this.prop, force));
+ return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ this.startTime = now();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || "px";
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ var self = this;
+ function t( gotoEnd ) {
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval(jQuery.fx.tick, 13);
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var t = now(), done = true;
+
+ if ( gotoEnd || t >= this.options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ this.options.curAnim[ this.prop ] = true;
+
+ for ( var i in this.options.curAnim ) {
+ if ( this.options.curAnim[i] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ if ( this.options.display != null ) {
+ // Reset the overflow
+ this.elem.style.overflow = this.options.overflow;
+
+ // Reset the display
+ var old = jQuery.data(this.elem, "olddisplay");
+ this.elem.style.display = old ? old : this.options.display;
+
+ if ( jQuery.css(this.elem, "display") === "none" ) {
+ this.elem.style.display = "block";
+ }
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( this.options.hide ) {
+ jQuery(this.elem).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( this.options.hide || this.options.show ) {
+ for ( var p in this.options.curAnim ) {
+ jQuery.style(this.elem, p, this.options.orig[p]);
+ }
+ }
+
+ // Execute the complete function
+ this.options.complete.call( this.elem );
+ }
+
+ return false;
+
+ } else {
+ var n = t - this.startTime;
+ this.state = n / this.options.duration;
+
+ // Perform the easing function, defaults to swing
+ var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
+ var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
+ this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
+ this.now = this.start + ((this.end - this.start) * this.pos);
+
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ var timers = jQuery.timers;
+
+ for ( var i = 0; i < timers.length; i++ ) {
+ if ( !timers[i]() ) {
+ timers.splice(i--, 1);
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style(fx.elem, "opacity", fx.now);
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ jQuery.offset.initialize();
+
+ var offsetParent = elem.offsetParent, prevOffsetParent = elem,
+ doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
+ body = doc.body, defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop, left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+ initialize: function() {
+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
+ html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
+
+ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+ container.innerHTML = html;
+ body.insertBefore( container, body.firstChild );
+ innerDiv = container.firstChild;
+ checkDiv = innerDiv.firstChild;
+ td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
+ // safari subtracts parent border width here which is 5px
+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+ checkDiv.style.position = checkDiv.style.top = "";
+
+ innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+ body.removeChild( container );
+ body = container = innerDiv = checkDiv = table = td = null;
+ jQuery.offset.initialize = jQuery.noop;
+ },
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop, left = body.offsetLeft;
+
+ jQuery.offset.initialize();
+
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0;
+ left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ // set position first, in-case top/left are set even on static elem
+ if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
+ elem.style.position = "relative";
+ }
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0,
+ curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ var props = {
+ top: (options.top - curOffset.top) + curTop,
+ left: (options.left - curOffset.left) + curLeft
+ };
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0;
+ offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0;
+ parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function(val) {
+ var elem = this[0], win;
+
+ if ( !elem ) {
+ return null;
+ }
+
+ if ( val !== undefined ) {
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery(win).scrollLeft(),
+ i ? val : jQuery(win).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ } else {
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+ };
+});
+
+function getWindow( elem ) {
+ return ("scrollTo" in elem && elem.document) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn["inner" + name] = function() {
+ return this[0] ?
+ jQuery.css( this[0], type, false, "padding" ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn["outer" + name] = function( margin ) {
+ return this[0] ?
+ jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
+ elem.document.body[ "client" + name ] :
+
+ // Get document width or height
+ (elem.nodeType === 9) ? // is it a document
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ ) :
+
+ // Get or set width or height on the element
+ size === undefined ?
+ // Get width or height on the element
+ jQuery.css( elem, type ) :
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ this.css( type, typeof size === "string" ? size : size + "px" );
+ };
+
+});
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+
+})(window);
diff --git a/examples/lessons/6_English_VocabularyBirds/js/karma.js b/examples/lessons/6_English_VocabularyBirds/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_English_VocabularyBirds/js/lesson.js b/examples/lessons/6_English_VocabularyBirds/js/lesson.js
new file mode 100755
index 0000000..462b7a4
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/js/lesson.js
@@ -0,0 +1,359 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.ogg'},
+ {'name':'incorrect','file':'incorrect.ogg'},
+ {'name':'bulbul','file':'bulbul.wav'},
+ {'name':'crane','file':'crane.wav'},
+ {'name':'egret','file':'egret.wav'},
+ {'name':'kingfisher','file':'kingfisher.wav'},
+ {'name':'penguin','file':'penguin.wav'},
+ {'name':'swan','file':'swan.wav'},
+ {'name':'swift','file':'swift.wav'},
+ {'name':'vulture','file':'vulture.wav'},
+ {'name':'woodpecker','file':'woodpecker.wav'},
+ {'name':'ostrich','file':'ostrich.wav'}
+ ]});
+
+ k.ready(function(){
+ var i,j,flag;
+ var TOTAL_QUES = 10;
+ var TOTAL_LEVEL = 3;
+ var currentDragObject;
+ var randImages = [];
+ var randPositions = [];
+ var randOtherImages = [];
+ var currentAnimal;
+ var totalCounter;
+ var currentQuestion;
+ var currentDragObject;
+ var arrangedAns = [];
+ var correctAnimalParts = [];
+ var randTexts = []; //for the confirmation sections
+ var checked;
+ var sectionNum; //store the current tab num
+ var flag_checked;
+ var currentQues; //store the current Animal name
+ var currentAnimal; //store the current Animal Image name
+ var correctQuest; //store 1 if the question and image is same
+ var num;
+ var flag_confirm; //whether confirmation dialog box is on the top or not
+ var currentDropObject;
+ var droppedWord;
+ var zIndex; //show current dragged Object at top
+
+ var birds = new Array('bulbul','crane','egret','kingfisher','ostrich',
+ 'penguin','swan','swift','vulture','woodpecker'
+ );
+
+ var genRandTexts=function (){
+ randTexts[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randTexts[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randTexts[i] === randTexts[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+ var genRandImages=function (){
+ randImages[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randImages[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randImages[i] === randImages[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+ var genRandOtherImages = function(){
+ randOtherImages[0] = currentAnimal;
+ for(i=1; i<7; i++){
+ do{
+ flag = 0;
+ randOtherImages[i] = k.rand(0,6);
+ for(j=0; j<i; j++){
+ if(randOtherImages[i] === randOtherImages[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+
+ };
+
+
+ var genRandPositions = function(){ // 15 random positions 8 correct
+ randPositions[0] = k.rand(0,14);
+ for(i=1; i<15; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,14);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+
+ };
+
+ var assignDragTexts = function(txtId){
+ randText = randTexts[i];
+ $('#dragTxtSection').append('<div id="text'+txtId+'" class="dragObjects">'+birds[randText]+'</div>');
+ var dragObjCss = {
+ 'float': 'left','cursor': 'move','width':'100px','height':'25px',
+ 'margin':'0.1em','color':'#5B3CD5',
+ 'font':'20px/30px Helvetica, Geneva, Arial, Verdana, sans-serif'
+ };
+ $('#text'+txtId).css(dragObjCss);
+ };
+
+ var confirmAnswer = function(){
+ genRandTexts();
+ $('#confirmSection').show().html('');
+ $('#confirmSection').append('<div id="confirmBox"></div>');
+ $('#confirmBox').append('<div id="checkAnswer"></div>');
+ $('#confirmBox').append('<div id="word0" class="dropObjects"></div>');
+ var dropObjCss = {
+ 'margin':'7em auto','margin-bottom':'3em','width':'100px','height':'30px',
+ 'border':'1px solid #FF0000'
+ };
+ $('#word0').css(dropObjCss);
+ $('#confirmBox').append('<div id="confimBtn"></div>');
+ $('#confirmSection').append('<div id="dragTxtSection"></div>');
+
+ for(i = 0; i<10; i++){
+ assignDragTexts(i);
+ }
+ drag_drop();
+
+ }
+
+ var check_puzzle_completion = function(){
+ var correct = 0;
+ for(i = 0; i< 9 ;i++){
+ if(arrangedAns[i] === correctAnimalParts[i]){
+ correct++;
+ }
+ }
+ if(correct === 9){
+ //alert("great job its time to show some confirmations");
+ $('#section').addClass('backOpaque');
+ flag_confirm = 0;
+ confirmAnswer();
+
+ }
+ };
+
+ var next_images = function(){
+ currentAnimal = randImages[totalCounter];
+ $('#imgAnimalsDisplay').html('<img src="assets/image/'+birds[currentAnimal]+'.png" />');
+ $('#animalText').html('').append('<div class="imgVol"></div>');
+ $('#animalText').append(birds[currentAnimal]);
+ $('.imgVol').click(function(){
+ k.audio[birds[currentAnimal]].play();
+ });
+ };
+
+ var assignDragPuzzle = function(puzzleId,imgName){
+ $('#dragImgSection').append('<div id="drag'+num+'" class="dragObjects"></div>');
+ var dragObjCss = {
+ 'float': 'left','cursor': 'move','width':'100px','height':'100px',
+ 'border':'1px solid #A8F42D',
+ 'background':'url(assets/image/'+birds[imgName]+puzzleId+'.png)'
+ };
+ $('#drag'+num).css(dragObjCss);
+ if(imgName === currentAnimal){
+ correctAnimalParts[puzzleId] = $('#drag'+num).attr('id');
+ }
+ num++;
+ };
+
+ var assignPuzzle = function(puzzleId){
+ $('#imgPuzzleArea').append('<div id="drop'+puzzleId+'" class="dropObjects"></div>');
+ var dropObjCss = {
+ 'float': 'left','width':'100px','height':'100px',
+ 'border':'1px solid #A8F42D','background': '#C8FFC2'
+ };
+ $('#drop'+puzzleId).css(dropObjCss);
+ };
+
+ var display_game_over = function() {
+ $('#confirmSection').hide();
+ $('#gameOver').show().html('Game Over !!! Congratulations');
+ $('#gameOver').append('<div id="gameOverInfo">You have successfully completed all the vocabulary section</div>');
+ };
+
+ var delay_gameOver = function(){
+ document.delayForm.delayval.value = 1;
+ display_game_over();
+ };
+
+ var next_puzzle = function() {
+ $('#confirmSection').hide();
+ zIndex = 0;
+ $('#section').removeClass('backOpaque');
+ $('#section').html('').append('<div id="infoText"></div>');
+ $('#infoText').append('Listen to the name of the animal.'+
+ 'And drag and drop the pisces to complete the picture of the animal you just heard the name of.');
+ currentAnimal = randImages[totalCounter];
+ $('#infoText').append('<div class="imgVol"></div>');
+ $('.imgVol').click(function(){
+ k.audio[birds[currentAnimal]].play();
+ });
+ $('#section').append('<div id = "imgPuzzleArea"></div>');
+ for(i = 0; i< 9; i++){
+ assignPuzzle(i);
+
+ }
+ $('#section').append('<div id = "dragImgSection"></div>');
+ genRandPositions();
+ genRandOtherImages();
+ var number = 1;
+ num = 0;
+ for(i = 0; i< 15; i++){
+ var randPos = randPositions[i]; //any random pos between 1-15
+ if(randPos<9){
+ assignDragPuzzle(randPos,currentAnimal);
+ }
+ else{
+ randPos = 15-randPos;
+ assignDragPuzzle(randPos,randOtherImages[number]);
+ number++;
+ }
+ }
+ flag_confirm = 1;
+ drag_drop();
+ };
+
+ function game_start(){
+ $('#section').removeClass('backOpaque');
+ $('#linkNext').hide();
+ $('#linkBack').hide();
+ sectionNum = 1;
+ genRandImages();
+ totalCounter = 0;
+ next_puzzle();
+
+ }
+
+ function game(){
+ $('#help').hide();
+ sectionNum = 0;
+ totalCounter = 0;
+ flag_confirm = 1;
+ $('#confirmSection').hide();
+ $('#section').removeClass('backOpaque');
+ $('#linkNext').show();
+ $('#linkBack').hide();
+ $('#gameOver').hide();
+ $('#section').html('').append('<div id="topText">Click on the speaker and listen to the name of the wild birds</div>');
+ $('#section').append('<div id="imgAnimalsDisplay"></div>');
+ $('#section').append('<div id="animalText"></div>');
+ genRandImages();
+ next_images();
+ }
+
+ game();
+
+ function drag_drop(){
+ $('.dragObjects').draggable({ containment: '#content'});
+ $('.dragObjects').bind('dragstart', function(event, ui) {
+ currentDragObject = event.target.id;
+ $('#'+currentDragObject).css({'z-index':zIndex});
+ currentDragAnimal = parseInt(currentDragObject.substring(4));
+ zIndex++;
+ });
+
+ $(".dropObjects").droppable({ tolerence: 'intersect' ,hoverClass: 'drophover'});
+ $('.dropObjects').bind('drop', function(event, ui) {
+ currentDropObject = event.target.id;
+ droppedWord = parseInt(currentDropObject.substring(4));
+
+ if(flag_confirm != 0){
+ arrangedAns[droppedWord] = $('#'+currentDragObject).attr('id');
+ check_puzzle_completion();
+ }
+
+ });
+ $('#confimBtn').click(function(){
+ var dragAnimalText = $('#'+currentDragObject).text();
+ if(dragAnimalText === birds[currentAnimal]){
+ k.audio.correct.play();
+ $('#checkAnswer').html('<img src="assets/image/correct.png" />');
+ totalCounter++;
+ if(totalCounter === TOTAL_QUES){
+ t=setTimeout(function(){delay_gameOver();},1000);
+ }
+ else{
+ $('#linkNext').show();
+ }
+ }
+ else{
+ k.audio.incorrect.play();
+ $('#checkAnswer').html('<img src="assets/image/incorrect.png" />');
+ }
+
+ });
+
+ }
+ $('#linkHelp').click(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+ });
+ $('#linkNext').click(function(){
+ if(sectionNum === 0){ //first level for knowing the birds
+ if(totalCounter === TOTAL_QUES-2){
+ $('#linkBack').show();
+ $('#linkNext').hide();
+ }
+ else{
+ $('#linkNext').show();
+ $('#linkBack').show();
+ }
+ totalCounter++;
+ next_images();
+ }
+ else{
+ $('#linkNext').hide();
+ next_puzzle();
+ }
+ });
+ $('#linkBack').click(function(){
+ if(totalCounter === 1){
+ $('#linkBack').hide();
+ $('#linkNext').show();
+ }
+ else{
+ $('#linkNext').show();
+ $('#linkBack').show();
+ }
+ totalCounter--;
+ next_images();
+ });
+ $('#linkCheck').click(function(){
+ check_answers();
+ });
+ $('#linkStart').click(function(){
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ game();
+ });
+
+ }); //end of k.ready
+}); //end of document.ready \ No newline at end of file
diff --git a/examples/lessons/6_English_VocabularyBirds/js/ui.core.js b/examples/lessons/6_English_VocabularyBirds/js/ui.core.js
new file mode 100755
index 0000000..5493e0a
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/js/ui.core.js
@@ -0,0 +1,519 @@
+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+;jQuery.ui || (function($) {
+
+var _remove = $.fn.remove,
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+
+//Helper functions and ui object
+$.ui = {
+ version: "1.7.2",
+
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function(module, option, set) {
+ var proto = $.ui[module].prototype;
+ for(var i in set) {
+ proto.plugins[i] = proto.plugins[i] || [];
+ proto.plugins[i].push([option, set[i]]);
+ }
+ },
+ call: function(instance, name, args) {
+ var set = instance.plugins[name];
+ if(!set || !instance.element[0].parentNode) { return; }
+
+ for (var i = 0; i < set.length; i++) {
+ if (instance.options[set[i][0]]) {
+ set[i][1].apply(instance.element, args);
+ }
+ }
+ }
+ },
+
+ contains: function(a, b) {
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
+ },
+
+ hasScroll: function(el, a) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ($(el).css('overflow') == 'hidden') { return false; }
+
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
+ has = false;
+
+ if (el[scroll] > 0) { return true; }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[scroll] = 1;
+ has = (el[scroll] > 0);
+ el[scroll] = 0;
+ return has;
+ },
+
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
+ },
+
+ isOver: function(y, x, top, left, height, width) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+ },
+
+ keyCode: {
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+};
+
+// WAI-ARIA normalization
+if (isFF2) {
+ var attr = $.attr,
+ removeAttr = $.fn.removeAttr,
+ ariaNS = "http://www.w3.org/2005/07/aaa",
+ ariaState = /^aria-/,
+ ariaRole = /^wairole:/;
+
+ $.attr = function(elem, name, value) {
+ var set = value !== undefined;
+
+ return (name == 'role'
+ ? (set
+ ? attr.call(this, elem, name, "wairole:" + value)
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
+ : (ariaState.test(name)
+ ? (set
+ ? elem.setAttributeNS(ariaNS,
+ name.replace(ariaState, "aaa:"), value)
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
+ : attr.apply(this, arguments)));
+ };
+
+ $.fn.removeAttr = function(name) {
+ return (ariaState.test(name)
+ ? this.each(function() {
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
+ }) : removeAttr.call(this, name));
+ };
+}
+
+//jQuery plugins
+$.fn.extend({
+ remove: function() {
+ // Safari has a native remove event which actually removes DOM elements,
+ // so we have to use triggerHandler instead of trigger (#3037).
+ $("*", this).add(this).each(function() {
+ $(this).triggerHandler("remove");
+ });
+ return _remove.apply(this, arguments );
+ },
+
+ enableSelection: function() {
+ return this
+ .attr('unselectable', 'off')
+ .css('MozUserSelect', '')
+ .unbind('selectstart.ui');
+ },
+
+ disableSelection: function() {
+ return this
+ .attr('unselectable', 'on')
+ .css('MozUserSelect', 'none')
+ .bind('selectstart.ui', function() { return false; });
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ }
+});
+
+
+//Additional selectors
+$.extend($.expr[':'], {
+ data: function(elem, i, match) {
+ return !!$.data(elem, match[3]);
+ },
+
+ focusable: function(element) {
+ var nodeName = element.nodeName.toLowerCase(),
+ tabIndex = $.attr(element, 'tabindex');
+ return (/input|select|textarea|button|object/.test(nodeName)
+ ? !element.disabled
+ : 'a' == nodeName || 'area' == nodeName
+ ? element.href || !isNaN(tabIndex)
+ : !isNaN(tabIndex))
+ // the element and all of its ancestors must be visible
+ // the browser may report that the area is hidden
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
+ },
+
+ tabbable: function(element) {
+ var tabIndex = $.attr(element, 'tabindex');
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
+ }
+});
+
+
+// $.widget is a factory to create jQuery plugins
+// taking some boilerplate code out of the plugin code
+function getter(namespace, plugin, method, args) {
+ function getMethods(type) {
+ var methods = $[namespace][plugin][type] || [];
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
+ }
+
+ var methods = getMethods('getter');
+ if (args.length == 1 && typeof args[0] == 'string') {
+ methods = methods.concat(getMethods('getterSetter'));
+ }
+ return ($.inArray(method, methods) != -1);
+}
+
+$.widget = function(name, prototype) {
+ var namespace = name.split(".")[0];
+ name = name.split(".")[1];
+
+ // create plugin method
+ $.fn[name] = function(options) {
+ var isMethodCall = (typeof options == 'string'),
+ args = Array.prototype.slice.call(arguments, 1);
+
+ // prevent calls to internal methods
+ if (isMethodCall && options.substring(0, 1) == '_') {
+ return this;
+ }
+
+ // handle getter methods
+ if (isMethodCall && getter(namespace, name, options, args)) {
+ var instance = $.data(this[0], name);
+ return (instance ? instance[options].apply(instance, args)
+ : undefined);
+ }
+
+ // handle initialization and non-getter methods
+ return this.each(function() {
+ var instance = $.data(this, name);
+
+ // constructor
+ (!instance && !isMethodCall &&
+ $.data(this, name, new $[namespace][name](this, options))._init());
+
+ // method call
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
+ instance[options].apply(instance, args));
+ });
+ };
+
+ // create widget constructor
+ $[namespace] = $[namespace] || {};
+ $[namespace][name] = function(element, options) {
+ var self = this;
+
+ this.namespace = namespace;
+ this.widgetName = name;
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
+ this.widgetBaseClass = namespace + '-' + name;
+
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
+ this.element = $(element)
+ .bind('setData.' + name, function(event, key, value) {
+ if (event.target == element) {
+ return self._setData(key, value);
+ }
+ })
+ .bind('getData.' + name, function(event, key) {
+ if (event.target == element) {
+ return self._getData(key);
+ }
+ })
+ .bind('remove', function() {
+ return self.destroy();
+ });
+ };
+
+ // add widget prototype
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
+
+ // TODO: merge getter and getterSetter properties from widget prototype
+ // and plugin prototype
+ $[namespace][name].getterSetter = 'option';
+};
+
+$.widget.prototype = {
+ _init: function() {},
+ destroy: function() {
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
+ },
+
+ option: function(key, value) {
+ var options = key,
+ self = this;
+
+ if (typeof key == "string") {
+ if (value === undefined) {
+ return this._getData(key);
+ }
+ options = {};
+ options[key] = value;
+ }
+
+ $.each(options, function(key, value) {
+ self._setData(key, value);
+ });
+ },
+ _getData: function(key) {
+ return this.options[key];
+ },
+ _setData: function(key, value) {
+ this.options[key] = value;
+
+ if (key == 'disabled') {
+ this.element
+ [value ? 'addClass' : 'removeClass'](
+ this.widgetBaseClass + '-disabled' + ' ' +
+ this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
+ }
+ },
+
+ enable: function() {
+ this._setData('disabled', false);
+ },
+ disable: function() {
+ this._setData('disabled', true);
+ },
+
+ _trigger: function(type, event, data) {
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = $.Event(event);
+ event.type = eventName;
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if (event.originalEvent) {
+ for (var i = $.event.props.length, prop; i;) {
+ prop = $.event.props[--i];
+ event[prop] = event.originalEvent[prop];
+ }
+ }
+
+ this.element.trigger(event, data);
+
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
+ }
+};
+
+$.widget.defaults = {
+ disabled: false
+};
+
+
+/** Mouse Interaction Plugin **/
+
+$.ui.mouse = {
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ // Prevent text selection in IE
+ if ($.browser.msie) {
+ this._mouseUnselectable = this.element.attr('unselectable');
+ this.element.attr('unselectable', 'on');
+ }
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+
+ // Restore text selection in IE
+ ($.browser.msie
+ && this.element.attr('unselectable', this._mouseUnselectable));
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ // TODO: figure out why we have to use originalEvent
+ event.originalEvent = event.originalEvent || {};
+ if (event.originalEvent.mouseHandled) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ // preventDefault() is used to prevent the selection of text here -
+ // however, in Safari, this causes select boxes not to be selectable
+ // anymore, so this fix is needed
+ ($.browser.safari || event.preventDefault());
+
+ event.originalEvent.mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+};
+
+$.ui.mouse.defaults = {
+ cancel: null,
+ distance: 1,
+ delay: 0
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_English_VocabularyBirds/js/ui.draggable.js b/examples/lessons/6_English_VocabularyBirds/js/ui.draggable.js
new file mode 100755
index 0000000..0402f0e
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/js/ui.draggable.js
@@ -0,0 +1,766 @@
+/*
+ * jQuery UI Draggable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * ui.core.js
+ */
+(function($) {
+
+$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
+
+ _init: function() {
+
+ if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
+ this.element[0].style.position = 'relative';
+
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
+
+ this._mouseInit();
+
+ },
+
+ destroy: function() {
+ if(!this.element.data('draggable')) return;
+ this.element
+ .removeData("draggable")
+ .unbind(".draggable")
+ .removeClass("ui-draggable"
+ + " ui-draggable-dragging"
+ + " ui-draggable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+
+ var o = this.options;
+
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
+ return false;
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle)
+ return false;
+
+ return true;
+
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if($.ui.ddmanager)
+ $.ui.ddmanager.current = this;
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css("position");
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.element.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
+ if(o.cursorAt)
+ this._adjustOffsetFromHelper(o.cursorAt);
+
+ //Set a containment if given in the options
+ if(o.containment)
+ this._setContainment();
+
+ //Call plugins and callbacks
+ this._trigger("start", event);
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(this, event);
+
+ this.helper.addClass("ui-draggable-dragging");
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ this._trigger('drag', event, ui);
+ this.position = ui.position;
+ }
+
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
+ dropped = $.ui.ddmanager.drop(this, event);
+
+ //if a drop comes from outside (a sortable)
+ if(this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ var self = this;
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ self._trigger("stop", event);
+ self._clear();
+ });
+ } else {
+ this._trigger("stop", event);
+ this._clear();
+ }
+
+ return false;
+ },
+
+ _getHandle: function(event) {
+
+ var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
+ $(this.options.handle, this.element)
+ .find("*")
+ .andSelf()
+ .each(function() {
+ if(this == event.target) handle = true;
+ });
+
+ return handle;
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options;
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
+
+ if(!helper.parents('body').length)
+ helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
+
+ if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
+ helper.css("position", "absolute");
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
+ if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
+ if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
+ po = { top: 0, left: 0 };
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition == "relative") {
+ var p = this.element.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
+ top: (parseInt(this.element.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var o = this.options;
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
+ ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+
+ if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
+ var ce = $(o.containment)[0]; if(!ce) return;
+ var co = $(o.containment).offset();
+ var over = ($(ce).css("overflow") != 'hidden');
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ } else if(o.containment.constructor == Array) {
+ this.containment = o.containment;
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) pos = this.position;
+ var mod = d == "absolute" ? 1 : -1;
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top // The absolute mouse position
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left // The absolute mouse position
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ var pageX = event.pageX;
+ var pageY = event.pageY;
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
+ if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
+ }
+
+ if(o.grid) {
+ var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY // The absolute mouse position
+ - this.offset.click.top // Click offset (relative to the element)
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX // The absolute mouse position
+ - this.offset.click.left // Click offset (relative to the element)
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
+ //if($.ui.ddmanager) $.ui.ddmanager.current = null;
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function(type, event, ui) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call(this, type, [event, ui]);
+ if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
+ return $.widget.prototype._trigger.call(this, type, event, ui);
+ },
+
+ plugins: {},
+
+ _uiHash: function(event) {
+ return {
+ helper: this.helper,
+ position: this.position,
+ absolutePosition: this.positionAbs, //deprecated
+ offset: this.positionAbs
+ };
+ }
+
+}));
+
+$.extend($.ui.draggable, {
+ version: "1.7.2",
+ eventPrefix: "drag",
+ defaults: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input,option",
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ delay: 0,
+ distance: 1,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false
+ }
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+ start: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options,
+ uiSortable = $.extend({}, ui, { item: inst.element });
+ inst.sortables = [];
+ $(o.connectToSortable).each(function() {
+ var sortable = $.data(this, 'sortable');
+ if (sortable && !sortable.options.disabled) {
+ inst.sortables.push({
+ instance: sortable,
+ shouldRevert: sortable.options.revert
+ });
+ sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+
+ },
+ stop: function(event, ui) {
+
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+ var inst = $(this).data("draggable"),
+ uiSortable = $.extend({}, ui, { item: inst.element });
+
+ $.each(inst.sortables, function() {
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
+ if(this.shouldRevert) this.instance.options.revert = true;
+
+ //Trigger the stop of the sortable
+ this.instance._mouseStop(event);
+
+ this.instance.options.helper = this.instance.options._helper;
+
+ //If the helper has been the original item, restore properties in the sortable
+ if(inst.options.helper == 'original')
+ this.instance.currentItem.css({ top: 'auto', left: 'auto' });
+
+ } else {
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ this.instance._trigger("deactivate", event, uiSortable);
+ }
+
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), self = this;
+
+ var checkPos = function(o) {
+ var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
+ var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
+ var itemHeight = o.height, itemWidth = o.width;
+ var itemTop = o.top, itemLeft = o.left;
+
+ return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
+ };
+
+ $.each(inst.sortables, function(i) {
+
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
+
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+ if(!this.instance.isOver) {
+
+ this.instance.isOver = 1;
+ //Now we fake the start of dragging for the sortable instance,
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+ this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+ this.instance.options.helper = function() { return ui.helper[0]; };
+
+ event.target = this.instance.currentItem[0];
+ this.instance._mouseCapture(event, true);
+ this.instance._mouseStart(event, true, true);
+
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+ this.instance.offset.click.top = inst.offset.click.top;
+ this.instance.offset.click.left = inst.offset.click.left;
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+ inst._trigger("toSortable", event);
+ inst.dropped = this.instance.element; //draggable revert needs that
+ //hack so receive/update callbacks work (mostly)
+ inst.currentItem = inst.element;
+ this.instance.fromOutside = inst;
+
+ }
+
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+ if(this.instance.currentItem) this.instance._mouseDrag(event);
+
+ } else {
+
+ //If it doesn't intersect with the sortable, and it intersected before,
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+ this.instance.cancelHelperRemoval = true;
+
+ //Prevent reverting on this forced stop
+ this.instance.options.revert = false;
+
+ // The out event needs to be triggered independently
+ this.instance._trigger('out', event, this.instance._uiHash(this.instance));
+
+ this.instance._mouseStop(event, true);
+ this.instance.options.helper = this.instance.options._helper;
+
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+ this.instance.currentItem.remove();
+ if(this.instance.placeholder) this.instance.placeholder.remove();
+
+ inst._trigger("fromSortable", event);
+ inst.dropped = false; //draggable revert needs that
+ }
+
+ };
+
+ });
+
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function(event, ui) {
+ var t = $('body'), o = $(this).data('draggable').options;
+ if (t.css("cursor")) o._cursor = t.css("cursor");
+ t.css("cursor", o.cursor);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if (o._cursor) $('body').css("cursor", o._cursor);
+ }
+});
+
+$.ui.plugin.add("draggable", "iframeFix", {
+ start: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+ $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
+ .css({
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+ position: "absolute", opacity: "0.001", zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo("body");
+ });
+ },
+ stop: function(event, ui) {
+ $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data('draggable').options;
+ if(t.css("opacity")) o._opacity = t.css("opacity");
+ t.css('opacity', o.opacity);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if(o._opacity) $(ui.helper).css('opacity', o._opacity);
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function(event, ui) {
+ var i = $(this).data("draggable");
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
+ },
+ drag: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options, scrolled = false;
+
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
+
+ if(!o.axis || o.axis != 'x') {
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+ else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+ else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(!o.axis || o.axis != 'x') {
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(i, event);
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options;
+ i.snapElements = [];
+
+ $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
+ var $t = $(this); var $o = $t.offset();
+ if(this != i.element[0]) i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options;
+ var d = o.snapTolerance;
+
+ var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (var i = inst.snapElements.length - 1; i >= 0; i--){
+
+ var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
+ t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
+
+ //Yes, I know, this is insane ;)
+ if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
+ if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if(o.snapMode != 'inner') {
+ var ts = Math.abs(t - y2) <= d;
+ var bs = Math.abs(b - y1) <= d;
+ var ls = Math.abs(l - x2) <= d;
+ var rs = Math.abs(r - x1) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+ }
+
+ var first = (ts || bs || ls || rs);
+
+ if(o.snapMode != 'outer') {
+ var ts = Math.abs(t - y1) <= d;
+ var bs = Math.abs(b - y2) <= d;
+ var ls = Math.abs(l - x1) <= d;
+ var rs = Math.abs(r - x2) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+ }
+
+ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ };
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function(event, ui) {
+
+ var o = $(this).data("draggable").options;
+
+ var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
+ return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
+ });
+
+ $(group).each(function(i) {
+ this.style.zIndex = o.stack.min + i;
+ });
+
+ this[0].style.zIndex = o.stack.min + group.length;
+
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data("draggable").options;
+ if(t.css("zIndex")) o._zIndex = t.css("zIndex");
+ t.css('zIndex', o.zIndex);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data("draggable").options;
+ if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
+ }
+});
+
+})(jQuery);
diff --git a/examples/lessons/6_English_VocabularyBirds/js/ui.droppable.js b/examples/lessons/6_English_VocabularyBirds/js/ui.droppable.js
new file mode 100755
index 0000000..8e7be33
--- /dev/null
+++ b/examples/lessons/6_English_VocabularyBirds/js/ui.droppable.js
@@ -0,0 +1,282 @@
+/*
+ * jQuery UI Droppable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * ui.core.js
+ * ui.draggable.js
+ */
+(function($) {
+
+$.widget("ui.droppable", {
+
+ _init: function() {
+
+ var o = this.options, accept = o.accept;
+ this.isover = 0; this.isout = 1;
+
+ this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
+ return d.is(accept);
+ };
+
+ //Store the droppable's proportions
+ this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
+
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
+ $.ui.ddmanager.droppables[this.options.scope].push(this);
+
+ (this.options.addClasses && this.element.addClass("ui-droppable"));
+
+ },
+
+ destroy: function() {
+ var drop = $.ui.ddmanager.droppables[this.options.scope];
+ for ( var i = 0; i < drop.length; i++ )
+ if ( drop[i] == this )
+ drop.splice(i, 1);
+
+ this.element
+ .removeClass("ui-droppable ui-droppable-disabled")
+ .removeData("droppable")
+ .unbind(".droppable");
+ },
+
+ _setData: function(key, value) {
+
+ if(key == 'accept') {
+ this.options.accept = value && $.isFunction(value) ? value : function(d) {
+ return d.is(value);
+ };
+ } else {
+ $.widget.prototype._setData.apply(this, arguments);
+ }
+
+ },
+
+ _activate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.addClass(this.options.activeClass);
+ (draggable && this._trigger('activate', event, this.ui(draggable)));
+ },
+
+ _deactivate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ (draggable && this._trigger('deactivate', event, this.ui(draggable)));
+ },
+
+ _over: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
+ this._trigger('over', event, this.ui(draggable));
+ }
+
+ },
+
+ _out: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('out', event, this.ui(draggable));
+ }
+
+ },
+
+ _drop: function(event,custom) {
+
+ var draggable = custom || $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
+
+ var childrenIntersection = false;
+ this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
+ var inst = $.data(this, 'droppable');
+ if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
+ childrenIntersection = true; return false;
+ }
+ });
+ if(childrenIntersection) return false;
+
+ if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('drop', event, this.ui(draggable));
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function(c) {
+ return {
+ draggable: (c.currentItem || c.element),
+ helper: c.helper,
+ position: c.position,
+ absolutePosition: c.positionAbs, //deprecated
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.extend($.ui.droppable, {
+ version: "1.7.2",
+ eventPrefix: 'drop',
+ defaults: {
+ accept: '*',
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: 'default',
+ tolerance: 'intersect'
+ }
+});
+
+$.ui.intersect = function(draggable, droppable, toleranceMode) {
+
+ if (!droppable.offset) return false;
+
+ var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
+ y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
+ var l = droppable.offset.left, r = l + droppable.proportions.width,
+ t = droppable.offset.top, b = t + droppable.proportions.height;
+
+ switch (toleranceMode) {
+ case 'fit':
+ return (l < x1 && x2 < r
+ && t < y1 && y2 < b);
+ break;
+ case 'intersect':
+ return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
+ && x2 - (draggable.helperProportions.width / 2) < r // Left Half
+ && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
+ && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
+ break;
+ case 'pointer':
+ var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
+ isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
+ return isOver;
+ break;
+ case 'touch':
+ return (
+ (y1 >= t && y1 <= b) || // Top edge touching
+ (y2 >= t && y2 <= b) || // Bottom edge touching
+ (y1 < t && y2 > b) // Surrounded vertically
+ ) && (
+ (x1 >= l && x1 <= r) || // Left edge touching
+ (x2 >= l && x2 <= r) || // Right edge touching
+ (x1 < l && x2 > r) // Surrounded horizontally
+ );
+ break;
+ default:
+ return false;
+ break;
+ }
+
+};
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { 'default': [] },
+ prepareOffsets: function(t, event) {
+
+ var m = $.ui.ddmanager.droppables[t.options.scope];
+ var type = event ? event.type : null; // workaround for #2317
+ var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
+
+ droppablesLoop: for (var i = 0; i < m.length; i++) {
+
+ if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
+ for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
+ m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
+
+ m[i].offset = m[i].element.offset();
+ m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
+
+ if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
+
+ }
+
+ },
+ drop: function(draggable, event) {
+
+ var dropped = false;
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(!this.options) return;
+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
+ dropped = this._drop.call(this, event);
+
+ if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ this.isout = 1; this.isover = 0;
+ this._deactivate.call(this, event);
+ }
+
+ });
+ return dropped;
+
+ },
+ drag: function(draggable, event) {
+
+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
+
+ //Run through all droppables and check their positions based on specific tolerance options
+
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(this.options.disabled || this.greedyChild || !this.visible) return;
+ var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
+
+ var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
+ if(!c) return;
+
+ var parentInstance;
+ if (this.options.greedy) {
+ var parent = this.element.parents(':data(droppable):eq(0)');
+ if (parent.length) {
+ parentInstance = $.data(parent[0], 'droppable');
+ parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
+ }
+ }
+
+ // we just moved into a greedy child
+ if (parentInstance && c == 'isover') {
+ parentInstance['isover'] = 0;
+ parentInstance['isout'] = 1;
+ parentInstance._out.call(parentInstance, event);
+ }
+
+ this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
+ this[c == "isover" ? "_over" : "_out"].call(this, event);
+
+ // we just moved out of a greedy child
+ if (parentInstance && c == 'isout') {
+ parentInstance['isout'] = 0;
+ parentInstance['isover'] = 1;
+ parentInstance._over.call(parentInstance, event);
+ }
+ });
+
+ }
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.61417~ b/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.61417~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.61417~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.63800~ b/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.63800~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.63800~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.83946~ b/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.83946~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.83946~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.90016~ b/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.90016~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.90016~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.92952~ b/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.92952~
new file mode 100755
index 0000000..77f8df2
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/.tmp_index.html.92952~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Eng Crossword</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Crossword Puzzle <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="acrossImg"></div>
+ <div id="downImg"></div>
+ <div id="crosswordSection">
+
+
+ </div>
+
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/audio/correct.ogg b/examples/lessons/6_English_alphabeticalOrder/assets/audio/correct.ogg
new file mode 100755
index 0000000..a0d9e3a
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/audio/correct.ogg
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/audio/incorrect.ogg b/examples/lessons/6_English_alphabeticalOrder/assets/audio/incorrect.ogg
new file mode 100755
index 0000000..4805e55
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/audio/incorrect.ogg
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/background.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/background.png
new file mode 100755
index 0000000..71b92e0
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/background.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/bg_footer.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/bg_header.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/bg_title_block.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_back.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_back_hover.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_help.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_help_hover.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_next.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_next_hover.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_ole.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_ole_hover.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again_hover.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_start.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_start_hover.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_start_mouse_down.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/check.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/check.png
new file mode 100755
index 0000000..84fc229
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/check.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/correct.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/correct.png
new file mode 100755
index 0000000..ca9b9db
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ele0.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele0.png
new file mode 100755
index 0000000..4eccd23
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele0.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ele1.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele1.png
new file mode 100755
index 0000000..2b1cdfb
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele1.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ele2.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele2.png
new file mode 100755
index 0000000..2e4e052
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele2.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ele3.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele3.png
new file mode 100755
index 0000000..72150f7
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele3.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ele4.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele4.png
new file mode 100755
index 0000000..6c01d20
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele4.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ele5.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele5.png
new file mode 100755
index 0000000..2de0e24
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ele5.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/house0.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/house0.png
new file mode 100755
index 0000000..f177650
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/house0.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/house1.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/house1.png
new file mode 100755
index 0000000..c98bfab
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/house1.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/house2.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/house2.png
new file mode 100755
index 0000000..1a2a5a2
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/house2.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/house3.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/house3.png
new file mode 100755
index 0000000..31daef2
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/house3.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/house4.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/house4.png
new file mode 100755
index 0000000..109bbe3
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/house4.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/house5.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/house5.png
new file mode 100755
index 0000000..f0fa406
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/house5.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/incorrect.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/incorrect.png
new file mode 100755
index 0000000..49ee2a2
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/incorrect.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ship0.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship0.png
new file mode 100755
index 0000000..7605feb
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship0.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ship1.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship1.png
new file mode 100755
index 0000000..f60f4fa
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship1.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ship2.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship2.png
new file mode 100755
index 0000000..fd7e7d7
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship2.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ship3.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship3.png
new file mode 100755
index 0000000..df518ba
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship3.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ship4.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship4.png
new file mode 100755
index 0000000..e8c3eb4
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship4.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/ship5.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship5.png
new file mode 100755
index 0000000..bfe03e7
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/ship5.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/title_block_lt.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/assets/image/title_block_rt.png b/examples/lessons/6_English_alphabeticalOrder/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_English_alphabeticalOrder/css/lesson.css b/examples/lessons/6_English_alphabeticalOrder/css/lesson.css
new file mode 100755
index 0000000..79d39cd
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/css/lesson.css
@@ -0,0 +1,229 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: absolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ /*width: 251px;*/
+ padding-right: 5px;
+ padding-top: 5px;
+}
+ #linkCheck{
+ width: 187px; height: 55px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0px auto;
+ margin-top: 85px;
+ width: 100%;
+ height: 400px;
+
+}
+ #section{
+ width: 900px;
+ height: 400px;
+ background: url(../assets/image/background.png);
+ margin: 0px auto;
+ }
+
+ #alphaCloud1{
+ margin: 2px auto;
+ width: 400px;
+ margin-left: 210px;
+ height: 20px;
+ padding: 5px;
+ text-align:center;
+ }
+ #alphaCloud2{
+ margin: 2px auto;
+ width: 400px;
+ height: 20px;
+ margin-left: 300px;
+ padding: 5px;
+ text-align:center;
+ }
+ #topText{
+ position:absolute;
+ top:28%;
+ left: 15%;
+ width: 720px;
+ height: 50px;
+ color: #2B0085;
+ font: 25px/30px "Courier New", Courier, monospace,Arial;
+
+ }
+ #alphaArrange{
+ margin-top: 26px;
+ margin-left: 0px;
+ width: 245px;
+ height: 250px;
+ padding: 5px;
+ text-align:center;
+ }
+ .drophover{
+ background-color: #FF9900;
+ }
+ #checkAnswer{
+ display:none;
+ position:absolute;
+ left: 30%;
+ bottom: 15%;
+ width: 100px;
+ height: 92px;
+ }
+
+ #displayImgArea{
+ position:absolute;
+ top: 35%;
+ right: 10%;
+ width:450px;
+ height: 270px;
+
+
+ }
+ .imgDisplay{
+ float:left;
+ margin: 0em;
+ }
+#gameOver{
+ display:none;
+ position:absolute;
+ width: 300px;
+ text-align:center;
+ top: 40%;
+ left: 40%;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ color:red;
+}
+#gameOverInfo{
+ margin-top: 35px;
+ text-align:center;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#06D946;
+
+} \ No newline at end of file
diff --git a/examples/lessons/6_English_alphabeticalOrder/css/ui.scoreboard.css b/examples/lessons/6_English_alphabeticalOrder/css/ui.scoreboard.css
new file mode 100755
index 0000000..11cdbb5
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/css/ui.scoreboard.css
@@ -0,0 +1,62 @@
+.ui-scoreboard-container-h{
+max-width: 800em;
+max-height: 200px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+
+.ui-scoreboard-spacing-h{
+max-width: 200em;
+max-height: 300em;
+display:inline;
+margin-left:0.2em;
+margin-right:0.4em;
+}
+
+.ui-scoreboard-text{
+font-size:larger;
+text-align: center;
+}
+
+.ui-scoreboard-number-h {
+background-color:black;
+color: white;
+padding-left:0.4em;
+padding-right:0.4em;
+font-size:larger;
+}
+
+.ui-scoreboard-button{
+float:right;
+cursor:pointer;
+}
+
+button .ui-scoreboard-icon{
+float: left;
+margin-right:0.3em;
+}
+.ui-scoreboard-container-v{
+max-width: 200px;
+max-height: 400px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+.ui-scoreboard-spacing-v{
+display:block;
+margin: 0.4em;
+}
+
+.ui-scoreboard-number-v{
+background-color:black;
+color: white;
+width: 1em;
+text-align:center;
+margin-left:auto;
+margin-right: auto;
+padding:0.4em;
+font-size:larger;
+}
+
+
diff --git a/examples/lessons/6_English_alphabeticalOrder/index.html b/examples/lessons/6_English_alphabeticalOrder/index.html
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/index.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_alphabeticalOrder/js/jquery-1.3.2.min.js b/examples/lessons/6_English_alphabeticalOrder/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_English_alphabeticalOrder/js/karma.js b/examples/lessons/6_English_alphabeticalOrder/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_English_alphabeticalOrder/js/lesson.js b/examples/lessons/6_English_alphabeticalOrder/js/lesson.js
new file mode 100755
index 0000000..c128d56
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/js/lesson.js
@@ -0,0 +1,213 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.ogg'},
+ {'name':'incorrect','file':'incorrect.ogg'}
+ ]});
+
+ k.ready(function(){
+ var i,j,flag;
+ var TOTAL_QUES = 6;
+ var TOTAL_LEVEL = 3;
+ var currentDragObject;
+ var randPositions = [];
+ var arrangedAns = [];
+ var sectionNum; //store the three levels values 0,1,2
+ var currentAlphaNum; //store the current questions num
+ var checked; //store the current checked value
+ var num;
+ var currentAnsArray = []; //store the current array set of alphabets
+ var flag_checked; //status flag for one time correct alpahbetical order
+ var imgCounter;
+ // six alphabets given to be ordered 6 steps needed to complete the picture 3 levels too complex
+ var alphabets = new Array('aeroplane','apple','ant','arrow','audio','axe',
+ 'eagle','ear','east','egg','elephant','engine',
+ 'fan','fall','fat','first','fog','fun',
+ 'egg','goat','ladder','leaf','net','tiger',
+ 'crocodile','deer','elephant','lion','rhinosorous','tiger',
+ 'bus','flag','glass','nose','pencil','table',
+ 'bag','ball','banana','bat','bed','bone',
+ 'cat','camera','class','color','country','cream',
+ 'cat','cow','dog','donkey','hen','rabbit',
+ 'dam','dark','den','dog','drink','duck',
+ 'glass','nail','picture','radio','star','watch',
+ 'bus','flag','glass','nose','pencil','table',
+ 'magic','man','many','master','miracle','mouse',
+ 'pan','pencil','pig','pot','practice','pumpkin',
+ 'salte','school','short','smile','snake','stick',
+ 'axe','mountain','plate','umbrella','volley-ball','x-ray',
+ 'television','temple','toggle','trap','trust','turn',
+ 'bottle','fish','house','pan','tree','window'
+ );
+ var imageDisplay = new Array('ele0','ele1','ele2','ele3','ele4','ele5','house0','house1','house2','house3','house4','house5',
+ 'ship0','ship1','ship2','ship3','ship4','ship5');
+ var scoreboard = $('#score_box').scoreboard({'layout':'horizontal',
+ 'winningScore': alphabets.length});
+
+ var genRandPosition=function (){
+ randPositions[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+ var assignAlphabets = function (alphaId){
+ var alphaCloudId = 1; //for positioning only
+ if(alphaId>2){
+ alphaCloudId = 2;
+ }
+ var alphaCurId = alphaId + (currentAlphaNum*TOTAL_QUES);
+ $('#alphaCloud'+alphaCloudId).append('<div id="drag'+alphaId+'" class="dragObjects">'+alphabets[alphaCurId]+'</div>');
+ var dragObjCss = {
+ 'position':'relative','float': 'left','cursor': 'move',
+ 'width':'100px','height':'30px','padding-left': '20px',
+ 'font':'20px/25px bold Arial,Verdana,Geneva,Helvetica'
+ };
+ $('.dragObjects').css(dragObjCss);
+
+ $('#alphaArrange').append('<div id="drop'+num+'" class="dropObjects"></div>');
+ var dropObjCss = {
+ 'width':'222px','height': '33px','margin': '0.65em 0.5em'
+ };
+ $('.dropObjects').css(dropObjCss);
+ num++;
+ };
+
+ function drag_drop(){
+ $('.dragObjects').draggable({ containment: '#content'});
+ $('.dragObjects').bind('dragstart', function(event, ui) {
+ currentDragObject = event.target.id;
+ var currentMonth = parseInt(currentDragObject.substring(4));
+
+ });
+
+ $(".dropObjects").droppable({ tolerence: 'intersect' ,hoverClass: 'drophover' });
+ $('.dropObjects').bind('drop', function(event, ui) {
+ var currentDropObject = event.target.id;
+ var droppedWord = parseInt(currentDropObject.substring(4));
+ arrangedAns[droppedWord] = $('#'+currentDragObject).text();
+ });
+ }
+ var display_control = function(){
+ if(checked === 1){
+ $('#disImg'+imgCounter).show();
+ imgCounter++;
+ next_alphabets();
+ }
+
+ };
+ var delay_correctShow = function(){
+ document.delayForm.delayval.value = 1;
+ $('#checkAnswer').hide();
+ if(currentAlphaNum%6 === 0 && currentAlphaNum != 0){ //next level
+ $('#section').html('');
+ $('#linkNext').show();
+ }
+ else{
+ display_control();
+ }
+ };
+
+ var check_alphabets_order = function(){
+ var correct = 0;
+ for(i=0; i<TOTAL_QUES; i++){
+ //var alpha = i+(currentAlphaNum*TOTAL_QUES);
+ if(arrangedAns[i] === currentAnsArray[i] && arrangedAns.length != 0){
+ correct++;
+ }
+ }
+ $('#checkAnswer').show();
+ if(correct === TOTAL_QUES){
+ if(flag_checked === 0){
+ scoreboard.scoreboard('inc');
+ }
+ currentAlphaNum++;
+ checked = 1;
+ k.audio.correct.play();
+ $('#checkAnswer').html('<img src="assets/image/correct.png">');
+ scoreboard.scoreboard('incTotal');
+ }
+ else{
+ k.audio.incorrect.play();
+ $('#checkAnswer').html('<img src="assets/image/incorrect.png">');
+ checked = 0;
+ flag_checked = 1;
+ }
+
+ t=setTimeout(function(){delay_correctShow();},1000);
+
+
+
+
+ };
+ var display_game_over = function(){
+
+ $('#section').hide();
+ $('#gameOver').show();
+ $('#gameOver').html('');
+ $('#gameOver').append('GAME OVER<br/>Congratulations!!!');
+ };
+ var next_alphabets = function(){
+ if(currentAlphaNum === alphabets.length){ //show all
+ display_game_over();
+ }
+ else{
+ $('#section').html('').append('<div id="alphaCloud1"></div>');
+ $('#section').append('<div id="alphaCloud2"></div>');
+ $('#section').append('<div id="topText">Rearrange the above words in alphabetical order.</div>');
+ $('#section').append('<div id="alphaArrange"></div>');
+ genRandPosition();
+ num = 0;
+ flag_checked = 0;
+ for(i = 0; i< TOTAL_QUES ; i++){
+ assignAlphabets(randPositions[i]);
+ }
+ for(i = 0;i<TOTAL_QUES;i++){
+ var curAlphabet = (currentAlphaNum*TOTAL_QUES)+i;
+ currentAnsArray[i] = alphabets[curAlphabet];
+ }
+ currentAnsArray.sort();
+ drag_drop();
+
+ }
+ };
+ function game_start(){
+ $('#gameOver').hide();
+ $('#displayImgArea').show();
+ $('#displayImgArea').html('');
+ imgCounter = 0;
+ for(i = 0;i<TOTAL_QUES;i++){
+ imgId = i + (sectionNum*TOTAL_QUES);
+ $('#displayImgArea').append('<img id="disImg'+i+'" class="imgDisplay" src="assets/image/'+imageDisplay[imgId]+'.png" width="30%" height="50%">');
+ $('#disImg'+i).hide();
+ }
+ next_alphabets();
+ }
+ $('#linkNext').hide();
+ $('#linkCheck').click(function(){
+ check_alphabets_order();
+ });
+ $('#linkNext').click(function(){
+ $('#linkNext').hide();
+ sectionNum += 1;
+ game_start();
+ });
+ $('#linkStart').click(function(){
+ sectionNum = 0;
+ currentAlphaNum = 0;
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ scoreboard.scoreboard('reset');
+ currentAlphaNum = sectionNum*currentAlphaNum;
+ game_start();
+ });
+ }); //end of k.ready
+}); //end of document.ready \ No newline at end of file
diff --git a/examples/lessons/6_English_alphabeticalOrder/js/ui.core.js b/examples/lessons/6_English_alphabeticalOrder/js/ui.core.js
new file mode 100755
index 0000000..5493e0a
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/js/ui.core.js
@@ -0,0 +1,519 @@
+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+;jQuery.ui || (function($) {
+
+var _remove = $.fn.remove,
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+
+//Helper functions and ui object
+$.ui = {
+ version: "1.7.2",
+
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function(module, option, set) {
+ var proto = $.ui[module].prototype;
+ for(var i in set) {
+ proto.plugins[i] = proto.plugins[i] || [];
+ proto.plugins[i].push([option, set[i]]);
+ }
+ },
+ call: function(instance, name, args) {
+ var set = instance.plugins[name];
+ if(!set || !instance.element[0].parentNode) { return; }
+
+ for (var i = 0; i < set.length; i++) {
+ if (instance.options[set[i][0]]) {
+ set[i][1].apply(instance.element, args);
+ }
+ }
+ }
+ },
+
+ contains: function(a, b) {
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
+ },
+
+ hasScroll: function(el, a) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ($(el).css('overflow') == 'hidden') { return false; }
+
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
+ has = false;
+
+ if (el[scroll] > 0) { return true; }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[scroll] = 1;
+ has = (el[scroll] > 0);
+ el[scroll] = 0;
+ return has;
+ },
+
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
+ },
+
+ isOver: function(y, x, top, left, height, width) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+ },
+
+ keyCode: {
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+};
+
+// WAI-ARIA normalization
+if (isFF2) {
+ var attr = $.attr,
+ removeAttr = $.fn.removeAttr,
+ ariaNS = "http://www.w3.org/2005/07/aaa",
+ ariaState = /^aria-/,
+ ariaRole = /^wairole:/;
+
+ $.attr = function(elem, name, value) {
+ var set = value !== undefined;
+
+ return (name == 'role'
+ ? (set
+ ? attr.call(this, elem, name, "wairole:" + value)
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
+ : (ariaState.test(name)
+ ? (set
+ ? elem.setAttributeNS(ariaNS,
+ name.replace(ariaState, "aaa:"), value)
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
+ : attr.apply(this, arguments)));
+ };
+
+ $.fn.removeAttr = function(name) {
+ return (ariaState.test(name)
+ ? this.each(function() {
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
+ }) : removeAttr.call(this, name));
+ };
+}
+
+//jQuery plugins
+$.fn.extend({
+ remove: function() {
+ // Safari has a native remove event which actually removes DOM elements,
+ // so we have to use triggerHandler instead of trigger (#3037).
+ $("*", this).add(this).each(function() {
+ $(this).triggerHandler("remove");
+ });
+ return _remove.apply(this, arguments );
+ },
+
+ enableSelection: function() {
+ return this
+ .attr('unselectable', 'off')
+ .css('MozUserSelect', '')
+ .unbind('selectstart.ui');
+ },
+
+ disableSelection: function() {
+ return this
+ .attr('unselectable', 'on')
+ .css('MozUserSelect', 'none')
+ .bind('selectstart.ui', function() { return false; });
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ }
+});
+
+
+//Additional selectors
+$.extend($.expr[':'], {
+ data: function(elem, i, match) {
+ return !!$.data(elem, match[3]);
+ },
+
+ focusable: function(element) {
+ var nodeName = element.nodeName.toLowerCase(),
+ tabIndex = $.attr(element, 'tabindex');
+ return (/input|select|textarea|button|object/.test(nodeName)
+ ? !element.disabled
+ : 'a' == nodeName || 'area' == nodeName
+ ? element.href || !isNaN(tabIndex)
+ : !isNaN(tabIndex))
+ // the element and all of its ancestors must be visible
+ // the browser may report that the area is hidden
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
+ },
+
+ tabbable: function(element) {
+ var tabIndex = $.attr(element, 'tabindex');
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
+ }
+});
+
+
+// $.widget is a factory to create jQuery plugins
+// taking some boilerplate code out of the plugin code
+function getter(namespace, plugin, method, args) {
+ function getMethods(type) {
+ var methods = $[namespace][plugin][type] || [];
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
+ }
+
+ var methods = getMethods('getter');
+ if (args.length == 1 && typeof args[0] == 'string') {
+ methods = methods.concat(getMethods('getterSetter'));
+ }
+ return ($.inArray(method, methods) != -1);
+}
+
+$.widget = function(name, prototype) {
+ var namespace = name.split(".")[0];
+ name = name.split(".")[1];
+
+ // create plugin method
+ $.fn[name] = function(options) {
+ var isMethodCall = (typeof options == 'string'),
+ args = Array.prototype.slice.call(arguments, 1);
+
+ // prevent calls to internal methods
+ if (isMethodCall && options.substring(0, 1) == '_') {
+ return this;
+ }
+
+ // handle getter methods
+ if (isMethodCall && getter(namespace, name, options, args)) {
+ var instance = $.data(this[0], name);
+ return (instance ? instance[options].apply(instance, args)
+ : undefined);
+ }
+
+ // handle initialization and non-getter methods
+ return this.each(function() {
+ var instance = $.data(this, name);
+
+ // constructor
+ (!instance && !isMethodCall &&
+ $.data(this, name, new $[namespace][name](this, options))._init());
+
+ // method call
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
+ instance[options].apply(instance, args));
+ });
+ };
+
+ // create widget constructor
+ $[namespace] = $[namespace] || {};
+ $[namespace][name] = function(element, options) {
+ var self = this;
+
+ this.namespace = namespace;
+ this.widgetName = name;
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
+ this.widgetBaseClass = namespace + '-' + name;
+
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
+ this.element = $(element)
+ .bind('setData.' + name, function(event, key, value) {
+ if (event.target == element) {
+ return self._setData(key, value);
+ }
+ })
+ .bind('getData.' + name, function(event, key) {
+ if (event.target == element) {
+ return self._getData(key);
+ }
+ })
+ .bind('remove', function() {
+ return self.destroy();
+ });
+ };
+
+ // add widget prototype
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
+
+ // TODO: merge getter and getterSetter properties from widget prototype
+ // and plugin prototype
+ $[namespace][name].getterSetter = 'option';
+};
+
+$.widget.prototype = {
+ _init: function() {},
+ destroy: function() {
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
+ },
+
+ option: function(key, value) {
+ var options = key,
+ self = this;
+
+ if (typeof key == "string") {
+ if (value === undefined) {
+ return this._getData(key);
+ }
+ options = {};
+ options[key] = value;
+ }
+
+ $.each(options, function(key, value) {
+ self._setData(key, value);
+ });
+ },
+ _getData: function(key) {
+ return this.options[key];
+ },
+ _setData: function(key, value) {
+ this.options[key] = value;
+
+ if (key == 'disabled') {
+ this.element
+ [value ? 'addClass' : 'removeClass'](
+ this.widgetBaseClass + '-disabled' + ' ' +
+ this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
+ }
+ },
+
+ enable: function() {
+ this._setData('disabled', false);
+ },
+ disable: function() {
+ this._setData('disabled', true);
+ },
+
+ _trigger: function(type, event, data) {
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = $.Event(event);
+ event.type = eventName;
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if (event.originalEvent) {
+ for (var i = $.event.props.length, prop; i;) {
+ prop = $.event.props[--i];
+ event[prop] = event.originalEvent[prop];
+ }
+ }
+
+ this.element.trigger(event, data);
+
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
+ }
+};
+
+$.widget.defaults = {
+ disabled: false
+};
+
+
+/** Mouse Interaction Plugin **/
+
+$.ui.mouse = {
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ // Prevent text selection in IE
+ if ($.browser.msie) {
+ this._mouseUnselectable = this.element.attr('unselectable');
+ this.element.attr('unselectable', 'on');
+ }
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+
+ // Restore text selection in IE
+ ($.browser.msie
+ && this.element.attr('unselectable', this._mouseUnselectable));
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ // TODO: figure out why we have to use originalEvent
+ event.originalEvent = event.originalEvent || {};
+ if (event.originalEvent.mouseHandled) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ // preventDefault() is used to prevent the selection of text here -
+ // however, in Safari, this causes select boxes not to be selectable
+ // anymore, so this fix is needed
+ ($.browser.safari || event.preventDefault());
+
+ event.originalEvent.mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+};
+
+$.ui.mouse.defaults = {
+ cancel: null,
+ distance: 1,
+ delay: 0
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_English_alphabeticalOrder/js/ui.draggable.js b/examples/lessons/6_English_alphabeticalOrder/js/ui.draggable.js
new file mode 100755
index 0000000..0402f0e
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/js/ui.draggable.js
@@ -0,0 +1,766 @@
+/*
+ * jQuery UI Draggable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * ui.core.js
+ */
+(function($) {
+
+$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
+
+ _init: function() {
+
+ if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
+ this.element[0].style.position = 'relative';
+
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
+
+ this._mouseInit();
+
+ },
+
+ destroy: function() {
+ if(!this.element.data('draggable')) return;
+ this.element
+ .removeData("draggable")
+ .unbind(".draggable")
+ .removeClass("ui-draggable"
+ + " ui-draggable-dragging"
+ + " ui-draggable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+
+ var o = this.options;
+
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
+ return false;
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle)
+ return false;
+
+ return true;
+
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if($.ui.ddmanager)
+ $.ui.ddmanager.current = this;
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css("position");
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.element.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
+ if(o.cursorAt)
+ this._adjustOffsetFromHelper(o.cursorAt);
+
+ //Set a containment if given in the options
+ if(o.containment)
+ this._setContainment();
+
+ //Call plugins and callbacks
+ this._trigger("start", event);
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(this, event);
+
+ this.helper.addClass("ui-draggable-dragging");
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ this._trigger('drag', event, ui);
+ this.position = ui.position;
+ }
+
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
+ dropped = $.ui.ddmanager.drop(this, event);
+
+ //if a drop comes from outside (a sortable)
+ if(this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ var self = this;
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ self._trigger("stop", event);
+ self._clear();
+ });
+ } else {
+ this._trigger("stop", event);
+ this._clear();
+ }
+
+ return false;
+ },
+
+ _getHandle: function(event) {
+
+ var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
+ $(this.options.handle, this.element)
+ .find("*")
+ .andSelf()
+ .each(function() {
+ if(this == event.target) handle = true;
+ });
+
+ return handle;
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options;
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
+
+ if(!helper.parents('body').length)
+ helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
+
+ if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
+ helper.css("position", "absolute");
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
+ if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
+ if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
+ po = { top: 0, left: 0 };
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition == "relative") {
+ var p = this.element.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
+ top: (parseInt(this.element.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var o = this.options;
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
+ ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+
+ if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
+ var ce = $(o.containment)[0]; if(!ce) return;
+ var co = $(o.containment).offset();
+ var over = ($(ce).css("overflow") != 'hidden');
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ } else if(o.containment.constructor == Array) {
+ this.containment = o.containment;
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) pos = this.position;
+ var mod = d == "absolute" ? 1 : -1;
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top // The absolute mouse position
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left // The absolute mouse position
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ var pageX = event.pageX;
+ var pageY = event.pageY;
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
+ if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
+ }
+
+ if(o.grid) {
+ var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY // The absolute mouse position
+ - this.offset.click.top // Click offset (relative to the element)
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX // The absolute mouse position
+ - this.offset.click.left // Click offset (relative to the element)
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
+ //if($.ui.ddmanager) $.ui.ddmanager.current = null;
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function(type, event, ui) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call(this, type, [event, ui]);
+ if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
+ return $.widget.prototype._trigger.call(this, type, event, ui);
+ },
+
+ plugins: {},
+
+ _uiHash: function(event) {
+ return {
+ helper: this.helper,
+ position: this.position,
+ absolutePosition: this.positionAbs, //deprecated
+ offset: this.positionAbs
+ };
+ }
+
+}));
+
+$.extend($.ui.draggable, {
+ version: "1.7.2",
+ eventPrefix: "drag",
+ defaults: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input,option",
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ delay: 0,
+ distance: 1,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false
+ }
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+ start: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options,
+ uiSortable = $.extend({}, ui, { item: inst.element });
+ inst.sortables = [];
+ $(o.connectToSortable).each(function() {
+ var sortable = $.data(this, 'sortable');
+ if (sortable && !sortable.options.disabled) {
+ inst.sortables.push({
+ instance: sortable,
+ shouldRevert: sortable.options.revert
+ });
+ sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+
+ },
+ stop: function(event, ui) {
+
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+ var inst = $(this).data("draggable"),
+ uiSortable = $.extend({}, ui, { item: inst.element });
+
+ $.each(inst.sortables, function() {
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
+ if(this.shouldRevert) this.instance.options.revert = true;
+
+ //Trigger the stop of the sortable
+ this.instance._mouseStop(event);
+
+ this.instance.options.helper = this.instance.options._helper;
+
+ //If the helper has been the original item, restore properties in the sortable
+ if(inst.options.helper == 'original')
+ this.instance.currentItem.css({ top: 'auto', left: 'auto' });
+
+ } else {
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ this.instance._trigger("deactivate", event, uiSortable);
+ }
+
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), self = this;
+
+ var checkPos = function(o) {
+ var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
+ var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
+ var itemHeight = o.height, itemWidth = o.width;
+ var itemTop = o.top, itemLeft = o.left;
+
+ return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
+ };
+
+ $.each(inst.sortables, function(i) {
+
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
+
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+ if(!this.instance.isOver) {
+
+ this.instance.isOver = 1;
+ //Now we fake the start of dragging for the sortable instance,
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+ this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+ this.instance.options.helper = function() { return ui.helper[0]; };
+
+ event.target = this.instance.currentItem[0];
+ this.instance._mouseCapture(event, true);
+ this.instance._mouseStart(event, true, true);
+
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+ this.instance.offset.click.top = inst.offset.click.top;
+ this.instance.offset.click.left = inst.offset.click.left;
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+ inst._trigger("toSortable", event);
+ inst.dropped = this.instance.element; //draggable revert needs that
+ //hack so receive/update callbacks work (mostly)
+ inst.currentItem = inst.element;
+ this.instance.fromOutside = inst;
+
+ }
+
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+ if(this.instance.currentItem) this.instance._mouseDrag(event);
+
+ } else {
+
+ //If it doesn't intersect with the sortable, and it intersected before,
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+ this.instance.cancelHelperRemoval = true;
+
+ //Prevent reverting on this forced stop
+ this.instance.options.revert = false;
+
+ // The out event needs to be triggered independently
+ this.instance._trigger('out', event, this.instance._uiHash(this.instance));
+
+ this.instance._mouseStop(event, true);
+ this.instance.options.helper = this.instance.options._helper;
+
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+ this.instance.currentItem.remove();
+ if(this.instance.placeholder) this.instance.placeholder.remove();
+
+ inst._trigger("fromSortable", event);
+ inst.dropped = false; //draggable revert needs that
+ }
+
+ };
+
+ });
+
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function(event, ui) {
+ var t = $('body'), o = $(this).data('draggable').options;
+ if (t.css("cursor")) o._cursor = t.css("cursor");
+ t.css("cursor", o.cursor);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if (o._cursor) $('body').css("cursor", o._cursor);
+ }
+});
+
+$.ui.plugin.add("draggable", "iframeFix", {
+ start: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+ $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
+ .css({
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+ position: "absolute", opacity: "0.001", zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo("body");
+ });
+ },
+ stop: function(event, ui) {
+ $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data('draggable').options;
+ if(t.css("opacity")) o._opacity = t.css("opacity");
+ t.css('opacity', o.opacity);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if(o._opacity) $(ui.helper).css('opacity', o._opacity);
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function(event, ui) {
+ var i = $(this).data("draggable");
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
+ },
+ drag: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options, scrolled = false;
+
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
+
+ if(!o.axis || o.axis != 'x') {
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+ else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+ else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(!o.axis || o.axis != 'x') {
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(i, event);
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options;
+ i.snapElements = [];
+
+ $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
+ var $t = $(this); var $o = $t.offset();
+ if(this != i.element[0]) i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options;
+ var d = o.snapTolerance;
+
+ var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (var i = inst.snapElements.length - 1; i >= 0; i--){
+
+ var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
+ t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
+
+ //Yes, I know, this is insane ;)
+ if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
+ if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if(o.snapMode != 'inner') {
+ var ts = Math.abs(t - y2) <= d;
+ var bs = Math.abs(b - y1) <= d;
+ var ls = Math.abs(l - x2) <= d;
+ var rs = Math.abs(r - x1) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+ }
+
+ var first = (ts || bs || ls || rs);
+
+ if(o.snapMode != 'outer') {
+ var ts = Math.abs(t - y1) <= d;
+ var bs = Math.abs(b - y2) <= d;
+ var ls = Math.abs(l - x1) <= d;
+ var rs = Math.abs(r - x2) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+ }
+
+ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ };
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function(event, ui) {
+
+ var o = $(this).data("draggable").options;
+
+ var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
+ return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
+ });
+
+ $(group).each(function(i) {
+ this.style.zIndex = o.stack.min + i;
+ });
+
+ this[0].style.zIndex = o.stack.min + group.length;
+
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data("draggable").options;
+ if(t.css("zIndex")) o._zIndex = t.css("zIndex");
+ t.css('zIndex', o.zIndex);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data("draggable").options;
+ if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
+ }
+});
+
+})(jQuery);
diff --git a/examples/lessons/6_English_alphabeticalOrder/js/ui.droppable.js b/examples/lessons/6_English_alphabeticalOrder/js/ui.droppable.js
new file mode 100755
index 0000000..8e7be33
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/js/ui.droppable.js
@@ -0,0 +1,282 @@
+/*
+ * jQuery UI Droppable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * ui.core.js
+ * ui.draggable.js
+ */
+(function($) {
+
+$.widget("ui.droppable", {
+
+ _init: function() {
+
+ var o = this.options, accept = o.accept;
+ this.isover = 0; this.isout = 1;
+
+ this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
+ return d.is(accept);
+ };
+
+ //Store the droppable's proportions
+ this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
+
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
+ $.ui.ddmanager.droppables[this.options.scope].push(this);
+
+ (this.options.addClasses && this.element.addClass("ui-droppable"));
+
+ },
+
+ destroy: function() {
+ var drop = $.ui.ddmanager.droppables[this.options.scope];
+ for ( var i = 0; i < drop.length; i++ )
+ if ( drop[i] == this )
+ drop.splice(i, 1);
+
+ this.element
+ .removeClass("ui-droppable ui-droppable-disabled")
+ .removeData("droppable")
+ .unbind(".droppable");
+ },
+
+ _setData: function(key, value) {
+
+ if(key == 'accept') {
+ this.options.accept = value && $.isFunction(value) ? value : function(d) {
+ return d.is(value);
+ };
+ } else {
+ $.widget.prototype._setData.apply(this, arguments);
+ }
+
+ },
+
+ _activate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.addClass(this.options.activeClass);
+ (draggable && this._trigger('activate', event, this.ui(draggable)));
+ },
+
+ _deactivate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ (draggable && this._trigger('deactivate', event, this.ui(draggable)));
+ },
+
+ _over: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
+ this._trigger('over', event, this.ui(draggable));
+ }
+
+ },
+
+ _out: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('out', event, this.ui(draggable));
+ }
+
+ },
+
+ _drop: function(event,custom) {
+
+ var draggable = custom || $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
+
+ var childrenIntersection = false;
+ this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
+ var inst = $.data(this, 'droppable');
+ if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
+ childrenIntersection = true; return false;
+ }
+ });
+ if(childrenIntersection) return false;
+
+ if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('drop', event, this.ui(draggable));
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function(c) {
+ return {
+ draggable: (c.currentItem || c.element),
+ helper: c.helper,
+ position: c.position,
+ absolutePosition: c.positionAbs, //deprecated
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.extend($.ui.droppable, {
+ version: "1.7.2",
+ eventPrefix: 'drop',
+ defaults: {
+ accept: '*',
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: 'default',
+ tolerance: 'intersect'
+ }
+});
+
+$.ui.intersect = function(draggable, droppable, toleranceMode) {
+
+ if (!droppable.offset) return false;
+
+ var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
+ y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
+ var l = droppable.offset.left, r = l + droppable.proportions.width,
+ t = droppable.offset.top, b = t + droppable.proportions.height;
+
+ switch (toleranceMode) {
+ case 'fit':
+ return (l < x1 && x2 < r
+ && t < y1 && y2 < b);
+ break;
+ case 'intersect':
+ return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
+ && x2 - (draggable.helperProportions.width / 2) < r // Left Half
+ && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
+ && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
+ break;
+ case 'pointer':
+ var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
+ isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
+ return isOver;
+ break;
+ case 'touch':
+ return (
+ (y1 >= t && y1 <= b) || // Top edge touching
+ (y2 >= t && y2 <= b) || // Bottom edge touching
+ (y1 < t && y2 > b) // Surrounded vertically
+ ) && (
+ (x1 >= l && x1 <= r) || // Left edge touching
+ (x2 >= l && x2 <= r) || // Right edge touching
+ (x1 < l && x2 > r) // Surrounded horizontally
+ );
+ break;
+ default:
+ return false;
+ break;
+ }
+
+};
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { 'default': [] },
+ prepareOffsets: function(t, event) {
+
+ var m = $.ui.ddmanager.droppables[t.options.scope];
+ var type = event ? event.type : null; // workaround for #2317
+ var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
+
+ droppablesLoop: for (var i = 0; i < m.length; i++) {
+
+ if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
+ for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
+ m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
+
+ m[i].offset = m[i].element.offset();
+ m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
+
+ if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
+
+ }
+
+ },
+ drop: function(draggable, event) {
+
+ var dropped = false;
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(!this.options) return;
+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
+ dropped = this._drop.call(this, event);
+
+ if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ this.isout = 1; this.isover = 0;
+ this._deactivate.call(this, event);
+ }
+
+ });
+ return dropped;
+
+ },
+ drag: function(draggable, event) {
+
+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
+
+ //Run through all droppables and check their positions based on specific tolerance options
+
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(this.options.disabled || this.greedyChild || !this.visible) return;
+ var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
+
+ var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
+ if(!c) return;
+
+ var parentInstance;
+ if (this.options.greedy) {
+ var parent = this.element.parents(':data(droppable):eq(0)');
+ if (parent.length) {
+ parentInstance = $.data(parent[0], 'droppable');
+ parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
+ }
+ }
+
+ // we just moved into a greedy child
+ if (parentInstance && c == 'isover') {
+ parentInstance['isover'] = 0;
+ parentInstance['isout'] = 1;
+ parentInstance._out.call(parentInstance, event);
+ }
+
+ this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
+ this[c == "isover" ? "_over" : "_out"].call(this, event);
+
+ // we just moved out of a greedy child
+ if (parentInstance && c == 'isout') {
+ parentInstance['isout'] = 0;
+ parentInstance['isover'] = 1;
+ parentInstance._over.call(parentInstance, event);
+ }
+ });
+
+ }
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_English_alphabeticalOrder/js/ui.scoreboard.js b/examples/lessons/6_English_alphabeticalOrder/js/ui.scoreboard.js
new file mode 100755
index 0000000..53a930a
--- /dev/null
+++ b/examples/lessons/6_English_alphabeticalOrder/js/ui.scoreboard.js
@@ -0,0 +1,107 @@
+(function($){
+ $.widget('ui.scoreboard',
+ {
+ getScore : function(){
+ return this._getData('score');
+ },
+ setScore : function(newScore){
+ this._setData('score', parseInt(newScore));
+ this._refresh();
+ },
+ getTotal : function(){
+ return this._getData('total');
+ },
+ setTotal : function(newTotal){
+ this._setData('total', parseInt(newTotal));
+ this._refresh();
+ },
+ reset : function(){
+ this._setData('score', this._getData('initialScore'));
+ this._setData('total', this._getData('initialTotal'));
+ this._refresh();
+ },
+ inc : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') + incVal);
+ this._refresh();
+ if(this._getData('winScore') === this._getData('score')){
+ this.element.trigger('winGame');
+ }
+ },
+ incTotal : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') + incVal);
+ this._refresh();
+ },
+ dec : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') - decVal);
+ this._refresh();
+ },
+ decTotal : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') - decVal);
+ this._refresh();
+ },
+ _init : function(){
+
+ var divDisplay = "inline";
+ var score = this.options.score;
+ var total = this.options.total;
+ var layoutId = "h";
+ var self = this;
+
+
+ this._setData('initialScore', parseInt(this.options.score));
+ this._setData('initialTotal', parseInt(this.options.total));
+ this._setData('score', parseInt(this.options.score));
+ this._setData('total', parseInt(this.options.total));
+ this._setData('winScore', parseInt(this.options.winningScore) || 0);
+
+ if(this.options.layout === "vertical"){
+ layoutId = "v";
+ }
+
+ this.evWinGame = document.createEvent('Events');
+
+ this.element.addClass('ui-scoreboard-container-' + layoutId +
+ ' ui-widget ui-widget-content ui-corner-all');
+
+ var clone = $('<div>')
+ .addClass('ui-scoreboard-spacing-' + layoutId);
+ this._scoreText = $("<div>Score</div>")
+ .addClass('ui-scoreboard-spacing-'+ layoutId +
+ ' ui-corner-all ui-scoreboard-text')
+ .appendTo(this.element);
+ this._score = $("<div>" + score + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ $("<div>Total</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-corner-all ' +
+ 'ui-scoreboard-text')
+ .appendTo(this.element);
+ this._total = $("<div>" + total + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ },
+ _refresh : function(){
+ this._score.text(this._getData('score'));
+ this._total.text(this._getData('total'));
+ },
+ destroy : function(){
+ this.element.remove();
+ $.widget.prototype.destroy.apply(this, arguments);
+ }
+
+
+ });
+
+ $.ui.scoreboard.getter = ['getScore', 'getTotal'];
+ $.ui.scoreboard.defaults = {
+ score: 0, total: 0, layout: "horizontal", winningScore: 0
+ };
+
+ })(jQuery); \ No newline at end of file
diff --git a/examples/lessons/6_English_months/.tmp_index.html.63800~ b/examples/lessons/6_English_months/.tmp_index.html.63800~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_months/.tmp_index.html.63800~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_months/.tmp_index.html.69489~ b/examples/lessons/6_English_months/.tmp_index.html.69489~
new file mode 100755
index 0000000..da51ff8
--- /dev/null
+++ b/examples/lessons/6_English_months/.tmp_index.html.69489~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Months</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Months of the Year<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_months/.tmp_index.html.83946~ b/examples/lessons/6_English_months/.tmp_index.html.83946~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_months/.tmp_index.html.83946~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_months/.tmp_index.html.92952~ b/examples/lessons/6_English_months/.tmp_index.html.92952~
new file mode 100755
index 0000000..77f8df2
--- /dev/null
+++ b/examples/lessons/6_English_months/.tmp_index.html.92952~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Eng Crossword</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Crossword Puzzle <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="acrossImg"></div>
+ <div id="downImg"></div>
+ <div id="crosswordSection">
+
+
+ </div>
+
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_months/assets/audio/April.wav b/examples/lessons/6_English_months/assets/audio/April.wav
new file mode 100755
index 0000000..a6ced1b
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/April.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/August.wav b/examples/lessons/6_English_months/assets/audio/August.wav
new file mode 100755
index 0000000..8ba28d0
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/August.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/December.wav b/examples/lessons/6_English_months/assets/audio/December.wav
new file mode 100755
index 0000000..42ee4bb
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/December.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/February.wav b/examples/lessons/6_English_months/assets/audio/February.wav
new file mode 100755
index 0000000..08da715
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/February.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/January.wav b/examples/lessons/6_English_months/assets/audio/January.wav
new file mode 100755
index 0000000..7a2d370
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/January.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/July.wav b/examples/lessons/6_English_months/assets/audio/July.wav
new file mode 100755
index 0000000..eb73098
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/July.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/June.wav b/examples/lessons/6_English_months/assets/audio/June.wav
new file mode 100755
index 0000000..ec2ce83
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/June.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/March.wav b/examples/lessons/6_English_months/assets/audio/March.wav
new file mode 100755
index 0000000..93d4885
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/March.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/May.wav b/examples/lessons/6_English_months/assets/audio/May.wav
new file mode 100755
index 0000000..09d3f47
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/May.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/November.wav b/examples/lessons/6_English_months/assets/audio/November.wav
new file mode 100755
index 0000000..24b265b
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/November.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/October.wav b/examples/lessons/6_English_months/assets/audio/October.wav
new file mode 100755
index 0000000..431b9c7
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/October.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/September.wav b/examples/lessons/6_English_months/assets/audio/September.wav
new file mode 100755
index 0000000..b079f7c
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/September.wav
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/correct.ogg b/examples/lessons/6_English_months/assets/audio/correct.ogg
new file mode 100755
index 0000000..a0d9e3a
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/correct.ogg
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/audio/incorrect.ogg b/examples/lessons/6_English_months/assets/audio/incorrect.ogg
new file mode 100755
index 0000000..4805e55
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/audio/incorrect.ogg
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/April.png b/examples/lessons/6_English_months/assets/image/April.png
new file mode 100755
index 0000000..eb87cbe
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/April.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/August.png b/examples/lessons/6_English_months/assets/image/August.png
new file mode 100755
index 0000000..96d59f1
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/August.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/December.png b/examples/lessons/6_English_months/assets/image/December.png
new file mode 100755
index 0000000..c060b1c
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/December.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/February.png b/examples/lessons/6_English_months/assets/image/February.png
new file mode 100755
index 0000000..d108a2a
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/February.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/January.png b/examples/lessons/6_English_months/assets/image/January.png
new file mode 100755
index 0000000..67d3919
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/January.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/July.png b/examples/lessons/6_English_months/assets/image/July.png
new file mode 100755
index 0000000..67e675c
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/July.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/June.png b/examples/lessons/6_English_months/assets/image/June.png
new file mode 100755
index 0000000..1163da9
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/June.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/March.png b/examples/lessons/6_English_months/assets/image/March.png
new file mode 100755
index 0000000..ec189e8
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/March.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/May.png b/examples/lessons/6_English_months/assets/image/May.png
new file mode 100755
index 0000000..4d47b1b
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/May.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/November.png b/examples/lessons/6_English_months/assets/image/November.png
new file mode 100755
index 0000000..b259ae2
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/November.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/October.png b/examples/lessons/6_English_months/assets/image/October.png
new file mode 100755
index 0000000..e7ad250
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/October.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/September.png b/examples/lessons/6_English_months/assets/image/September.png
new file mode 100755
index 0000000..3b074ee
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/September.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/bg_footer.png b/examples/lessons/6_English_months/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/bg_header.png b/examples/lessons/6_English_months/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/bg_title_block.png b/examples/lessons/6_English_months/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_back.png b/examples/lessons/6_English_months/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_back_hover.png b/examples/lessons/6_English_months/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_help.png b/examples/lessons/6_English_months/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_help_hover.png b/examples/lessons/6_English_months/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_next.png b/examples/lessons/6_English_months/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_next_hover.png b/examples/lessons/6_English_months/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_ole.png b/examples/lessons/6_English_months/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_ole_hover.png b/examples/lessons/6_English_months/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_play_again.png b/examples/lessons/6_English_months/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_play_again_hover.png b/examples/lessons/6_English_months/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_English_months/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_start.png b/examples/lessons/6_English_months/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_start_hover.png b/examples/lessons/6_English_months/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/btn_start_mouse_down.png b/examples/lessons/6_English_months/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/check.png b/examples/lessons/6_English_months/assets/image/check.png
new file mode 100755
index 0000000..84fc229
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/check.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/correct.png b/examples/lessons/6_English_months/assets/image/correct.png
new file mode 100755
index 0000000..603700d
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/incorrect.png b/examples/lessons/6_English_months/assets/image/incorrect.png
new file mode 100755
index 0000000..cccf59b
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/incorrect.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_April.png b/examples/lessons/6_English_months/assets/image/small_April.png
new file mode 100755
index 0000000..caa4366
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_April.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_August.png b/examples/lessons/6_English_months/assets/image/small_August.png
new file mode 100755
index 0000000..dca9649
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_August.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_December.png b/examples/lessons/6_English_months/assets/image/small_December.png
new file mode 100755
index 0000000..ec60fab
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_December.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_February.png b/examples/lessons/6_English_months/assets/image/small_February.png
new file mode 100755
index 0000000..733b1fd
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_February.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_January.png b/examples/lessons/6_English_months/assets/image/small_January.png
new file mode 100755
index 0000000..3dbfee6
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_January.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_July.png b/examples/lessons/6_English_months/assets/image/small_July.png
new file mode 100755
index 0000000..e30027a
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_July.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_June.png b/examples/lessons/6_English_months/assets/image/small_June.png
new file mode 100755
index 0000000..eb4fcdf
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_June.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_March.png b/examples/lessons/6_English_months/assets/image/small_March.png
new file mode 100755
index 0000000..f35bbd2
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_March.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_May.png b/examples/lessons/6_English_months/assets/image/small_May.png
new file mode 100755
index 0000000..6f111b5
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_May.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_November.png b/examples/lessons/6_English_months/assets/image/small_November.png
new file mode 100755
index 0000000..8b9e34e
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_November.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_October.png b/examples/lessons/6_English_months/assets/image/small_October.png
new file mode 100755
index 0000000..740e302
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_October.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/small_September.png b/examples/lessons/6_English_months/assets/image/small_September.png
new file mode 100755
index 0000000..0425852
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/small_September.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/title_block_lt.png b/examples/lessons/6_English_months/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_English_months/assets/image/title_block_rt.png b/examples/lessons/6_English_months/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_English_months/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_English_months/css/lesson.css b/examples/lessons/6_English_months/css/lesson.css
new file mode 100755
index 0000000..1660e95
--- /dev/null
+++ b/examples/lessons/6_English_months/css/lesson.css
@@ -0,0 +1,246 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: absolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ /*width: 251px;*/
+ padding-right: 5px;
+ padding-top: 5px;
+}
+ #linkCheck{
+ width: 187px; height: 55px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayfile:///usr/share/ubuntu-artwork/home/index.htmlAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0px auto;
+ margin-top: 85px;
+ height: 400px;
+
+}
+ #section{
+ margin: 5px auto;
+ width: 100%;
+ height: 400px;
+ text-align:center;
+ }
+ #topText{
+ margin: 20px auto;
+ width: 500px;
+ height: 25px;
+ color: blue;
+ font: 20px/25px Arial, Verdana, Geneva, Arial, Helvetica, sans-serif;
+ }
+ .drophover{
+ background-color: #FF9900;
+ }
+ .imgArea{
+ float:left;
+ margin-right: 15px;
+ margin-bottom: 20px;
+ padding: 2px;
+ width: 150px;
+ height: 135px;
+ text-align:center;
+ }
+ .monthsName{
+ cursor: pointer;
+ text-align:center;
+ font: 20px/25px Arial, Helvetica, sans-serif;
+
+ }
+ .imgBox{
+ margin-top:0.1em;
+ text-align:center;
+ }
+
+ .dropMonthArea{
+ float:left;
+ margin-right: 25px;
+ margin-bottom: 20px;
+ padding: 2px;
+ width: 225px;
+ height: 50px;
+ text-align:center;
+ }
+
+
+ #dragMonthArea{
+ position:absolute;
+ left: 10%;
+ bottom: 16%;
+ width: 80%;
+ height: 90px;
+ border: 1px solid #D0F692;
+ }
+
+ input.blankBox{
+ font: 15px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ height:20px;
+ width: 20px;
+ color:red;
+ text-align:center;
+ }
+ .imgSmall{
+ float:left;
+ }
+ .orderTxt{
+ float: left;
+ margin-right: 10px;
+ width: 50px;
+ height: 30px;
+ font: 16px/20px Arial, Verdana, Geneva, Helvetica, sans-serif;
+ }
+
+ .imgDisplay{
+ float:left;
+ margin: 0em;
+ }
+
+ .check{
+ float:right;
+ width: 20px;
+ height: 20px;
+ }
+#gameOver{
+ display:none;
+ position:absolute;
+ width: 300px;
+ text-align:center;
+ top: 40%;
+ left: 40%;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ color:red;
+}
+#gameOverInfo{
+ margin-top: 35px;
+ text-align:center;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#06D946;
+
+} \ No newline at end of file
diff --git a/examples/lessons/6_English_months/index.html b/examples/lessons/6_English_months/index.html
new file mode 100755
index 0000000..b22d119
--- /dev/null
+++ b/examples/lessons/6_English_months/index.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Months</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/jquery.watermarkinput.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Months of the Year<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_months/js/jquery-1.3.2.min.js b/examples/lessons/6_English_months/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_English_months/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_English_months/js/jquery.watermarkinput.js b/examples/lessons/6_English_months/js/jquery.watermarkinput.js
new file mode 100755
index 0000000..fefa670
--- /dev/null
+++ b/examples/lessons/6_English_months/js/jquery.watermarkinput.js
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2007 Josh Bush (digitalbush.com)
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Version: Beta 1
+ * Release: 2007-06-01
+ */
+(function($) {
+ var map=new Array();
+ $.Watermark = {
+ ShowAll:function(){
+ for (var i=0;i<map.length;i++){
+ if(map[i].obj.val()==""){
+ map[i].obj.val(map[i].text);
+ map[i].obj.css("color",map[i].WatermarkColor);
+ }else{
+ map[i].obj.css("color",map[i].DefaultColor);
+ }
+ }
+ },
+ HideAll:function(){
+ for (var i=0;i<map.length;i++){
+ if(map[i].obj.val()==map[i].text)
+ map[i].obj.val("");
+ }
+ }
+ }
+
+ $.fn.Watermark = function(text,color) {
+ if(!color)
+ color="#aaa";
+ return this.each(
+ function(){
+ var input=$(this);
+ var defaultColor=input.css("color");
+ map[map.length]={text:text,obj:input,DefaultColor:defaultColor,WatermarkColor:color};
+ function clearMessage(){
+ if(input.val()==text)
+ input.val("");
+ input.css("color",defaultColor);
+ }
+
+ function insertMessage(){
+ if(input.val().length==0 || input.val()==text){
+ input.val(text);
+ input.css("color",color);
+ }else
+ input.css("color",defaultColor);
+ }
+
+ input.focus(clearMessage);
+ input.blur(insertMessage);
+ input.change(insertMessage);
+
+ insertMessage();
+ }
+ );
+ };
+})(jQuery); \ No newline at end of file
diff --git a/examples/lessons/6_English_months/js/karma.js b/examples/lessons/6_English_months/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_English_months/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_English_months/js/lesson.js b/examples/lessons/6_English_months/js/lesson.js
new file mode 100755
index 0000000..5919474
--- /dev/null
+++ b/examples/lessons/6_English_months/js/lesson.js
@@ -0,0 +1,227 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.ogg'},
+ {'name':'incorrect','file':'incorrect.ogg'},
+ {'name':'January','file':'January.wav'},
+ {'name':'February','file':'February.wav'},
+ {'name':'March','file':'March.wav'},
+ {'name':'April','file':'April.wav'},
+ {'name':'May','file':'May.wav'},
+ {'name':'June','file':'June.wav'},
+ {'name':'July','file':'July.wav'},
+ {'name':'August','file':'August.wav'},
+ {'name':'September','file':'September.wav'},
+ {'name':'October','file':'October.wav'},
+ {'name':'November','file':'November.wav'},
+ {'name':'December','file':'December.wav'}
+ ]});
+
+ k.ready(function(){
+ var i,j,flag;
+ var TOTAL_QUES = 12;
+ var currentDragObject;
+ var randPositions = [];
+ var arrangedAns = [];
+ var sectionNum; //store the three levels values 0,1,2
+ var currentAlphaNum; //store the current questions num
+ var checked; //store the current checked value
+ var num;
+ var flag_checked; //status flag for one time correct alpahbetical order
+ var currentMonth;
+ var currentDragObject;
+ var arrangedAns = [];
+ var randBoxes = []; //store the random boxes value to check
+ // six alphabets given to be ordered 6 steps needed to complete the picture 3 levels too complex
+ var months = new Array('January','February','March','April','May','June','July','August',
+ 'September','October','November','December');
+ var monthOrder = new Array('1st','2nd','3rd','4th','5th','6th','7th','8th','9th','10th','11th','12th');
+
+ var genRandPosition=function (){
+ randPositions[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+ var assignMonthsDisplay = function (monthId){
+ $('#section').append('<div id="imageArea'+monthId+'" class="imgArea"></div>');
+ $('#imageArea'+monthId).append('<div id="month'+monthId+'" class="monthsName">'+months[monthId]+'</div>');
+ $('#imageArea'+monthId).append('<img draggable="false" class = "imgBox" src="assets/image/'+months[monthId]+'.png" width:"75%" height="75%"/>');
+ $('#imageArea'+monthId).click(function(){
+ k.audio[months[monthId]].play();
+ });
+ };
+
+ var assignMonths = function (monthId){
+ $('#section').append('<div id="monthArea'+monthId+'" class="dropMonthArea"></div>');
+ $('#monthArea'+monthId).append('<img class="imgSmall" src="assets/image/small_'+months[monthId]+'.png" />');
+ $('#monthArea'+monthId).append('<div class="orderTxt">'+monthOrder[monthId]+'</div>');
+ $('#monthArea'+monthId).append('<div id="drop'+monthId+'" class="dropObjects"></div>');
+ $('#monthArea'+monthId).append('<span id="checkMonth'+monthId+'" class="check"></div>');
+ var dropObjCss = {
+ 'width':'100px','height': '33px','margin': '10px 0px 10px 100px','border-bottom':'2px solid black'
+ };
+ $('.dropObjects').css(dropObjCss);
+
+ };
+
+ var assignDragMonths = function(monthId){
+ var currentMonth = months[monthId];
+ $('#dragMonthArea').append('<div id="drag'+monthId+'" class="dragObjects"></div>');
+ var dragObjCss = {
+ 'float': 'left','cursor': 'move','width':'120px','height':'30px',
+ 'margin':'0.3em',
+ 'font':'20px/25px bold Arial,Verdana,Geneva,Helvetica'
+ };
+ $('.dragObjects').css(dragObjCss);
+ var z;
+ var monthLength = currentMonth.length;
+ var randNum = k.rand(0,monthLength-1);
+ randBoxes[monthId] = randNum;
+ for(z = 0; z < monthLength; z++){
+ if(z === (randNum)){
+ $('#drag'+monthId).append('<input type="text" id="box'+monthId+'" class="blankBox" maxlength="1"/>')
+ $('#box'+monthId).Watermark("?");
+ //insert text box
+ }
+ else{
+ $('#drag'+monthId).append(currentMonth[z]);
+ }
+
+ }
+ };
+
+ function drag_drop(){
+ $('.dragObjects').draggable({ containment: '#content'});
+ $('.dragObjects').bind('dragstart', function(event, ui) {
+ currentDragObject = event.target.id;
+ currentMonth = parseInt(currentDragObject.substring(4));
+
+ });
+
+ $(".dropObjects").droppable({ tolerence: 'intersect' ,hoverClass: 'drophover'});
+ $('.dropObjects').bind('drop', function(event, ui) {
+ var currentDropObject = event.target.id;
+ var droppedWord = parseInt(currentDropObject.substring(4));
+ arrangedAns[droppedWord] = $('#'+currentDragObject).text();
+
+ /*if(arrangedAns[droppedWord] === months[droppedWord]){
+ $('#'+currentDragObject).draggable('disable');
+ }*/
+ });
+ }
+
+
+ var check_months = function(){
+ var correct = 0;
+ var d = 0;
+ var arrangedMonths = [];
+ for(i=0; i<TOTAL_QUES; i++){
+ if(arrangedAns[i].length != 0){
+ var boxText = $('#box'+i).val();
+ var textStore = "";
+ var actText = arrangedAns[i];
+ var len = arrangedAns[i].length;
+ var flag=0;
+ for(var x = 0; x < len+1; x++){
+ if(x === randBoxes[i]){
+ textStore += boxText;
+ flag = 1;
+ }
+ else{
+ if(flag === 1){
+ textStore += actText[x-1];
+ }
+ else{
+ textStore += actText[x];
+ }
+
+ }
+ }
+ arrangedMonths[i] = textStore;
+ }
+
+ //check correct or incorrect
+ if(arrangedMonths[i] === months[i]){
+ $('#checkMonth'+i).html('<img src="assets/image/correct.png">');
+ correct++;
+ }
+ else{
+ $('#checkMonth'+i).html('<img src="assets/image/incorrect.png">');
+ }
+
+ }
+ if(correct === 12){
+ display_game_over();
+ }
+
+ };
+
+
+ var display_game_over = function(){
+ $('#section').hide();
+ $('#gameOver').show();
+ $('#gameOver').html('');
+ $('#gameOver').append('GAME OVER<br/>Congratulations!!!');
+ };
+
+
+
+ function game_start(){
+ $('#linkCheck').show();
+ $('#gameOver').hide();
+ $('#linkNext').hide();
+ $('#section').html('');
+ for(var i = 0;i<TOTAL_QUES;i++){
+ arrangedAns[i] = 0;
+ }
+ $('#section').append('<div id="topText">Fill in the blanks and place month in right order.</div>');
+ for(i=0; i<TOTAL_QUES; i++){
+ assignMonths(i);
+ }
+ $('#section').append('<div id="dragMonthArea"></div>');
+ genRandPosition();
+ for(i=0; i<TOTAL_QUES; i++){
+ assignDragMonths(randPositions[i]);
+ }
+ drag_drop();
+
+ }
+ function game(){
+ $('#linkCheck').hide();
+ $('#gameOver').hide();
+ $('#linkNext').show();
+ $('#linkBack').hide();
+ $('#section').html('');
+ $('#section').append('<div id="topText">Learn the spelling of each month.</div>');
+ for( i = 0; i<TOTAL_QUES; i++){
+ assignMonthsDisplay(i);
+ }
+ }
+ game();
+ $('#linkCheck').click(function(){
+ check_months();
+ });
+ $('#linkNext').click(function(){
+ game_start();
+ });
+ $('#linkBack').click(function(){
+ game();
+ });
+ $('#linkStart').click(function(){
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ game();
+ });
+ }); //end of k.ready
+}); //end of document.ready \ No newline at end of file
diff --git a/examples/lessons/6_English_months/js/ui.core.js b/examples/lessons/6_English_months/js/ui.core.js
new file mode 100755
index 0000000..5493e0a
--- /dev/null
+++ b/examples/lessons/6_English_months/js/ui.core.js
@@ -0,0 +1,519 @@
+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+;jQuery.ui || (function($) {
+
+var _remove = $.fn.remove,
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+
+//Helper functions and ui object
+$.ui = {
+ version: "1.7.2",
+
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function(module, option, set) {
+ var proto = $.ui[module].prototype;
+ for(var i in set) {
+ proto.plugins[i] = proto.plugins[i] || [];
+ proto.plugins[i].push([option, set[i]]);
+ }
+ },
+ call: function(instance, name, args) {
+ var set = instance.plugins[name];
+ if(!set || !instance.element[0].parentNode) { return; }
+
+ for (var i = 0; i < set.length; i++) {
+ if (instance.options[set[i][0]]) {
+ set[i][1].apply(instance.element, args);
+ }
+ }
+ }
+ },
+
+ contains: function(a, b) {
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
+ },
+
+ hasScroll: function(el, a) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ($(el).css('overflow') == 'hidden') { return false; }
+
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
+ has = false;
+
+ if (el[scroll] > 0) { return true; }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[scroll] = 1;
+ has = (el[scroll] > 0);
+ el[scroll] = 0;
+ return has;
+ },
+
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
+ },
+
+ isOver: function(y, x, top, left, height, width) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+ },
+
+ keyCode: {
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+};
+
+// WAI-ARIA normalization
+if (isFF2) {
+ var attr = $.attr,
+ removeAttr = $.fn.removeAttr,
+ ariaNS = "http://www.w3.org/2005/07/aaa",
+ ariaState = /^aria-/,
+ ariaRole = /^wairole:/;
+
+ $.attr = function(elem, name, value) {
+ var set = value !== undefined;
+
+ return (name == 'role'
+ ? (set
+ ? attr.call(this, elem, name, "wairole:" + value)
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
+ : (ariaState.test(name)
+ ? (set
+ ? elem.setAttributeNS(ariaNS,
+ name.replace(ariaState, "aaa:"), value)
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
+ : attr.apply(this, arguments)));
+ };
+
+ $.fn.removeAttr = function(name) {
+ return (ariaState.test(name)
+ ? this.each(function() {
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
+ }) : removeAttr.call(this, name));
+ };
+}
+
+//jQuery plugins
+$.fn.extend({
+ remove: function() {
+ // Safari has a native remove event which actually removes DOM elements,
+ // so we have to use triggerHandler instead of trigger (#3037).
+ $("*", this).add(this).each(function() {
+ $(this).triggerHandler("remove");
+ });
+ return _remove.apply(this, arguments );
+ },
+
+ enableSelection: function() {
+ return this
+ .attr('unselectable', 'off')
+ .css('MozUserSelect', '')
+ .unbind('selectstart.ui');
+ },
+
+ disableSelection: function() {
+ return this
+ .attr('unselectable', 'on')
+ .css('MozUserSelect', 'none')
+ .bind('selectstart.ui', function() { return false; });
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ }
+});
+
+
+//Additional selectors
+$.extend($.expr[':'], {
+ data: function(elem, i, match) {
+ return !!$.data(elem, match[3]);
+ },
+
+ focusable: function(element) {
+ var nodeName = element.nodeName.toLowerCase(),
+ tabIndex = $.attr(element, 'tabindex');
+ return (/input|select|textarea|button|object/.test(nodeName)
+ ? !element.disabled
+ : 'a' == nodeName || 'area' == nodeName
+ ? element.href || !isNaN(tabIndex)
+ : !isNaN(tabIndex))
+ // the element and all of its ancestors must be visible
+ // the browser may report that the area is hidden
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
+ },
+
+ tabbable: function(element) {
+ var tabIndex = $.attr(element, 'tabindex');
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
+ }
+});
+
+
+// $.widget is a factory to create jQuery plugins
+// taking some boilerplate code out of the plugin code
+function getter(namespace, plugin, method, args) {
+ function getMethods(type) {
+ var methods = $[namespace][plugin][type] || [];
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
+ }
+
+ var methods = getMethods('getter');
+ if (args.length == 1 && typeof args[0] == 'string') {
+ methods = methods.concat(getMethods('getterSetter'));
+ }
+ return ($.inArray(method, methods) != -1);
+}
+
+$.widget = function(name, prototype) {
+ var namespace = name.split(".")[0];
+ name = name.split(".")[1];
+
+ // create plugin method
+ $.fn[name] = function(options) {
+ var isMethodCall = (typeof options == 'string'),
+ args = Array.prototype.slice.call(arguments, 1);
+
+ // prevent calls to internal methods
+ if (isMethodCall && options.substring(0, 1) == '_') {
+ return this;
+ }
+
+ // handle getter methods
+ if (isMethodCall && getter(namespace, name, options, args)) {
+ var instance = $.data(this[0], name);
+ return (instance ? instance[options].apply(instance, args)
+ : undefined);
+ }
+
+ // handle initialization and non-getter methods
+ return this.each(function() {
+ var instance = $.data(this, name);
+
+ // constructor
+ (!instance && !isMethodCall &&
+ $.data(this, name, new $[namespace][name](this, options))._init());
+
+ // method call
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
+ instance[options].apply(instance, args));
+ });
+ };
+
+ // create widget constructor
+ $[namespace] = $[namespace] || {};
+ $[namespace][name] = function(element, options) {
+ var self = this;
+
+ this.namespace = namespace;
+ this.widgetName = name;
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
+ this.widgetBaseClass = namespace + '-' + name;
+
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
+ this.element = $(element)
+ .bind('setData.' + name, function(event, key, value) {
+ if (event.target == element) {
+ return self._setData(key, value);
+ }
+ })
+ .bind('getData.' + name, function(event, key) {
+ if (event.target == element) {
+ return self._getData(key);
+ }
+ })
+ .bind('remove', function() {
+ return self.destroy();
+ });
+ };
+
+ // add widget prototype
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
+
+ // TODO: merge getter and getterSetter properties from widget prototype
+ // and plugin prototype
+ $[namespace][name].getterSetter = 'option';
+};
+
+$.widget.prototype = {
+ _init: function() {},
+ destroy: function() {
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
+ },
+
+ option: function(key, value) {
+ var options = key,
+ self = this;
+
+ if (typeof key == "string") {
+ if (value === undefined) {
+ return this._getData(key);
+ }
+ options = {};
+ options[key] = value;
+ }
+
+ $.each(options, function(key, value) {
+ self._setData(key, value);
+ });
+ },
+ _getData: function(key) {
+ return this.options[key];
+ },
+ _setData: function(key, value) {
+ this.options[key] = value;
+
+ if (key == 'disabled') {
+ this.element
+ [value ? 'addClass' : 'removeClass'](
+ this.widgetBaseClass + '-disabled' + ' ' +
+ this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
+ }
+ },
+
+ enable: function() {
+ this._setData('disabled', false);
+ },
+ disable: function() {
+ this._setData('disabled', true);
+ },
+
+ _trigger: function(type, event, data) {
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = $.Event(event);
+ event.type = eventName;
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if (event.originalEvent) {
+ for (var i = $.event.props.length, prop; i;) {
+ prop = $.event.props[--i];
+ event[prop] = event.originalEvent[prop];
+ }
+ }
+
+ this.element.trigger(event, data);
+
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
+ }
+};
+
+$.widget.defaults = {
+ disabled: false
+};
+
+
+/** Mouse Interaction Plugin **/
+
+$.ui.mouse = {
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ // Prevent text selection in IE
+ if ($.browser.msie) {
+ this._mouseUnselectable = this.element.attr('unselectable');
+ this.element.attr('unselectable', 'on');
+ }
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+
+ // Restore text selection in IE
+ ($.browser.msie
+ && this.element.attr('unselectable', this._mouseUnselectable));
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ // TODO: figure out why we have to use originalEvent
+ event.originalEvent = event.originalEvent || {};
+ if (event.originalEvent.mouseHandled) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ // preventDefault() is used to prevent the selection of text here -
+ // however, in Safari, this causes select boxes not to be selectable
+ // anymore, so this fix is needed
+ ($.browser.safari || event.preventDefault());
+
+ event.originalEvent.mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+};
+
+$.ui.mouse.defaults = {
+ cancel: null,
+ distance: 1,
+ delay: 0
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_English_months/js/ui.draggable.js b/examples/lessons/6_English_months/js/ui.draggable.js
new file mode 100755
index 0000000..0402f0e
--- /dev/null
+++ b/examples/lessons/6_English_months/js/ui.draggable.js
@@ -0,0 +1,766 @@
+/*
+ * jQuery UI Draggable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * ui.core.js
+ */
+(function($) {
+
+$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
+
+ _init: function() {
+
+ if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
+ this.element[0].style.position = 'relative';
+
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
+
+ this._mouseInit();
+
+ },
+
+ destroy: function() {
+ if(!this.element.data('draggable')) return;
+ this.element
+ .removeData("draggable")
+ .unbind(".draggable")
+ .removeClass("ui-draggable"
+ + " ui-draggable-dragging"
+ + " ui-draggable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+
+ var o = this.options;
+
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
+ return false;
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle)
+ return false;
+
+ return true;
+
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if($.ui.ddmanager)
+ $.ui.ddmanager.current = this;
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css("position");
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.element.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
+ if(o.cursorAt)
+ this._adjustOffsetFromHelper(o.cursorAt);
+
+ //Set a containment if given in the options
+ if(o.containment)
+ this._setContainment();
+
+ //Call plugins and callbacks
+ this._trigger("start", event);
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(this, event);
+
+ this.helper.addClass("ui-draggable-dragging");
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ this._trigger('drag', event, ui);
+ this.position = ui.position;
+ }
+
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
+ dropped = $.ui.ddmanager.drop(this, event);
+
+ //if a drop comes from outside (a sortable)
+ if(this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ var self = this;
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ self._trigger("stop", event);
+ self._clear();
+ });
+ } else {
+ this._trigger("stop", event);
+ this._clear();
+ }
+
+ return false;
+ },
+
+ _getHandle: function(event) {
+
+ var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
+ $(this.options.handle, this.element)
+ .find("*")
+ .andSelf()
+ .each(function() {
+ if(this == event.target) handle = true;
+ });
+
+ return handle;
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options;
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
+
+ if(!helper.parents('body').length)
+ helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
+
+ if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
+ helper.css("position", "absolute");
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
+ if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
+ if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
+ po = { top: 0, left: 0 };
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition == "relative") {
+ var p = this.element.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
+ top: (parseInt(this.element.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var o = this.options;
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
+ ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+
+ if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
+ var ce = $(o.containment)[0]; if(!ce) return;
+ var co = $(o.containment).offset();
+ var over = ($(ce).css("overflow") != 'hidden');
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ } else if(o.containment.constructor == Array) {
+ this.containment = o.containment;
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) pos = this.position;
+ var mod = d == "absolute" ? 1 : -1;
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top // The absolute mouse position
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left // The absolute mouse position
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ var pageX = event.pageX;
+ var pageY = event.pageY;
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
+ if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
+ }
+
+ if(o.grid) {
+ var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY // The absolute mouse position
+ - this.offset.click.top // Click offset (relative to the element)
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX // The absolute mouse position
+ - this.offset.click.left // Click offset (relative to the element)
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
+ //if($.ui.ddmanager) $.ui.ddmanager.current = null;
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function(type, event, ui) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call(this, type, [event, ui]);
+ if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
+ return $.widget.prototype._trigger.call(this, type, event, ui);
+ },
+
+ plugins: {},
+
+ _uiHash: function(event) {
+ return {
+ helper: this.helper,
+ position: this.position,
+ absolutePosition: this.positionAbs, //deprecated
+ offset: this.positionAbs
+ };
+ }
+
+}));
+
+$.extend($.ui.draggable, {
+ version: "1.7.2",
+ eventPrefix: "drag",
+ defaults: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input,option",
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ delay: 0,
+ distance: 1,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false
+ }
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+ start: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options,
+ uiSortable = $.extend({}, ui, { item: inst.element });
+ inst.sortables = [];
+ $(o.connectToSortable).each(function() {
+ var sortable = $.data(this, 'sortable');
+ if (sortable && !sortable.options.disabled) {
+ inst.sortables.push({
+ instance: sortable,
+ shouldRevert: sortable.options.revert
+ });
+ sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+
+ },
+ stop: function(event, ui) {
+
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+ var inst = $(this).data("draggable"),
+ uiSortable = $.extend({}, ui, { item: inst.element });
+
+ $.each(inst.sortables, function() {
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
+ if(this.shouldRevert) this.instance.options.revert = true;
+
+ //Trigger the stop of the sortable
+ this.instance._mouseStop(event);
+
+ this.instance.options.helper = this.instance.options._helper;
+
+ //If the helper has been the original item, restore properties in the sortable
+ if(inst.options.helper == 'original')
+ this.instance.currentItem.css({ top: 'auto', left: 'auto' });
+
+ } else {
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ this.instance._trigger("deactivate", event, uiSortable);
+ }
+
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), self = this;
+
+ var checkPos = function(o) {
+ var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
+ var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
+ var itemHeight = o.height, itemWidth = o.width;
+ var itemTop = o.top, itemLeft = o.left;
+
+ return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
+ };
+
+ $.each(inst.sortables, function(i) {
+
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
+
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+ if(!this.instance.isOver) {
+
+ this.instance.isOver = 1;
+ //Now we fake the start of dragging for the sortable instance,
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+ this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+ this.instance.options.helper = function() { return ui.helper[0]; };
+
+ event.target = this.instance.currentItem[0];
+ this.instance._mouseCapture(event, true);
+ this.instance._mouseStart(event, true, true);
+
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+ this.instance.offset.click.top = inst.offset.click.top;
+ this.instance.offset.click.left = inst.offset.click.left;
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+ inst._trigger("toSortable", event);
+ inst.dropped = this.instance.element; //draggable revert needs that
+ //hack so receive/update callbacks work (mostly)
+ inst.currentItem = inst.element;
+ this.instance.fromOutside = inst;
+
+ }
+
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+ if(this.instance.currentItem) this.instance._mouseDrag(event);
+
+ } else {
+
+ //If it doesn't intersect with the sortable, and it intersected before,
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+ this.instance.cancelHelperRemoval = true;
+
+ //Prevent reverting on this forced stop
+ this.instance.options.revert = false;
+
+ // The out event needs to be triggered independently
+ this.instance._trigger('out', event, this.instance._uiHash(this.instance));
+
+ this.instance._mouseStop(event, true);
+ this.instance.options.helper = this.instance.options._helper;
+
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+ this.instance.currentItem.remove();
+ if(this.instance.placeholder) this.instance.placeholder.remove();
+
+ inst._trigger("fromSortable", event);
+ inst.dropped = false; //draggable revert needs that
+ }
+
+ };
+
+ });
+
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function(event, ui) {
+ var t = $('body'), o = $(this).data('draggable').options;
+ if (t.css("cursor")) o._cursor = t.css("cursor");
+ t.css("cursor", o.cursor);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if (o._cursor) $('body').css("cursor", o._cursor);
+ }
+});
+
+$.ui.plugin.add("draggable", "iframeFix", {
+ start: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+ $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
+ .css({
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+ position: "absolute", opacity: "0.001", zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo("body");
+ });
+ },
+ stop: function(event, ui) {
+ $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data('draggable').options;
+ if(t.css("opacity")) o._opacity = t.css("opacity");
+ t.css('opacity', o.opacity);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if(o._opacity) $(ui.helper).css('opacity', o._opacity);
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function(event, ui) {
+ var i = $(this).data("draggable");
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
+ },
+ drag: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options, scrolled = false;
+
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
+
+ if(!o.axis || o.axis != 'x') {
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+ else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+ else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(!o.axis || o.axis != 'x') {
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(i, event);
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options;
+ i.snapElements = [];
+
+ $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
+ var $t = $(this); var $o = $t.offset();
+ if(this != i.element[0]) i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options;
+ var d = o.snapTolerance;
+
+ var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (var i = inst.snapElements.length - 1; i >= 0; i--){
+
+ var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
+ t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
+
+ //Yes, I know, this is insane ;)
+ if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
+ if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if(o.snapMode != 'inner') {
+ var ts = Math.abs(t - y2) <= d;
+ var bs = Math.abs(b - y1) <= d;
+ var ls = Math.abs(l - x2) <= d;
+ var rs = Math.abs(r - x1) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+ }
+
+ var first = (ts || bs || ls || rs);
+
+ if(o.snapMode != 'outer') {
+ var ts = Math.abs(t - y1) <= d;
+ var bs = Math.abs(b - y2) <= d;
+ var ls = Math.abs(l - x1) <= d;
+ var rs = Math.abs(r - x2) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+ }
+
+ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ };
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function(event, ui) {
+
+ var o = $(this).data("draggable").options;
+
+ var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
+ return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
+ });
+
+ $(group).each(function(i) {
+ this.style.zIndex = o.stack.min + i;
+ });
+
+ this[0].style.zIndex = o.stack.min + group.length;
+
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data("draggable").options;
+ if(t.css("zIndex")) o._zIndex = t.css("zIndex");
+ t.css('zIndex', o.zIndex);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data("draggable").options;
+ if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
+ }
+});
+
+})(jQuery);
diff --git a/examples/lessons/6_English_months/js/ui.droppable.js b/examples/lessons/6_English_months/js/ui.droppable.js
new file mode 100755
index 0000000..8e7be33
--- /dev/null
+++ b/examples/lessons/6_English_months/js/ui.droppable.js
@@ -0,0 +1,282 @@
+/*
+ * jQuery UI Droppable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * ui.core.js
+ * ui.draggable.js
+ */
+(function($) {
+
+$.widget("ui.droppable", {
+
+ _init: function() {
+
+ var o = this.options, accept = o.accept;
+ this.isover = 0; this.isout = 1;
+
+ this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
+ return d.is(accept);
+ };
+
+ //Store the droppable's proportions
+ this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
+
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
+ $.ui.ddmanager.droppables[this.options.scope].push(this);
+
+ (this.options.addClasses && this.element.addClass("ui-droppable"));
+
+ },
+
+ destroy: function() {
+ var drop = $.ui.ddmanager.droppables[this.options.scope];
+ for ( var i = 0; i < drop.length; i++ )
+ if ( drop[i] == this )
+ drop.splice(i, 1);
+
+ this.element
+ .removeClass("ui-droppable ui-droppable-disabled")
+ .removeData("droppable")
+ .unbind(".droppable");
+ },
+
+ _setData: function(key, value) {
+
+ if(key == 'accept') {
+ this.options.accept = value && $.isFunction(value) ? value : function(d) {
+ return d.is(value);
+ };
+ } else {
+ $.widget.prototype._setData.apply(this, arguments);
+ }
+
+ },
+
+ _activate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.addClass(this.options.activeClass);
+ (draggable && this._trigger('activate', event, this.ui(draggable)));
+ },
+
+ _deactivate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ (draggable && this._trigger('deactivate', event, this.ui(draggable)));
+ },
+
+ _over: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
+ this._trigger('over', event, this.ui(draggable));
+ }
+
+ },
+
+ _out: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('out', event, this.ui(draggable));
+ }
+
+ },
+
+ _drop: function(event,custom) {
+
+ var draggable = custom || $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
+
+ var childrenIntersection = false;
+ this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
+ var inst = $.data(this, 'droppable');
+ if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
+ childrenIntersection = true; return false;
+ }
+ });
+ if(childrenIntersection) return false;
+
+ if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('drop', event, this.ui(draggable));
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function(c) {
+ return {
+ draggable: (c.currentItem || c.element),
+ helper: c.helper,
+ position: c.position,
+ absolutePosition: c.positionAbs, //deprecated
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.extend($.ui.droppable, {
+ version: "1.7.2",
+ eventPrefix: 'drop',
+ defaults: {
+ accept: '*',
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: 'default',
+ tolerance: 'intersect'
+ }
+});
+
+$.ui.intersect = function(draggable, droppable, toleranceMode) {
+
+ if (!droppable.offset) return false;
+
+ var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
+ y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
+ var l = droppable.offset.left, r = l + droppable.proportions.width,
+ t = droppable.offset.top, b = t + droppable.proportions.height;
+
+ switch (toleranceMode) {
+ case 'fit':
+ return (l < x1 && x2 < r
+ && t < y1 && y2 < b);
+ break;
+ case 'intersect':
+ return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
+ && x2 - (draggable.helperProportions.width / 2) < r // Left Half
+ && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
+ && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
+ break;
+ case 'pointer':
+ var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
+ isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
+ return isOver;
+ break;
+ case 'touch':
+ return (
+ (y1 >= t && y1 <= b) || // Top edge touching
+ (y2 >= t && y2 <= b) || // Bottom edge touching
+ (y1 < t && y2 > b) // Surrounded vertically
+ ) && (
+ (x1 >= l && x1 <= r) || // Left edge touching
+ (x2 >= l && x2 <= r) || // Right edge touching
+ (x1 < l && x2 > r) // Surrounded horizontally
+ );
+ break;
+ default:
+ return false;
+ break;
+ }
+
+};
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { 'default': [] },
+ prepareOffsets: function(t, event) {
+
+ var m = $.ui.ddmanager.droppables[t.options.scope];
+ var type = event ? event.type : null; // workaround for #2317
+ var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
+
+ droppablesLoop: for (var i = 0; i < m.length; i++) {
+
+ if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
+ for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
+ m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
+
+ m[i].offset = m[i].element.offset();
+ m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
+
+ if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
+
+ }
+
+ },
+ drop: function(draggable, event) {
+
+ var dropped = false;
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(!this.options) return;
+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
+ dropped = this._drop.call(this, event);
+
+ if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ this.isout = 1; this.isover = 0;
+ this._deactivate.call(this, event);
+ }
+
+ });
+ return dropped;
+
+ },
+ drag: function(draggable, event) {
+
+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
+
+ //Run through all droppables and check their positions based on specific tolerance options
+
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(this.options.disabled || this.greedyChild || !this.visible) return;
+ var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
+
+ var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
+ if(!c) return;
+
+ var parentInstance;
+ if (this.options.greedy) {
+ var parent = this.element.parents(':data(droppable):eq(0)');
+ if (parent.length) {
+ parentInstance = $.data(parent[0], 'droppable');
+ parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
+ }
+ }
+
+ // we just moved into a greedy child
+ if (parentInstance && c == 'isover') {
+ parentInstance['isover'] = 0;
+ parentInstance['isout'] = 1;
+ parentInstance._out.call(parentInstance, event);
+ }
+
+ this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
+ this[c == "isover" ? "_over" : "_out"].call(this, event);
+
+ // we just moved out of a greedy child
+ if (parentInstance && c == 'isout') {
+ parentInstance['isout'] = 0;
+ parentInstance['isover'] = 1;
+ parentInstance._over.call(parentInstance, event);
+ }
+ });
+
+ }
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_English_syllables/.tmp_index.html.38007~ b/examples/lessons/6_English_syllables/.tmp_index.html.38007~
new file mode 100755
index 0000000..ccbe4d6
--- /dev/null
+++ b/examples/lessons/6_English_syllables/.tmp_index.html.38007~
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox1" class="timerBoxes"></div>
+ <div id="timerBox2" class="timerBoxes"></div>
+ <div id="timerBox3" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_syllables/.tmp_index.html.42094~ b/examples/lessons/6_English_syllables/.tmp_index.html.42094~
new file mode 100755
index 0000000..74d1095
--- /dev/null
+++ b/examples/lessons/6_English_syllables/.tmp_index.html.42094~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <a href="#"><div id="linkNextExercise" class ="linkNext"></div></a>
+ <a href="#"><div id="linkPrevExercise" class ="linkBack"></div></a>
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox3" class="timerBoxes">00</div>
+ <div id="timerBox2" class="timerBoxes">00</div>
+ <div id="timerBox1" class="timerBoxes">00</div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_syllables/.tmp_index.html.54401~ b/examples/lessons/6_English_syllables/.tmp_index.html.54401~
new file mode 100755
index 0000000..b2ecae3
--- /dev/null
+++ b/examples/lessons/6_English_syllables/.tmp_index.html.54401~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox1" class="timerBoxes"></div>
+ <div id="timerBox2" class="timerBoxes"></div>
+ <div id="timerBox3" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_syllables/.tmp_index.html.71755~ b/examples/lessons/6_English_syllables/.tmp_index.html.71755~
new file mode 100755
index 0000000..3e635a2
--- /dev/null
+++ b/examples/lessons/6_English_syllables/.tmp_index.html.71755~
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="linkNextExercise" class ="linkNext"></div>
+ <div id="linkPrevExercise" class ="linkBack"></div>
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox3" class="timerBoxes">00</div>
+ <div id="timerBox2" class="timerBoxes">00</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_syllables/.tmp_index.html.88163~ b/examples/lessons/6_English_syllables/.tmp_index.html.88163~
new file mode 100755
index 0000000..74d1095
--- /dev/null
+++ b/examples/lessons/6_English_syllables/.tmp_index.html.88163~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <a href="#"><div id="linkNextExercise" class ="linkNext"></div></a>
+ <a href="#"><div id="linkPrevExercise" class ="linkBack"></div></a>
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox3" class="timerBoxes">00</div>
+ <div id="timerBox2" class="timerBoxes">00</div>
+ <div id="timerBox1" class="timerBoxes">00</div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_syllables/.tmp_index.html.99197~ b/examples/lessons/6_English_syllables/.tmp_index.html.99197~
new file mode 100755
index 0000000..3e635a2
--- /dev/null
+++ b/examples/lessons/6_English_syllables/.tmp_index.html.99197~
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="linkNextExercise" class ="linkNext"></div>
+ <div id="linkPrevExercise" class ="linkBack"></div>
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox3" class="timerBoxes">00</div>
+ <div id="timerBox2" class="timerBoxes">00</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_syllables/assets/audio/correct.ogg b/examples/lessons/6_English_syllables/assets/audio/correct.ogg
new file mode 100755
index 0000000..a0d9e3a
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/audio/correct.ogg
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/audio/incorrect.ogg b/examples/lessons/6_English_syllables/assets/audio/incorrect.ogg
new file mode 100755
index 0000000..4805e55
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/audio/incorrect.ogg
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/bgContainer.png b/examples/lessons/6_English_syllables/assets/image/bgContainer.png
new file mode 100755
index 0000000..a81304e
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/bgContainer.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/bg_footer.png b/examples/lessons/6_English_syllables/assets/image/bg_footer.png
new file mode 100755
index 0000000..8982264
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/bg_header.png b/examples/lessons/6_English_syllables/assets/image/bg_header.png
new file mode 100755
index 0000000..98213f7
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/bg_title_block.png b/examples/lessons/6_English_syllables/assets/image/bg_title_block.png
new file mode 100755
index 0000000..2c9dacf
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_back.png b/examples/lessons/6_English_syllables/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_back_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_help.png b/examples/lessons/6_English_syllables/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_help_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_next.png b/examples/lessons/6_English_syllables/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_next_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_ole.png b/examples/lessons/6_English_syllables/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_ole_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_play_again.png b/examples/lessons/6_English_syllables/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_play_again_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_English_syllables/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_start.png b/examples/lessons/6_English_syllables/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_start_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/btn_start_mouse_down.png b/examples/lessons/6_English_syllables/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/computer_base.png b/examples/lessons/6_English_syllables/assets/image/computer_base.png
new file mode 100755
index 0000000..b18175d
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/computer_base.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/computer_body.png b/examples/lessons/6_English_syllables/assets/image/computer_body.png
new file mode 100755
index 0000000..a083144
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/computer_body.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/computer_top.png b/examples/lessons/6_English_syllables/assets/image/computer_top.png
new file mode 100755
index 0000000..0ea98fa
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/computer_top.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/help.png b/examples/lessons/6_English_syllables/assets/image/help.png
new file mode 100755
index 0000000..4cde516
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/help.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/player_base.png b/examples/lessons/6_English_syllables/assets/image/player_base.png
new file mode 100755
index 0000000..4b25b30
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/player_base.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/player_body.png b/examples/lessons/6_English_syllables/assets/image/player_body.png
new file mode 100755
index 0000000..e1d1bb7
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/player_body.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/player_top.png b/examples/lessons/6_English_syllables/assets/image/player_top.png
new file mode 100755
index 0000000..9d95c18
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/player_top.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/title_block_lt.png b/examples/lessons/6_English_syllables/assets/image/title_block_lt.png
new file mode 100755
index 0000000..4696182
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/assets/image/title_block_rt.png b/examples/lessons/6_English_syllables/assets/image/title_block_rt.png
new file mode 100755
index 0000000..37cc44a
--- /dev/null
+++ b/examples/lessons/6_English_syllables/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_English_syllables/css/lesson.css b/examples/lessons/6_English_syllables/css/lesson.css
new file mode 100755
index 0000000..94e9e24
--- /dev/null
+++ b/examples/lessons/6_English_syllables/css/lesson.css
@@ -0,0 +1,295 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+/* Designed for 1200*900 px screen resolution */
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 75px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 6px;
+ padding-left: 15px;
+}
+
+
+ .linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ .linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 6px;
+ padding-right: 15px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ .linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ .linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ position:relative;
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ height: 75px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ padding-right: 5px;
+ padding-top: 10px;
+}
+ #linkCheck{
+ margin: 1em 3em 0 0;
+ width: 101px; height: 30px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+#linkNextExercise{
+ position:absolute;
+ bottom: 75px;
+ right: 10px;
+}
+#linkPrevExercise{
+ position:absolute;
+ bottom: 75px;
+ left: 10px;
+}
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0 auto;
+ margin-top: 75px;
+ width: 1180px;
+ height: 550px;
+ padding: 0.5em;
+}
+ #left-side{
+ position:relative;
+ margin: 40px auto;
+ margin-bottom:0;
+ padding-top:50px;
+ float:left;
+ width: 170px;
+ height: 450px;
+ border: 4px solid #000;
+ }
+ #leftText{
+ position:absolute;
+ top: -30px;
+ left: 0px;
+ text-align:center;
+ height: 40px;
+ font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman;
+ color: #FF0000;
+ }
+ .default{
+ float:left;
+ margin: 0px auto;
+ text-align:center;
+ width: 170px;
+ height: 44px;
+ }
+ #right-side{
+ position:relative;
+ margin: 40px auto;
+ margin-bottom:0;
+ padding-top: 50px;
+ float:right;
+ width: 170px;
+ height: 450px;
+ border: 4px solid #000;
+ }
+ #rightText{
+ position:absolute;
+ top: -30px;
+ left: 10px;
+ text-align:center;
+ height: 40px;
+ font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman;
+ color: #FF0000;
+ }
+ #main-content{
+ margin-top: 10px;
+ float:left;
+ margin-left: 90px;
+ width: 650px;
+ height: 525px;
+ }
+ #topText{
+ text-align:center;
+ height: 40px;
+ font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman;
+ }
+ #container{
+ position:relative;
+ margin: 5px auto;
+ width : 598px;
+ height: 390px;
+ border: 4px solid #000;
+ background:url(../assets/image/bgContainer.png);
+ }
+ #joinSyllable{
+ margin: 10px auto;
+ width : 525px;
+ height: 60px;
+ border: 4px solid #000;
+ }
+ .sign{
+ float:left;
+ width: 20px;
+ height: 30px;
+ padding: 5px;
+ text-align:center;
+ font : 30px/35px Verdana,Helvetica,Arial Black, Times New Roman;
+ }
+ .drophover{
+ background-color: #FF9900;
+ }
+
+ .correctWord{
+ border:none
+ color: #FF00FF;
+ }
+
+
+
+ #help{
+ display:none;
+ position:absolute;
+ right: 60px;
+ top: 75px;;
+ width: 256px;
+ height: 600px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+ #timerBar {
+ float: left;
+ margin-left:50px;
+ width: 200px;
+ height:35px;
+ padding-left: 10px;
+ padding-top: 7px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+ }
+
+ .timerBoxes{ /* Show the timer running after the game has began.... */
+ float:left;
+ margin: 0.5em 0 0 0.1em;
+ width: 50px;
+ height: 30px;
+ border: 2px dotted green;
+ padding: 3px;
+ color: blue;
+ text-align:center;
+ font : bold 25px Arial Black, Times New Roman;
+ background: #ACC;
+ }
+
+ #gameOver{
+ opacity: 1;
+ display:none;
+ position:absolute;
+ top:5%;
+ left: 40%;
+ color: blue;
+ text-align:center;
+ font : bold 25px/35px Arial Black, Times New Roman;
+}
diff --git a/examples/lessons/6_English_syllables/index.html b/examples/lessons/6_English_syllables/index.html
new file mode 100755
index 0000000..74d1095
--- /dev/null
+++ b/examples/lessons/6_English_syllables/index.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <a href="#"><div id="linkNextExercise" class ="linkNext"></div></a>
+ <a href="#"><div id="linkPrevExercise" class ="linkBack"></div></a>
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox3" class="timerBoxes">00</div>
+ <div id="timerBox2" class="timerBoxes">00</div>
+ <div id="timerBox1" class="timerBoxes">00</div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_syllables/js/jquery-1.3.2.min.js b/examples/lessons/6_English_syllables/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_English_syllables/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_English_syllables/js/karma.js b/examples/lessons/6_English_syllables/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_English_syllables/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_English_syllables/js/lesson.js b/examples/lessons/6_English_syllables/js/lesson.js
new file mode 100755
index 0000000..ca45a59
--- /dev/null
+++ b/examples/lessons/6_English_syllables/js/lesson.js
@@ -0,0 +1,359 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.ogg'},
+ {'name':'incorrect','file':'incorrect.ogg'}
+ ]});
+
+ k.ready(function(){
+ var i,j;
+ var totalCounter;
+ var currentQuestion;
+ var TOTAL_QUES = 10;
+ var currentDragObject;
+ var prevDragObject;
+ var dropNum;
+ var sectionNum;
+ var randPositions = [];
+ var compCounter;
+ var playerCounter;
+ var fstSyllableId;
+ var fstSyllableId;
+ var checked;
+ var gamePlay;
+ var s,m,h,play;
+ var currentBlock; //flag for which side increases the score 1-player 0-computer
+ var completedWords = [];
+ var syllableWord1= new Array('be','en','ti','tues','stu','chil','eng','hap','sun','in',
+ 'sen','com','pro','prac','talk','pic','num','tea','mar','comp'
+ );
+ var syllableWord2 = new Array('lieve','gine','ger','key','dent','ly','lish','py','day','sect',
+ 'tence','plete','noun','tice','ing','nic','ber','cher','ket','uter'
+ );
+
+
+ var genRandPosition=function (){
+ randPositions[0] = k.rand(0,19);
+ for(i=1; i<20; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,19);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+
+ var checkTime = function(timePara){
+ if (timePara<10 )
+ {
+ timePara="0" + timePara;
+ }
+ return timePara;
+ };
+
+
+ var resetTimer = function(){
+ play = 0;
+ s = 10;
+ s=checkTime(s);
+ $('#timerBox1').html(s);
+ };
+
+ var increaseTime = function(){
+ if(play === 1){
+ s--;
+ s=checkTime(s);
+ if(s == 00){ //computer score increase
+ k.audio.incorrect.play();
+ checked = 0;
+ t=setTimeout(function(){delay_correct();},2000);
+ currentBlock = 0;
+ assignBuildBlocks();
+ compCounter++;
+ dropNum = 0;
+ resetTimer();
+ }
+ else{
+ $('#timerBox1').html(s);
+ var t=setTimeout(function(){increaseTime();},1000);
+ }
+ }
+ };
+ var startTimer = function(){
+ play = 1;
+ increaseTime();
+
+ };
+
+ var check_game_over = function(){
+ var flag_game = 0;
+ if(totalCounter === 40){ //game over
+ $('#content').addClass('backOpaque');
+ $('#gameOver').show();
+ resetTimer();
+ }
+ else if(totalCounter === 20){
+ if(playerCounter < 10 || compCounter <10){ //u were missed play again
+ $('#topText').html('Sorry U missed the chance !!! Click Play Again.'); }
+ flag_game = 1;
+ }
+ else if(compCounter === 10){ //computer wins
+ $('#leftText').html('Computer Wins');
+ $('#topText').html('Sorry U missed the chance !!! Click Play Again.');
+ flag_game = 1;
+ }
+ else if(playerCounter === 10){ //player wins
+ $('#rightText').html('Player Wins');
+ $('#topText').html('Great Job !!! Click Next Button to proceed to next level.');
+ flag_game = 1;
+ }
+ if(flag_game === 1){
+ playerCounter = 10;
+ compCounter = 10;
+ if(gamePlay === 0){
+ $('#linkNextExercise').show();
+ }
+ else{
+ $('#linkPrevExercise').show();
+ }
+ }
+
+
+ };
+ var assignBuildBlocks = function(){
+ var compName,playerName;
+ if((currentBlock === 1 && playerCounter === 9) || (currentBlock === 0 && compCounter === 9)){
+ compName = 'computer_top';
+ playerName = 'player_top';
+
+ }
+ else if((currentBlock === 1 && playerCounter === 0) || (currentBlock === 0 && compCounter === 0)){
+ compName = 'computer_base';
+ playerName = 'player_base';
+ }
+ else{
+ compName = 'computer_body';
+ playerName = 'player_body';
+ }
+
+ if(currentBlock === 1){
+ $('#playerBuild'+(9-playerCounter)).append('<img src="assets/image/'+playerName+'.png" />');
+ }
+ else{
+ $('#compBuild'+(9-compCounter)).append('<img src="assets/image/'+compName+'.png" />');
+ }
+
+ };
+
+ var delay_correct = function(){
+ document.delayForm.delayval.value = 1;
+ if(checked ===1 ){
+ $('#drag'+completedWords[totalCounter-2]).hide();
+ $('#drag'+completedWords[totalCounter-1]).hide();
+ }
+ $('#drop0').html('----------');
+ $('#drop1').html('----------');
+ $('#drop2').html('------------');
+ };
+ var check_answers = function(){
+ var flag_correct = 0;
+ var secStart = sectionNum * 10;
+ var secStop = (sectionNum+1) * 10;
+ for( i = secStart ; i<secStop; i++){
+ var fstSyllable = $('#drag'+fstSyllableId).text();
+ var secondSyllable = $('#drag'+secondSyllableId).text();
+ if(fstSyllable === syllableWord1[i] && secondSyllable === syllableWord2[i]){
+ k.audio.correct.play();
+ $('#drop2').html(fstSyllable+secondSyllable);
+ totalCounter += 2;
+ completedWords[totalCounter-2] = fstSyllableId;
+ completedWords[totalCounter-1] = secondSyllableId;
+ flag_correct = 1;
+ correctCounter++;
+ //check with timer and populate the side bar
+ //if done within 10 seconds
+ currentBlock = 1;
+ assignBuildBlocks();
+ playerCounter++;
+ checked = 1;
+ t=setTimeout(function(){delay_correct();},1000);
+ }
+ }
+ if(flag_correct === 0){ //rearrange them
+ checked = 0;
+ k.audio.incorrect.play();
+ $('#drop2').html('Not a Valid Word');
+ currentBlock = 0;
+ assignBuildBlocks();
+ compCounter++;
+ t=setTimeout(function(){delay_correct();},1000);
+ }
+
+ };
+
+ var assignSyllableWords = function(sId){
+ if(sId<10){
+ sysId = sId+(10*sectionNum);
+ $('#container').append('<div id="drag'+sId+'" >'+syllableWord1[sysId]+'</div>');
+ }
+ else{
+ sysId = ((10*(sectionNum+2)) - 1)-sId;
+ $('#container').append('<div id="drag'+sId+'" >'+syllableWord2[sysId]+'</div>');
+ }
+
+ var dragObjCss = {
+ 'float':'left','position':'relative','cursor': 'move','margin': '1em',
+ 'width':'100px','height':'30px','border': '2px solid black',
+ 'font':'20px/25px bold Arial,Verdana,Geneva,Helvetica',
+ 'text-align':'center'
+ };
+ $('#drag'+sId).css(dragObjCss);
+ $('#drag'+sId).click(function(){
+ currentSyllable = $(this).text();
+ if(dropNum === 0){
+ fstSyllableId = $(this).attr('id');
+ fstSyllableId = parseInt(fstSyllableId.substring(4));
+ startTimer();
+
+ }
+ else{
+ secondSyllableId = $(this).attr('id');
+ secondSyllableId = parseInt(secondSyllableId.substring(4));
+ }
+ $('#drop'+dropNum).html(currentSyllable);
+ dropNum++;
+ if(dropNum === 2){
+ dropNum = 0;
+ resetTimer();
+ check_answers();
+ }
+ check_game_over();
+ });
+
+ };
+
+ var assignDropPlaces = function(drpId){
+ $('#joinSyllable').append('<div id="drop'+drpId+'" class="dropObjects"></div>');
+ var dropObjCss = {
+ 'float':'left','width':'100px','height': '45px','margin': '0.5em 0.5em',
+ 'font':'20px/35px bold Arial,Verdana,Geneva,Helvetica',
+ 'text-align':'center','color':'#FF00FF'
+ };
+
+ if(drpId === 2){
+ $('#drop'+drpId).css(dropObjCss).css({'width':'200px'}).html('------------');
+ }
+ else{
+ $('#drop'+drpId).css(dropObjCss).html('----------');
+ }
+ };
+
+
+ var next_syllables = function(){
+ resetTimer();
+ $('#content').removeClass('backOpaque').html('');
+ $('#content').append('<div id="left-side"></div>');
+ $('#content').append('<div id="main-content"></div>');
+ $('#content').append('<div id="right-side"></div>');
+ $('#left-side').append('<div id="leftText"></div>');
+ $('#leftText').html('Computer Building');
+ $('#right-side').append('<div id="rightText"></div>');
+ $('#rightText').html('Player Building');
+
+
+ $('#main-content').append('<div id="topText">Join two syllables to make one word</div>');
+ $('#main-content').append('<div id="container"></div>');
+ $('#main-content').append('<div id="joinSyllable"></div>');
+ genRandPosition();
+ playerCounter = 0;
+ compCounter = 0;
+ for(i = 0; i< 20; i++){
+ var randNum = randPositions[i];
+ assignSyllableWords(randNum);
+ }
+ $('#joinSyllable').html('');
+ for(i = 0; i< 3;i++){
+ assignDropPlaces(i);
+ if(i === 0){
+ $('#joinSyllable').append('<div class="sign">+</div>');
+ }
+ else if(i === 1){
+ $('#joinSyllable').append('<div class="sign">=</div>');
+ }
+ }
+ for(var i = 0; i< TOTAL_QUES; i++){
+ $('#left-side').append('<div id="compBuild'+i+'></div>');
+ $('#compBuild'+i).addClass('default');
+ $('#right-side').append('<div id="playerBuild'+i+'></div>');
+ $('#playerBuild'+i).addClass('default');
+ }
+
+ };
+
+ function game_start(){
+ gamePlay = 0;
+
+
+ $('#linkNextExercise').hide();
+ $('#linkPrevExercise').hide();
+ $('#gameOver').hide();
+ dropNum = 0;
+ correctCounter = 0;
+ totalCounter = 0;
+ sectionNum = k.rand(0,1);
+ next_syllables();
+ }
+
+ function game(){
+
+
+ $('#linkNextExercise').hide();
+ $('#linkPrevExercise').hide();
+ $('#gameOver').hide();
+
+ }
+
+ game();
+
+ $('#linkNextExercise').click(function(){
+ $('#linkNextExercise').hide();
+ if(sectionNum === 0){
+ sectionNum += 1;
+ }
+ else{
+ sectionNum -= 1;
+ }
+ gamePlay++;
+ next_syllables();
+ });
+ $('#linkPrevExercise').click(function(){
+ $('#linkPrevExercise').hide();
+ if(sectionNum === 0){
+ sectionNum += 1;
+ }
+ else{
+ sectionNum -= 1;
+ }
+ gamePlay--;
+ next_syllables();
+ });
+ $('#linkStart').click(function(){
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ game_start();
+ });
+ $('#linkHelp').mouseover(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+ });
+ }); //end of k.ready
+ }); //end of document.read
+
diff --git a/examples/lessons/6_English_syllables/js/lesson.js~ b/examples/lessons/6_English_syllables/js/lesson.js~
new file mode 100755
index 0000000..ca45a59
--- /dev/null
+++ b/examples/lessons/6_English_syllables/js/lesson.js~
@@ -0,0 +1,359 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.ogg'},
+ {'name':'incorrect','file':'incorrect.ogg'}
+ ]});
+
+ k.ready(function(){
+ var i,j;
+ var totalCounter;
+ var currentQuestion;
+ var TOTAL_QUES = 10;
+ var currentDragObject;
+ var prevDragObject;
+ var dropNum;
+ var sectionNum;
+ var randPositions = [];
+ var compCounter;
+ var playerCounter;
+ var fstSyllableId;
+ var fstSyllableId;
+ var checked;
+ var gamePlay;
+ var s,m,h,play;
+ var currentBlock; //flag for which side increases the score 1-player 0-computer
+ var completedWords = [];
+ var syllableWord1= new Array('be','en','ti','tues','stu','chil','eng','hap','sun','in',
+ 'sen','com','pro','prac','talk','pic','num','tea','mar','comp'
+ );
+ var syllableWord2 = new Array('lieve','gine','ger','key','dent','ly','lish','py','day','sect',
+ 'tence','plete','noun','tice','ing','nic','ber','cher','ket','uter'
+ );
+
+
+ var genRandPosition=function (){
+ randPositions[0] = k.rand(0,19);
+ for(i=1; i<20; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,19);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+
+ var checkTime = function(timePara){
+ if (timePara<10 )
+ {
+ timePara="0" + timePara;
+ }
+ return timePara;
+ };
+
+
+ var resetTimer = function(){
+ play = 0;
+ s = 10;
+ s=checkTime(s);
+ $('#timerBox1').html(s);
+ };
+
+ var increaseTime = function(){
+ if(play === 1){
+ s--;
+ s=checkTime(s);
+ if(s == 00){ //computer score increase
+ k.audio.incorrect.play();
+ checked = 0;
+ t=setTimeout(function(){delay_correct();},2000);
+ currentBlock = 0;
+ assignBuildBlocks();
+ compCounter++;
+ dropNum = 0;
+ resetTimer();
+ }
+ else{
+ $('#timerBox1').html(s);
+ var t=setTimeout(function(){increaseTime();},1000);
+ }
+ }
+ };
+ var startTimer = function(){
+ play = 1;
+ increaseTime();
+
+ };
+
+ var check_game_over = function(){
+ var flag_game = 0;
+ if(totalCounter === 40){ //game over
+ $('#content').addClass('backOpaque');
+ $('#gameOver').show();
+ resetTimer();
+ }
+ else if(totalCounter === 20){
+ if(playerCounter < 10 || compCounter <10){ //u were missed play again
+ $('#topText').html('Sorry U missed the chance !!! Click Play Again.'); }
+ flag_game = 1;
+ }
+ else if(compCounter === 10){ //computer wins
+ $('#leftText').html('Computer Wins');
+ $('#topText').html('Sorry U missed the chance !!! Click Play Again.');
+ flag_game = 1;
+ }
+ else if(playerCounter === 10){ //player wins
+ $('#rightText').html('Player Wins');
+ $('#topText').html('Great Job !!! Click Next Button to proceed to next level.');
+ flag_game = 1;
+ }
+ if(flag_game === 1){
+ playerCounter = 10;
+ compCounter = 10;
+ if(gamePlay === 0){
+ $('#linkNextExercise').show();
+ }
+ else{
+ $('#linkPrevExercise').show();
+ }
+ }
+
+
+ };
+ var assignBuildBlocks = function(){
+ var compName,playerName;
+ if((currentBlock === 1 && playerCounter === 9) || (currentBlock === 0 && compCounter === 9)){
+ compName = 'computer_top';
+ playerName = 'player_top';
+
+ }
+ else if((currentBlock === 1 && playerCounter === 0) || (currentBlock === 0 && compCounter === 0)){
+ compName = 'computer_base';
+ playerName = 'player_base';
+ }
+ else{
+ compName = 'computer_body';
+ playerName = 'player_body';
+ }
+
+ if(currentBlock === 1){
+ $('#playerBuild'+(9-playerCounter)).append('<img src="assets/image/'+playerName+'.png" />');
+ }
+ else{
+ $('#compBuild'+(9-compCounter)).append('<img src="assets/image/'+compName+'.png" />');
+ }
+
+ };
+
+ var delay_correct = function(){
+ document.delayForm.delayval.value = 1;
+ if(checked ===1 ){
+ $('#drag'+completedWords[totalCounter-2]).hide();
+ $('#drag'+completedWords[totalCounter-1]).hide();
+ }
+ $('#drop0').html('----------');
+ $('#drop1').html('----------');
+ $('#drop2').html('------------');
+ };
+ var check_answers = function(){
+ var flag_correct = 0;
+ var secStart = sectionNum * 10;
+ var secStop = (sectionNum+1) * 10;
+ for( i = secStart ; i<secStop; i++){
+ var fstSyllable = $('#drag'+fstSyllableId).text();
+ var secondSyllable = $('#drag'+secondSyllableId).text();
+ if(fstSyllable === syllableWord1[i] && secondSyllable === syllableWord2[i]){
+ k.audio.correct.play();
+ $('#drop2').html(fstSyllable+secondSyllable);
+ totalCounter += 2;
+ completedWords[totalCounter-2] = fstSyllableId;
+ completedWords[totalCounter-1] = secondSyllableId;
+ flag_correct = 1;
+ correctCounter++;
+ //check with timer and populate the side bar
+ //if done within 10 seconds
+ currentBlock = 1;
+ assignBuildBlocks();
+ playerCounter++;
+ checked = 1;
+ t=setTimeout(function(){delay_correct();},1000);
+ }
+ }
+ if(flag_correct === 0){ //rearrange them
+ checked = 0;
+ k.audio.incorrect.play();
+ $('#drop2').html('Not a Valid Word');
+ currentBlock = 0;
+ assignBuildBlocks();
+ compCounter++;
+ t=setTimeout(function(){delay_correct();},1000);
+ }
+
+ };
+
+ var assignSyllableWords = function(sId){
+ if(sId<10){
+ sysId = sId+(10*sectionNum);
+ $('#container').append('<div id="drag'+sId+'" >'+syllableWord1[sysId]+'</div>');
+ }
+ else{
+ sysId = ((10*(sectionNum+2)) - 1)-sId;
+ $('#container').append('<div id="drag'+sId+'" >'+syllableWord2[sysId]+'</div>');
+ }
+
+ var dragObjCss = {
+ 'float':'left','position':'relative','cursor': 'move','margin': '1em',
+ 'width':'100px','height':'30px','border': '2px solid black',
+ 'font':'20px/25px bold Arial,Verdana,Geneva,Helvetica',
+ 'text-align':'center'
+ };
+ $('#drag'+sId).css(dragObjCss);
+ $('#drag'+sId).click(function(){
+ currentSyllable = $(this).text();
+ if(dropNum === 0){
+ fstSyllableId = $(this).attr('id');
+ fstSyllableId = parseInt(fstSyllableId.substring(4));
+ startTimer();
+
+ }
+ else{
+ secondSyllableId = $(this).attr('id');
+ secondSyllableId = parseInt(secondSyllableId.substring(4));
+ }
+ $('#drop'+dropNum).html(currentSyllable);
+ dropNum++;
+ if(dropNum === 2){
+ dropNum = 0;
+ resetTimer();
+ check_answers();
+ }
+ check_game_over();
+ });
+
+ };
+
+ var assignDropPlaces = function(drpId){
+ $('#joinSyllable').append('<div id="drop'+drpId+'" class="dropObjects"></div>');
+ var dropObjCss = {
+ 'float':'left','width':'100px','height': '45px','margin': '0.5em 0.5em',
+ 'font':'20px/35px bold Arial,Verdana,Geneva,Helvetica',
+ 'text-align':'center','color':'#FF00FF'
+ };
+
+ if(drpId === 2){
+ $('#drop'+drpId).css(dropObjCss).css({'width':'200px'}).html('------------');
+ }
+ else{
+ $('#drop'+drpId).css(dropObjCss).html('----------');
+ }
+ };
+
+
+ var next_syllables = function(){
+ resetTimer();
+ $('#content').removeClass('backOpaque').html('');
+ $('#content').append('<div id="left-side"></div>');
+ $('#content').append('<div id="main-content"></div>');
+ $('#content').append('<div id="right-side"></div>');
+ $('#left-side').append('<div id="leftText"></div>');
+ $('#leftText').html('Computer Building');
+ $('#right-side').append('<div id="rightText"></div>');
+ $('#rightText').html('Player Building');
+
+
+ $('#main-content').append('<div id="topText">Join two syllables to make one word</div>');
+ $('#main-content').append('<div id="container"></div>');
+ $('#main-content').append('<div id="joinSyllable"></div>');
+ genRandPosition();
+ playerCounter = 0;
+ compCounter = 0;
+ for(i = 0; i< 20; i++){
+ var randNum = randPositions[i];
+ assignSyllableWords(randNum);
+ }
+ $('#joinSyllable').html('');
+ for(i = 0; i< 3;i++){
+ assignDropPlaces(i);
+ if(i === 0){
+ $('#joinSyllable').append('<div class="sign">+</div>');
+ }
+ else if(i === 1){
+ $('#joinSyllable').append('<div class="sign">=</div>');
+ }
+ }
+ for(var i = 0; i< TOTAL_QUES; i++){
+ $('#left-side').append('<div id="compBuild'+i+'></div>');
+ $('#compBuild'+i).addClass('default');
+ $('#right-side').append('<div id="playerBuild'+i+'></div>');
+ $('#playerBuild'+i).addClass('default');
+ }
+
+ };
+
+ function game_start(){
+ gamePlay = 0;
+
+
+ $('#linkNextExercise').hide();
+ $('#linkPrevExercise').hide();
+ $('#gameOver').hide();
+ dropNum = 0;
+ correctCounter = 0;
+ totalCounter = 0;
+ sectionNum = k.rand(0,1);
+ next_syllables();
+ }
+
+ function game(){
+
+
+ $('#linkNextExercise').hide();
+ $('#linkPrevExercise').hide();
+ $('#gameOver').hide();
+
+ }
+
+ game();
+
+ $('#linkNextExercise').click(function(){
+ $('#linkNextExercise').hide();
+ if(sectionNum === 0){
+ sectionNum += 1;
+ }
+ else{
+ sectionNum -= 1;
+ }
+ gamePlay++;
+ next_syllables();
+ });
+ $('#linkPrevExercise').click(function(){
+ $('#linkPrevExercise').hide();
+ if(sectionNum === 0){
+ sectionNum += 1;
+ }
+ else{
+ sectionNum -= 1;
+ }
+ gamePlay--;
+ next_syllables();
+ });
+ $('#linkStart').click(function(){
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ game_start();
+ });
+ $('#linkHelp').mouseover(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+ });
+ }); //end of k.ready
+ }); //end of document.read
+
diff --git a/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.3663~ b/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.3663~
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.3663~
diff --git a/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.63800~ b/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.63800~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.63800~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.69489~ b/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.69489~
new file mode 100755
index 0000000..da51ff8
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.69489~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Months</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Months of the Year<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.83946~ b/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.83946~
new file mode 100755
index 0000000..721bead
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.83946~
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Alphabetical Order</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Alphabetical Order <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.92952~ b/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.92952~
new file mode 100755
index 0000000..77f8df2
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/.tmp_index.html.92952~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Eng Crossword</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Crossword Puzzle <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="acrossImg"></div>
+ <div id="downImg"></div>
+ <div id="crosswordSection">
+
+
+ </div>
+
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/audio/correct.ogg b/examples/lessons/6_English_yesNoQuestions/assets/audio/correct.ogg
new file mode 100755
index 0000000..a0d9e3a
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/audio/correct.ogg
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/audio/incorrect.ogg b/examples/lessons/6_English_yesNoQuestions/assets/audio/incorrect.ogg
new file mode 100755
index 0000000..4805e55
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/audio/incorrect.ogg
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/backImage.png b/examples/lessons/6_English_yesNoQuestions/assets/image/backImage.png
new file mode 100755
index 0000000..395650b
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/backImage.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/bear.png b/examples/lessons/6_English_yesNoQuestions/assets/image/bear.png
new file mode 100755
index 0000000..b8c29e4
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/bear.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/bg_footer.png b/examples/lessons/6_English_yesNoQuestions/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/bg_header.png b/examples/lessons/6_English_yesNoQuestions/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/bg_title_block.png b/examples/lessons/6_English_yesNoQuestions/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/bird.png b/examples/lessons/6_English_yesNoQuestions/assets/image/bird.png
new file mode 100755
index 0000000..ab1e994
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/bird.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_mouse_down.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/check.png b/examples/lessons/6_English_yesNoQuestions/assets/image/check.png
new file mode 100755
index 0000000..84fc229
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/check.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/cock.png b/examples/lessons/6_English_yesNoQuestions/assets/image/cock.png
new file mode 100755
index 0000000..998c31c
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/cock.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/comma.png b/examples/lessons/6_English_yesNoQuestions/assets/image/comma.png
new file mode 100755
index 0000000..aa0474e
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/comma.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/correct.png b/examples/lessons/6_English_yesNoQuestions/assets/image/correct.png
new file mode 100755
index 0000000..ca9b9db
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/cow.png b/examples/lessons/6_English_yesNoQuestions/assets/image/cow.png
new file mode 100755
index 0000000..205fd8e
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/cow.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/crow.png b/examples/lessons/6_English_yesNoQuestions/assets/image/crow.png
new file mode 100755
index 0000000..33c1366
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/crow.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/domestic.png b/examples/lessons/6_English_yesNoQuestions/assets/image/domestic.png
new file mode 100755
index 0000000..3b5d099
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/domestic.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/dot.png b/examples/lessons/6_English_yesNoQuestions/assets/image/dot.png
new file mode 100755
index 0000000..74ac1ff
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/dot.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/duck.png b/examples/lessons/6_English_yesNoQuestions/assets/image/duck.png
new file mode 100755
index 0000000..59ed78e
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/duck.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/eagle.png b/examples/lessons/6_English_yesNoQuestions/assets/image/eagle.png
new file mode 100755
index 0000000..23d7c3f
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/eagle.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/egret.png b/examples/lessons/6_English_yesNoQuestions/assets/image/egret.png
new file mode 100755
index 0000000..8d2c253
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/egret.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/elephant.png b/examples/lessons/6_English_yesNoQuestions/assets/image/elephant.png
new file mode 100755
index 0000000..8d862f6
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/elephant.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/goat.png b/examples/lessons/6_English_yesNoQuestions/assets/image/goat.png
new file mode 100755
index 0000000..48b2726
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/goat.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/horse.png b/examples/lessons/6_English_yesNoQuestions/assets/image/horse.png
new file mode 100755
index 0000000..132b7b3
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/horse.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/incorrect.png b/examples/lessons/6_English_yesNoQuestions/assets/image/incorrect.png
new file mode 100755
index 0000000..49ee2a2
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/incorrect.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/jackel.png b/examples/lessons/6_English_yesNoQuestions/assets/image/jackel.png
new file mode 100755
index 0000000..31eb0c5
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/jackel.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/monkey.png b/examples/lessons/6_English_yesNoQuestions/assets/image/monkey.png
new file mode 100755
index 0000000..94e31de
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/monkey.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/mynah.png b/examples/lessons/6_English_yesNoQuestions/assets/image/mynah.png
new file mode 100755
index 0000000..0818f20
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/mynah.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/owl.png b/examples/lessons/6_English_yesNoQuestions/assets/image/owl.png
new file mode 100755
index 0000000..be45b5e
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/owl.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/parrot.png b/examples/lessons/6_English_yesNoQuestions/assets/image/parrot.png
new file mode 100755
index 0000000..5eacfd7
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/parrot.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/pig.png b/examples/lessons/6_English_yesNoQuestions/assets/image/pig.png
new file mode 100755
index 0000000..c523e35
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/pig.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/pigeon.png b/examples/lessons/6_English_yesNoQuestions/assets/image/pigeon.png
new file mode 100755
index 0000000..6c0edd7
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/pigeon.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/rabbit.png b/examples/lessons/6_English_yesNoQuestions/assets/image/rabbit.png
new file mode 100755
index 0000000..4aa302d
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/rabbit.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/rhino.png b/examples/lessons/6_English_yesNoQuestions/assets/image/rhino.png
new file mode 100755
index 0000000..d853865
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/rhino.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/sheep.png b/examples/lessons/6_English_yesNoQuestions/assets/image/sheep.png
new file mode 100755
index 0000000..de61ac8
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/sheep.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/snake.png b/examples/lessons/6_English_yesNoQuestions/assets/image/snake.png
new file mode 100755
index 0000000..472295b
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/snake.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/sparrow.png b/examples/lessons/6_English_yesNoQuestions/assets/image/sparrow.png
new file mode 100755
index 0000000..547645b
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/sparrow.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/tiger.png b/examples/lessons/6_English_yesNoQuestions/assets/image/tiger.png
new file mode 100755
index 0000000..4b6e708
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/tiger.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_lt.png b/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_rt.png b/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/turtle.png b/examples/lessons/6_English_yesNoQuestions/assets/image/turtle.png
new file mode 100755
index 0000000..d08bbdc
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/turtle.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/wild.png b/examples/lessons/6_English_yesNoQuestions/assets/image/wild.png
new file mode 100755
index 0000000..a8cc09e
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/assets/image/wild.png
Binary files differ
diff --git a/examples/lessons/6_English_yesNoQuestions/css/lesson.css b/examples/lessons/6_English_yesNoQuestions/css/lesson.css
new file mode 100755
index 0000000..4b89d22
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/css/lesson.css
@@ -0,0 +1,252 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: absolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ /*width: 251px;*/
+ padding-right: 5px;
+ padding-top: 5px;
+}
+ #linkCheck{
+ width: 187px; height: 55px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0px auto;
+ margin-top: 85px;
+ width: 100%;
+ height: 400px;
+
+}
+ #tabs{
+ margin-left: 0.5em;
+ width: 650px;
+ height: 60px;
+ }
+ .tabBox{
+ float:left;
+ margin: 0.5em;
+ }
+ .tabSelected{
+ background-color: #00FF00;
+ }
+
+ #section{
+ width: 900px;
+ height: 300px;
+ margin: 5px auto;
+ }
+
+ #questionSection{
+ margin-top: 50px;
+ margin-left: 300px;
+ }
+ .questions{
+ margin-top: 5px;
+ margin-left: 20px;
+ height: 30px;
+ font: 25px/30px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #000000;
+ }
+ #answerSection{
+ margin-left: 50px;
+ margin-top: 10px;
+ width: 600px;
+ height: 70px;
+ }
+ #comma{
+ width: 36px;
+ height: 60px;
+ margin-left: 118px;
+ background-image: url(../assets/image/comma.png);
+ }
+ #dot{
+ position:absolute;
+ top: 44%;
+ right: 17%;
+ width: 36px;
+ height: 60px;
+ background-image: url(../assets/image/dot.png);
+ }
+ #dragAnswers{
+ padding: 10px;
+ margin-top: 40px;
+ margin-left: 85px;
+ width: 350px;
+ height: 30px;
+ border: 2px solid #ABF549;
+
+ }
+ #imgAnimals{
+ position:absolute;
+ left: 10%;
+ top: 30%;
+ width: 222px;
+ height: 300px;
+ background: url(../assets/image/backImage.png);
+ text-align:center;
+ }
+ .imgAnim{
+ margin-top: 75px;
+ }
+
+ .drophover{
+ background-color: #FF9900;
+ }
+ #checkAnswer{
+ position:absolute;
+ right: 5%;
+ bottom: 45%;
+ width: 100px;
+ height: 92px;
+ }
+
+
+
+#gameOver{
+ margin: 10px auto;
+ width: 500px;
+ text-align:center;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ color:red;
+}
+#gameOverInfo{
+ margin-top: 35px;
+ text-align:center;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#06D946;
+
+}
+.specialText{
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF9900;
+ border-bottom: 2px dotted #CCC;
+
+} \ No newline at end of file
diff --git a/examples/lessons/6_English_yesNoQuestions/css/ui.scoreboard.css b/examples/lessons/6_English_yesNoQuestions/css/ui.scoreboard.css
new file mode 100755
index 0000000..11cdbb5
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/css/ui.scoreboard.css
@@ -0,0 +1,62 @@
+.ui-scoreboard-container-h{
+max-width: 800em;
+max-height: 200px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+
+.ui-scoreboard-spacing-h{
+max-width: 200em;
+max-height: 300em;
+display:inline;
+margin-left:0.2em;
+margin-right:0.4em;
+}
+
+.ui-scoreboard-text{
+font-size:larger;
+text-align: center;
+}
+
+.ui-scoreboard-number-h {
+background-color:black;
+color: white;
+padding-left:0.4em;
+padding-right:0.4em;
+font-size:larger;
+}
+
+.ui-scoreboard-button{
+float:right;
+cursor:pointer;
+}
+
+button .ui-scoreboard-icon{
+float: left;
+margin-right:0.3em;
+}
+.ui-scoreboard-container-v{
+max-width: 200px;
+max-height: 400px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+.ui-scoreboard-spacing-v{
+display:block;
+margin: 0.4em;
+}
+
+.ui-scoreboard-number-v{
+background-color:black;
+color: white;
+width: 1em;
+text-align:center;
+margin-left:auto;
+margin-right: auto;
+padding:0.4em;
+font-size:larger;
+}
+
+
diff --git a/examples/lessons/6_English_yesNoQuestions/index.html b/examples/lessons/6_English_yesNoQuestions/index.html
new file mode 100755
index 0000000..c359651
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/index.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Yes No Questions</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <link type="text/css" rel="stylesheet" href="css/demos.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.4.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Yes No Questions <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="tabs"></div>
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_English_yesNoQuestions/js/jquery-1.4.js b/examples/lessons/6_English_yesNoQuestions/js/jquery-1.4.js
new file mode 100755
index 0000000..a448490
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/js/jquery-1.4.js
@@ -0,0 +1,5999 @@
+/*!
+ * jQuery JavaScript Library v1.4
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://docs.jquery.com/License
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Jan 13 15:23:05 2010 -0500
+ */
+(function( window, undefined ) {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
+
+ // Is it a simple selector
+ isSimple = /^.[^:#\[\.,]*$/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // Has the ready events already been bound?
+ readyBound = false,
+
+ // The functions to execute on DOM ready
+ readyList = [],
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ indexOf = Array.prototype.indexOf;
+
+jQuery.fn = jQuery.prototype = {
+ init: function( selector, context ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ match = quickExpr.exec( selector );
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
+ }
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ if ( elem ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $("TAG")
+ } else if ( !context && /^\w+$/.test( selector ) ) {
+ this.selector = selector;
+ this.context = document;
+ selector = document.getElementsByTagName( selector );
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return jQuery( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.isArray( selector ) ?
+ this.setArray( selector ) :
+ jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.4",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = jQuery( elems || null );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Force the current matched set of elements to become
+ // the specified array of elements (destroying the stack in the process)
+ // You should use pushStack() in order to do this, but maintain the stack
+ setArray: function( elems ) {
+ // Resetting the length to 0, then using the native Array push
+ // is a super-fast way to populate an object with array-like properties
+ this.length = 0;
+ push.apply( this, elems );
+
+ return this;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // If the DOM is already ready
+ if ( jQuery.isReady ) {
+ // Execute the function immediately
+ fn.call( document, jQuery );
+
+ // Otherwise, remember the function for later
+ } else if ( readyList ) {
+ // Add the function to the wait list
+ readyList.push( fn );
+ }
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || jQuery(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ // copy reference to target object
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging object literal values or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
+ var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
+ : jQuery.isArray(copy) ? [] : {};
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ window.$ = _$;
+
+ if ( deep ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // Handle when the DOM is ready
+ ready: function() {
+ // Make sure that the DOM is not already loaded
+ if ( !jQuery.isReady ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 13 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If there are functions bound, to execute
+ if ( readyList ) {
+ // Execute all of them
+ var fn, i = 0;
+ while ( (fn = readyList[ i++ ]) ) {
+ fn.call( document, jQuery );
+ }
+
+ // Reset the list of functions
+ readyList = null;
+ }
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyBound ) {
+ return;
+ }
+
+ readyBound = true;
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ return jQuery.ready();
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent("onreadystatechange", DOMContentLoaded);
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return toString.call(obj) === "[object Function]";
+ },
+
+ isArray: function( obj ) {
+ return toString.call(obj) === "[object Array]";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor
+ && !hasOwnProperty.call(obj, "constructor")
+ && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwnProperty.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ noop: function() {},
+
+ // Evalulates a script in a global context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test(data) ) {
+ // Inspired by code by Andrea Giammarchi
+ // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+ var head = document.getElementsByTagName("head")[0] || document.documentElement,
+ script = document.createElement("script");
+
+ script.type = "text/javascript";
+
+ if ( jQuery.support.scriptEval ) {
+ script.appendChild( document.createTextNode( data ) );
+ } else {
+ script.text = data;
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709).
+ head.insertBefore( script, head.firstChild );
+ head.removeChild( script );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction(object);
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( var value = object[0];
+ i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+ }
+ }
+
+ return object;
+ },
+
+ trim: function( text ) {
+ return (text || "").replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+ if ( array.indexOf ) {
+ return array.indexOf( elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length, j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [];
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ if ( !inv !== !callback( elems[ i ], i ) ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var ret = [], value;
+
+ // Go through the array, translating each of the items to their
+ // new value (or values).
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ proxy: function( fn, proxy, thisObject ) {
+ if ( arguments.length === 2 ) {
+ if ( typeof proxy === "string" ) {
+ thisObject = fn;
+ fn = thisObject[ proxy ];
+ proxy = undefined;
+
+ } else if ( proxy && !jQuery.isFunction( proxy ) ) {
+ thisObject = proxy;
+ proxy = undefined;
+ }
+ }
+
+ if ( !proxy && fn ) {
+ proxy = function() {
+ return fn.apply( thisObject || this, arguments );
+ };
+ }
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ if ( fn ) {
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+ }
+
+ // So proxy can be declared as an argument
+ return proxy;
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ var ret = { browser: "" };
+
+ ua = ua.toLowerCase();
+
+ if ( /webkit/.test( ua ) ) {
+ ret = { browser: "webkit", version: /webkit[\/ ]([\w.]+)/ };
+
+ } else if ( /opera/.test( ua ) ) {
+ ret = { browser: "opera", version: /version/.test( ua ) ? /version[\/ ]([\w.]+)/ : /opera[\/ ]([\w.]+)/ };
+
+ } else if ( /msie/.test( ua ) ) {
+ ret = { browser: "msie", version: /msie ([\w.]+)/ };
+
+ } else if ( /mozilla/.test( ua ) && !/compatible/.test( ua ) ) {
+ ret = { browser: "mozilla", version: /rv:([\w.]+)/ };
+ }
+
+ ret.version = (ret.version && ret.version.exec( ua ) || [0, "0"])[1];
+
+ return ret;
+ },
+
+ browser: {}
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+if ( indexOf ) {
+ jQuery.inArray = function( elem, array ) {
+ return indexOf.call( array, elem );
+ };
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch( error ) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+if ( indexOf ) {
+ jQuery.inArray = function( elem, array ) {
+ return indexOf.call( array, elem );
+ };
+}
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+// Mutifunctional method to get and set values to a collection
+// The value/s can be optionally by executed if its a function
+function access( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : null;
+}
+
+function now() {
+ return (new Date).getTime();
+}
+(function() {
+
+ jQuery.support = {};
+
+ var root = document.documentElement,
+ script = document.createElement("script"),
+ div = document.createElement("div"),
+ id = "script" + now();
+
+ div.style.display = "none";
+ div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+ var all = div.getElementsByTagName("*"),
+ a = div.getElementsByTagName("a")[0];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return;
+ }
+
+ jQuery.support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: div.firstChild.nodeType === 3,
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText insted)
+ style: /red/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: a.getAttribute("href") === "/a",
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: div.getElementsByTagName("input")[0].value === "on",
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
+
+ // Will be defined later
+ scriptEval: false,
+ noCloneEvent: true,
+ boxModel: null
+ };
+
+ script.type = "text/javascript";
+ try {
+ script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
+ } catch(e) {}
+
+ root.insertBefore( script, root.firstChild );
+
+ // Make sure that the execution of code works by injecting a script
+ // tag with appendChild/createTextNode
+ // (IE doesn't support this, fails, and uses .text instead)
+ if ( window[ id ] ) {
+ jQuery.support.scriptEval = true;
+ delete window[ id ];
+ }
+
+ root.removeChild( script );
+
+ if ( div.attachEvent && div.fireEvent ) {
+ div.attachEvent("onclick", function click() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ jQuery.support.noCloneEvent = false;
+ div.detachEvent("onclick", click);
+ });
+ div.cloneNode(true).fireEvent("onclick");
+ }
+
+ // Figure out if the W3C box model works as expected
+ // document.body must exist before we can do this
+ // TODO: This timeout is temporary until I move ready into core.js.
+ jQuery(function() {
+ var div = document.createElement("div");
+ div.style.width = div.style.paddingLeft = "1px";
+
+ document.body.appendChild( div );
+ jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+ document.body.removeChild( div ).style.display = 'none';
+ div = null;
+ });
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+ var eventSupported = function( eventName ) {
+ var el = document.createElement("div");
+ eventName = "on" + eventName;
+
+ var isSupported = (eventName in el);
+ if ( !isSupported ) {
+ el.setAttribute(eventName, "return;");
+ isSupported = typeof el[eventName] === "function";
+ }
+ el = null;
+
+ return isSupported;
+ };
+
+ jQuery.support.submitBubbles = eventSupported("submit");
+ jQuery.support.changeBubbles = eventSupported("change");
+
+ // release memory in IE
+ root = script = div = all = a = null;
+})();
+
+jQuery.props = {
+ "for": "htmlFor",
+ "class": "className",
+ readonly: "readOnly",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ rowspan: "rowSpan",
+ colspan: "colSpan",
+ tabindex: "tabIndex",
+ usemap: "useMap",
+ frameborder: "frameBorder"
+};
+var expando = "jQuery" + now(), uuid = 0, windowData = {};
+var emptyObject = {};
+
+jQuery.extend({
+ cache: {},
+
+ expando:expando,
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ "object": true,
+ "applet": true
+ },
+
+ data: function( elem, name, data ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ], cache = jQuery.cache, thisCache;
+
+ // Handle the case where there's no name immediately
+ if ( !name && !id ) {
+ return null;
+ }
+
+ // Compute a unique ID for the element
+ if ( !id ) {
+ id = ++uuid;
+ }
+
+ // Avoid generating a new cache unless none exists and we
+ // want to manipulate it.
+ if ( typeof name === "object" ) {
+ elem[ expando ] = id;
+ thisCache = cache[ id ] = jQuery.extend(true, {}, name);
+ } else if ( cache[ id ] ) {
+ thisCache = cache[ id ];
+ } else if ( typeof data === "undefined" ) {
+ thisCache = emptyObject;
+ } else {
+ thisCache = cache[ id ] = {};
+ }
+
+ // Prevent overriding the named cache with undefined values
+ if ( data !== undefined ) {
+ elem[ expando ] = id;
+ thisCache[ name ] = data;
+ }
+
+ return typeof name === "string" ? thisCache[ name ] : thisCache;
+ },
+
+ removeData: function( elem, name ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
+
+ // If we want to remove a specific section of the element's data
+ if ( name ) {
+ if ( thisCache ) {
+ // Remove the section of cache data
+ delete thisCache[ name ];
+
+ // If we've removed all the data, remove the element's cache
+ if ( jQuery.isEmptyObject(thisCache) ) {
+ jQuery.removeData( elem );
+ }
+ }
+
+ // Otherwise, we want to remove all of the element's data
+ } else {
+ // Clean up the element expando
+ try {
+ delete elem[ expando ];
+ } catch( e ) {
+ // IE has trouble directly removing the expando
+ // but it's ok with using removeAttribute
+ if ( elem.removeAttribute ) {
+ elem.removeAttribute( expando );
+ }
+ }
+
+ // Completely remove the data cache
+ delete cache[ id ];
+ }
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ if ( typeof key === "undefined" && this.length ) {
+ return jQuery.data( this[0] );
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ }
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ } else {
+ return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
+ jQuery.data( this, key, value );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ if ( !elem ) {
+ return;
+ }
+
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( !data ) {
+ return q || [];
+ }
+
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data) );
+
+ } else {
+ q.push( data );
+ }
+
+ return q;
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ), fn = queue.shift();
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function( i, elem ) {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ }
+});
+var rclass = /[\n\t]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rspecialurl = /href|src|style/,
+ rtype = /(button|input)/i,
+ rfocusable = /(button|input|object|select|textarea)/i,
+ rclickable = /^(a|area)$/i,
+ rradiocheck = /radio|checkbox/;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name, fn ) {
+ return this.each(function(){
+ jQuery.attr( this, name, "" );
+ if ( this.nodeType === 1 ) {
+ this.removeAttribute( name );
+ }
+ });
+ },
+
+ addClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.addClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ var classNames = (value || "").split( rspace );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className ) {
+ elem.className = value;
+
+ } else {
+ var className = " " + elem.className + " ";
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
+ elem.className += " " + classNames[c];
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.removeClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ var classNames = (value || "").split(rspace);
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ var className = (" " + elem.className + " ").replace(rclass, " ");
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[c] + " ", " ");
+ }
+ elem.className = className.substring(1, className.length - 1);
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value, isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className, i = 0, self = jQuery(this),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery.data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ if ( value === undefined ) {
+ var elem = this[0];
+
+ if ( elem ) {
+ if ( jQuery.nodeName( elem, "option" ) ) {
+ return (elem.attributes.value || {}).specified ? elem.value : elem.text;
+ }
+
+ // We need to handle select boxes special
+ if ( jQuery.nodeName( elem, "select" ) ) {
+ var index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ if ( option.selected ) {
+ // Get the specifc value for the option
+ value = jQuery(option).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ }
+
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+
+
+ // Everything else, we just grab the value
+ return (elem.value || "").replace(rreturn, "");
+
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction(value);
+
+ return this.each(function(i) {
+ var self = jQuery(this), val = value;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call(this, i, self.val());
+ }
+
+ // Typecast each time if the value is a Function and the appended
+ // value is therefore different each time.
+ if ( typeof val === "number" ) {
+ val += "";
+ }
+
+ if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
+ this.checked = jQuery.inArray( self.val(), val ) >= 0;
+
+ } else if ( jQuery.nodeName( this, "select" ) ) {
+ var values = jQuery.makeArray(val);
+
+ jQuery( "option", this ).each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ this.selectedIndex = -1;
+ }
+
+ } else {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attr: function( elem, name, value, pass ) {
+ // don't set attributes on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery(elem)[name](value);
+ }
+
+ var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
+ // Whether we are setting (or getting)
+ set = value !== undefined;
+
+ // Try to normalize/fix the name
+ name = notxml && jQuery.props[ name ] || name;
+
+ // Only do all the following if this is a node (faster for style)
+ if ( elem.nodeType === 1 ) {
+ // These attributes require special treatment
+ var special = rspecialurl.test( name );
+
+ // Safari mis-reports the default selected property of an option
+ // Accessing the parent's selectedIndex property fixes it
+ if ( name === "selected" && !jQuery.support.optSelected ) {
+ var parent = elem.parentNode;
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ }
+
+ // If applicable, access the attribute via the DOM 0 way
+ if ( name in elem && notxml && !special ) {
+ if ( set ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
+ throw "type property can't be changed";
+ }
+
+ elem[ name ] = value;
+ }
+
+ // browsers index elements by id/name on forms, give priority to attributes.
+ if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
+ return elem.getAttributeNode( name ).nodeValue;
+ }
+
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ if ( name === "tabIndex" ) {
+ var attributeNode = elem.getAttributeNode( "tabIndex" );
+
+ return attributeNode && attributeNode.specified ?
+ attributeNode.value :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+
+ return elem[ name ];
+ }
+
+ if ( !jQuery.support.style && notxml && name === "style" ) {
+ if ( set ) {
+ elem.style.cssText = "" + value;
+ }
+
+ return elem.style.cssText;
+ }
+
+ if ( set ) {
+ // convert the value to a string (all browsers do this but IE) see #1070
+ elem.setAttribute( name, "" + value );
+ }
+
+ var attr = !jQuery.support.hrefNormalized && notxml && special ?
+ // Some attributes require a special call on IE
+ elem.getAttribute( name, 2 ) :
+ elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return attr === null ? undefined : attr;
+ }
+
+ // elem is actually elem.style ... set the style
+ // Using attr for specific style information is now deprecated. Use style insead.
+ return jQuery.style( elem, name, value );
+ }
+});
+var fcleanup = function( nm ) {
+ return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
+ return "\\" + ch;
+ });
+};
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // For whatever reason, IE has trouble passing the window object
+ // around, causing it to be cloned in the process
+ if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
+ elem = window;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // if data is passed, bind to handler
+ if ( data !== undefined ) {
+ // Create temporary function pointer to original handler
+ var fn = handler;
+
+ // Create unique handler function, wrapped around original handler
+ handler = jQuery.proxy( fn );
+
+ // Store data in unique handler
+ handler.data = data;
+ }
+
+ // Init the element's event structure
+ var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
+ handle = jQuery.data( elem, "handle" ), eventHandle;
+
+ if ( !handle ) {
+ eventHandle = function() {
+ // Handle the second event of a trigger and when
+ // an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+
+ handle = jQuery.data( elem, "handle", eventHandle );
+ }
+
+ // If no handle is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !handle ) {
+ return;
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native
+ // event in IE.
+ handle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split( /\s+/ );
+ var type, i=0;
+ while ( (type = types[ i++ ]) ) {
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ handler.type = namespaces.slice(0).sort().join(".");
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = this.special[ type ] || {};
+
+
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = {};
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, handle, false );
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, handle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers );
+ if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
+ modifiedHandler.guid = modifiedHandler.guid || handler.guid;
+ handler = modifiedHandler;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers[ handler.guid ] = handler;
+
+ // Keep track of which events have been used, for global triggering
+ this.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ var events = jQuery.data( elem, "events" ), ret, type, fn;
+
+ if ( events ) {
+ // Unbind all events for the element
+ if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
+ for ( type in events ) {
+ this.remove( elem, type + (types || "") );
+ }
+ } else {
+ // types is actually an event object here
+ if ( types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(/\s+/);
+ var i = 0;
+ while ( (type = types[ i++ ]) ) {
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ var all = !namespaces.length,
+ cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ),
+ namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"),
+ special = this.special[ type ] || {};
+
+ if ( events[ type ] ) {
+ // remove the given handler for the given type
+ if ( handler ) {
+ fn = events[ type ][ handler.guid ];
+ delete events[ type ][ handler.guid ];
+
+ // remove all handlers for the given type
+ } else {
+ for ( var handle in events[ type ] ) {
+ // Handle the removal of namespaced events
+ if ( all || namespace.test( events[ type ][ handle ].type ) ) {
+ delete events[ type ][ handle ];
+ }
+ }
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, namespaces, fn);
+ }
+
+ // remove generic event handler if no more handlers exist
+ for ( ret in events[ type ] ) {
+ break;
+ }
+ if ( !ret ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
+ } else if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
+ }
+ }
+ ret = null;
+ delete events[ type ];
+ }
+ }
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ for ( ret in events ) {
+ break;
+ }
+ if ( !ret ) {
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) {
+ handle.elem = null;
+ }
+ jQuery.removeData( elem, "events" );
+ jQuery.removeData( elem, "handle" );
+ }
+ }
+ },
+
+ // bubbling is internal
+ trigger: function( event, data, elem /*, bubbling */ ) {
+ // Event object or event type
+ var type = event.type || event,
+ bubbling = arguments[3];
+
+ if ( !bubbling ) {
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[expando] ? event :
+ // Object literal
+ jQuery.extend( jQuery.Event(type), event ) :
+ // Just the event type (string)
+ jQuery.Event(type);
+
+ if ( type.indexOf("!") >= 0 ) {
+ event.type = type = type.slice(0, -1);
+ event.exclusive = true;
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // Don't bubble custom events when global (to avoid too much overhead)
+ event.stopPropagation();
+
+ // Only trigger if we've ever bound an event for it
+ if ( this.global[ type ] ) {
+ jQuery.each( jQuery.cache, function() {
+ if ( this.events && this.events[type] ) {
+ jQuery.event.trigger( event, data, this.handle.elem );
+ }
+ });
+ }
+ }
+
+ // Handle triggering a single element
+
+ // don't do events on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // Clean up in case it is reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone the incoming data, if any
+ data = jQuery.makeArray( data );
+ data.unshift( event );
+ }
+
+ event.currentTarget = elem;
+
+ // Trigger the event, it is assumed that "handle" is a function
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) {
+ handle.apply( elem, data );
+ }
+
+ var nativeFn, nativeHandler;
+ try {
+ if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
+ nativeFn = elem[ type ];
+ nativeHandler = elem[ "on" + type ];
+ }
+ // prevent IE from throwing an error for some elements with some event types, see #3533
+ } catch (e) {}
+
+ var isClick = jQuery.nodeName(elem, "a") && type === "click";
+
+ // Trigger the native events (except for clicks on links)
+ if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !isClick ) {
+ this.triggered = true;
+ try {
+ elem[ type ]();
+ // prevent IE from throwing an error for some hidden elements
+ } catch (e) {}
+
+ // Handle triggering native .onfoo handlers
+ } else if ( nativeHandler && elem[ "on" + type ].apply( elem, data ) === false ) {
+ event.result = false;
+ }
+
+ this.triggered = false;
+
+ if ( !event.isPropagationStopped() ) {
+ var parent = elem.parentNode || elem.ownerDocument;
+ if ( parent ) {
+ jQuery.event.trigger( event, data, parent, true );
+ }
+ }
+ },
+
+ handle: function( event ) {
+ // returned undefined or false
+ var all, handlers;
+
+ event = arguments[0] = jQuery.event.fix( event || window.event );
+ event.currentTarget = this;
+
+ // Namespaced event handlers
+ var namespaces = event.type.split(".");
+ event.type = namespaces.shift();
+
+ // Cache this now, all = true means, any handler
+ all = !namespaces.length && !event.exclusive;
+
+ var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
+
+ handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
+
+ for ( var j in handlers ) {
+ var handler = handlers[ j ];
+
+ // Filter the functions by class
+ if ( all || namespace.test(handler.type) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handler;
+ event.data = handler.data;
+
+ var ret = handler.apply( this, arguments );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+
+ }
+ }
+
+ return event.result;
+ },
+
+ props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+
+ fix: function( event ) {
+ if ( event[ expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var doc = document.documentElement, body = document.body;
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
+ event.which = event.charCode || event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( proxy, data, namespaces, live ) {
+ jQuery.extend( proxy, data || {} );
+
+ proxy.guid += data.selector + data.live;
+ jQuery.event.add( this, data.live, liveHandler, data );
+
+ },
+
+ remove: function( namespaces ) {
+ if ( namespaces.length ) {
+ var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
+
+ jQuery.each( (jQuery.data(this, "events").live || {}), function() {
+ if ( name.test(this.type) ) {
+ remove++;
+ }
+ });
+
+ if ( remove < 1 ) {
+ jQuery.event.remove( this, namespaces[0], liveHandler );
+ }
+ }
+ },
+ special: {}
+ },
+ beforeunload: {
+ setup: function( data, namespaces, fn ) {
+ // We only want to do this special case on windows
+ if ( this.setInterval ) {
+ this.onbeforeunload = fn;
+ }
+
+ return false;
+ },
+ teardown: function( namespaces, fn ) {
+ if ( this.onbeforeunload === fn ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+jQuery.Event = function( src ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = now();
+
+ // Mark it as fixed
+ this[ expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+ }
+ // otherwise set the returnValue property of the original event to false (IE)
+ e.returnValue = false;
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+ // Check if mouse(over|out) are still within the same parent element
+ var parent = event.relatedTarget;
+
+ // Traverse up the tree
+ while ( parent && parent !== this ) {
+ // Firefox sometimes assigns relatedTarget a XUL element
+ // which we cannot access the parentNode property of
+ try {
+ parent = parent.parentNode;
+
+ // assuming we've left the element since we most likely mousedover a xul element
+ } catch(e) {
+ break;
+ }
+ }
+
+ if ( parent !== this ) {
+ // set the correct event type
+ event.type = event.data;
+
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+jQuery.event.special.submit = {
+ setup: function( data, namespaces, fn ) {
+ if ( this.nodeName.toLowerCase() !== "form" ) {
+ jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ remove: function( namespaces, fn ) {
+ jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") );
+ jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") );
+ }
+};
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+var formElems = /textarea|input|select/i;
+
+function getVal( elem ) {
+ var type = elem.type, val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( elem.nodeName.toLowerCase() === "select" ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+}
+
+function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery.data( elem, "_change_data" );
+ val = getVal(elem);
+
+ if ( val === data ) {
+ return;
+ }
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery.data( elem, "_change_data", val );
+ }
+
+ if ( elem.type !== "select" && (data != null || val) ) {
+ e.type = "change";
+ return jQuery.event.trigger( e, arguments[1], this );
+ }
+}
+
+jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information/focus[in] is not needed anymore
+ beforeactivate: function( e ) {
+ var elem = e.target;
+
+ if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) {
+ jQuery.data( elem, "_change_data", getVal(elem) );
+ }
+ }
+ },
+ setup: function( data, namespaces, fn ) {
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] );
+ }
+
+ return formElems.test( this.nodeName );
+ },
+ remove: function( namespaces, fn ) {
+ for ( var type in changeFilters ) {
+ jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] );
+ }
+
+ return formElems.test( this.nodeName );
+ }
+};
+
+var changeFilters = jQuery.event.special.change.filters;
+
+}
+
+function trigger( type, elem, args ) {
+ args[0].type = type;
+ return jQuery.event.handle.apply( elem, args );
+}
+
+// Create "bubbling" focus and blur events
+if ( document.addEventListener ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ this.addEventListener( orig, handler, true );
+ },
+ teardown: function() {
+ this.removeEventListener( orig, handler, true );
+ }
+ };
+
+ function handler( e ) {
+ e = jQuery.event.fix( e );
+ e.type = fix;
+ return jQuery.event.handle.call( this, e );
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( jQuery.isFunction( data ) ) {
+ thisObject = fn;
+ fn = data;
+ data = undefined;
+ }
+
+ var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ }) : fn;
+
+ return type === "unload" && name !== "one" ?
+ this.one( type, data, fn, thisObject ) :
+ this.each(function() {
+ jQuery.event.add( this, type, handler, data );
+ });
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+ return this;
+ }
+
+ return this.each(function() {
+ jQuery.event.remove( this, type, fn );
+ });
+ },
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ var event = jQuery.Event( type );
+ event.preventDefault();
+ event.stopPropagation();
+ jQuery.event.trigger( event, data, this[0] );
+ return event.result;
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments, i = 1;
+
+ // link all the functions, so any of them can unbind this click handler
+ while ( i < args.length ) {
+ jQuery.proxy( fn, args[ i++ ] );
+ }
+
+ return this.click( jQuery.proxy( fn, function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ }));
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ },
+
+ live: function( type, data, fn ) {
+ if ( jQuery.isFunction( data ) ) {
+ fn = data;
+ data = undefined;
+ }
+
+ jQuery( this.context ).bind( liveConvert( type, this.selector ), {
+ data: data, selector: this.selector, live: type
+ }, fn );
+
+ return this;
+ },
+
+ die: function( type, fn ) {
+ jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
+ return this;
+ }
+});
+
+function liveHandler( event ) {
+ var stop = true, elems = [], selectors = [], args = arguments,
+ related, match, fn, elem, j, i, data,
+ live = jQuery.extend({}, jQuery.data( this, "events" ).live);
+
+ for ( j in live ) {
+ fn = live[j];
+ if ( fn.live === event.type ||
+ fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) {
+
+ data = fn.data;
+ if ( !(data.beforeFilter && data.beforeFilter[event.type] &&
+ !data.beforeFilter[event.type](event)) ) {
+ selectors.push( fn.selector );
+ }
+ } else {
+ delete live[j];
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ for ( j in live ) {
+ fn = live[j];
+ elem = match[i].elem;
+ related = null;
+
+ if ( match[i].selector === fn.selector ) {
+ // Those two events require additional checking
+ if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) {
+ related = jQuery( event.relatedTarget ).closest( fn.selector )[0];
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, fn: fn });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+ event.currentTarget = match.elem;
+ event.data = match.fn.data;
+ if ( match.fn.apply( match.elem, args ) === false ) {
+ stop = false;
+ break;
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "&")].join(".");
+}
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( fn ) {
+ return fn ? this.bind( name, fn ) : this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+// Prevent memory leaks in IE
+// Window isn't included so as not to unbind existing unload events
+// More info:
+// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
+if ( window.attachEvent && !window.addEventListener ) {
+ window.attachEvent("onunload", function() {
+ for ( var id in jQuery.cache ) {
+ if ( jQuery.cache[ id ].handle ) {
+ // Try/Catch is to handle iframes being unloaded, see #4280
+ try {
+ jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+ } catch(e) {}
+ }
+ }
+ });
+}
+/*!
+ * Sizzle CSS Selector Engine - v1.0
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function(){
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function(selector, context, results, seed) {
+ results = results || [];
+ var origContext = context = context || document;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+ var ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
+ }
+
+ if ( context ) {
+ var ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+ set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray(set);
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ var cur = parts.pop(), pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ throw "Syntax error, unrecognized expression: " + (cur || selector);
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+ } else if ( context && context.nodeType === 1 ) {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+ } else {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function(results){
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort(sortOrder);
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[i-1] ) {
+ results.splice(i--, 1);
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function(expr, set){
+ return Sizzle(expr, null, null, set);
+};
+
+Sizzle.find = function(expr, context, isXML){
+ var set, match;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var type = Expr.order[i], match;
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace(/\\/g, "");
+ set = Expr.find[ type ]( match, context, isXML );
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = context.getElementsByTagName("*");
+ }
+
+ return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+ var old = expr, result = [], curLoop = set, match, anyFound,
+ isXMLFilter = set && set[0] && isXML(set[0]);
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var filter = Expr.filter[ type ], found, item, left = match[1];
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+ } else {
+ curLoop[i] = false;
+ }
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ throw "Syntax error, unrecognized expression: " + expr;
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+var Expr = Sizzle.selectors = {
+ order: [ "ID", "NAME", "TAG" ],
+ match: {
+ ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
+ TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
+ CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+ },
+ leftMatch: {},
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+ attrHandle: {
+ href: function(elem){
+ return elem.getAttribute("href");
+ }
+ },
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !/\W/.test(part),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part){
+ var isPartStr = typeof part === "string";
+
+ if ( isPartStr && !/\W/.test(part) ) {
+ part = part.toLowerCase();
+
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+ } else {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+ "": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = part.toLowerCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+ },
+ "~": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = part.toLowerCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
+ }
+ },
+ find: {
+ ID: function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? [m] : [];
+ }
+ },
+ NAME: function(match, context){
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [], results = context.getElementsByName(match[1]);
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+ TAG: function(match, context){
+ return context.getElementsByTagName(match[1]);
+ }
+ },
+ preFilter: {
+ CLASS: function(match, curLoop, inplace, result, not, isXML){
+ match = " " + match[1].replace(/\\/g, "") + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+ ID: function(match){
+ return match[1].replace(/\\/g, "");
+ },
+ TAG: function(match, curLoop){
+ return match[1].toLowerCase();
+ },
+ CHILD: function(match){
+ if ( match[1] === "nth" ) {
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+ ATTR: function(match, curLoop, inplace, result, not, isXML){
+ var name = match[1].replace(/\\/g, "");
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+ PSEUDO: function(match, curLoop, inplace, result, not){
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+ return false;
+ }
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+ POS: function(match){
+ match.unshift( true );
+ return match;
+ }
+ },
+ filters: {
+ enabled: function(elem){
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+ disabled: function(elem){
+ return elem.disabled === true;
+ },
+ checked: function(elem){
+ return elem.checked === true;
+ },
+ selected: function(elem){
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ elem.parentNode.selectedIndex;
+ return elem.selected === true;
+ },
+ parent: function(elem){
+ return !!elem.firstChild;
+ },
+ empty: function(elem){
+ return !elem.firstChild;
+ },
+ has: function(elem, i, match){
+ return !!Sizzle( match[3], elem ).length;
+ },
+ header: function(elem){
+ return /h\d/i.test( elem.nodeName );
+ },
+ text: function(elem){
+ return "text" === elem.type;
+ },
+ radio: function(elem){
+ return "radio" === elem.type;
+ },
+ checkbox: function(elem){
+ return "checkbox" === elem.type;
+ },
+ file: function(elem){
+ return "file" === elem.type;
+ },
+ password: function(elem){
+ return "password" === elem.type;
+ },
+ submit: function(elem){
+ return "submit" === elem.type;
+ },
+ image: function(elem){
+ return "image" === elem.type;
+ },
+ reset: function(elem){
+ return "reset" === elem.type;
+ },
+ button: function(elem){
+ return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
+ },
+ input: function(elem){
+ return /input|select|textarea|button/i.test(elem.nodeName);
+ }
+ },
+ setFilters: {
+ first: function(elem, i){
+ return i === 0;
+ },
+ last: function(elem, i, match, array){
+ return i === array.length - 1;
+ },
+ even: function(elem, i){
+ return i % 2 === 0;
+ },
+ odd: function(elem, i){
+ return i % 2 === 1;
+ },
+ lt: function(elem, i, match){
+ return i < match[3] - 0;
+ },
+ gt: function(elem, i, match){
+ return i > match[3] - 0;
+ },
+ nth: function(elem, i, match){
+ return match[3] - 0 === i;
+ },
+ eq: function(elem, i, match){
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ } else {
+ throw "Syntax error, unrecognized expression: " + name;
+ }
+ },
+ CHILD: function(elem, match){
+ var type = match[1], node = elem;
+ switch (type) {
+ case 'only':
+ case 'first':
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ if ( type === "first" ) {
+ return true;
+ }
+ node = elem;
+ case 'last':
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ return true;
+ case 'nth':
+ var first = match[2], last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+ if ( first === 0 ) {
+ return diff === 0;
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+ ID: function(elem, match){
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+ TAG: function(elem, match){
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+ CLASS: function(elem, match){
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+ ATTR: function(elem, match){
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+ POS: function(elem, match, i, array){
+ var name = match[2], filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS;
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
+ return "\\" + (num - 0 + 1);
+ }));
+}
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 );
+
+// Provide a fallback method if it does not work
+} catch(e){
+ makeArray = function(array, results) {
+ var ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var i = 0, l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+ } else {
+ for ( var i = 0; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( "sourceIndex" in document.documentElement ) {
+ sortOrder = function( a, b ) {
+ if ( !a.sourceIndex || !b.sourceIndex ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.sourceIndex ? -1 : 1;
+ }
+
+ var ret = a.sourceIndex - b.sourceIndex;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( document.createRange ) {
+ sortOrder = function( a, b ) {
+ if ( !a.ownerDocument || !b.ownerDocument ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.ownerDocument ? -1 : 1;
+ }
+
+ var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
+ aRange.setStart(a, 0);
+ aRange.setEnd(a, 0);
+ bRange.setStart(b, 0);
+ bRange.setEnd(b, 0);
+ var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+function getText( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date).getTime();
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+ }
+ };
+
+ Expr.filter.ID = function(elem, match){
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+ root = form = null; // release memory in IE
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+ Expr.attrHandle.href = function(elem){
+ return elem.getAttribute("href", 2);
+ };
+ }
+
+ div = null; // release memory in IE
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle, div = document.createElement("div");
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && context.nodeType === 9 && !isXML(context) ) {
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(e){}
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ div = null; // release memory in IE
+ })();
+}
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function(match, context, isXML) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ div = null; // release memory in IE
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+var contains = document.compareDocumentPosition ? function(a, b){
+ return a.compareDocumentPosition(b) & 16;
+} : function(a, b){
+ return a !== b && (a.contains ? a.contains(b) : true);
+};
+
+var isXML = function(elem){
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function(selector, context){
+ var tmpSet = [], later = "", match,
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.getText = getText;
+jQuery.isXMLDoc = isXML;
+jQuery.contains = contains;
+
+return;
+
+window.Sizzle = Sizzle;
+
+})();
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ slice = Array.prototype.slice;
+
+// Implement the identical functionality for filter and not
+var winnow = function( elements, qualifier, keep ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return !!qualifier.call( elem, i, elem ) === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+};
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var ret = this.pushStack( "", "find", selector ), length = 0;
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( var n = length; n < ret.length; n++ ) {
+ for ( var r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && jQuery.filter( selector, this ).length > 0;
+ },
+
+ closest: function( selectors, context ) {
+ if ( jQuery.isArray( selectors ) ) {
+ var ret = [], cur = this[0], match, matches = {}, selector;
+
+ if ( cur && selectors.length ) {
+ for ( var i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[selector] ) {
+ matches[selector] = jQuery.expr.match.POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[selector];
+
+ if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
+ ret.push({ selector: selector, elem: cur });
+ delete matches[selector];
+ }
+ }
+ cur = cur.parentNode;
+ }
+ }
+
+ return ret;
+ }
+
+ var pos = jQuery.expr.match.POS.test( selectors ) ?
+ jQuery( selectors, context || this.context ) : null;
+
+ return this.map(function( i, cur ) {
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
+ return cur;
+ }
+ cur = cur.parentNode;
+ }
+ return null;
+ });
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ if ( !elem || typeof elem === "string" ) {
+ return jQuery.inArray( this[0],
+ // If it receives a string, the selector is used
+ // If it receives nothing, the siblings are used
+ elem ? jQuery( elem ) : this.parent().children() );
+ }
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context || this.context ) :
+ jQuery.makeArray( selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, slice.call(arguments).join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [], cur = elem[dir];
+ while ( cur && cur.nodeType !== 9 && (until === undefined || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
+ rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&\w+;/,
+ fcloseTag = function( all, front, tag ) {
+ return rselfClosing.test( tag ) ?
+ all :
+ front + "></" + tag + ">";
+ },
+ wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ area: [ 1, "<map>", "</map>" ],
+ _default: [ 0, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ return self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.getText( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append(this);
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ return this.each(function() {
+ var self = jQuery( this ), contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ clone: function( events ) {
+ // Do the clone
+ var ret = this.map(function() {
+ if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
+ // IE copies events bound via attachEvent when
+ // using cloneNode. Calling detachEvent on the
+ // clone will also remove the events from the orignal
+ // In order to get around this, we use innerHTML.
+ // Unfortunately, this means some modifications to
+ // attributes in IE that are actually only stored
+ // as properties will not be copied (such as the
+ // the name attribute on an input).
+ var html = this.outerHTML, ownerDocument = this.ownerDocument;
+ if ( !html ) {
+ var div = ownerDocument.createElement("div");
+ div.appendChild( this.cloneNode(true) );
+ html = div.innerHTML;
+ }
+
+ return jQuery.clean([html.replace(rinlinejQuery, "")
+ .replace(rleadingWhitespace, "")], ownerDocument)[0];
+ } else {
+ return this.cloneNode(true);
+ }
+ });
+
+ // Copy the events from the original to the clone
+ if ( events === true ) {
+ cloneCopyEvent( this, ret );
+ cloneCopyEvent( this.find("*"), ret.find("*") );
+ }
+
+ // Return the cloned set
+ return ret;
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !/<script/i.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery(this), old = self.html();
+ self.empty().append(function(){
+ return value.call( this, i, old );
+ });
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( !jQuery.isFunction( value ) ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling, parent = this.parentNode;
+
+ jQuery(this).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, value = args[0], scripts = [];
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ return self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ // If we're in a fragment, just use that instead of building a new one
+ if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
+ results = { fragment: args[0].parentNode };
+ } else {
+ results = buildFragment( args, this, scripts );
+ }
+
+ first = results.fragment.firstChild;
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ results.cacheable || this.length > 1 || i > 0 ?
+ results.fragment.cloneNode(true) :
+ results.fragment
+ );
+ }
+ }
+
+ if ( scripts ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+
+ function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+ }
+ }
+});
+
+function cloneCopyEvent(orig, ret) {
+ var i = 0;
+
+ ret.each(function() {
+ if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
+ return;
+ }
+
+ var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var handler in events[ type ] ) {
+ jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+ }
+ }
+ }
+ });
+}
+
+function buildFragment( args, nodes, scripts ) {
+ var fragment, cacheable, cached, cacheresults, doc;
+
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
+ cacheable = true;
+ cacheresults = jQuery.fragments[ args[0] ];
+ if ( cacheresults ) {
+ if ( cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ cached = true;
+ }
+ }
+
+ if ( !fragment ) {
+ doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+}
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [], insert = jQuery( selector );
+
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+ ret = ret.concat( elems );
+ }
+ return this.pushStack( ret, name, insert.selector );
+ };
+});
+
+jQuery.each({
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
+ if ( !keepData && this.nodeType === 1 ) {
+ cleanData( this.getElementsByTagName("*") );
+ cleanData( [ this ] );
+ }
+
+ if ( this.parentNode ) {
+ this.parentNode.removeChild( this );
+ }
+ }
+ },
+
+ empty: function() {
+ // Remove element nodes and prevent memory leaks
+ if ( this.nodeType === 1 ) {
+ cleanData( this.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( this.firstChild ) {
+ this.removeChild( this.firstChild );
+ }
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function() {
+ return this.each( fn, arguments );
+ };
+});
+
+jQuery.extend({
+ clean: function( elems, context, fragment, scripts ) {
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [];
+
+ jQuery.each(elems, function( i, elem ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ return;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" && !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+
+ } else if ( typeof elem === "string" ) {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, fcloseTag);
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( var j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = jQuery.makeArray( div.childNodes );
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+
+ });
+
+ if ( fragment ) {
+ for ( var i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ }
+});
+
+function cleanData( elems ) {
+ for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
+ if ( !jQuery.noData[elem.nodeName.toLowerCase()] && (id = elem[expando]) ) {
+ delete jQuery.cache[ id ];
+ }
+ }
+}
+// exclude the following css properties to add px
+var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+ ralpha = /alpha\([^)]*\)/,
+ ropacity = /opacity=([^)]*)/,
+ rfloat = /float/i,
+ rdashAlpha = /-([a-z])/ig,
+ rupper = /([A-Z])/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+
+ cssShow = { position: "absolute", visibility: "hidden", display:"block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+
+ // cache check for defaultView.getComputedStyle
+ getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
+ // normalize float css property
+ styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn.css = function( name, value ) {
+ return access( this, name, value, true, function( elem, name, value ) {
+ if ( value === undefined ) {
+ return jQuery.curCSS( elem, name );
+ }
+
+ if ( typeof value === "number" && !rexclude.test(name) ) {
+ value += "px";
+ }
+
+ jQuery.style( elem, name, value );
+ });
+};
+
+jQuery.extend({
+ style: function( elem, name, value ) {
+ // don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // ignore negative width and height values #1599
+ if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
+ value = undefined;
+ }
+
+ var style = elem.style || elem, set = value !== undefined;
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name === "opacity" ) {
+ if ( set ) {
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // Set the alpha filter to set the opacity
+ var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
+ var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
+ style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
+ }
+
+ return style.filter && style.filter.indexOf("opacity=") >= 0 ?
+ (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
+ "";
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( rfloat.test( name ) ) {
+ name = styleFloat;
+ }
+
+ name = name.replace(rdashAlpha, fcamelCase);
+
+ if ( set ) {
+ style[ name ] = value;
+ }
+
+ return style[ name ];
+ },
+
+ css: function( elem, name, force, extra ) {
+ if ( name === "width" || name === "height" ) {
+ var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
+
+ function getWH() {
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
+
+ if ( extra === "border" ) {
+ return;
+ }
+
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
+ }
+
+ if ( extra === "margin" ) {
+ val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
+ } else {
+ val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
+ }
+ });
+ }
+
+ if ( elem.offsetWidth !== 0 ) {
+ getWH();
+ } else {
+ jQuery.swap( elem, props, getWH );
+ }
+
+ return Math.max(0, Math.round(val));
+ }
+
+ return jQuery.curCSS( elem, name, force );
+ },
+
+ curCSS: function( elem, name, force ) {
+ var ret, style = elem.style, filter;
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
+ ret = ropacity.test(elem.currentStyle.filter || "") ?
+ (parseFloat(RegExp.$1) / 100) + "" :
+ "";
+
+ return ret === "" ?
+ "1" :
+ ret;
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( rfloat.test( name ) ) {
+ name = styleFloat;
+ }
+
+ if ( !force && style && style[ name ] ) {
+ ret = style[ name ];
+
+ } else if ( getComputedStyle ) {
+
+ // Only "float" is needed here
+ if ( rfloat.test( name ) ) {
+ name = "float";
+ }
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ var defaultView = elem.ownerDocument.defaultView;
+
+ if ( !defaultView ) {
+ return null;
+ }
+
+ var computedStyle = defaultView.getComputedStyle( elem, null );
+
+ if ( computedStyle ) {
+ ret = computedStyle.getPropertyValue( name );
+ }
+
+ // We should always get a number back from opacity
+ if ( name === "opacity" && ret === "" ) {
+ ret = "1";
+ }
+
+ } else if ( elem.currentStyle ) {
+ var camelCase = name.replace(rdashAlpha, fcamelCase);
+
+ ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+ // Remember the original values
+ var left = style.left, rsLeft = elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret;
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( var name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth, height = elem.offsetHeight,
+ skip = elem.nodeName.toLowerCase() === "tr";
+
+ return width === 0 && height === 0 && !skip ?
+ true :
+ width > 0 && height > 0 && !skip ?
+ false :
+ jQuery.curCSS(elem, "display") === "none";
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+var jsc = now(),
+ rscript = /<script(.|\s)*?\/script>/gi,
+ rselectTextarea = /select|textarea/i,
+ rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
+ jsre = /=\?(&|$)/,
+ rquery = /\?/,
+ rts = /(\?|&)_=.*?(&|$)/,
+ rurl = /^(\w+:)?\/\/([^\/?#]+)/,
+ r20 = /%20/g;
+
+jQuery.fn.extend({
+ // Keep a copy of the old load
+ _load: jQuery.fn.load,
+
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" ) {
+ return this._load( url );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf(" ");
+ if ( off >= 0 ) {
+ var selector = url.slice(off, url.length);
+ url = url.slice(0, off);
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = null;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ context:this,
+ complete: function( res, status ) {
+ // If successful, inject the HTML into all the matched elements
+ if ( status === "success" || status === "notmodified" ) {
+ // See if a selector was specified
+ this.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div />")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(res.responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ res.responseText );
+ }
+
+ if ( callback ) {
+ this.each( callback, [res.responseText, status, res] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param(this.serializeArray());
+ },
+ serializeArray: function() {
+ return this.map(function() {
+ return this.elements ? jQuery.makeArray(this.elements) : this;
+ })
+ .filter(function() {
+ return this.name && !this.disabled &&
+ (this.checked || rselectTextarea.test(this.nodeName) ||
+ rinput.test(this.type));
+ })
+ .map(function( i, elem ) {
+ var val = jQuery(this).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray(val) ?
+ jQuery.map( val, function( val, i ) {
+ return { name: elem.name, value: val };
+ }) :
+ { name: elem.name, value: val };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
+ jQuery.fn[o] = function( f ) {
+ return this.bind(o, f);
+ };
+});
+
+jQuery.extend({
+
+ get: function( url, data, callback, type ) {
+ // shift arguments if data argument was omited
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = null;
+ }
+
+ return jQuery.ajax({
+ type: "GET",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get(url, null, callback, "script");
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get(url, data, callback, "json");
+ },
+
+ post: function( url, data, callback, type ) {
+ // shift arguments if data argument was omited
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = {};
+ }
+
+ return jQuery.ajax({
+ type: "POST",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ ajaxSetup: function( settings ) {
+ jQuery.extend( jQuery.ajaxSettings, settings );
+ },
+
+ ajaxSettings: {
+ url: location.href,
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ username: null,
+ password: null,
+ traditional: false,
+ */
+ // Create the request object; Microsoft failed to properly
+ // implement the XMLHttpRequest in IE7 (can't request local files),
+ // so we use the ActiveXObject when it is available
+ // This function can be overriden by calling jQuery.ajaxSetup
+ xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
+ function() {
+ return new window.XMLHttpRequest();
+ } :
+ function() {
+ try {
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
+ } catch(e) {}
+ },
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ script: "text/javascript, application/javascript",
+ json: "application/json, text/javascript",
+ text: "text/plain",
+ _default: "*/*"
+ }
+ },
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajax: function( origSettings ) {
+ var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
+
+ var jsonp, status, data,
+ callbackContext = s.context || s,
+ type = s.type.toUpperCase();
+
+ // convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Handle JSONP Parameter Callbacks
+ if ( s.dataType === "jsonp" ) {
+ if ( type === "GET" ) {
+ if ( !jsre.test( s.url ) ) {
+ s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+ }
+ } else if ( !s.data || !jsre.test(s.data) ) {
+ s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+ }
+ s.dataType = "json";
+ }
+
+ // Build temporary JSONP function
+ if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
+ jsonp = s.jsonpCallback || ("jsonp" + jsc++);
+
+ // Replace the =? sequence both in the query string and the data
+ if ( s.data ) {
+ s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
+ }
+
+ s.url = s.url.replace(jsre, "=" + jsonp + "$1");
+
+ // We need to make sure
+ // that a JSONP style response is executed properly
+ s.dataType = "script";
+
+ // Handle JSONP-style loading
+ window[ jsonp ] = window[ jsonp ] || function( tmp ) {
+ data = tmp;
+ success();
+ complete();
+ // Garbage collect
+ window[ jsonp ] = undefined;
+
+ try {
+ delete window[ jsonp ];
+ } catch(e) {}
+
+ if ( head ) {
+ head.removeChild( script );
+ }
+ };
+ }
+
+ if ( s.dataType === "script" && s.cache === null ) {
+ s.cache = false;
+ }
+
+ if ( s.cache === false && type === "GET" ) {
+ var ts = now();
+
+ // try replacing _= if it is there
+ var ret = s.url.replace(rts, "$1_=" + ts + "$2");
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
+ }
+
+ // If data is available, append data to url for get requests
+ if ( s.data && type === "GET" ) {
+ s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
+ }
+
+ // Watch for a new set of requests
+ if ( s.global && ! jQuery.active++ ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // Matches an absolute URL, and saves the domain
+ var parts = rurl.exec( s.url ),
+ remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
+
+ // If we're requesting a remote document
+ // and trying to load JSON or Script with a GET
+ if ( s.dataType === "script" && type === "GET" && remote ) {
+ var head = document.getElementsByTagName("head")[0] || document.documentElement;
+ var script = document.createElement("script");
+ script.src = s.url;
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ // Handle Script loading
+ if ( !jsonp ) {
+ var done = false;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function() {
+ if ( !done && (!this.readyState ||
+ this.readyState === "loaded" || this.readyState === "complete") ) {
+ done = true;
+ success();
+ complete();
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+ }
+ };
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+
+ // We handle everything using the script element injection
+ return undefined;
+ }
+
+ var requestDone = false;
+
+ // Create the request object
+ var xhr = s.xhr();
+
+ if ( !xhr ) {
+ return;
+ }
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open(type, s.url, s.async, s.username, s.password);
+ } else {
+ xhr.open(type, s.url, s.async);
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ // Set the correct header, if data is being sent
+ if ( s.data || origSettings && origSettings.contentType ) {
+ xhr.setRequestHeader("Content-Type", s.contentType);
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[s.url] ) {
+ xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
+ }
+
+ if ( jQuery.etag[s.url] ) {
+ xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
+ }
+ }
+
+ // Set header so the called script knows that it's an XMLHttpRequest
+ // Only send the header if it's not a remote XHR
+ if ( !remote ) {
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
+ s.accepts[ s.dataType ] + ", */*" :
+ s.accepts._default );
+ } catch(e) {}
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+
+ // close opended socket
+ xhr.abort();
+ return false;
+ }
+
+ if ( s.global ) {
+ trigger("ajaxSend", [xhr, s]);
+ }
+
+ // Wait for a response to come back
+ var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
+ // The request was aborted
+ if ( !xhr || xhr.readyState === 0 ) {
+ // Opera doesn't call onreadystatechange before this point
+ // so we simulate the call
+ if ( !requestDone ) {
+ complete();
+ }
+
+ requestDone = true;
+ if ( xhr ) {
+ xhr.onreadystatechange = jQuery.noop;
+ }
+
+ // The transfer is complete and the data is available, or the request timed out
+ } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
+ requestDone = true;
+ xhr.onreadystatechange = jQuery.noop;
+
+ status = isTimeout === "timeout" ?
+ "timeout" :
+ !jQuery.httpSuccess( xhr ) ?
+ "error" :
+ s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
+ "notmodified" :
+ "success";
+
+ if ( status === "success" ) {
+ // Watch for, and catch, XML document parse errors
+ try {
+ // process the data (runs the xml through httpData regardless of callback)
+ data = jQuery.httpData( xhr, s.dataType, s );
+ } catch(e) {
+ status = "parsererror";
+ }
+ }
+
+ // Make sure that the request was successful or notmodified
+ if ( status === "success" || status === "notmodified" ) {
+ // JSONP handles its own success callback
+ if ( !jsonp ) {
+ success();
+ }
+ } else {
+ jQuery.handleError(s, xhr, status);
+ }
+
+ // Fire the complete handlers
+ complete();
+
+ if ( isTimeout === "timeout" ) {
+ xhr.abort();
+ }
+
+ // Stop memory leaks
+ if ( s.async ) {
+ xhr = null;
+ }
+ }
+ };
+
+ // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
+ // Opera doesn't fire onreadystatechange at all on abort
+ try {
+ var oldAbort = xhr.abort;
+ xhr.abort = function() {
+ if ( xhr ) {
+ oldAbort.call( xhr );
+ if ( xhr ) {
+ xhr.readyState = 0;
+ }
+ }
+
+ onreadystatechange();
+ };
+ } catch(e) { }
+
+ // Timeout checker
+ if ( s.async && s.timeout > 0 ) {
+ setTimeout(function() {
+ // Check to see if the request is still happening
+ if ( xhr && !requestDone ) {
+ onreadystatechange( "timeout" );
+ }
+ }, s.timeout);
+ }
+
+ // Send the data
+ try {
+ xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
+ } catch(e) {
+ jQuery.handleError(s, xhr, null, e);
+ // Fire the complete handlers
+ complete();
+ }
+
+ // firefox 1.5 doesn't fire statechange for sync requests
+ if ( !s.async ) {
+ onreadystatechange();
+ }
+
+ function success() {
+ // If a local callback was specified, fire it and pass it the data
+ if ( s.success ) {
+ s.success.call( callbackContext, data, status, xhr );
+ }
+
+ // Fire the global callback
+ if ( s.global ) {
+ trigger( "ajaxSuccess", [xhr, s] );
+ }
+ }
+
+ function complete() {
+ // Process result
+ if ( s.complete ) {
+ s.complete.call( callbackContext, xhr, status);
+ }
+
+ // The request was completed
+ if ( s.global ) {
+ trigger( "ajaxComplete", [xhr, s] );
+ }
+
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+
+ function trigger(type, args) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
+ }
+
+ // return XMLHttpRequest to allow aborting the request etc.
+ return xhr;
+ },
+
+ handleError: function( s, xhr, status, e ) {
+ // If a local callback was specified, fire it
+ if ( s.error ) {
+ s.error.call( s.context || window, xhr, status, e );
+ }
+
+ // Fire the global callback
+ if ( s.global ) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
+ }
+ },
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Determines if an XMLHttpRequest was successful or not
+ httpSuccess: function( xhr ) {
+ try {
+ // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
+ return !xhr.status && location.protocol === "file:" ||
+ // Opera returns 0 when status is 304
+ ( xhr.status >= 200 && xhr.status < 300 ) ||
+ xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
+ } catch(e) {}
+
+ return false;
+ },
+
+ // Determines if an XMLHttpRequest returns NotModified
+ httpNotModified: function( xhr, url ) {
+ var lastModified = xhr.getResponseHeader("Last-Modified"),
+ etag = xhr.getResponseHeader("Etag");
+
+ if ( lastModified ) {
+ jQuery.lastModified[url] = lastModified;
+ }
+
+ if ( etag ) {
+ jQuery.etag[url] = etag;
+ }
+
+ // Opera returns 0 when status is 304
+ return xhr.status === 304 || xhr.status === 0;
+ },
+
+ httpData: function( xhr, type, s ) {
+ var ct = xhr.getResponseHeader("content-type") || "",
+ xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
+ data = xml ? xhr.responseXML : xhr.responseText;
+
+ if ( xml && data.documentElement.nodeName === "parsererror" ) {
+ throw "parsererror";
+ }
+
+ // Allow a pre-filtering function to sanitize the response
+ // s is checked to keep backwards compatibility
+ if ( s && s.dataFilter ) {
+ data = s.dataFilter( data, type );
+ }
+
+ // The filter can actually parse the response
+ if ( typeof data === "string" ) {
+ // Get the JavaScript object, if JSON is used.
+ if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if (/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
+ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
+ .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
+
+ // Try to use the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ data = window.JSON.parse( data );
+
+ } else {
+ data = (new Function("return " + data))();
+ }
+
+ } else {
+ throw "Invalid JSON: " + data;
+ }
+
+ // If the type is "script", eval it in global context
+ } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
+ jQuery.globalEval( data );
+ }
+ }
+
+ return data;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+
+ var s = [];
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ function add( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction(value) ? value() : value;
+ s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray(a) || a.jquery ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ jQuery.each( a, function buildParams( prefix, obj ) {
+
+ if ( jQuery.isArray(obj) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ jQuery.each( obj, function( k, v ) {
+ buildParams( prefix + "[" + k + "]", v );
+ });
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+ });
+ }
+
+ // Return the resulting serialization
+ return s.join("&").replace(r20, "+");
+ }
+
+});
+var elemdisplay = {},
+ rfxtypes = /toggle|show|hide/,
+ rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ];
+
+jQuery.fn.extend({
+ show: function( speed, callback ) {
+ if ( speed != null ) {
+ return this.animate( genFx("show", 3), speed, callback);
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var old = jQuery.data(this[i], "olddisplay");
+
+ this[i].style.display = old || "";
+
+ if ( jQuery.css(this[i], "display") === "none" ) {
+ var nodeName = this[i].nodeName, display;
+
+ if ( elemdisplay[ nodeName ] ) {
+ display = elemdisplay[ nodeName ];
+
+ } else {
+ var elem = jQuery("<" + nodeName + " />").appendTo("body");
+
+ display = elem.css("display");
+
+ if ( display === "none" ) {
+ display = "block";
+ }
+
+ elem.remove();
+
+ elemdisplay[ nodeName ] = display;
+ }
+
+ jQuery.data(this[i], "olddisplay", display);
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var j = 0, k = this.length; j < k; j++ ) {
+ this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, callback ) {
+ if ( speed != null ) {
+ return this.animate( genFx("hide", 3), speed, callback);
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var old = jQuery.data(this[i], "olddisplay");
+ if ( !old && old !== "none" ) {
+ jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var j = 0, k = this.length; j < k; j++ ) {
+ this[j].style.display = "none";
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2 ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete );
+ }
+
+ return this[ optall.queue === false ? "each" : "queue" ](function() {
+ var opt = jQuery.extend({}, optall), p,
+ hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
+ self = this;
+
+ for ( p in prop ) {
+ var name = p.replace(rdashAlpha, fcamelCase);
+
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ p = name;
+ }
+
+ if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
+ return opt.complete.call(this);
+ }
+
+ if ( ( p === "height" || p === "width" ) && this.style ) {
+ // Store display property
+ opt.display = jQuery.css(this, "display");
+
+ // Make sure that nothing sneaks out
+ opt.overflow = this.style.overflow;
+ }
+
+ if ( jQuery.isArray( prop[p] ) ) {
+ // Create (if needed) and add to specialEasing
+ (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
+ prop[p] = prop[p][0];
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ opt.curAnim = jQuery.extend({}, prop);
+
+ jQuery.each( prop, function( name, val ) {
+ var e = new jQuery.fx( self, opt, name );
+
+ if ( rfxtypes.test(val) ) {
+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+
+ } else {
+ var parts = rfxnum.exec(val),
+ start = e.cur(true) || 0;
+
+ if ( parts ) {
+ var end = parseFloat( parts[2] ),
+ unit = parts[3] || "px";
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ self.style[ name ] = (end || 1) + unit;
+ start = ((end || 1) / e.cur(true)) * start;
+ self.style[ name ] = start + unit;
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ });
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function( clearQueue, gotoEnd ) {
+ var timers = jQuery.timers;
+
+ if ( clearQueue ) {
+ this.queue([]);
+ }
+
+ this.each(function() {
+ // go in reverse order so anything added to the queue during the loop is ignored
+ for ( var i = timers.length - 1; i >= 0; i-- ) {
+ if ( timers[i].elem === this ) {
+ if (gotoEnd) {
+ // force the next step to be the last
+ timers[i](true);
+ }
+
+ timers.splice(i, 1);
+ }
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if ( !gotoEnd ) {
+ this.dequeue();
+ }
+
+ return this;
+ }
+
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, callback ) {
+ return this.animate( props, speed, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? speed : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function() {
+ if ( opt.queue !== false ) {
+ jQuery(this).dequeue();
+ }
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ if ( !options.orig ) {
+ options.orig = {};
+ }
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+ // Set display property to block for height/width animations
+ if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
+ this.elem.style.display = "block";
+ }
+ },
+
+ // Get the current size
+ cur: function( force ) {
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var r = parseFloat(jQuery.css(this.elem, this.prop, force));
+ return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ this.startTime = now();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || "px";
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ var self = this;
+ function t( gotoEnd ) {
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval(jQuery.fx.tick, 13);
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var t = now(), done = true;
+
+ if ( gotoEnd || t >= this.options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ this.options.curAnim[ this.prop ] = true;
+
+ for ( var i in this.options.curAnim ) {
+ if ( this.options.curAnim[i] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ if ( this.options.display != null ) {
+ // Reset the overflow
+ this.elem.style.overflow = this.options.overflow;
+
+ // Reset the display
+ var old = jQuery.data(this.elem, "olddisplay");
+ this.elem.style.display = old ? old : this.options.display;
+
+ if ( jQuery.css(this.elem, "display") === "none" ) {
+ this.elem.style.display = "block";
+ }
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( this.options.hide ) {
+ jQuery(this.elem).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( this.options.hide || this.options.show ) {
+ for ( var p in this.options.curAnim ) {
+ jQuery.style(this.elem, p, this.options.orig[p]);
+ }
+ }
+
+ // Execute the complete function
+ this.options.complete.call( this.elem );
+ }
+
+ return false;
+
+ } else {
+ var n = t - this.startTime;
+ this.state = n / this.options.duration;
+
+ // Perform the easing function, defaults to swing
+ var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
+ var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
+ this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
+ this.now = this.start + ((this.end - this.start) * this.pos);
+
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ var timers = jQuery.timers;
+
+ for ( var i = 0; i < timers.length; i++ ) {
+ if ( !timers[i]() ) {
+ timers.splice(i--, 1);
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style(fx.elem, "opacity", fx.now);
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ jQuery.offset.initialize();
+
+ var offsetParent = elem.offsetParent, prevOffsetParent = elem,
+ doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
+ body = doc.body, defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop, left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+ initialize: function() {
+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
+ html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
+
+ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+ container.innerHTML = html;
+ body.insertBefore( container, body.firstChild );
+ innerDiv = container.firstChild;
+ checkDiv = innerDiv.firstChild;
+ td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
+ // safari subtracts parent border width here which is 5px
+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+ checkDiv.style.position = checkDiv.style.top = "";
+
+ innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+ body.removeChild( container );
+ body = container = innerDiv = checkDiv = table = td = null;
+ jQuery.offset.initialize = jQuery.noop;
+ },
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop, left = body.offsetLeft;
+
+ jQuery.offset.initialize();
+
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0;
+ left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ // set position first, in-case top/left are set even on static elem
+ if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
+ elem.style.position = "relative";
+ }
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0,
+ curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ var props = {
+ top: (options.top - curOffset.top) + curTop,
+ left: (options.left - curOffset.left) + curLeft
+ };
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0;
+ offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0;
+ parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function(val) {
+ var elem = this[0], win;
+
+ if ( !elem ) {
+ return null;
+ }
+
+ if ( val !== undefined ) {
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery(win).scrollLeft(),
+ i ? val : jQuery(win).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ } else {
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+ };
+});
+
+function getWindow( elem ) {
+ return ("scrollTo" in elem && elem.document) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn["inner" + name] = function() {
+ return this[0] ?
+ jQuery.css( this[0], type, false, "padding" ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn["outer" + name] = function( margin ) {
+ return this[0] ?
+ jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
+ elem.document.body[ "client" + name ] :
+
+ // Get document width or height
+ (elem.nodeType === 9) ? // is it a document
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ ) :
+
+ // Get or set width or height on the element
+ size === undefined ?
+ // Get width or height on the element
+ jQuery.css( elem, type ) :
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ this.css( type, typeof size === "string" ? size : size + "px" );
+ };
+
+});
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+
+})(window);
diff --git a/examples/lessons/6_English_yesNoQuestions/js/karma.js b/examples/lessons/6_English_yesNoQuestions/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_English_yesNoQuestions/js/lesson.js b/examples/lessons/6_English_yesNoQuestions/js/lesson.js
new file mode 100755
index 0000000..a842b3d
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/js/lesson.js
@@ -0,0 +1,298 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.ogg'},
+ {'name':'incorrect','file':'incorrect.ogg'}
+ ]});
+
+ k.ready(function(){
+ var i,j,flag;
+ var TOTAL_QUES = 8;
+ var TOTAL_LEVEL = 3;
+ var currentDragObject;
+ var randPositions = [];
+ var randImages = [];
+ var randOptions = [];
+ var totalCounter;
+ var correctCounter;
+ var currentQuestion;
+ var currentDragObject;
+ var arrangedAns = [];
+ var checked;
+ var sectionNum; //store the current tab num
+ var flag_checked;
+ var currentQues; //store the current Animal name
+ var currentAnimal; //store the current Animal Image name
+ var correctQuest; //store 1 if the question and image is same
+
+ var animals = new Array('tiger','elephant','jackel','bear','rhino','monkey','turtle','snake',
+ 'duck','cock','pig','cow','goat','horse','sheep','rabbit',
+ 'parrot','mynah','crow','sparrow','egret','pigeon','owl','eagle'
+ );
+ var answersOpts = new Array('Yes','No','it','is',"isn't");
+ var tabs = new Array('wild','domestic','bird');
+ var correctYes = new Array('Yes','it','is');
+ var correctNo = new Array('No','it',"isn't");
+
+ var scoreboard = $('#score_box').scoreboard({'layout':'horizontal',
+ 'winningScore': 8});
+ /*scoreboard.bind('winGame',function(){ //needs total score counter to be checked problem
+ $('#gameOver').show();
+ $('#dot').hide();
+ $('#questionSection').hide();
+ $('#gameOver').append('Game Over !!!');
+ $('#gameOver').append('<div id="gameOverInfo">You got <span class="specialText">'+correctCounter+
+ '</span> correct out of <span class="specialText">'+totalCounter+'</span> questions .</div>');
+
+ });
+ */
+
+ var genRandOpts=function (){
+ randOptions[0] = k.rand(0,4);
+ for(i=1; i<5; i++){
+ do{
+ flag = 0;
+ randOptions[i] = k.rand(0,4);
+ for(j=0; j<i; j++){
+ if(randOptions[i] === randOptions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+
+ };
+ var genRandImages=function (){
+ randImages[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randImages[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randImages[i] === randImages[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+ var genRandPosition=function (){
+ randPositions[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+ var display_game_over = function(){
+ $('#dot').hide();
+ $('#gameOver').show();
+ $('#questionSection').html('').append('<div id="gameOver"></div>');
+ $('#gameOver').append('Game Over !!!');
+ $('#gameOver').append('<div id="gameOverInfo">You got <span class="specialText">'+correctCounter+
+ '</span> correct out of <span class="specialText">'+totalCounter+'</span> questions .</div>');
+
+ };
+ var display_control = function(){
+ if(checked === 1){
+ next_questions();
+ }
+ };
+ var delay_correctShow = function(){
+ document.delayForm.delayval.value = 1;
+ $('#checkAnswer').hide();
+ display_control();
+ }
+
+ var check_answers = function(){
+ $('#checkAnswer').show();
+ var correct = 0;
+ var correctCheck = 0;
+ if(correctQuest === 1){
+ for(var i = 0 ; i< 3; i++){
+ if(arrangedAns[i] === correctYes[i]){
+ correct++;
+ }
+ }
+ if(correct === 3){
+ correctCheck = 1;
+ }
+ }
+ else{
+ for(var i = 0 ; i< 3; i++){
+ if(arrangedAns[i] === correctNo[i]){
+ correct++;
+ }
+ }
+ if(correct === 3){
+ correctCheck = 1;
+ }
+ }
+ if(correctCheck === 1){
+ if(flag_checked === 0){
+ scoreboard.scoreboard('inc');
+ correctCounter++;
+ }
+ k.audio.correct.play();
+ $('#checkAnswer').html('<img src="assets/image/correct.png" />');
+ checked = 1;
+ totalCounter++;
+ scoreboard.scoreboard('incTotal');
+ }
+ else{
+ k.audio.incorrect.play();
+ $('#checkAnswer').html('<img src="assets/image/incorrect.png" />');
+ checked = 0;
+ flag_checked = 1;
+ }
+ t=setTimeout(function(){delay_correctShow();},1000);
+ };
+
+ var assignTabs = function (tabId){
+ $('#tabs').append('<div id="tabs'+tabId+'" class="tabBox"></div>');
+ var tabImgCss = {
+ 'width': '179px',
+ 'height': '50px',
+ 'background-image': 'url("assets/image/'+tabs[tabId]+'.png")',
+ 'background-repeat': 'no-repeat'
+ };
+ $('#tabs'+tabId).css(tabImgCss);
+ $('#tabs'+tabId).click(function(){
+ for(j = 0; j<TOTAL_LEVEL; j++){
+ if(tabId === j){
+ $('#tabs'+j).addClass('tabSelected');
+ }
+ else{
+ $('#tabs'+j).removeClass('tabSelected');
+ }
+ }
+ sectionNum = tabId;
+ game();
+ });
+ };
+
+ var assignAns = function (ansId){
+ $('#answerSection').append('<div id="drop'+ansId+'" class="dropObjects"></div>');
+ var dropObjCss = {
+ 'width':'125px','height': '30px','margin':'1.7em 0.5em 0.2em 0.5em' ,
+ 'border-bottom': '2px solid black','float':'left'
+ };
+ $('.dropObjects').css(dropObjCss);
+ };
+
+ var assignDragAns = function (optId){
+ $('#dragAnswers').append('<div id="drag'+optId+'" class="dragObjects">'+answersOpts[optId]+'</div>');
+ var dragObjCss = {
+ 'float': 'left','cursor': 'move',
+ 'height':'30px','padding': '0px 1em',
+ 'font':'20px/25px bold Arial,Verdana,Geneva,Helvetica'
+ };
+ $('.dragObjects').css(dragObjCss);
+ };
+
+ var next_questions = function(){
+ if(totalCounter === TOTAL_QUES){
+ display_game_over();
+ }
+ else{
+ currentQuestion = totalCounter;
+ flag_checked = 0;
+ genRandOpts();
+ for(i=0; i<3; i++){
+ arrangedAns[i] = 0;
+ }
+ var randImage = randImages[currentQuestion]+(sectionNum*TOTAL_QUES);
+ var randNum = randPositions[currentQuestion]+(sectionNum*TOTAL_QUES);
+ currentQues = animals[randNum];
+ currentAnimal = animals[randImage];
+ $('#questionSection').html('');
+ $('#imgAnimals').html('<img class="imgAnim" src = "assets/image/'+currentAnimal+'.png" />');
+ $('#questionSection').append('<div id="ques'+currentQuestion+'" class="questions"></div>');
+ $('#ques'+currentQuestion).append(totalCounter+1+'.').append(' Is this ');
+
+ if(currentQues[0] === 'a' || currentQues[0] === 'e' ||currentQues[0] === 'i' ||currentQues[0] === 'o' ||currentQues[0] === 'u'){
+ $('#ques'+currentQuestion).append('an ');
+ }
+ else{
+ $('#ques'+currentQuestion).append('a ');
+ }
+ $('#ques'+currentQuestion).append(currentQues+' ?');
+ if(currentAnimal === currentQues){
+ correctQuest = 1;
+ }
+ else{
+ correctQuest = 0;
+ }
+ $('#questionSection').append('<div id="answerSection"></div>');
+ for(i = 0; i<3 ;i++){
+ assignAns(i);
+ }
+ $('#answerSection').append('<div id="comma"></div>');
+ $('#section').append('<div id="dot"></div>');
+ $('#questionSection').append('<div id="dragAnswers"></div>');
+ var randOption;
+ for(i = 0; i<5 ;i++){
+ randOption = randOptions[i];
+ assignDragAns(randOption);
+ }
+ drag_drop();
+ }
+
+ };
+
+ function game(){
+ scoreboard.scoreboard('reset');
+ $('#linkNext').hide();
+ $('#gameOver').hide();
+ correctCounter = 0;
+ totalCounter = 0;
+ genRandPosition();
+ genRandImages();
+ $('#section').html('');
+ $('#tabs1').removeClass('tabSelected');
+ $('#tabs2').removeClass('tabSelected');
+ $('#tabs'+sectionNum).addClass('tabSelected');
+ $('#section').append('<div id="imgAnimals"></div>');
+ $('#section').append('<div id="questionSection"></div>');
+ next_questions();
+ }
+ for(i = 0; i< TOTAL_LEVEL; i++){
+ assignTabs(i);
+ }
+ sectionNum = 0;
+
+ $('#linkCheck').click(function(){
+ check_answers();
+ });
+ $('#linkStart').click(function(){
+
+ sectionNum = 0;
+ game();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ game();
+ });
+
+ function drag_drop(){
+ $('.dragObjects').draggable({ containment: '#content'});
+ $('.dragObjects').bind('dragstart', function(event, ui) {
+ currentDragObject = event.target.id;
+ });
+
+ $(".dropObjects").droppable({ tolerence: 'intersect' ,hoverClass: 'drophover' });
+ $('.dropObjects').bind('drop', function(event, ui) {
+ var currentDropObject = event.target.id;
+ var droppedWord = parseInt(currentDropObject.substring(4));
+ arrangedAns[droppedWord] = $('#'+currentDragObject).text();
+ });
+ }
+
+
+ }); //end of k.ready
+}); //end of document.ready \ No newline at end of file
diff --git a/examples/lessons/6_English_yesNoQuestions/js/ui.core.js b/examples/lessons/6_English_yesNoQuestions/js/ui.core.js
new file mode 100755
index 0000000..5493e0a
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/js/ui.core.js
@@ -0,0 +1,519 @@
+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+;jQuery.ui || (function($) {
+
+var _remove = $.fn.remove,
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+
+//Helper functions and ui object
+$.ui = {
+ version: "1.7.2",
+
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function(module, option, set) {
+ var proto = $.ui[module].prototype;
+ for(var i in set) {
+ proto.plugins[i] = proto.plugins[i] || [];
+ proto.plugins[i].push([option, set[i]]);
+ }
+ },
+ call: function(instance, name, args) {
+ var set = instance.plugins[name];
+ if(!set || !instance.element[0].parentNode) { return; }
+
+ for (var i = 0; i < set.length; i++) {
+ if (instance.options[set[i][0]]) {
+ set[i][1].apply(instance.element, args);
+ }
+ }
+ }
+ },
+
+ contains: function(a, b) {
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
+ },
+
+ hasScroll: function(el, a) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ($(el).css('overflow') == 'hidden') { return false; }
+
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
+ has = false;
+
+ if (el[scroll] > 0) { return true; }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[scroll] = 1;
+ has = (el[scroll] > 0);
+ el[scroll] = 0;
+ return has;
+ },
+
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
+ },
+
+ isOver: function(y, x, top, left, height, width) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+ },
+
+ keyCode: {
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+};
+
+// WAI-ARIA normalization
+if (isFF2) {
+ var attr = $.attr,
+ removeAttr = $.fn.removeAttr,
+ ariaNS = "http://www.w3.org/2005/07/aaa",
+ ariaState = /^aria-/,
+ ariaRole = /^wairole:/;
+
+ $.attr = function(elem, name, value) {
+ var set = value !== undefined;
+
+ return (name == 'role'
+ ? (set
+ ? attr.call(this, elem, name, "wairole:" + value)
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
+ : (ariaState.test(name)
+ ? (set
+ ? elem.setAttributeNS(ariaNS,
+ name.replace(ariaState, "aaa:"), value)
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
+ : attr.apply(this, arguments)));
+ };
+
+ $.fn.removeAttr = function(name) {
+ return (ariaState.test(name)
+ ? this.each(function() {
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
+ }) : removeAttr.call(this, name));
+ };
+}
+
+//jQuery plugins
+$.fn.extend({
+ remove: function() {
+ // Safari has a native remove event which actually removes DOM elements,
+ // so we have to use triggerHandler instead of trigger (#3037).
+ $("*", this).add(this).each(function() {
+ $(this).triggerHandler("remove");
+ });
+ return _remove.apply(this, arguments );
+ },
+
+ enableSelection: function() {
+ return this
+ .attr('unselectable', 'off')
+ .css('MozUserSelect', '')
+ .unbind('selectstart.ui');
+ },
+
+ disableSelection: function() {
+ return this
+ .attr('unselectable', 'on')
+ .css('MozUserSelect', 'none')
+ .bind('selectstart.ui', function() { return false; });
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ }
+});
+
+
+//Additional selectors
+$.extend($.expr[':'], {
+ data: function(elem, i, match) {
+ return !!$.data(elem, match[3]);
+ },
+
+ focusable: function(element) {
+ var nodeName = element.nodeName.toLowerCase(),
+ tabIndex = $.attr(element, 'tabindex');
+ return (/input|select|textarea|button|object/.test(nodeName)
+ ? !element.disabled
+ : 'a' == nodeName || 'area' == nodeName
+ ? element.href || !isNaN(tabIndex)
+ : !isNaN(tabIndex))
+ // the element and all of its ancestors must be visible
+ // the browser may report that the area is hidden
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
+ },
+
+ tabbable: function(element) {
+ var tabIndex = $.attr(element, 'tabindex');
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
+ }
+});
+
+
+// $.widget is a factory to create jQuery plugins
+// taking some boilerplate code out of the plugin code
+function getter(namespace, plugin, method, args) {
+ function getMethods(type) {
+ var methods = $[namespace][plugin][type] || [];
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
+ }
+
+ var methods = getMethods('getter');
+ if (args.length == 1 && typeof args[0] == 'string') {
+ methods = methods.concat(getMethods('getterSetter'));
+ }
+ return ($.inArray(method, methods) != -1);
+}
+
+$.widget = function(name, prototype) {
+ var namespace = name.split(".")[0];
+ name = name.split(".")[1];
+
+ // create plugin method
+ $.fn[name] = function(options) {
+ var isMethodCall = (typeof options == 'string'),
+ args = Array.prototype.slice.call(arguments, 1);
+
+ // prevent calls to internal methods
+ if (isMethodCall && options.substring(0, 1) == '_') {
+ return this;
+ }
+
+ // handle getter methods
+ if (isMethodCall && getter(namespace, name, options, args)) {
+ var instance = $.data(this[0], name);
+ return (instance ? instance[options].apply(instance, args)
+ : undefined);
+ }
+
+ // handle initialization and non-getter methods
+ return this.each(function() {
+ var instance = $.data(this, name);
+
+ // constructor
+ (!instance && !isMethodCall &&
+ $.data(this, name, new $[namespace][name](this, options))._init());
+
+ // method call
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
+ instance[options].apply(instance, args));
+ });
+ };
+
+ // create widget constructor
+ $[namespace] = $[namespace] || {};
+ $[namespace][name] = function(element, options) {
+ var self = this;
+
+ this.namespace = namespace;
+ this.widgetName = name;
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
+ this.widgetBaseClass = namespace + '-' + name;
+
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
+ this.element = $(element)
+ .bind('setData.' + name, function(event, key, value) {
+ if (event.target == element) {
+ return self._setData(key, value);
+ }
+ })
+ .bind('getData.' + name, function(event, key) {
+ if (event.target == element) {
+ return self._getData(key);
+ }
+ })
+ .bind('remove', function() {
+ return self.destroy();
+ });
+ };
+
+ // add widget prototype
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
+
+ // TODO: merge getter and getterSetter properties from widget prototype
+ // and plugin prototype
+ $[namespace][name].getterSetter = 'option';
+};
+
+$.widget.prototype = {
+ _init: function() {},
+ destroy: function() {
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
+ },
+
+ option: function(key, value) {
+ var options = key,
+ self = this;
+
+ if (typeof key == "string") {
+ if (value === undefined) {
+ return this._getData(key);
+ }
+ options = {};
+ options[key] = value;
+ }
+
+ $.each(options, function(key, value) {
+ self._setData(key, value);
+ });
+ },
+ _getData: function(key) {
+ return this.options[key];
+ },
+ _setData: function(key, value) {
+ this.options[key] = value;
+
+ if (key == 'disabled') {
+ this.element
+ [value ? 'addClass' : 'removeClass'](
+ this.widgetBaseClass + '-disabled' + ' ' +
+ this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
+ }
+ },
+
+ enable: function() {
+ this._setData('disabled', false);
+ },
+ disable: function() {
+ this._setData('disabled', true);
+ },
+
+ _trigger: function(type, event, data) {
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = $.Event(event);
+ event.type = eventName;
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if (event.originalEvent) {
+ for (var i = $.event.props.length, prop; i;) {
+ prop = $.event.props[--i];
+ event[prop] = event.originalEvent[prop];
+ }
+ }
+
+ this.element.trigger(event, data);
+
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
+ }
+};
+
+$.widget.defaults = {
+ disabled: false
+};
+
+
+/** Mouse Interaction Plugin **/
+
+$.ui.mouse = {
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ // Prevent text selection in IE
+ if ($.browser.msie) {
+ this._mouseUnselectable = this.element.attr('unselectable');
+ this.element.attr('unselectable', 'on');
+ }
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+
+ // Restore text selection in IE
+ ($.browser.msie
+ && this.element.attr('unselectable', this._mouseUnselectable));
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ // TODO: figure out why we have to use originalEvent
+ event.originalEvent = event.originalEvent || {};
+ if (event.originalEvent.mouseHandled) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ // preventDefault() is used to prevent the selection of text here -
+ // however, in Safari, this causes select boxes not to be selectable
+ // anymore, so this fix is needed
+ ($.browser.safari || event.preventDefault());
+
+ event.originalEvent.mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+};
+
+$.ui.mouse.defaults = {
+ cancel: null,
+ distance: 1,
+ delay: 0
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_English_yesNoQuestions/js/ui.draggable.js b/examples/lessons/6_English_yesNoQuestions/js/ui.draggable.js
new file mode 100755
index 0000000..0402f0e
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/js/ui.draggable.js
@@ -0,0 +1,766 @@
+/*
+ * jQuery UI Draggable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * ui.core.js
+ */
+(function($) {
+
+$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
+
+ _init: function() {
+
+ if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
+ this.element[0].style.position = 'relative';
+
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
+
+ this._mouseInit();
+
+ },
+
+ destroy: function() {
+ if(!this.element.data('draggable')) return;
+ this.element
+ .removeData("draggable")
+ .unbind(".draggable")
+ .removeClass("ui-draggable"
+ + " ui-draggable-dragging"
+ + " ui-draggable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+
+ var o = this.options;
+
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
+ return false;
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle)
+ return false;
+
+ return true;
+
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if($.ui.ddmanager)
+ $.ui.ddmanager.current = this;
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css("position");
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.element.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
+ if(o.cursorAt)
+ this._adjustOffsetFromHelper(o.cursorAt);
+
+ //Set a containment if given in the options
+ if(o.containment)
+ this._setContainment();
+
+ //Call plugins and callbacks
+ this._trigger("start", event);
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(this, event);
+
+ this.helper.addClass("ui-draggable-dragging");
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ this._trigger('drag', event, ui);
+ this.position = ui.position;
+ }
+
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
+ dropped = $.ui.ddmanager.drop(this, event);
+
+ //if a drop comes from outside (a sortable)
+ if(this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ var self = this;
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ self._trigger("stop", event);
+ self._clear();
+ });
+ } else {
+ this._trigger("stop", event);
+ this._clear();
+ }
+
+ return false;
+ },
+
+ _getHandle: function(event) {
+
+ var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
+ $(this.options.handle, this.element)
+ .find("*")
+ .andSelf()
+ .each(function() {
+ if(this == event.target) handle = true;
+ });
+
+ return handle;
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options;
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
+
+ if(!helper.parents('body').length)
+ helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
+
+ if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
+ helper.css("position", "absolute");
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
+ if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
+ if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
+ po = { top: 0, left: 0 };
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition == "relative") {
+ var p = this.element.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
+ top: (parseInt(this.element.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var o = this.options;
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
+ ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+
+ if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
+ var ce = $(o.containment)[0]; if(!ce) return;
+ var co = $(o.containment).offset();
+ var over = ($(ce).css("overflow") != 'hidden');
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ } else if(o.containment.constructor == Array) {
+ this.containment = o.containment;
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) pos = this.position;
+ var mod = d == "absolute" ? 1 : -1;
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top // The absolute mouse position
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left // The absolute mouse position
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ var pageX = event.pageX;
+ var pageY = event.pageY;
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
+ if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
+ }
+
+ if(o.grid) {
+ var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY // The absolute mouse position
+ - this.offset.click.top // Click offset (relative to the element)
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX // The absolute mouse position
+ - this.offset.click.left // Click offset (relative to the element)
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
+ //if($.ui.ddmanager) $.ui.ddmanager.current = null;
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function(type, event, ui) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call(this, type, [event, ui]);
+ if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
+ return $.widget.prototype._trigger.call(this, type, event, ui);
+ },
+
+ plugins: {},
+
+ _uiHash: function(event) {
+ return {
+ helper: this.helper,
+ position: this.position,
+ absolutePosition: this.positionAbs, //deprecated
+ offset: this.positionAbs
+ };
+ }
+
+}));
+
+$.extend($.ui.draggable, {
+ version: "1.7.2",
+ eventPrefix: "drag",
+ defaults: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input,option",
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ delay: 0,
+ distance: 1,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false
+ }
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+ start: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options,
+ uiSortable = $.extend({}, ui, { item: inst.element });
+ inst.sortables = [];
+ $(o.connectToSortable).each(function() {
+ var sortable = $.data(this, 'sortable');
+ if (sortable && !sortable.options.disabled) {
+ inst.sortables.push({
+ instance: sortable,
+ shouldRevert: sortable.options.revert
+ });
+ sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+
+ },
+ stop: function(event, ui) {
+
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+ var inst = $(this).data("draggable"),
+ uiSortable = $.extend({}, ui, { item: inst.element });
+
+ $.each(inst.sortables, function() {
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
+ if(this.shouldRevert) this.instance.options.revert = true;
+
+ //Trigger the stop of the sortable
+ this.instance._mouseStop(event);
+
+ this.instance.options.helper = this.instance.options._helper;
+
+ //If the helper has been the original item, restore properties in the sortable
+ if(inst.options.helper == 'original')
+ this.instance.currentItem.css({ top: 'auto', left: 'auto' });
+
+ } else {
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ this.instance._trigger("deactivate", event, uiSortable);
+ }
+
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), self = this;
+
+ var checkPos = function(o) {
+ var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
+ var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
+ var itemHeight = o.height, itemWidth = o.width;
+ var itemTop = o.top, itemLeft = o.left;
+
+ return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
+ };
+
+ $.each(inst.sortables, function(i) {
+
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
+
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+ if(!this.instance.isOver) {
+
+ this.instance.isOver = 1;
+ //Now we fake the start of dragging for the sortable instance,
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+ this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+ this.instance.options.helper = function() { return ui.helper[0]; };
+
+ event.target = this.instance.currentItem[0];
+ this.instance._mouseCapture(event, true);
+ this.instance._mouseStart(event, true, true);
+
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+ this.instance.offset.click.top = inst.offset.click.top;
+ this.instance.offset.click.left = inst.offset.click.left;
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+ inst._trigger("toSortable", event);
+ inst.dropped = this.instance.element; //draggable revert needs that
+ //hack so receive/update callbacks work (mostly)
+ inst.currentItem = inst.element;
+ this.instance.fromOutside = inst;
+
+ }
+
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+ if(this.instance.currentItem) this.instance._mouseDrag(event);
+
+ } else {
+
+ //If it doesn't intersect with the sortable, and it intersected before,
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+ this.instance.cancelHelperRemoval = true;
+
+ //Prevent reverting on this forced stop
+ this.instance.options.revert = false;
+
+ // The out event needs to be triggered independently
+ this.instance._trigger('out', event, this.instance._uiHash(this.instance));
+
+ this.instance._mouseStop(event, true);
+ this.instance.options.helper = this.instance.options._helper;
+
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+ this.instance.currentItem.remove();
+ if(this.instance.placeholder) this.instance.placeholder.remove();
+
+ inst._trigger("fromSortable", event);
+ inst.dropped = false; //draggable revert needs that
+ }
+
+ };
+
+ });
+
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function(event, ui) {
+ var t = $('body'), o = $(this).data('draggable').options;
+ if (t.css("cursor")) o._cursor = t.css("cursor");
+ t.css("cursor", o.cursor);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if (o._cursor) $('body').css("cursor", o._cursor);
+ }
+});
+
+$.ui.plugin.add("draggable", "iframeFix", {
+ start: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+ $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
+ .css({
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+ position: "absolute", opacity: "0.001", zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo("body");
+ });
+ },
+ stop: function(event, ui) {
+ $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data('draggable').options;
+ if(t.css("opacity")) o._opacity = t.css("opacity");
+ t.css('opacity', o.opacity);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if(o._opacity) $(ui.helper).css('opacity', o._opacity);
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function(event, ui) {
+ var i = $(this).data("draggable");
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
+ },
+ drag: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options, scrolled = false;
+
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
+
+ if(!o.axis || o.axis != 'x') {
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+ else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+ else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(!o.axis || o.axis != 'x') {
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(i, event);
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options;
+ i.snapElements = [];
+
+ $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
+ var $t = $(this); var $o = $t.offset();
+ if(this != i.element[0]) i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options;
+ var d = o.snapTolerance;
+
+ var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (var i = inst.snapElements.length - 1; i >= 0; i--){
+
+ var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
+ t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
+
+ //Yes, I know, this is insane ;)
+ if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
+ if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if(o.snapMode != 'inner') {
+ var ts = Math.abs(t - y2) <= d;
+ var bs = Math.abs(b - y1) <= d;
+ var ls = Math.abs(l - x2) <= d;
+ var rs = Math.abs(r - x1) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+ }
+
+ var first = (ts || bs || ls || rs);
+
+ if(o.snapMode != 'outer') {
+ var ts = Math.abs(t - y1) <= d;
+ var bs = Math.abs(b - y2) <= d;
+ var ls = Math.abs(l - x1) <= d;
+ var rs = Math.abs(r - x2) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+ }
+
+ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ };
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function(event, ui) {
+
+ var o = $(this).data("draggable").options;
+
+ var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
+ return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
+ });
+
+ $(group).each(function(i) {
+ this.style.zIndex = o.stack.min + i;
+ });
+
+ this[0].style.zIndex = o.stack.min + group.length;
+
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data("draggable").options;
+ if(t.css("zIndex")) o._zIndex = t.css("zIndex");
+ t.css('zIndex', o.zIndex);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data("draggable").options;
+ if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
+ }
+});
+
+})(jQuery);
diff --git a/examples/lessons/6_English_yesNoQuestions/js/ui.droppable.js b/examples/lessons/6_English_yesNoQuestions/js/ui.droppable.js
new file mode 100755
index 0000000..8e7be33
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/js/ui.droppable.js
@@ -0,0 +1,282 @@
+/*
+ * jQuery UI Droppable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * ui.core.js
+ * ui.draggable.js
+ */
+(function($) {
+
+$.widget("ui.droppable", {
+
+ _init: function() {
+
+ var o = this.options, accept = o.accept;
+ this.isover = 0; this.isout = 1;
+
+ this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
+ return d.is(accept);
+ };
+
+ //Store the droppable's proportions
+ this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
+
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
+ $.ui.ddmanager.droppables[this.options.scope].push(this);
+
+ (this.options.addClasses && this.element.addClass("ui-droppable"));
+
+ },
+
+ destroy: function() {
+ var drop = $.ui.ddmanager.droppables[this.options.scope];
+ for ( var i = 0; i < drop.length; i++ )
+ if ( drop[i] == this )
+ drop.splice(i, 1);
+
+ this.element
+ .removeClass("ui-droppable ui-droppable-disabled")
+ .removeData("droppable")
+ .unbind(".droppable");
+ },
+
+ _setData: function(key, value) {
+
+ if(key == 'accept') {
+ this.options.accept = value && $.isFunction(value) ? value : function(d) {
+ return d.is(value);
+ };
+ } else {
+ $.widget.prototype._setData.apply(this, arguments);
+ }
+
+ },
+
+ _activate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.addClass(this.options.activeClass);
+ (draggable && this._trigger('activate', event, this.ui(draggable)));
+ },
+
+ _deactivate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ (draggable && this._trigger('deactivate', event, this.ui(draggable)));
+ },
+
+ _over: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
+ this._trigger('over', event, this.ui(draggable));
+ }
+
+ },
+
+ _out: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('out', event, this.ui(draggable));
+ }
+
+ },
+
+ _drop: function(event,custom) {
+
+ var draggable = custom || $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
+
+ var childrenIntersection = false;
+ this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
+ var inst = $.data(this, 'droppable');
+ if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
+ childrenIntersection = true; return false;
+ }
+ });
+ if(childrenIntersection) return false;
+
+ if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('drop', event, this.ui(draggable));
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function(c) {
+ return {
+ draggable: (c.currentItem || c.element),
+ helper: c.helper,
+ position: c.position,
+ absolutePosition: c.positionAbs, //deprecated
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.extend($.ui.droppable, {
+ version: "1.7.2",
+ eventPrefix: 'drop',
+ defaults: {
+ accept: '*',
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: 'default',
+ tolerance: 'intersect'
+ }
+});
+
+$.ui.intersect = function(draggable, droppable, toleranceMode) {
+
+ if (!droppable.offset) return false;
+
+ var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
+ y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
+ var l = droppable.offset.left, r = l + droppable.proportions.width,
+ t = droppable.offset.top, b = t + droppable.proportions.height;
+
+ switch (toleranceMode) {
+ case 'fit':
+ return (l < x1 && x2 < r
+ && t < y1 && y2 < b);
+ break;
+ case 'intersect':
+ return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
+ && x2 - (draggable.helperProportions.width / 2) < r // Left Half
+ && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
+ && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
+ break;
+ case 'pointer':
+ var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
+ isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
+ return isOver;
+ break;
+ case 'touch':
+ return (
+ (y1 >= t && y1 <= b) || // Top edge touching
+ (y2 >= t && y2 <= b) || // Bottom edge touching
+ (y1 < t && y2 > b) // Surrounded vertically
+ ) && (
+ (x1 >= l && x1 <= r) || // Left edge touching
+ (x2 >= l && x2 <= r) || // Right edge touching
+ (x1 < l && x2 > r) // Surrounded horizontally
+ );
+ break;
+ default:
+ return false;
+ break;
+ }
+
+};
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { 'default': [] },
+ prepareOffsets: function(t, event) {
+
+ var m = $.ui.ddmanager.droppables[t.options.scope];
+ var type = event ? event.type : null; // workaround for #2317
+ var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
+
+ droppablesLoop: for (var i = 0; i < m.length; i++) {
+
+ if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
+ for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
+ m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
+
+ m[i].offset = m[i].element.offset();
+ m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
+
+ if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
+
+ }
+
+ },
+ drop: function(draggable, event) {
+
+ var dropped = false;
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(!this.options) return;
+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
+ dropped = this._drop.call(this, event);
+
+ if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ this.isout = 1; this.isover = 0;
+ this._deactivate.call(this, event);
+ }
+
+ });
+ return dropped;
+
+ },
+ drag: function(draggable, event) {
+
+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
+
+ //Run through all droppables and check their positions based on specific tolerance options
+
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(this.options.disabled || this.greedyChild || !this.visible) return;
+ var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
+
+ var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
+ if(!c) return;
+
+ var parentInstance;
+ if (this.options.greedy) {
+ var parent = this.element.parents(':data(droppable):eq(0)');
+ if (parent.length) {
+ parentInstance = $.data(parent[0], 'droppable');
+ parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
+ }
+ }
+
+ // we just moved into a greedy child
+ if (parentInstance && c == 'isover') {
+ parentInstance['isover'] = 0;
+ parentInstance['isout'] = 1;
+ parentInstance._out.call(parentInstance, event);
+ }
+
+ this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
+ this[c == "isover" ? "_over" : "_out"].call(this, event);
+
+ // we just moved out of a greedy child
+ if (parentInstance && c == 'isout') {
+ parentInstance['isout'] = 0;
+ parentInstance['isover'] = 1;
+ parentInstance._over.call(parentInstance, event);
+ }
+ });
+
+ }
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_English_yesNoQuestions/js/ui.scoreboard.js b/examples/lessons/6_English_yesNoQuestions/js/ui.scoreboard.js
new file mode 100755
index 0000000..53a930a
--- /dev/null
+++ b/examples/lessons/6_English_yesNoQuestions/js/ui.scoreboard.js
@@ -0,0 +1,107 @@
+(function($){
+ $.widget('ui.scoreboard',
+ {
+ getScore : function(){
+ return this._getData('score');
+ },
+ setScore : function(newScore){
+ this._setData('score', parseInt(newScore));
+ this._refresh();
+ },
+ getTotal : function(){
+ return this._getData('total');
+ },
+ setTotal : function(newTotal){
+ this._setData('total', parseInt(newTotal));
+ this._refresh();
+ },
+ reset : function(){
+ this._setData('score', this._getData('initialScore'));
+ this._setData('total', this._getData('initialTotal'));
+ this._refresh();
+ },
+ inc : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') + incVal);
+ this._refresh();
+ if(this._getData('winScore') === this._getData('score')){
+ this.element.trigger('winGame');
+ }
+ },
+ incTotal : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') + incVal);
+ this._refresh();
+ },
+ dec : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') - decVal);
+ this._refresh();
+ },
+ decTotal : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') - decVal);
+ this._refresh();
+ },
+ _init : function(){
+
+ var divDisplay = "inline";
+ var score = this.options.score;
+ var total = this.options.total;
+ var layoutId = "h";
+ var self = this;
+
+
+ this._setData('initialScore', parseInt(this.options.score));
+ this._setData('initialTotal', parseInt(this.options.total));
+ this._setData('score', parseInt(this.options.score));
+ this._setData('total', parseInt(this.options.total));
+ this._setData('winScore', parseInt(this.options.winningScore) || 0);
+
+ if(this.options.layout === "vertical"){
+ layoutId = "v";
+ }
+
+ this.evWinGame = document.createEvent('Events');
+
+ this.element.addClass('ui-scoreboard-container-' + layoutId +
+ ' ui-widget ui-widget-content ui-corner-all');
+
+ var clone = $('<div>')
+ .addClass('ui-scoreboard-spacing-' + layoutId);
+ this._scoreText = $("<div>Score</div>")
+ .addClass('ui-scoreboard-spacing-'+ layoutId +
+ ' ui-corner-all ui-scoreboard-text')
+ .appendTo(this.element);
+ this._score = $("<div>" + score + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ $("<div>Total</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-corner-all ' +
+ 'ui-scoreboard-text')
+ .appendTo(this.element);
+ this._total = $("<div>" + total + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ },
+ _refresh : function(){
+ this._score.text(this._getData('score'));
+ this._total.text(this._getData('total'));
+ },
+ destroy : function(){
+ this.element.remove();
+ $.widget.prototype.destroy.apply(this, arguments);
+ }
+
+
+ });
+
+ $.ui.scoreboard.getter = ['getScore', 'getTotal'];
+ $.ui.scoreboard.defaults = {
+ score: 0, total: 0, layout: "horizontal", winningScore: 0
+ };
+
+ })(jQuery); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/audio/correct.wav b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/audio/correct.wav
new file mode 100755
index 0000000..a49ba33
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/audio/correct.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/audio/incorrect.wav b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/audio/incorrect.wav
new file mode 100755
index 0000000..906c6a3
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/audio/incorrect.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_footer.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_header.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_title_block.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_back.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_help.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_next.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_ole.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/check.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/check.png
new file mode 100755
index 0000000..bd0afcb
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/check.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/correct.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/correct.png
new file mode 100755
index 0000000..ca9b9db
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/cross.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/cross.png
new file mode 100755
index 0000000..d5ef090
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/cross.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/gameOver.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/gameOver.png
new file mode 100755
index 0000000..81c403b
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/gameOver.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/help.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/help.png
new file mode 100755
index 0000000..e79e879
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img0.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img0.png
new file mode 100755
index 0000000..b87bed8
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img0.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img0More.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img0More.png
new file mode 100755
index 0000000..6e7431e
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img0More.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img1.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img1.png
new file mode 100755
index 0000000..f9bf83a
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img1.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img1More.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img1More.png
new file mode 100755
index 0000000..2cb7ee4
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img1More.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img2.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img2.png
new file mode 100755
index 0000000..d629f77
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img2.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img2More.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img2More.png
new file mode 100755
index 0000000..b713994
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img2More.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img3.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img3.png
new file mode 100755
index 0000000..e2a9738
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img3.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img3More.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img3More.png
new file mode 100755
index 0000000..d4c7734
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img3More.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img4.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img4.png
new file mode 100755
index 0000000..2235a0a
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img4.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img4More.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img4More.png
new file mode 100755
index 0000000..ec800cd
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img4More.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img5.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img5.png
new file mode 100755
index 0000000..5860c7e
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img5.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img5More.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img5More.png
new file mode 100755
index 0000000..a62bd8f
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img5More.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img6.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img6.png
new file mode 100755
index 0000000..68422dc
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img6.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img6More.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img6More.png
new file mode 100755
index 0000000..1c6be38
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img6More.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img7.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img7.png
new file mode 100755
index 0000000..69232ca
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img7.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img7More.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img7More.png
new file mode 100755
index 0000000..9bc0e09
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/img7More.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/incorrect.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/incorrect.png
new file mode 100755
index 0000000..49ee2a2
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/incorrect.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/title_block_lt.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/title_block_rt.png b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/css/lesson.css b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/css/lesson.css
new file mode 100755
index 0000000..3893644
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/css/lesson.css
@@ -0,0 +1,285 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }bgCalculation
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: abbgCalculationsolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ /*width: 25bgCalculation1px;*/
+ padding-right: 5px;
+ padding-top: 5px;
+}
+ #linkCheck{
+ margin: 1em 3em 0 0;
+ width: 101px; height: 30px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0 auto;
+ margin-top: 85px;
+ width: 95%;
+ padding: 0.5em;
+ height: 375px;
+}
+ #section{
+ width: 900px;
+ height: 400px;
+ margin: 0 auto;
+ }
+
+ #left-side{
+ float:left;
+ width: 360px;
+ height: 365px;
+ border: 2px solid black;
+ }
+ .bgQuesMain{
+ margin: 0em auto;
+ width: 360px;
+ height: 115px;
+ text-align:center;
+ background: #D2D77E;
+ }
+ .bgQuesAns{
+ margin: 0em auto;
+ padding-top: 10px;
+ width: 360px;
+ height: 240px;
+ text-align:center;
+ background: #A5FFFE;
+ }
+ #right-side{
+ float:right;
+ width: 360px;
+ height: 365px;
+ border: 2px solid black;
+ }
+
+ .bgQuestion{
+ margin: 0em auto;
+ padding-top: 25px;
+ width: 360px;
+ height: 90px;
+ text-align:center;
+ background: #FED67E;
+ }
+ .bgCalculation{
+ margin: 0em auto;
+ padding-top: 5px;
+ width: 360px;
+ height: 245px;
+ text-align:center;
+ background: #6DFFD5;
+ }
+
+ #textQues1{
+ float:right;
+ margin-top: 20px;
+ width: 300px;
+ height:30px;
+ letter-spacing: 5px;
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ padding-right: 20px;
+
+ text-align:right;
+ }
+ #textQues2{
+ float:right;
+ margin-top: 10px;
+ width: 350px;
+ height:30px;
+ letter-spacing: 5px;
+ text-align:right;
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ padding-right: 15px;
+ }
+ #textQues3{
+ float:right;
+ text-align:right;
+ margin-top: 20px;
+ width: 300px;
+ height: 30px;
+ padding-right: 15px;
+ }
+ #textQues4{
+ float:right;
+ text-align:right;
+ margin-top: 20px;
+ width: 300px;
+ height: 30px;
+ padding-right: 20px;
+ }
+ .blankBoxes{
+ padding-left: 15px;
+ width: 35px;
+ height: 40px;
+ border-bottom : 2px solid black;
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ }
+ .quesText{
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #000000;
+ }
+ input.textBox{
+ size:3;
+ font: 15px/20px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ height:25px;
+ width: 30px;
+ text-align:center;
+ }
+ .focus {
+ background-color: #FFEEAA;
+ }
+ .correct{
+ background-color: #C0F9F3;
+ }
+ .incorrect{
+ background-color: #FFFF00;
+ }
+
+ #help{
+ display:none;
+ position:absolute;
+ right: 20%;
+ top: 1%;
+ width: 224px;
+ height: 525px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+ #gameOver{
+ display:none;
+ position:absolute;
+ top: 40%;
+ left: 25%;
+ width: 432px;
+ height: 68px;
+ background: url('../assets/image/gameOver.png');
+ } \ No newline at end of file
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/css/ui.scoreboard.css b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/css/ui.scoreboard.css
new file mode 100755
index 0000000..11cdbb5
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/css/ui.scoreboard.css
@@ -0,0 +1,62 @@
+.ui-scoreboard-container-h{
+max-width: 800em;
+max-height: 200px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+
+.ui-scoreboard-spacing-h{
+max-width: 200em;
+max-height: 300em;
+display:inline;
+margin-left:0.2em;
+margin-right:0.4em;
+}
+
+.ui-scoreboard-text{
+font-size:larger;
+text-align: center;
+}
+
+.ui-scoreboard-number-h {
+background-color:black;
+color: white;
+padding-left:0.4em;
+padding-right:0.4em;
+font-size:larger;
+}
+
+.ui-scoreboard-button{
+float:right;
+cursor:pointer;
+}
+
+button .ui-scoreboard-icon{
+float: left;
+margin-right:0.3em;
+}
+.ui-scoreboard-container-v{
+max-width: 200px;
+max-height: 400px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+.ui-scoreboard-spacing-v{
+display:block;
+margin: 0.4em;
+}
+
+.ui-scoreboard-number-v{
+background-color:black;
+color: white;
+width: 1em;
+text-align:center;
+margin-left:auto;
+margin-right: auto;
+padding:0.4em;
+font-size:larger;
+}
+
+
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/index.html b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/index.html
new file mode 100755
index 0000000..100e6b7
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/index.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Adding and Multiplying Variables</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Adding and Multiplying Variables || <span id="currentTitle"> चलको जोड र गुणन </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/karma.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/lesson.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/lesson.js
new file mode 100755
index 0000000..22e8099
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/lesson.js
@@ -0,0 +1,212 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.wav'},
+ {'name':'incorrect','file':'incorrect.wav'}
+ ]});
+
+ k.ready(function(){
+ var i,j;
+ var totalCounter;
+ var correctCounter;
+ var currentQuestion;
+ var TOTAL_QUES = 8;
+ var flag_correct;
+ var randPositions = [];
+ var check_num;
+ var infoQues1 = new Array('एउटा बट्टामा y ओटा लडडुहरु छन ',
+ 'एउटा सीसाकलमको बट्टामा p ओटा सीसाकलमहरु छन',
+ 'एउटा बोरामा r केजी चामल छ ',
+ 'एउटा सिसीमा z लिटर तेल छ ',
+ 'एउटा कार्टुनमा x प्याकेट चाउचाउ छन ',
+ 'एउटा डालोमा n ओटा नरिवलहरु छन ',
+ 'एउटा झोलामा m केजी आपहरु छन',
+ 'यो एउटा बिस्कुटको प्याकेटमा x ओटा बिस्कुटहरु छन '
+ );
+
+ var infoQues2 = new Array('यदि एउटा बट्टामा 20 ओटा लडडुहरु छन भने 5 ओटा बट्टामा',
+ 'यदि एउटा बट्टामा 10 ओटा सीसाकलमहरु छन भने 4 ओटा बट्टामा',
+ 'यदि एउटा बोरामा 50 केजी चामल छ भने 4 ओटा बोरामा जम्मा ',
+ 'यदि एउटा सिसीमा 2 लिटर तेल छ भने 4 ओटा सिसीमा जम्मा ',
+ 'यदि एउटा कार्टुनमा 30 प्याकेट चाउचाउ छन भने 3 ओटा कार्टुनमा जम्मा ',
+ 'यदि एउटा डालोमा 25 ओटा नरिवलहरु छन भने 3 ओटा डालोमा जम्मा ',
+ 'यदि एउटा झोलामा 7 केजी आपहरु छन भने 2 ओटा झोलामा जम्मा ',
+ 'यदि एउटा प्याकेटमा 15 बिस्कुट ओटा बिस्कुट छन भने 3 ओटा प्याकेटमा जम्मा '
+ );
+
+ var infoQues3 = new Array('ओटा लडडुहरु छन','सीसाकलमहरु छन','केजी चामल छ','लिटर तेल छ',
+ 'प्याकेट चाउचाउ छन','ओटा नरिवलहरु छन','केजी आपहरु छन','बिस्कुटहरु छन'
+ );
+ var variableName = new Array('y','p','r','z','x','n','m','x');
+ var perPack = new Array('20','10','50','2','30','25','7','15');
+ var quantity = new Array('5','4','4','4','3','3','2','3');
+ var answers = new Array('100','40','200','8','90','75','14','45');
+
+ var scoreboard = $('#score_box').scoreboard({'layout':'horizontal',
+ 'winningScore': TOTAL_QUES});
+
+ var genRandPosition=function (){
+ randPositions[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+ var next_question = function (){
+ if(totalCounter === TOTAL_QUES){
+ t=setTimeout(function(){delay_gameOver();},1000);
+ }
+ else{
+ currentQuestion = randPositions[totalCounter];
+ //currentQuestion = totalCounter;
+ flag_correct = 1;
+ check_num = 0;
+ $('#linkCheck').show();
+ $('.bgQuesMain').html('<img id="img'+currentQuestion+'" src="assets/image/img'+currentQuestion+'.png" />');
+ $('.bgQuesAns').html('<img id="img'+currentQuestion+'" src="assets/image/img'+currentQuestion+'More.png" />');
+ $('.bgQuestion').addClass('quesText').html(infoQues1[currentQuestion]+' ।');
+ $('.bgCalculation').addClass('quesText').html(infoQues2[currentQuestion]);
+ $('.bgCalculation').append('<div id="textQues1"></div>');
+ $('.bgCalculation').append('<div id="textQues2"></div>');
+ for( i = 0; i< quantity[currentQuestion]; i++){
+ $('#textQues1').append(variableName[currentQuestion]);
+ $('#textQues2').append('<span class="blankBoxes"></span>');
+ if(i != quantity[currentQuestion]-1){
+ $('#textQues1').append('+');
+ $('#textQues2').append('+');
+ }
+ else{
+ $('#textQues1').append(' = ').append(quantity[currentQuestion]+' * '+variableName[currentQuestion]);
+ $('#textQues2').append(' = ').append(quantity[currentQuestion]+' *'+'<input type="text" id="text1" class="textBox" maxLength="2"/>');
+ }
+ $("input#text1").focus();
+ }
+
+
+ foucs_blur();
+ }
+
+ };
+
+ function game_start(){
+ $('#gameOver').hide();
+ $('#linkCheck').show();
+ $('#section').removeClass('backOpaque');
+ genRandPosition();
+ next_question();
+ }
+
+ function game() {
+ totalCounter = 0;
+ correctCounter = 0;
+ $('#section').html('').append('<div id="left-side"></div>');
+ $('#left-side').append('<div class="bgQuesMain"></div>');
+ $('#left-side').append('<div class="bgQuesAns"></div>');
+ $('#section').append('<div id="right-side"></div>');
+ $('#right-side').append('<div class="bgQuestion"></div>');
+ $('#right-side').append('<div class="bgCalculation"></div>');
+ $('#help').hide();
+ $('.bgAns').hide();
+ $('#linkCheck').hide();
+ $('#gameOver').hide();
+
+ }
+
+ game();
+
+ var delay_nextQues = function(){
+ document.delayForm.delayval.value = 1;
+ next_question();
+ };
+
+ var delay_gameOver = function(){
+ document.delayForm.delayval.value = 1;
+ $('#section').addClass('backOpaque');
+ $('#linkCheck').hide();
+ $('#gameOver').show();
+ };
+
+ var check_answer = function(){
+ if(check_num === 0){
+ var textVal = $('#text1').val();
+ if(textVal === perPack[currentQuestion]){ // first one is correct
+ k.audio.correct.play();
+ $('.bgCalculation').append('<div id="textQues3"></div>');
+ $('.bgCalculation').append('<div id="textQues4"></div>');
+ $('#textQues3').append(' = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;').append('<input type="text" id="text2" class="textBox" maxLength="3"/>');
+ $('#textQues4').append(infoQues3[currentQuestion]+' ।');
+ $('#text1').attr("disabled", true);
+ $('.blankBoxes').css({'padding':'0'}).html(perPack[currentQuestion]);
+ check_num++;
+ $("input#text2").focus();
+ foucs_blur();
+ }
+ else{
+ k.audio.incorrect.play();
+ flag_correct = 0;
+ }
+ }
+ else{
+ textVal = $('#text2').val();
+ //if(textVal === perPack[currentQuestion] * quantity[currentQuestion]){
+ if(textVal === answers[currentQuestion]){
+ k.audio.correct.play();
+ if(flag_correct === 1){
+ scoreboard.scoreboard('inc');
+ correctCounter++;
+ }
+ scoreboard.scoreboard('incTotal');
+ totalCounter++;
+ t=setTimeout(function(){delay_nextQues();},1000);
+ }
+ else{
+ flag_correct = 0;
+ k.audio.incorrect.play();
+ }
+ }
+ };
+
+ function foucs_blur(){
+
+ $('input[type="text"]')
+ .focus(function() {
+ $(this).removeClass('incorrect').addClass("focus");
+ })
+ .blur(function() {
+ $(this).removeClass("focus");
+ })
+ .keypress(function(event) {
+ if(event.which === 13){
+ check_answer();
+ }
+
+ });
+
+ $('#linkCheck').click(function(){
+ check_answer();
+ });
+ }
+
+ $('#linkStart').click(function(){
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ scoreboard.scoreboard('reset');
+ game_start();
+ });
+ $('#linkHelp').click(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+ });
+ }); //end of k.ready
+}); //end of document.ready \ No newline at end of file
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.core.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.core.js
new file mode 100755
index 0000000..5493e0a
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.core.js
@@ -0,0 +1,519 @@
+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+;jQuery.ui || (function($) {
+
+var _remove = $.fn.remove,
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+
+//Helper functions and ui object
+$.ui = {
+ version: "1.7.2",
+
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function(module, option, set) {
+ var proto = $.ui[module].prototype;
+ for(var i in set) {
+ proto.plugins[i] = proto.plugins[i] || [];
+ proto.plugins[i].push([option, set[i]]);
+ }
+ },
+ call: function(instance, name, args) {
+ var set = instance.plugins[name];
+ if(!set || !instance.element[0].parentNode) { return; }
+
+ for (var i = 0; i < set.length; i++) {
+ if (instance.options[set[i][0]]) {
+ set[i][1].apply(instance.element, args);
+ }
+ }
+ }
+ },
+
+ contains: function(a, b) {
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
+ },
+
+ hasScroll: function(el, a) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ($(el).css('overflow') == 'hidden') { return false; }
+
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
+ has = false;
+
+ if (el[scroll] > 0) { return true; }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[scroll] = 1;
+ has = (el[scroll] > 0);
+ el[scroll] = 0;
+ return has;
+ },
+
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
+ },
+
+ isOver: function(y, x, top, left, height, width) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+ },
+
+ keyCode: {
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+};
+
+// WAI-ARIA normalization
+if (isFF2) {
+ var attr = $.attr,
+ removeAttr = $.fn.removeAttr,
+ ariaNS = "http://www.w3.org/2005/07/aaa",
+ ariaState = /^aria-/,
+ ariaRole = /^wairole:/;
+
+ $.attr = function(elem, name, value) {
+ var set = value !== undefined;
+
+ return (name == 'role'
+ ? (set
+ ? attr.call(this, elem, name, "wairole:" + value)
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
+ : (ariaState.test(name)
+ ? (set
+ ? elem.setAttributeNS(ariaNS,
+ name.replace(ariaState, "aaa:"), value)
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
+ : attr.apply(this, arguments)));
+ };
+
+ $.fn.removeAttr = function(name) {
+ return (ariaState.test(name)
+ ? this.each(function() {
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
+ }) : removeAttr.call(this, name));
+ };
+}
+
+//jQuery plugins
+$.fn.extend({
+ remove: function() {
+ // Safari has a native remove event which actually removes DOM elements,
+ // so we have to use triggerHandler instead of trigger (#3037).
+ $("*", this).add(this).each(function() {
+ $(this).triggerHandler("remove");
+ });
+ return _remove.apply(this, arguments );
+ },
+
+ enableSelection: function() {
+ return this
+ .attr('unselectable', 'off')
+ .css('MozUserSelect', '')
+ .unbind('selectstart.ui');
+ },
+
+ disableSelection: function() {
+ return this
+ .attr('unselectable', 'on')
+ .css('MozUserSelect', 'none')
+ .bind('selectstart.ui', function() { return false; });
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ }
+});
+
+
+//Additional selectors
+$.extend($.expr[':'], {
+ data: function(elem, i, match) {
+ return !!$.data(elem, match[3]);
+ },
+
+ focusable: function(element) {
+ var nodeName = element.nodeName.toLowerCase(),
+ tabIndex = $.attr(element, 'tabindex');
+ return (/input|select|textarea|button|object/.test(nodeName)
+ ? !element.disabled
+ : 'a' == nodeName || 'area' == nodeName
+ ? element.href || !isNaN(tabIndex)
+ : !isNaN(tabIndex))
+ // the element and all of its ancestors must be visible
+ // the browser may report that the area is hidden
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
+ },
+
+ tabbable: function(element) {
+ var tabIndex = $.attr(element, 'tabindex');
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
+ }
+});
+
+
+// $.widget is a factory to create jQuery plugins
+// taking some boilerplate code out of the plugin code
+function getter(namespace, plugin, method, args) {
+ function getMethods(type) {
+ var methods = $[namespace][plugin][type] || [];
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
+ }
+
+ var methods = getMethods('getter');
+ if (args.length == 1 && typeof args[0] == 'string') {
+ methods = methods.concat(getMethods('getterSetter'));
+ }
+ return ($.inArray(method, methods) != -1);
+}
+
+$.widget = function(name, prototype) {
+ var namespace = name.split(".")[0];
+ name = name.split(".")[1];
+
+ // create plugin method
+ $.fn[name] = function(options) {
+ var isMethodCall = (typeof options == 'string'),
+ args = Array.prototype.slice.call(arguments, 1);
+
+ // prevent calls to internal methods
+ if (isMethodCall && options.substring(0, 1) == '_') {
+ return this;
+ }
+
+ // handle getter methods
+ if (isMethodCall && getter(namespace, name, options, args)) {
+ var instance = $.data(this[0], name);
+ return (instance ? instance[options].apply(instance, args)
+ : undefined);
+ }
+
+ // handle initialization and non-getter methods
+ return this.each(function() {
+ var instance = $.data(this, name);
+
+ // constructor
+ (!instance && !isMethodCall &&
+ $.data(this, name, new $[namespace][name](this, options))._init());
+
+ // method call
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
+ instance[options].apply(instance, args));
+ });
+ };
+
+ // create widget constructor
+ $[namespace] = $[namespace] || {};
+ $[namespace][name] = function(element, options) {
+ var self = this;
+
+ this.namespace = namespace;
+ this.widgetName = name;
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
+ this.widgetBaseClass = namespace + '-' + name;
+
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
+ this.element = $(element)
+ .bind('setData.' + name, function(event, key, value) {
+ if (event.target == element) {
+ return self._setData(key, value);
+ }
+ })
+ .bind('getData.' + name, function(event, key) {
+ if (event.target == element) {
+ return self._getData(key);
+ }
+ })
+ .bind('remove', function() {
+ return self.destroy();
+ });
+ };
+
+ // add widget prototype
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
+
+ // TODO: merge getter and getterSetter properties from widget prototype
+ // and plugin prototype
+ $[namespace][name].getterSetter = 'option';
+};
+
+$.widget.prototype = {
+ _init: function() {},
+ destroy: function() {
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
+ },
+
+ option: function(key, value) {
+ var options = key,
+ self = this;
+
+ if (typeof key == "string") {
+ if (value === undefined) {
+ return this._getData(key);
+ }
+ options = {};
+ options[key] = value;
+ }
+
+ $.each(options, function(key, value) {
+ self._setData(key, value);
+ });
+ },
+ _getData: function(key) {
+ return this.options[key];
+ },
+ _setData: function(key, value) {
+ this.options[key] = value;
+
+ if (key == 'disabled') {
+ this.element
+ [value ? 'addClass' : 'removeClass'](
+ this.widgetBaseClass + '-disabled' + ' ' +
+ this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
+ }
+ },
+
+ enable: function() {
+ this._setData('disabled', false);
+ },
+ disable: function() {
+ this._setData('disabled', true);
+ },
+
+ _trigger: function(type, event, data) {
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = $.Event(event);
+ event.type = eventName;
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if (event.originalEvent) {
+ for (var i = $.event.props.length, prop; i;) {
+ prop = $.event.props[--i];
+ event[prop] = event.originalEvent[prop];
+ }
+ }
+
+ this.element.trigger(event, data);
+
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
+ }
+};
+
+$.widget.defaults = {
+ disabled: false
+};
+
+
+/** Mouse Interaction Plugin **/
+
+$.ui.mouse = {
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ // Prevent text selection in IE
+ if ($.browser.msie) {
+ this._mouseUnselectable = this.element.attr('unselectable');
+ this.element.attr('unselectable', 'on');
+ }
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+
+ // Restore text selection in IE
+ ($.browser.msie
+ && this.element.attr('unselectable', this._mouseUnselectable));
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ // TODO: figure out why we have to use originalEvent
+ event.originalEvent = event.originalEvent || {};
+ if (event.originalEvent.mouseHandled) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ // preventDefault() is used to prevent the selection of text here -
+ // however, in Safari, this causes select boxes not to be selectable
+ // anymore, so this fix is needed
+ ($.browser.safari || event.preventDefault());
+
+ event.originalEvent.mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+};
+
+$.ui.mouse.defaults = {
+ cancel: null,
+ distance: 1,
+ delay: 0
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.draggable.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.draggable.js
new file mode 100755
index 0000000..0402f0e
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.draggable.js
@@ -0,0 +1,766 @@
+/*
+ * jQuery UI Draggable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * ui.core.js
+ */
+(function($) {
+
+$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
+
+ _init: function() {
+
+ if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
+ this.element[0].style.position = 'relative';
+
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
+
+ this._mouseInit();
+
+ },
+
+ destroy: function() {
+ if(!this.element.data('draggable')) return;
+ this.element
+ .removeData("draggable")
+ .unbind(".draggable")
+ .removeClass("ui-draggable"
+ + " ui-draggable-dragging"
+ + " ui-draggable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+
+ var o = this.options;
+
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
+ return false;
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle)
+ return false;
+
+ return true;
+
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if($.ui.ddmanager)
+ $.ui.ddmanager.current = this;
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css("position");
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.element.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
+ if(o.cursorAt)
+ this._adjustOffsetFromHelper(o.cursorAt);
+
+ //Set a containment if given in the options
+ if(o.containment)
+ this._setContainment();
+
+ //Call plugins and callbacks
+ this._trigger("start", event);
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(this, event);
+
+ this.helper.addClass("ui-draggable-dragging");
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ this._trigger('drag', event, ui);
+ this.position = ui.position;
+ }
+
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
+ dropped = $.ui.ddmanager.drop(this, event);
+
+ //if a drop comes from outside (a sortable)
+ if(this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ var self = this;
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ self._trigger("stop", event);
+ self._clear();
+ });
+ } else {
+ this._trigger("stop", event);
+ this._clear();
+ }
+
+ return false;
+ },
+
+ _getHandle: function(event) {
+
+ var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
+ $(this.options.handle, this.element)
+ .find("*")
+ .andSelf()
+ .each(function() {
+ if(this == event.target) handle = true;
+ });
+
+ return handle;
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options;
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
+
+ if(!helper.parents('body').length)
+ helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
+
+ if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
+ helper.css("position", "absolute");
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
+ if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
+ if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
+ po = { top: 0, left: 0 };
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition == "relative") {
+ var p = this.element.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
+ top: (parseInt(this.element.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var o = this.options;
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
+ ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+
+ if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
+ var ce = $(o.containment)[0]; if(!ce) return;
+ var co = $(o.containment).offset();
+ var over = ($(ce).css("overflow") != 'hidden');
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ } else if(o.containment.constructor == Array) {
+ this.containment = o.containment;
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) pos = this.position;
+ var mod = d == "absolute" ? 1 : -1;
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top // The absolute mouse position
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left // The absolute mouse position
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ var pageX = event.pageX;
+ var pageY = event.pageY;
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
+ if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
+ }
+
+ if(o.grid) {
+ var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY // The absolute mouse position
+ - this.offset.click.top // Click offset (relative to the element)
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX // The absolute mouse position
+ - this.offset.click.left // Click offset (relative to the element)
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
+ //if($.ui.ddmanager) $.ui.ddmanager.current = null;
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function(type, event, ui) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call(this, type, [event, ui]);
+ if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
+ return $.widget.prototype._trigger.call(this, type, event, ui);
+ },
+
+ plugins: {},
+
+ _uiHash: function(event) {
+ return {
+ helper: this.helper,
+ position: this.position,
+ absolutePosition: this.positionAbs, //deprecated
+ offset: this.positionAbs
+ };
+ }
+
+}));
+
+$.extend($.ui.draggable, {
+ version: "1.7.2",
+ eventPrefix: "drag",
+ defaults: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input,option",
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ delay: 0,
+ distance: 1,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false
+ }
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+ start: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options,
+ uiSortable = $.extend({}, ui, { item: inst.element });
+ inst.sortables = [];
+ $(o.connectToSortable).each(function() {
+ var sortable = $.data(this, 'sortable');
+ if (sortable && !sortable.options.disabled) {
+ inst.sortables.push({
+ instance: sortable,
+ shouldRevert: sortable.options.revert
+ });
+ sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+
+ },
+ stop: function(event, ui) {
+
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+ var inst = $(this).data("draggable"),
+ uiSortable = $.extend({}, ui, { item: inst.element });
+
+ $.each(inst.sortables, function() {
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
+ if(this.shouldRevert) this.instance.options.revert = true;
+
+ //Trigger the stop of the sortable
+ this.instance._mouseStop(event);
+
+ this.instance.options.helper = this.instance.options._helper;
+
+ //If the helper has been the original item, restore properties in the sortable
+ if(inst.options.helper == 'original')
+ this.instance.currentItem.css({ top: 'auto', left: 'auto' });
+
+ } else {
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ this.instance._trigger("deactivate", event, uiSortable);
+ }
+
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), self = this;
+
+ var checkPos = function(o) {
+ var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
+ var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
+ var itemHeight = o.height, itemWidth = o.width;
+ var itemTop = o.top, itemLeft = o.left;
+
+ return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
+ };
+
+ $.each(inst.sortables, function(i) {
+
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
+
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+ if(!this.instance.isOver) {
+
+ this.instance.isOver = 1;
+ //Now we fake the start of dragging for the sortable instance,
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+ this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+ this.instance.options.helper = function() { return ui.helper[0]; };
+
+ event.target = this.instance.currentItem[0];
+ this.instance._mouseCapture(event, true);
+ this.instance._mouseStart(event, true, true);
+
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+ this.instance.offset.click.top = inst.offset.click.top;
+ this.instance.offset.click.left = inst.offset.click.left;
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+ inst._trigger("toSortable", event);
+ inst.dropped = this.instance.element; //draggable revert needs that
+ //hack so receive/update callbacks work (mostly)
+ inst.currentItem = inst.element;
+ this.instance.fromOutside = inst;
+
+ }
+
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+ if(this.instance.currentItem) this.instance._mouseDrag(event);
+
+ } else {
+
+ //If it doesn't intersect with the sortable, and it intersected before,
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+ this.instance.cancelHelperRemoval = true;
+
+ //Prevent reverting on this forced stop
+ this.instance.options.revert = false;
+
+ // The out event needs to be triggered independently
+ this.instance._trigger('out', event, this.instance._uiHash(this.instance));
+
+ this.instance._mouseStop(event, true);
+ this.instance.options.helper = this.instance.options._helper;
+
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+ this.instance.currentItem.remove();
+ if(this.instance.placeholder) this.instance.placeholder.remove();
+
+ inst._trigger("fromSortable", event);
+ inst.dropped = false; //draggable revert needs that
+ }
+
+ };
+
+ });
+
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function(event, ui) {
+ var t = $('body'), o = $(this).data('draggable').options;
+ if (t.css("cursor")) o._cursor = t.css("cursor");
+ t.css("cursor", o.cursor);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if (o._cursor) $('body').css("cursor", o._cursor);
+ }
+});
+
+$.ui.plugin.add("draggable", "iframeFix", {
+ start: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+ $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
+ .css({
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+ position: "absolute", opacity: "0.001", zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo("body");
+ });
+ },
+ stop: function(event, ui) {
+ $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data('draggable').options;
+ if(t.css("opacity")) o._opacity = t.css("opacity");
+ t.css('opacity', o.opacity);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if(o._opacity) $(ui.helper).css('opacity', o._opacity);
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function(event, ui) {
+ var i = $(this).data("draggable");
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
+ },
+ drag: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options, scrolled = false;
+
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
+
+ if(!o.axis || o.axis != 'x') {
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+ else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+ else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(!o.axis || o.axis != 'x') {
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(i, event);
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options;
+ i.snapElements = [];
+
+ $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
+ var $t = $(this); var $o = $t.offset();
+ if(this != i.element[0]) i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options;
+ var d = o.snapTolerance;
+
+ var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (var i = inst.snapElements.length - 1; i >= 0; i--){
+
+ var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
+ t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
+
+ //Yes, I know, this is insane ;)
+ if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
+ if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if(o.snapMode != 'inner') {
+ var ts = Math.abs(t - y2) <= d;
+ var bs = Math.abs(b - y1) <= d;
+ var ls = Math.abs(l - x2) <= d;
+ var rs = Math.abs(r - x1) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+ }
+
+ var first = (ts || bs || ls || rs);
+
+ if(o.snapMode != 'outer') {
+ var ts = Math.abs(t - y1) <= d;
+ var bs = Math.abs(b - y2) <= d;
+ var ls = Math.abs(l - x1) <= d;
+ var rs = Math.abs(r - x2) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+ }
+
+ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ };
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function(event, ui) {
+
+ var o = $(this).data("draggable").options;
+
+ var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
+ return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
+ });
+
+ $(group).each(function(i) {
+ this.style.zIndex = o.stack.min + i;
+ });
+
+ this[0].style.zIndex = o.stack.min + group.length;
+
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data("draggable").options;
+ if(t.css("zIndex")) o._zIndex = t.css("zIndex");
+ t.css('zIndex', o.zIndex);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data("draggable").options;
+ if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
+ }
+});
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.droppable.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.droppable.js
new file mode 100755
index 0000000..8e7be33
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.droppable.js
@@ -0,0 +1,282 @@
+/*
+ * jQuery UI Droppable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * ui.core.js
+ * ui.draggable.js
+ */
+(function($) {
+
+$.widget("ui.droppable", {
+
+ _init: function() {
+
+ var o = this.options, accept = o.accept;
+ this.isover = 0; this.isout = 1;
+
+ this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
+ return d.is(accept);
+ };
+
+ //Store the droppable's proportions
+ this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
+
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
+ $.ui.ddmanager.droppables[this.options.scope].push(this);
+
+ (this.options.addClasses && this.element.addClass("ui-droppable"));
+
+ },
+
+ destroy: function() {
+ var drop = $.ui.ddmanager.droppables[this.options.scope];
+ for ( var i = 0; i < drop.length; i++ )
+ if ( drop[i] == this )
+ drop.splice(i, 1);
+
+ this.element
+ .removeClass("ui-droppable ui-droppable-disabled")
+ .removeData("droppable")
+ .unbind(".droppable");
+ },
+
+ _setData: function(key, value) {
+
+ if(key == 'accept') {
+ this.options.accept = value && $.isFunction(value) ? value : function(d) {
+ return d.is(value);
+ };
+ } else {
+ $.widget.prototype._setData.apply(this, arguments);
+ }
+
+ },
+
+ _activate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.addClass(this.options.activeClass);
+ (draggable && this._trigger('activate', event, this.ui(draggable)));
+ },
+
+ _deactivate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ (draggable && this._trigger('deactivate', event, this.ui(draggable)));
+ },
+
+ _over: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
+ this._trigger('over', event, this.ui(draggable));
+ }
+
+ },
+
+ _out: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('out', event, this.ui(draggable));
+ }
+
+ },
+
+ _drop: function(event,custom) {
+
+ var draggable = custom || $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
+
+ var childrenIntersection = false;
+ this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
+ var inst = $.data(this, 'droppable');
+ if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
+ childrenIntersection = true; return false;
+ }
+ });
+ if(childrenIntersection) return false;
+
+ if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('drop', event, this.ui(draggable));
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function(c) {
+ return {
+ draggable: (c.currentItem || c.element),
+ helper: c.helper,
+ position: c.position,
+ absolutePosition: c.positionAbs, //deprecated
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.extend($.ui.droppable, {
+ version: "1.7.2",
+ eventPrefix: 'drop',
+ defaults: {
+ accept: '*',
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: 'default',
+ tolerance: 'intersect'
+ }
+});
+
+$.ui.intersect = function(draggable, droppable, toleranceMode) {
+
+ if (!droppable.offset) return false;
+
+ var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
+ y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
+ var l = droppable.offset.left, r = l + droppable.proportions.width,
+ t = droppable.offset.top, b = t + droppable.proportions.height;
+
+ switch (toleranceMode) {
+ case 'fit':
+ return (l < x1 && x2 < r
+ && t < y1 && y2 < b);
+ break;
+ case 'intersect':
+ return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
+ && x2 - (draggable.helperProportions.width / 2) < r // Left Half
+ && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
+ && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
+ break;
+ case 'pointer':
+ var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
+ isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
+ return isOver;
+ break;
+ case 'touch':
+ return (
+ (y1 >= t && y1 <= b) || // Top edge touching
+ (y2 >= t && y2 <= b) || // Bottom edge touching
+ (y1 < t && y2 > b) // Surrounded vertically
+ ) && (
+ (x1 >= l && x1 <= r) || // Left edge touching
+ (x2 >= l && x2 <= r) || // Right edge touching
+ (x1 < l && x2 > r) // Surrounded horizontally
+ );
+ break;
+ default:
+ return false;
+ break;
+ }
+
+};
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { 'default': [] },
+ prepareOffsets: function(t, event) {
+
+ var m = $.ui.ddmanager.droppables[t.options.scope];
+ var type = event ? event.type : null; // workaround for #2317
+ var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
+
+ droppablesLoop: for (var i = 0; i < m.length; i++) {
+
+ if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
+ for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
+ m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
+
+ m[i].offset = m[i].element.offset();
+ m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
+
+ if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
+
+ }
+
+ },
+ drop: function(draggable, event) {
+
+ var dropped = false;
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(!this.options) return;
+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
+ dropped = this._drop.call(this, event);
+
+ if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ this.isout = 1; this.isover = 0;
+ this._deactivate.call(this, event);
+ }
+
+ });
+ return dropped;
+
+ },
+ drag: function(draggable, event) {
+
+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
+
+ //Run through all droppables and check their positions based on specific tolerance options
+
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(this.options.disabled || this.greedyChild || !this.visible) return;
+ var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
+
+ var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
+ if(!c) return;
+
+ var parentInstance;
+ if (this.options.greedy) {
+ var parent = this.element.parents(':data(droppable):eq(0)');
+ if (parent.length) {
+ parentInstance = $.data(parent[0], 'droppable');
+ parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
+ }
+ }
+
+ // we just moved into a greedy child
+ if (parentInstance && c == 'isover') {
+ parentInstance['isover'] = 0;
+ parentInstance['isout'] = 1;
+ parentInstance._out.call(parentInstance, event);
+ }
+
+ this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
+ this[c == "isover" ? "_over" : "_out"].call(this, event);
+
+ // we just moved out of a greedy child
+ if (parentInstance && c == 'isout') {
+ parentInstance['isout'] = 0;
+ parentInstance['isover'] = 1;
+ parentInstance._over.call(parentInstance, event);
+ }
+ });
+
+ }
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.scoreboard.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.scoreboard.js
new file mode 100755
index 0000000..53a930a
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.scoreboard.js
@@ -0,0 +1,107 @@
+(function($){
+ $.widget('ui.scoreboard',
+ {
+ getScore : function(){
+ return this._getData('score');
+ },
+ setScore : function(newScore){
+ this._setData('score', parseInt(newScore));
+ this._refresh();
+ },
+ getTotal : function(){
+ return this._getData('total');
+ },
+ setTotal : function(newTotal){
+ this._setData('total', parseInt(newTotal));
+ this._refresh();
+ },
+ reset : function(){
+ this._setData('score', this._getData('initialScore'));
+ this._setData('total', this._getData('initialTotal'));
+ this._refresh();
+ },
+ inc : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') + incVal);
+ this._refresh();
+ if(this._getData('winScore') === this._getData('score')){
+ this.element.trigger('winGame');
+ }
+ },
+ incTotal : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') + incVal);
+ this._refresh();
+ },
+ dec : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') - decVal);
+ this._refresh();
+ },
+ decTotal : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') - decVal);
+ this._refresh();
+ },
+ _init : function(){
+
+ var divDisplay = "inline";
+ var score = this.options.score;
+ var total = this.options.total;
+ var layoutId = "h";
+ var self = this;
+
+
+ this._setData('initialScore', parseInt(this.options.score));
+ this._setData('initialTotal', parseInt(this.options.total));
+ this._setData('score', parseInt(this.options.score));
+ this._setData('total', parseInt(this.options.total));
+ this._setData('winScore', parseInt(this.options.winningScore) || 0);
+
+ if(this.options.layout === "vertical"){
+ layoutId = "v";
+ }
+
+ this.evWinGame = document.createEvent('Events');
+
+ this.element.addClass('ui-scoreboard-container-' + layoutId +
+ ' ui-widget ui-widget-content ui-corner-all');
+
+ var clone = $('<div>')
+ .addClass('ui-scoreboard-spacing-' + layoutId);
+ this._scoreText = $("<div>Score</div>")
+ .addClass('ui-scoreboard-spacing-'+ layoutId +
+ ' ui-corner-all ui-scoreboard-text')
+ .appendTo(this.element);
+ this._score = $("<div>" + score + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ $("<div>Total</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-corner-all ' +
+ 'ui-scoreboard-text')
+ .appendTo(this.element);
+ this._total = $("<div>" + total + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ },
+ _refresh : function(){
+ this._score.text(this._getData('score'));
+ this._total.text(this._getData('total'));
+ },
+ destroy : function(){
+ this.element.remove();
+ $.widget.prototype.destroy.apply(this, arguments);
+ }
+
+
+ });
+
+ $.ui.scoreboard.getter = ['getScore', 'getTotal'];
+ $.ui.scoreboard.defaults = {
+ score: 0, total: 0, layout: "horizontal", winningScore: 0
+ };
+
+ })(jQuery); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/.tmp_index.html.46799~ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/.tmp_index.html.46799~
new file mode 100755
index 0000000..100e6b7
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/.tmp_index.html.46799~
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Adding and Multiplying Variables</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Adding and Multiplying Variables || <span id="currentTitle"> चलको जोड र गुणन </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/correct.wav b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/correct.wav
new file mode 100755
index 0000000..a49ba33
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/correct.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/incorrect.wav b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/incorrect.wav
new file mode 100755
index 0000000..906c6a3
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/incorrect.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bgLeft.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bgLeft.png
new file mode 100755
index 0000000..18fc2e1
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bgLeft.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_footer.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_header.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_title_block.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/check.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/check.png
new file mode 100755
index 0000000..bd0afcb
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/check.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/gameOver.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/gameOver.png
new file mode 100755
index 0000000..81c403b
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/gameOver.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/help.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/help.png
new file mode 100755
index 0000000..f3505e7
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img0.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img0.png
new file mode 100755
index 0000000..ed86909
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img0.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img1.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img1.png
new file mode 100755
index 0000000..b87cab4
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img1.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img2.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img2.png
new file mode 100755
index 0000000..15de5ef
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img2.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img3.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img3.png
new file mode 100755
index 0000000..915e20a
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img3.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img4.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img4.png
new file mode 100755
index 0000000..d172dac
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img4.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img5.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img5.png
new file mode 100755
index 0000000..011aea5
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img5.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques0.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques0.png
new file mode 100755
index 0000000..c35776e
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques0.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques1.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques1.png
new file mode 100755
index 0000000..cec454c
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques1.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques2.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques2.png
new file mode 100755
index 0000000..eba02bd
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques2.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques3.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques3.png
new file mode 100755
index 0000000..6008fa0
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques3.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques4.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques4.png
new file mode 100755
index 0000000..8b5397f
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques4.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques5.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques5.png
new file mode 100755
index 0000000..ee8d142
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques5.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_lt.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_rt.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/lesson.css b/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/lesson.css
new file mode 100755
index 0000000..283bf25
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/lesson.css
@@ -0,0 +1,273 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }bgCalculation
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: abbgCalculationsolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ /*width: 25bgCalculation1px;*/
+ padding-right: 5px;
+ padding-top: 5px;
+}
+ #linkCheck{
+ margin: 1em 3em 0 0;
+ width: 101px; height: 30px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0 auto;
+ margin-top: 85px;
+ width: 95%;
+ padding: 0.5em;
+ height: 375px;
+}
+ #section{
+ width: 900px;
+ height: 400px;
+ margin: 0 auto;
+ }
+
+ #left-side{
+ padding-top: 80px;
+ margin: 0em auto;
+ float:left;
+ width: 360px;
+ height: 285px;
+ border: 2px solid black;
+ text-align:center;
+ background: url(../assets/image/bgLeft.png);
+ -moz-border-radius : 20px;
+ -webkit-border-radius : 20px;
+ border-radius : 20px;
+ }
+
+ #right-side{
+ float:right;
+ width: 383px;
+ height: 365px;
+ border: 2px solid black;
+ -moz-border-radius : 20px;
+ -webkit-border-radius : 20px;
+ border-radius : 20px;
+ background-color: #7FFFC9;
+
+ }
+
+ #rightBack{
+ background-repeat: no-repeat;
+ width: 383px;
+ height: 365px;
+ }
+
+ .bgCalculation{
+ position:absolute;
+ top: 58%;
+ right: 8%;
+ padding-top: 5px;
+ width: 360px;
+ height: 90px;
+ text-align:center;
+
+ }
+
+ #textQues1{
+ float:right;
+ width: 300px;
+ height:30px;
+ letter-spacing: 5px;
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ padding-right: 20px;
+
+ text-align:right;
+ }
+ #textQues2{
+ float:right;
+ width: 350px;
+ height:30px;
+ letter-spacing: 5px;
+ text-align:right;
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ padding-right: 15px;
+ }
+ #textQues3{
+ margin-top: 5px;
+ float:right;
+ text-align:right;
+ width: 300px;
+ height: 30px;
+ padding-right: 15px;
+ }
+ .blankBoxes{
+ padding-left: 15px;
+ width: 35px;
+ height: 40px;
+ border-bottom : 2px solid black;
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ }
+ .quesText{
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #000000;
+ }
+ input.textBox{
+ size:3;
+ font: 15px/20px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ height:20px;
+ width: 30px;
+ text-align:center;
+ }
+ .focus {
+ background-color: #FFEEAA;
+ }
+ .correct{
+ background-color: #C0F9F3;
+ }
+ .incorrect{
+ background-color: #FFFF00;
+ }
+
+ #help{
+ display:none;
+ position:absolute;
+ right: 20%;
+ top: 1%;
+ width: 224px;
+ height: 525px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+ #gameOver{
+ display:none;
+ position:absolute;
+ top: 40%;
+ left: 25%;
+ width: 432px;
+ height: 68px;
+ background: url('../assets/image/gameOver.png');
+ } \ No newline at end of file
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/ui.scoreboard.css b/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/ui.scoreboard.css
new file mode 100755
index 0000000..11cdbb5
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/ui.scoreboard.css
@@ -0,0 +1,62 @@
+.ui-scoreboard-container-h{
+max-width: 800em;
+max-height: 200px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+
+.ui-scoreboard-spacing-h{
+max-width: 200em;
+max-height: 300em;
+display:inline;
+margin-left:0.2em;
+margin-right:0.4em;
+}
+
+.ui-scoreboard-text{
+font-size:larger;
+text-align: center;
+}
+
+.ui-scoreboard-number-h {
+background-color:black;
+color: white;
+padding-left:0.4em;
+padding-right:0.4em;
+font-size:larger;
+}
+
+.ui-scoreboard-button{
+float:right;
+cursor:pointer;
+}
+
+button .ui-scoreboard-icon{
+float: left;
+margin-right:0.3em;
+}
+.ui-scoreboard-container-v{
+max-width: 200px;
+max-height: 400px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+.ui-scoreboard-spacing-v{
+display:block;
+margin: 0.4em;
+}
+
+.ui-scoreboard-number-v{
+background-color:black;
+color: white;
+width: 1em;
+text-align:center;
+margin-left:auto;
+margin-right: auto;
+padding:0.4em;
+font-size:larger;
+}
+
+
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/index.html b/examples/lessons/6_Maths_AddingAndSubtractingVariables/index.html
new file mode 100755
index 0000000..736b381
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/index.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Adding and Subtracting Variables</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Adding and Subtracting Variables||<span id="currentTitle">सजातीय पद हरुको जोड र घटाउ</span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/karma.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/lesson.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/lesson.js
new file mode 100755
index 0000000..9f094ca
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/lesson.js
@@ -0,0 +1,215 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.wav'},
+ {'name':'incorrect','file':'incorrect.wav'}
+ ]});
+
+ k.ready(function(){
+ var i,j;
+ var totalCounter;
+ var correctCounter;
+ var currentQuestion;
+ var TOTAL_QUES = 6;
+ var flag_correct;
+ var randPositions = [];
+ var check_num;
+
+ var variableName = new Array('x','p','y','x','x','r');
+ var perPack = new Array('16','80','25','30','15','70');
+ var quantity = new Array('4','1','2','3','2','1');
+ var finishedQty = new Array('8','30','16','7','7','22');
+
+ var answers = new Array('58','50','34','97','37','48');
+
+
+ var scoreboard = $('#score_box').scoreboard({'layout':'horizontal',
+ 'winningScore': TOTAL_QUES});
+
+ var genRandPosition=function (){
+ randPositions[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+ var next_question = function (){
+ if(totalCounter === TOTAL_QUES){
+ t=setTimeout(function(){delay_gameOver();},1000);
+ }
+ else{
+ currentQuestion = randPositions[totalCounter];
+ currentQuestion = totalCounter;
+ flag_correct = 1;
+ check_num = 0;
+ var sign;
+ $('#linkCheck').show();
+ $('#left-side').html('<img id="img'+currentQuestion+'" src="assets/image/img'+currentQuestion+'.png" />');
+ //$('#left-side').html('<img id="img'+currentQuestion+'" src="assets/image/img0.png" />');
+
+ $('#rightBack').css({'background':'url(assets/image/ques'+currentQuestion+'.png)'});
+ $('.bgCalculation').html('').append('<div id="textQues1"></div>');
+ $('.bgCalculation').append('<div id="textQues2"></div>');
+
+ if(currentQuestion ===3 || currentQuestion === 4){
+ sign = '+';
+ }
+ else{
+ sign = '-';
+
+ }
+ for( i = 0; i< quantity[currentQuestion]; i++){
+ $('#textQues1').append(variableName[currentQuestion]);
+ $('#textQues2').append('<span class="blankBoxes"></span>');
+ if(i != quantity[currentQuestion]-1){
+ $('#textQues1').append('+');
+ $('#textQues2').append('+');
+ }
+ else{
+
+ if(parseInt(quantity[currentQuestion]) === 1){
+ $('#textQues1').append(sign+''+finishedQty[currentQuestion]);
+ $('#textQues1').append(' = ').append(variableName[currentQuestion]);
+ $('#textQues1').append(sign+''+finishedQty[currentQuestion]);
+ $('#textQues2').append(sign+''+finishedQty[currentQuestion]);
+ $('#textQues2').append(' = ').append('<input type="text" id="text1" class="textBox" maxLength="2"/>');
+ $('#textQues2').append(sign+''+finishedQty[currentQuestion]);
+ }
+ else{
+ $('#textQues1').append(sign+''+finishedQty[currentQuestion]);
+ $('#textQues1').append(' = ').append(quantity[currentQuestion]+' * '+variableName[currentQuestion]);
+ $('#textQues1').append(sign+''+finishedQty[currentQuestion]);
+ $('#textQues2').append(sign+''+finishedQty[currentQuestion]);
+ $('#textQues2').append(' = ').append(quantity[currentQuestion]+' *'+'<input type="text" id="text1" class="textBox" maxLength="2"/>');
+ $('#textQues2').append(sign+''+finishedQty[currentQuestion]);
+ }
+
+
+ }
+ $("input#text1").focus();
+ }
+
+
+ foucs_blur();
+
+ }
+
+ };
+
+ function game_start(){
+ $('#gameOver').hide();
+ $('#linkCheck').show();
+ $('#section').removeClass('backOpaque');
+ genRandPosition();
+ next_question();
+ }
+
+ function game() {
+ totalCounter = 0;
+ correctCounter = 0;
+ $('#section').html('').append('<div id="left-side"></div>');
+ $('#section').append('<div id="right-side"></div>');
+ $('#right-side').append('<div id="rightBack"></div>');
+ $('#right-side').append('<div class="bgCalculation"></div>');
+ $('#help').hide();
+ $('#linkCheck').hide();
+ $('#gameOver').hide();
+ }
+
+ game();
+
+ var delay_nextQues = function(){
+ document.delayForm.delayval.value = 1;
+ next_question();
+ };
+
+ var delay_gameOver = function(){
+ document.delayForm.delayval.value = 1;
+ $('#section').addClass('backOpaque');
+ $('#linkCheck').hide();
+ $('#gameOver').show();
+ };
+
+ var check_answer = function(){
+ if(check_num === 0){
+ var textVal = $('#text1').val();
+ if(textVal === perPack[currentQuestion]){ // first one is correct
+ k.audio.correct.play();
+ $('.bgCalculation').append('<div id="textQues3"></div>');
+ $('.bgCalculation').append('<div id="textQues4"></div>');
+ $('#textQues3').append(' = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;').append('<input type="text" id="text2" class="textBox" maxLength="3"/>');
+ $('#text1').attr("disabled", true);
+ $('.blankBoxes').css({'padding':'0'}).html(perPack[currentQuestion]);
+ check_num++;
+ $("input#text2").focus();
+ foucs_blur();
+ }
+ else{
+ k.audio.incorrect.play();
+ flag_correct = 0;
+ }
+ }
+ else{
+ textVal = $('#text2').val();
+ //if(textVal === perPack[currentQuestion] * quantity[currentQuestion]){
+ if(textVal === answers[currentQuestion]){
+ k.audio.correct.play();
+ if(flag_correct === 1){
+ scoreboard.scoreboard('inc');
+ correctCounter++;
+ }
+ scoreboard.scoreboard('incTotal');
+ totalCounter++;
+ t=setTimeout(function(){delay_nextQues();},1000);
+ }
+ else{
+ flag_correct = 0;
+ k.audio.incorrect.play();
+ }
+ }
+ };
+
+ function foucs_blur(){
+
+ $('input[type="text"]')
+ .focus(function() {
+ $(this).removeClass('incorrect').addClass("focus");
+ })
+ .blur(function() {
+ $(this).removeClass("focus");
+ })
+ .keypress(function(event) {
+ if(event.which === 13){
+ check_answer();
+ }
+
+ });
+
+ $('#linkCheck').click(function(){
+ check_answer();
+ });
+ }
+
+ $('#linkStart').click(function(){
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ scoreboard.scoreboard('reset');
+ game_start();
+ });
+ $('#linkHelp').click(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+ });
+ }); //end of k.ready
+}); //end of document.ready \ No newline at end of file
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.core.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.core.js
new file mode 100755
index 0000000..5493e0a
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.core.js
@@ -0,0 +1,519 @@
+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+;jQuery.ui || (function($) {
+
+var _remove = $.fn.remove,
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+
+//Helper functions and ui object
+$.ui = {
+ version: "1.7.2",
+
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function(module, option, set) {
+ var proto = $.ui[module].prototype;
+ for(var i in set) {
+ proto.plugins[i] = proto.plugins[i] || [];
+ proto.plugins[i].push([option, set[i]]);
+ }
+ },
+ call: function(instance, name, args) {
+ var set = instance.plugins[name];
+ if(!set || !instance.element[0].parentNode) { return; }
+
+ for (var i = 0; i < set.length; i++) {
+ if (instance.options[set[i][0]]) {
+ set[i][1].apply(instance.element, args);
+ }
+ }
+ }
+ },
+
+ contains: function(a, b) {
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
+ },
+
+ hasScroll: function(el, a) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ($(el).css('overflow') == 'hidden') { return false; }
+
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
+ has = false;
+
+ if (el[scroll] > 0) { return true; }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[scroll] = 1;
+ has = (el[scroll] > 0);
+ el[scroll] = 0;
+ return has;
+ },
+
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
+ },
+
+ isOver: function(y, x, top, left, height, width) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+ },
+
+ keyCode: {
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+};
+
+// WAI-ARIA normalization
+if (isFF2) {
+ var attr = $.attr,
+ removeAttr = $.fn.removeAttr,
+ ariaNS = "http://www.w3.org/2005/07/aaa",
+ ariaState = /^aria-/,
+ ariaRole = /^wairole:/;
+
+ $.attr = function(elem, name, value) {
+ var set = value !== undefined;
+
+ return (name == 'role'
+ ? (set
+ ? attr.call(this, elem, name, "wairole:" + value)
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
+ : (ariaState.test(name)
+ ? (set
+ ? elem.setAttributeNS(ariaNS,
+ name.replace(ariaState, "aaa:"), value)
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
+ : attr.apply(this, arguments)));
+ };
+
+ $.fn.removeAttr = function(name) {
+ return (ariaState.test(name)
+ ? this.each(function() {
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
+ }) : removeAttr.call(this, name));
+ };
+}
+
+//jQuery plugins
+$.fn.extend({
+ remove: function() {
+ // Safari has a native remove event which actually removes DOM elements,
+ // so we have to use triggerHandler instead of trigger (#3037).
+ $("*", this).add(this).each(function() {
+ $(this).triggerHandler("remove");
+ });
+ return _remove.apply(this, arguments );
+ },
+
+ enableSelection: function() {
+ return this
+ .attr('unselectable', 'off')
+ .css('MozUserSelect', '')
+ .unbind('selectstart.ui');
+ },
+
+ disableSelection: function() {
+ return this
+ .attr('unselectable', 'on')
+ .css('MozUserSelect', 'none')
+ .bind('selectstart.ui', function() { return false; });
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ }
+});
+
+
+//Additional selectors
+$.extend($.expr[':'], {
+ data: function(elem, i, match) {
+ return !!$.data(elem, match[3]);
+ },
+
+ focusable: function(element) {
+ var nodeName = element.nodeName.toLowerCase(),
+ tabIndex = $.attr(element, 'tabindex');
+ return (/input|select|textarea|button|object/.test(nodeName)
+ ? !element.disabled
+ : 'a' == nodeName || 'area' == nodeName
+ ? element.href || !isNaN(tabIndex)
+ : !isNaN(tabIndex))
+ // the element and all of its ancestors must be visible
+ // the browser may report that the area is hidden
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
+ },
+
+ tabbable: function(element) {
+ var tabIndex = $.attr(element, 'tabindex');
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
+ }
+});
+
+
+// $.widget is a factory to create jQuery plugins
+// taking some boilerplate code out of the plugin code
+function getter(namespace, plugin, method, args) {
+ function getMethods(type) {
+ var methods = $[namespace][plugin][type] || [];
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
+ }
+
+ var methods = getMethods('getter');
+ if (args.length == 1 && typeof args[0] == 'string') {
+ methods = methods.concat(getMethods('getterSetter'));
+ }
+ return ($.inArray(method, methods) != -1);
+}
+
+$.widget = function(name, prototype) {
+ var namespace = name.split(".")[0];
+ name = name.split(".")[1];
+
+ // create plugin method
+ $.fn[name] = function(options) {
+ var isMethodCall = (typeof options == 'string'),
+ args = Array.prototype.slice.call(arguments, 1);
+
+ // prevent calls to internal methods
+ if (isMethodCall && options.substring(0, 1) == '_') {
+ return this;
+ }
+
+ // handle getter methods
+ if (isMethodCall && getter(namespace, name, options, args)) {
+ var instance = $.data(this[0], name);
+ return (instance ? instance[options].apply(instance, args)
+ : undefined);
+ }
+
+ // handle initialization and non-getter methods
+ return this.each(function() {
+ var instance = $.data(this, name);
+
+ // constructor
+ (!instance && !isMethodCall &&
+ $.data(this, name, new $[namespace][name](this, options))._init());
+
+ // method call
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
+ instance[options].apply(instance, args));
+ });
+ };
+
+ // create widget constructor
+ $[namespace] = $[namespace] || {};
+ $[namespace][name] = function(element, options) {
+ var self = this;
+
+ this.namespace = namespace;
+ this.widgetName = name;
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
+ this.widgetBaseClass = namespace + '-' + name;
+
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
+ this.element = $(element)
+ .bind('setData.' + name, function(event, key, value) {
+ if (event.target == element) {
+ return self._setData(key, value);
+ }
+ })
+ .bind('getData.' + name, function(event, key) {
+ if (event.target == element) {
+ return self._getData(key);
+ }
+ })
+ .bind('remove', function() {
+ return self.destroy();
+ });
+ };
+
+ // add widget prototype
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
+
+ // TODO: merge getter and getterSetter properties from widget prototype
+ // and plugin prototype
+ $[namespace][name].getterSetter = 'option';
+};
+
+$.widget.prototype = {
+ _init: function() {},
+ destroy: function() {
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
+ },
+
+ option: function(key, value) {
+ var options = key,
+ self = this;
+
+ if (typeof key == "string") {
+ if (value === undefined) {
+ return this._getData(key);
+ }
+ options = {};
+ options[key] = value;
+ }
+
+ $.each(options, function(key, value) {
+ self._setData(key, value);
+ });
+ },
+ _getData: function(key) {
+ return this.options[key];
+ },
+ _setData: function(key, value) {
+ this.options[key] = value;
+
+ if (key == 'disabled') {
+ this.element
+ [value ? 'addClass' : 'removeClass'](
+ this.widgetBaseClass + '-disabled' + ' ' +
+ this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
+ }
+ },
+
+ enable: function() {
+ this._setData('disabled', false);
+ },
+ disable: function() {
+ this._setData('disabled', true);
+ },
+
+ _trigger: function(type, event, data) {
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = $.Event(event);
+ event.type = eventName;
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if (event.originalEvent) {
+ for (var i = $.event.props.length, prop; i;) {
+ prop = $.event.props[--i];
+ event[prop] = event.originalEvent[prop];
+ }
+ }
+
+ this.element.trigger(event, data);
+
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
+ }
+};
+
+$.widget.defaults = {
+ disabled: false
+};
+
+
+/** Mouse Interaction Plugin **/
+
+$.ui.mouse = {
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ // Prevent text selection in IE
+ if ($.browser.msie) {
+ this._mouseUnselectable = this.element.attr('unselectable');
+ this.element.attr('unselectable', 'on');
+ }
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+
+ // Restore text selection in IE
+ ($.browser.msie
+ && this.element.attr('unselectable', this._mouseUnselectable));
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ // TODO: figure out why we have to use originalEvent
+ event.originalEvent = event.originalEvent || {};
+ if (event.originalEvent.mouseHandled) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ // preventDefault() is used to prevent the selection of text here -
+ // however, in Safari, this causes select boxes not to be selectable
+ // anymore, so this fix is needed
+ ($.browser.safari || event.preventDefault());
+
+ event.originalEvent.mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+};
+
+$.ui.mouse.defaults = {
+ cancel: null,
+ distance: 1,
+ delay: 0
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.draggable.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.draggable.js
new file mode 100755
index 0000000..0402f0e
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.draggable.js
@@ -0,0 +1,766 @@
+/*
+ * jQuery UI Draggable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * ui.core.js
+ */
+(function($) {
+
+$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
+
+ _init: function() {
+
+ if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
+ this.element[0].style.position = 'relative';
+
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
+
+ this._mouseInit();
+
+ },
+
+ destroy: function() {
+ if(!this.element.data('draggable')) return;
+ this.element
+ .removeData("draggable")
+ .unbind(".draggable")
+ .removeClass("ui-draggable"
+ + " ui-draggable-dragging"
+ + " ui-draggable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+
+ var o = this.options;
+
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
+ return false;
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle)
+ return false;
+
+ return true;
+
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if($.ui.ddmanager)
+ $.ui.ddmanager.current = this;
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css("position");
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.element.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
+ if(o.cursorAt)
+ this._adjustOffsetFromHelper(o.cursorAt);
+
+ //Set a containment if given in the options
+ if(o.containment)
+ this._setContainment();
+
+ //Call plugins and callbacks
+ this._trigger("start", event);
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(this, event);
+
+ this.helper.addClass("ui-draggable-dragging");
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ this._trigger('drag', event, ui);
+ this.position = ui.position;
+ }
+
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
+ dropped = $.ui.ddmanager.drop(this, event);
+
+ //if a drop comes from outside (a sortable)
+ if(this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ var self = this;
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ self._trigger("stop", event);
+ self._clear();
+ });
+ } else {
+ this._trigger("stop", event);
+ this._clear();
+ }
+
+ return false;
+ },
+
+ _getHandle: function(event) {
+
+ var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
+ $(this.options.handle, this.element)
+ .find("*")
+ .andSelf()
+ .each(function() {
+ if(this == event.target) handle = true;
+ });
+
+ return handle;
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options;
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
+
+ if(!helper.parents('body').length)
+ helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
+
+ if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
+ helper.css("position", "absolute");
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
+ if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
+ if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
+ po = { top: 0, left: 0 };
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition == "relative") {
+ var p = this.element.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
+ top: (parseInt(this.element.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var o = this.options;
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
+ ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+
+ if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
+ var ce = $(o.containment)[0]; if(!ce) return;
+ var co = $(o.containment).offset();
+ var over = ($(ce).css("overflow") != 'hidden');
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ } else if(o.containment.constructor == Array) {
+ this.containment = o.containment;
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) pos = this.position;
+ var mod = d == "absolute" ? 1 : -1;
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top // The absolute mouse position
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left // The absolute mouse position
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ var pageX = event.pageX;
+ var pageY = event.pageY;
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
+ if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
+ }
+
+ if(o.grid) {
+ var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY // The absolute mouse position
+ - this.offset.click.top // Click offset (relative to the element)
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX // The absolute mouse position
+ - this.offset.click.left // Click offset (relative to the element)
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
+ //if($.ui.ddmanager) $.ui.ddmanager.current = null;
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function(type, event, ui) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call(this, type, [event, ui]);
+ if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
+ return $.widget.prototype._trigger.call(this, type, event, ui);
+ },
+
+ plugins: {},
+
+ _uiHash: function(event) {
+ return {
+ helper: this.helper,
+ position: this.position,
+ absolutePosition: this.positionAbs, //deprecated
+ offset: this.positionAbs
+ };
+ }
+
+}));
+
+$.extend($.ui.draggable, {
+ version: "1.7.2",
+ eventPrefix: "drag",
+ defaults: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input,option",
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ delay: 0,
+ distance: 1,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false
+ }
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+ start: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options,
+ uiSortable = $.extend({}, ui, { item: inst.element });
+ inst.sortables = [];
+ $(o.connectToSortable).each(function() {
+ var sortable = $.data(this, 'sortable');
+ if (sortable && !sortable.options.disabled) {
+ inst.sortables.push({
+ instance: sortable,
+ shouldRevert: sortable.options.revert
+ });
+ sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+
+ },
+ stop: function(event, ui) {
+
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+ var inst = $(this).data("draggable"),
+ uiSortable = $.extend({}, ui, { item: inst.element });
+
+ $.each(inst.sortables, function() {
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
+ if(this.shouldRevert) this.instance.options.revert = true;
+
+ //Trigger the stop of the sortable
+ this.instance._mouseStop(event);
+
+ this.instance.options.helper = this.instance.options._helper;
+
+ //If the helper has been the original item, restore properties in the sortable
+ if(inst.options.helper == 'original')
+ this.instance.currentItem.css({ top: 'auto', left: 'auto' });
+
+ } else {
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ this.instance._trigger("deactivate", event, uiSortable);
+ }
+
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), self = this;
+
+ var checkPos = function(o) {
+ var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
+ var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
+ var itemHeight = o.height, itemWidth = o.width;
+ var itemTop = o.top, itemLeft = o.left;
+
+ return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
+ };
+
+ $.each(inst.sortables, function(i) {
+
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
+
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+ if(!this.instance.isOver) {
+
+ this.instance.isOver = 1;
+ //Now we fake the start of dragging for the sortable instance,
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+ this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+ this.instance.options.helper = function() { return ui.helper[0]; };
+
+ event.target = this.instance.currentItem[0];
+ this.instance._mouseCapture(event, true);
+ this.instance._mouseStart(event, true, true);
+
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+ this.instance.offset.click.top = inst.offset.click.top;
+ this.instance.offset.click.left = inst.offset.click.left;
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+ inst._trigger("toSortable", event);
+ inst.dropped = this.instance.element; //draggable revert needs that
+ //hack so receive/update callbacks work (mostly)
+ inst.currentItem = inst.element;
+ this.instance.fromOutside = inst;
+
+ }
+
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+ if(this.instance.currentItem) this.instance._mouseDrag(event);
+
+ } else {
+
+ //If it doesn't intersect with the sortable, and it intersected before,
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+ this.instance.cancelHelperRemoval = true;
+
+ //Prevent reverting on this forced stop
+ this.instance.options.revert = false;
+
+ // The out event needs to be triggered independently
+ this.instance._trigger('out', event, this.instance._uiHash(this.instance));
+
+ this.instance._mouseStop(event, true);
+ this.instance.options.helper = this.instance.options._helper;
+
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+ this.instance.currentItem.remove();
+ if(this.instance.placeholder) this.instance.placeholder.remove();
+
+ inst._trigger("fromSortable", event);
+ inst.dropped = false; //draggable revert needs that
+ }
+
+ };
+
+ });
+
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function(event, ui) {
+ var t = $('body'), o = $(this).data('draggable').options;
+ if (t.css("cursor")) o._cursor = t.css("cursor");
+ t.css("cursor", o.cursor);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if (o._cursor) $('body').css("cursor", o._cursor);
+ }
+});
+
+$.ui.plugin.add("draggable", "iframeFix", {
+ start: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+ $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
+ .css({
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+ position: "absolute", opacity: "0.001", zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo("body");
+ });
+ },
+ stop: function(event, ui) {
+ $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data('draggable').options;
+ if(t.css("opacity")) o._opacity = t.css("opacity");
+ t.css('opacity', o.opacity);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if(o._opacity) $(ui.helper).css('opacity', o._opacity);
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function(event, ui) {
+ var i = $(this).data("draggable");
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
+ },
+ drag: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options, scrolled = false;
+
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
+
+ if(!o.axis || o.axis != 'x') {
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+ else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+ else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(!o.axis || o.axis != 'x') {
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(i, event);
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options;
+ i.snapElements = [];
+
+ $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
+ var $t = $(this); var $o = $t.offset();
+ if(this != i.element[0]) i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options;
+ var d = o.snapTolerance;
+
+ var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (var i = inst.snapElements.length - 1; i >= 0; i--){
+
+ var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
+ t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
+
+ //Yes, I know, this is insane ;)
+ if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
+ if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if(o.snapMode != 'inner') {
+ var ts = Math.abs(t - y2) <= d;
+ var bs = Math.abs(b - y1) <= d;
+ var ls = Math.abs(l - x2) <= d;
+ var rs = Math.abs(r - x1) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+ }
+
+ var first = (ts || bs || ls || rs);
+
+ if(o.snapMode != 'outer') {
+ var ts = Math.abs(t - y1) <= d;
+ var bs = Math.abs(b - y2) <= d;
+ var ls = Math.abs(l - x1) <= d;
+ var rs = Math.abs(r - x2) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+ }
+
+ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ };
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function(event, ui) {
+
+ var o = $(this).data("draggable").options;
+
+ var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
+ return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
+ });
+
+ $(group).each(function(i) {
+ this.style.zIndex = o.stack.min + i;
+ });
+
+ this[0].style.zIndex = o.stack.min + group.length;
+
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data("draggable").options;
+ if(t.css("zIndex")) o._zIndex = t.css("zIndex");
+ t.css('zIndex', o.zIndex);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data("draggable").options;
+ if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
+ }
+});
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.droppable.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.droppable.js
new file mode 100755
index 0000000..8e7be33
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.droppable.js
@@ -0,0 +1,282 @@
+/*
+ * jQuery UI Droppable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * ui.core.js
+ * ui.draggable.js
+ */
+(function($) {
+
+$.widget("ui.droppable", {
+
+ _init: function() {
+
+ var o = this.options, accept = o.accept;
+ this.isover = 0; this.isout = 1;
+
+ this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
+ return d.is(accept);
+ };
+
+ //Store the droppable's proportions
+ this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
+
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
+ $.ui.ddmanager.droppables[this.options.scope].push(this);
+
+ (this.options.addClasses && this.element.addClass("ui-droppable"));
+
+ },
+
+ destroy: function() {
+ var drop = $.ui.ddmanager.droppables[this.options.scope];
+ for ( var i = 0; i < drop.length; i++ )
+ if ( drop[i] == this )
+ drop.splice(i, 1);
+
+ this.element
+ .removeClass("ui-droppable ui-droppable-disabled")
+ .removeData("droppable")
+ .unbind(".droppable");
+ },
+
+ _setData: function(key, value) {
+
+ if(key == 'accept') {
+ this.options.accept = value && $.isFunction(value) ? value : function(d) {
+ return d.is(value);
+ };
+ } else {
+ $.widget.prototype._setData.apply(this, arguments);
+ }
+
+ },
+
+ _activate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.addClass(this.options.activeClass);
+ (draggable && this._trigger('activate', event, this.ui(draggable)));
+ },
+
+ _deactivate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ (draggable && this._trigger('deactivate', event, this.ui(draggable)));
+ },
+
+ _over: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
+ this._trigger('over', event, this.ui(draggable));
+ }
+
+ },
+
+ _out: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('out', event, this.ui(draggable));
+ }
+
+ },
+
+ _drop: function(event,custom) {
+
+ var draggable = custom || $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
+
+ var childrenIntersection = false;
+ this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
+ var inst = $.data(this, 'droppable');
+ if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
+ childrenIntersection = true; return false;
+ }
+ });
+ if(childrenIntersection) return false;
+
+ if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('drop', event, this.ui(draggable));
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function(c) {
+ return {
+ draggable: (c.currentItem || c.element),
+ helper: c.helper,
+ position: c.position,
+ absolutePosition: c.positionAbs, //deprecated
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.extend($.ui.droppable, {
+ version: "1.7.2",
+ eventPrefix: 'drop',
+ defaults: {
+ accept: '*',
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: 'default',
+ tolerance: 'intersect'
+ }
+});
+
+$.ui.intersect = function(draggable, droppable, toleranceMode) {
+
+ if (!droppable.offset) return false;
+
+ var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
+ y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
+ var l = droppable.offset.left, r = l + droppable.proportions.width,
+ t = droppable.offset.top, b = t + droppable.proportions.height;
+
+ switch (toleranceMode) {
+ case 'fit':
+ return (l < x1 && x2 < r
+ && t < y1 && y2 < b);
+ break;
+ case 'intersect':
+ return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
+ && x2 - (draggable.helperProportions.width / 2) < r // Left Half
+ && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
+ && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
+ break;
+ case 'pointer':
+ var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
+ isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
+ return isOver;
+ break;
+ case 'touch':
+ return (
+ (y1 >= t && y1 <= b) || // Top edge touching
+ (y2 >= t && y2 <= b) || // Bottom edge touching
+ (y1 < t && y2 > b) // Surrounded vertically
+ ) && (
+ (x1 >= l && x1 <= r) || // Left edge touching
+ (x2 >= l && x2 <= r) || // Right edge touching
+ (x1 < l && x2 > r) // Surrounded horizontally
+ );
+ break;
+ default:
+ return false;
+ break;
+ }
+
+};
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { 'default': [] },
+ prepareOffsets: function(t, event) {
+
+ var m = $.ui.ddmanager.droppables[t.options.scope];
+ var type = event ? event.type : null; // workaround for #2317
+ var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
+
+ droppablesLoop: for (var i = 0; i < m.length; i++) {
+
+ if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
+ for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
+ m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
+
+ m[i].offset = m[i].element.offset();
+ m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
+
+ if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
+
+ }
+
+ },
+ drop: function(draggable, event) {
+
+ var dropped = false;
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(!this.options) return;
+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
+ dropped = this._drop.call(this, event);
+
+ if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ this.isout = 1; this.isover = 0;
+ this._deactivate.call(this, event);
+ }
+
+ });
+ return dropped;
+
+ },
+ drag: function(draggable, event) {
+
+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
+
+ //Run through all droppables and check their positions based on specific tolerance options
+
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(this.options.disabled || this.greedyChild || !this.visible) return;
+ var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
+
+ var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
+ if(!c) return;
+
+ var parentInstance;
+ if (this.options.greedy) {
+ var parent = this.element.parents(':data(droppable):eq(0)');
+ if (parent.length) {
+ parentInstance = $.data(parent[0], 'droppable');
+ parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
+ }
+ }
+
+ // we just moved into a greedy child
+ if (parentInstance && c == 'isover') {
+ parentInstance['isover'] = 0;
+ parentInstance['isout'] = 1;
+ parentInstance._out.call(parentInstance, event);
+ }
+
+ this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
+ this[c == "isover" ? "_over" : "_out"].call(this, event);
+
+ // we just moved out of a greedy child
+ if (parentInstance && c == 'isout') {
+ parentInstance['isout'] = 0;
+ parentInstance['isover'] = 1;
+ parentInstance._over.call(parentInstance, event);
+ }
+ });
+
+ }
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.scoreboard.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.scoreboard.js
new file mode 100755
index 0000000..53a930a
--- /dev/null
+++ b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.scoreboard.js
@@ -0,0 +1,107 @@
+(function($){
+ $.widget('ui.scoreboard',
+ {
+ getScore : function(){
+ return this._getData('score');
+ },
+ setScore : function(newScore){
+ this._setData('score', parseInt(newScore));
+ this._refresh();
+ },
+ getTotal : function(){
+ return this._getData('total');
+ },
+ setTotal : function(newTotal){
+ this._setData('total', parseInt(newTotal));
+ this._refresh();
+ },
+ reset : function(){
+ this._setData('score', this._getData('initialScore'));
+ this._setData('total', this._getData('initialTotal'));
+ this._refresh();
+ },
+ inc : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') + incVal);
+ this._refresh();
+ if(this._getData('winScore') === this._getData('score')){
+ this.element.trigger('winGame');
+ }
+ },
+ incTotal : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') + incVal);
+ this._refresh();
+ },
+ dec : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') - decVal);
+ this._refresh();
+ },
+ decTotal : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') - decVal);
+ this._refresh();
+ },
+ _init : function(){
+
+ var divDisplay = "inline";
+ var score = this.options.score;
+ var total = this.options.total;
+ var layoutId = "h";
+ var self = this;
+
+
+ this._setData('initialScore', parseInt(this.options.score));
+ this._setData('initialTotal', parseInt(this.options.total));
+ this._setData('score', parseInt(this.options.score));
+ this._setData('total', parseInt(this.options.total));
+ this._setData('winScore', parseInt(this.options.winningScore) || 0);
+
+ if(this.options.layout === "vertical"){
+ layoutId = "v";
+ }
+
+ this.evWinGame = document.createEvent('Events');
+
+ this.element.addClass('ui-scoreboard-container-' + layoutId +
+ ' ui-widget ui-widget-content ui-corner-all');
+
+ var clone = $('<div>')
+ .addClass('ui-scoreboard-spacing-' + layoutId);
+ this._scoreText = $("<div>Score</div>")
+ .addClass('ui-scoreboard-spacing-'+ layoutId +
+ ' ui-corner-all ui-scoreboard-text')
+ .appendTo(this.element);
+ this._score = $("<div>" + score + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ $("<div>Total</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-corner-all ' +
+ 'ui-scoreboard-text')
+ .appendTo(this.element);
+ this._total = $("<div>" + total + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ },
+ _refresh : function(){
+ this._score.text(this._getData('score'));
+ this._total.text(this._getData('total'));
+ },
+ destroy : function(){
+ this.element.remove();
+ $.widget.prototype.destroy.apply(this, arguments);
+ }
+
+
+ });
+
+ $.ui.scoreboard.getter = ['getScore', 'getTotal'];
+ $.ui.scoreboard.defaults = {
+ score: 0, total: 0, layout: "horizontal", winningScore: 0
+ };
+
+ })(jQuery); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.10987~ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.10987~
new file mode 100755
index 0000000..3997344
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.10987~
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<head>
+ <title>Class English Raju And The Wolf</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Raju And The Wolf <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section">
+ <div id="topText">
+ Click on the answer you think is correct.
+ </div>
+ <div id="question"></div>
+ <div id="answer"></div>
+ <div id="optionSection"></div>
+ <div id="imgStory"></div>
+ </div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <div id="score_box">
+ <form name="scoreForm">
+ अंक:
+ <input name="score" type="text" id="score" size="2" maxlength="2" /> |
+ <input name="full_mark" type="text" id="full_mark" size="2" maxlength="2"/>
+ </form>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.57021~ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.57021~
new file mode 100755
index 0000000..6a7d4ba
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.57021~
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<head>
+ <title>Class English Sentence Practice 1</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Sentence Practice || <span id="currentTitle">Part 1</span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section">
+ <div id="topText">
+ Choose the right word to fill in the blank space.
+ </div>
+ <div id="question">
+
+ </div>
+ <div id="optionSection"></div>
+ <img class="imgSentence" src="assets/image/main.png">
+ </div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <div id="score_box">
+ <form name="scoreForm">
+ अंक:
+ <input name="score" type="text" id="score" size="2" maxlength="2" /> |
+ <input name="full_mark" type="text" id="full_mark" size="2" maxlength="2"/>
+ </form>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.6785~ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.6785~
new file mode 100755
index 0000000..6a7d4ba
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.6785~
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<head>
+ <title>Class English Sentence Practice 1</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ English Sentence Practice || <span id="currentTitle">Part 1</span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section">
+ <div id="topText">
+ Choose the right word to fill in the blank space.
+ </div>
+ <div id="question">
+
+ </div>
+ <div id="optionSection"></div>
+ <img class="imgSentence" src="assets/image/main.png">
+ </div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <div id="score_box">
+ <form name="scoreForm">
+ अंक:
+ <input name="score" type="text" id="score" size="2" maxlength="2" /> |
+ <input name="full_mark" type="text" id="full_mark" size="2" maxlength="2"/>
+ </form>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.72685~ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.72685~
new file mode 100755
index 0000000..d7f1249
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.72685~
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Math Set Multiple Choice</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Set Multiple Choice <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section">
+ <div id="topText">
+ Click on the answer you think is correct.
+ </div>
+ <div id="question"></div>
+ <div id="optionSection"></div>
+ <div id="answer"></div>
+ </div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <div id="score_box">
+ <form name="scoreForm">
+ अंक:
+ <input name="score" type="text" id="score" size="2" maxlength="2" /> |
+ <input name="full_mark" type="text" id="full_mark" size="2" maxlength="2"/>
+ </form>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.81724~ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.81724~
new file mode 100755
index 0000000..eed25b5
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.81724~
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Matching Factors and Products</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Matching Factors and Products<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerTitle">Timer:</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ <div id="timerBox2" class="timerBoxes"></div>
+ <div id="timerBox3" class="timerBoxes"></div>
+ </div>
+ <div id="clickDisplay">
+ <div id="clickTitle">Clicks:</div>
+ <div id="clickBox"></div>
+ </div>
+
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.99718~ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.99718~
new file mode 100755
index 0000000..d7f1249
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/.tmp_index.html.99718~
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Math Set Multiple Choice</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Set Multiple Choice <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section">
+ <div id="topText">
+ Click on the answer you think is correct.
+ </div>
+ <div id="question"></div>
+ <div id="optionSection"></div>
+ <div id="answer"></div>
+ </div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <div id="score_box">
+ <form name="scoreForm">
+ अंक:
+ <input name="score" type="text" id="score" size="2" maxlength="2" /> |
+ <input name="full_mark" type="text" id="full_mark" size="2" maxlength="2"/>
+ </form>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/correct.ogg b/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/correct.ogg
new file mode 100755
index 0000000..a0d9e3a
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/correct.ogg
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/incorrect.ogg b/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/incorrect.ogg
new file mode 100755
index 0000000..4805e55
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/incorrect.ogg
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/a.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/a.png
new file mode 100755
index 0000000..635ffa4
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/a.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/b.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/b.png
new file mode 100755
index 0000000..a03655e
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/b.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_footer.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_header.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_title_block.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/c.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/c.png
new file mode 100755
index 0000000..cad4fc1
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/c.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/correct.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/correct.png
new file mode 100755
index 0000000..f2dbc5a
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/d.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/d.png
new file mode 100755
index 0000000..709a8ee
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/d.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques1def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques1def.png
new file mode 100755
index 0000000..721e969
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques1def.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques2def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques2def.png
new file mode 100755
index 0000000..e5ebb6e
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques2def.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques3def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques3def.png
new file mode 100755
index 0000000..044e758
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques3def.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques4def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques4def.png
new file mode 100755
index 0000000..87e4e5c
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques4def.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques5def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques5def.png
new file mode 100755
index 0000000..b9f8f0c
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques5def.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques6def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques6def.png
new file mode 100755
index 0000000..6e50a4b
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques6def.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques7def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques7def.png
new file mode 100755
index 0000000..b065e27
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques7def.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques8def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques8def.png
new file mode 100755
index 0000000..280f318
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques8def.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_lt.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_rt.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/volume.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/volume.png
new file mode 100755
index 0000000..4cf5397
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/volume.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/wrong.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/wrong.png
new file mode 100755
index 0000000..edfe9c5
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/wrong.png
Binary files differ
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/css/lesson.css b/examples/lessons/6_Maths_SetMultipleChoice/css/lesson.css
new file mode 100755
index 0000000..3c784d3
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/css/lesson.css
@@ -0,0 +1,224 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: absolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 10px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ width: 251px;
+ padding-right: 5px;
+ padding-top: 5px;संख्यामा तर
+}
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0px auto;
+ margin-top: 90px;
+ width: 95%;
+ height: 375px;
+
+}
+#section{
+ margin: 0px auto;
+}
+
+ #topText{
+ width: 350px;
+ height:25px;
+ font: 15px/20px Arial, Helvetica, sans-serif;
+ color: #FF9900;
+ }
+ #question{
+ text-align:center;
+ margin: 2px auto;
+ padding:5px;
+ width: 700px;
+ height:30px;
+ font: 20px/25px Arial, Helvetica, sans-serif;
+ color: #0000FF;
+ }
+ #answer{
+ margin: 2px auto;
+ padding:2px;
+ width: 600px;
+ height: 80px;
+ text-align:center;
+ font: 20px/25px Arial, Helvetica, sans-serif;
+ color: #000000;
+ border: 5px groove #FF9900;
+ }
+
+
+ #optionSection{
+ margin: 5px auto;
+ margin-bottom: 2px;
+ width: 550px;
+ height: 210px;
+ }
+ .options{
+ float:left;
+ width: 44px;
+ height: 46px;
+ }
+ .check{
+ margin-top: 10px;
+ float:left;
+ width: 36px;
+ height: 32px;
+ }
+ .optionText{
+ float:left;
+ margin-left:0.7em;
+ width: 450px;
+ height: 50px;
+ font: 18px/50px Arial, Helvetica, sans-serif;
+ color: #000000;
+ }
+
+
+#gameOver{
+ display:none;
+ position:absolute;
+ top: 40%;
+ left: 20%;
+ text-align:center;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ color:red;
+}
+#gameOverInfo{
+ margin-top: 35px;
+ text-align:center;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#000000;
+
+}
+.specialText{
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF9900;
+ border-bottom: 2px dotted #CCC;
+
+}
+
+
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/index.html b/examples/lessons/6_Maths_SetMultipleChoice/index.html
new file mode 100755
index 0000000..d7f1249
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/index.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Math Set Multiple Choice</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Set Multiple Choice <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section">
+ <div id="topText">
+ Click on the answer you think is correct.
+ </div>
+ <div id="question"></div>
+ <div id="optionSection"></div>
+ <div id="answer"></div>
+ </div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <div id="score_box">
+ <form name="scoreForm">
+ अंक:
+ <input name="score" type="text" id="score" size="2" maxlength="2" /> |
+ <input name="full_mark" type="text" id="full_mark" size="2" maxlength="2"/>
+ </form>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_SetMultipleChoice/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_SetMultipleChoice/js/lesson.js b/examples/lessons/6_Maths_SetMultipleChoice/js/lesson.js
new file mode 100755
index 0000000..1d33caa
--- /dev/null
+++ b/examples/lessons/6_Maths_SetMultipleChoice/js/lesson.js
@@ -0,0 +1,193 @@
+$(document).ready(function() {
+ var i,j,flag;
+ var clickedObject; //store the clicked image id
+ var correctCounter = 0;
+ var totalCounter = 0;
+ var objrand = [];
+ var randQues = [];
+ var currentObj; //store the current object clicked
+ var currentQuestion;
+ var NUM_OBJECTS = 4; //no of options
+ var TOTAL_QUES = 8;
+ var flag_correct;
+
+ var questions = new Array('समूह V = {a,e,i,o,u}लाई कसरी लेख्दा ठिक हुदैन ',
+ 'MISSISSIPPI (नदीको) नाममा भएका अङ्ग्रेजी वर्णमालाका अक्षर हरुको M समुह बनाउदा कसरी लेख्नुपर्छ ',
+ 'चिन्ह &isin; ले के जनाउछ ',
+ 'चिन्ह &notin; ले के जनाउछ',
+ 'समुहको गणनात्मकता (cardinal numbers) भन्नाले के बुझिन्छ ',
+ 'बराबर समुह (equal sets) भन्नाले के बुझिन्छ' ,
+ 'समतुल्य समुह (equivalent sets) भन्नाले के बुझिन्छ',
+ 'चिन्ह &empty; ले कस्तो समुह जनाउछ'
+ );
+
+
+ //current answer among four stored at first 4 options for each questions
+ var answers = new Array(
+ 'V = {e,a,i,a,u}','V = {e,a,o,i,u}','V = {i,u,a,o,e}','V = {a,e,o,i,u}',
+ 'M = {M,I,S,I,P,I}','M = {M,I,S,S,I,S,S,I,P,P,I}','M = {M,I,S,P}','M = {M,I,S,S,P}',
+ 'समुहको सदस्य हो','समुहको सदस्य होइन','उप-समुह हो','उप-समुह होइन ',
+ 'समुहको सदस्य होइन','समुहको सदस्य हो','उप-समुह हो','उप-समुह होइन ',
+ 'समुहमा भएका सदस्यहरुको सङ्ख्या','सङ्ख्याहरु मिलेर बनेको समुह','समुहहरुको सङ्ख्या','समुहलाई गन्ने',
+ 'दुईओटा समुहमा उतिकै र उही सदस्यहरु छन् ', 'दुईओटा समुहमा उतिकै संख्यामा सदस्यहरु छन्',
+ 'दुईओटा समुहमा उतिकै केहि सदस्यहरु एकअर्कासंग मिल्छन' ,'दुईओटा समुहमा उतिकै संख्यामा तर सदस्यहरु सबै फरक हुनुपर्छ ',
+ 'दुईओटा समुहमा उतिकै संख्यामा सदस्यहरु छन्','दुईओटा समुहमा उतिकै र उही सदस्यहरु छन् ',
+ 'दुईओटा समुहमा उतिकै केहि सदस्यहरु एकअर्कासंग मिल्छन' ,'दुईओटा समुहमा उतिकै संख्यामा तर सदस्यहरु सबै फरक हुनुपर्छ ',
+ 'एउटा पनि सदस्य नभएको समुह ',' 0 (शून्य) संख्या सदस्य भएको समुह','सबैभन्दा ठुलो समुह ','उप-समुह'
+ );
+
+
+ var nepaliNumbers = new Array('०','१','२','३','४','५','६');
+ var optionImg = new Array('a','b','c','d');
+
+ var randNumber = function(limit){ //generate random number between any two ranges
+ var rand_no = Math.floor(limit*Math.random());
+ return rand_no;
+ };
+
+ var generate_random_questions = function(){
+ randQues[0] = randNumber(TOTAL_QUES);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randQues[i] = randNumber(TOTAL_QUES);
+ for(j=0; j<i; j++){
+ if(randQues[i]===randQues[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+ var generate_random_options_no = function(){
+ objrand[0] = randNumber(NUM_OBJECTS);
+ for(i=1; i<NUM_OBJECTS; i++){
+ do{
+ flag = 0;
+ objrand[i] = randNumber(NUM_OBJECTS);
+ for(j=0; j<i; j++){
+ if(objrand[i]===objrand[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+
+ };
+
+ var display_score = function(){
+ document.scoreForm.score.value = nepaliNumbers[correctCounter];
+ document.scoreForm.full_mark.value = nepaliNumbers[totalCounter];
+ };
+
+ var display_game_over = function(){
+ $('#section').hide();
+ $('#linkNext').hide();
+ $('#gameOver').show();
+ $('#gameOver').html();
+ $('#gameOver').append('Game Over !!!');
+ if(correctCounter === totalCounter){
+ $('#gameOver').append('<div id="gameOverInfo">बधाई छ !!! सबै उत्तर सहि भए !!! </div>');
+ }
+ else{
+ $('#gameOver').append('<div id="gameOverInfo">किन गलत भयो पत्ता लगाउ र अर्को पटक सहि बनाउने कोशिश गर । <br /> You Got <span class="specialText">'+correctCounter+
+ '</span> correct out of <span class="specialText">'+totalCounter+'</span> questions .</div>');
+ }
+ };
+
+ var delay = function(){
+ document.delayForm.delayval.value = 1;
+ display_game_over();
+ };
+ var check_game_over = function(){
+ if(totalCounter === TOTAL_QUES){ //show all
+ t=setTimeout(function(){delay();},1000);
+ }
+ };
+
+ var store_clicked_object = function(objectClicked){
+ var checked;
+ if(objrand[objectClicked] ===0){
+ if(flag_correct == 1){ //correct at first attempt
+ checked = "correct";
+ correctCounter++;
+ }
+ }
+ else{
+
+ flag_correct = 0;
+ checked = "wrong";
+ }
+
+ flag_correct = 0;
+ $('#checkans'+objectClicked).html('');
+ $('#checkans'+objectClicked).append('<img src="assets/image/'+checked+'.png">');
+ $('#answer').show('');
+ $('#answer').html('');
+ var quesNo =currentQuestion+1;
+ $('#answer').append('<img src="assets/image/ques'+quesNo+'def.png">');
+ $('#linkNext').show();
+ totalCounter++;
+ display_score();
+ check_game_over();
+ };
+
+
+ var assignOptions = function (square){
+ var a = currentQuestion*4;
+ var randOption = objrand[square]+a;
+ $('#optionSection').append('<div id="checkans'+square+'" class = "check"></div>');
+ $('#optionSection').append('<a href="#"></a>');
+ $('#optionSection a:last-of-type').append('<div class="options" id="option'+square+'">'+
+ '<img src="assets/image/'+optionImg[square]+'.png"></div>');
+ $('#optionSection a:last-of-type').append('<div class="optionText">'+answers[randOption]+'</div>');
+ $('#optionSection a:last-of-type').click(function(){
+ if(flag_correct === 1){
+ store_clicked_object(square);
+ }
+ });
+ };
+
+ var next_sentence = function(){
+ flag_correct = 1;
+ var imgName,topPos;
+ generate_random_options_no();
+ currentQuestion = randQues[totalCounter];
+ $('#question').html('');
+ $('#question').append(nepaliNumbers[totalCounter+1]).append(' .');
+ $('#question').append(questions[currentQuestion]).append(' ?');
+ for(var i = 0; i < 4; i++){
+ assignOptions(i);
+ }
+ };
+ function game(){
+ $('#gameOver').hide();
+ $('#section').show();
+ $('#answer').hide();
+ correctCounter = 0;
+ totalCounter = 0;
+ $('#linkNext').hide();
+ $('#optionSection').html('');
+ display_score();
+ generate_random_questions();
+ next_sentence();
+ }
+ $('#linkNext').click(function(){
+ $('#linkNext').hide();
+ $('#optionSection').html('');
+ $('#answer').hide('');
+ next_sentence();
+ });
+
+ $('#linkStart').click(function(){
+ game();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ game();
+ });
+ $('#answer').hide();
+ display_score();
+ $('#linkNext').hide();
+
+});//end of DOM
diff --git a/examples/lessons/6_Maths_goShopping/.tmp_index.html.30266~ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.30266~
new file mode 100755
index 0000000..0a633f5
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.30266~
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Go Shopping</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ Go Shopping || <span id="currentTitle">किनमेल </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="left-side"></div>
+ <div id="right-side"></div>
+ <div id="checkSection"></div>
+ </div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_goShopping/.tmp_index.html.38007~ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.38007~
new file mode 100755
index 0000000..ccbe4d6
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.38007~
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox1" class="timerBoxes"></div>
+ <div id="timerBox2" class="timerBoxes"></div>
+ <div id="timerBox3" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_goShopping/.tmp_index.html.44857~ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.44857~
new file mode 100755
index 0000000..0a633f5
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.44857~
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Go Shopping</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ Go Shopping || <span id="currentTitle">किनमेल </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="left-side"></div>
+ <div id="right-side"></div>
+ <div id="checkSection"></div>
+ </div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_goShopping/.tmp_index.html.54401~ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.54401~
new file mode 100755
index 0000000..b2ecae3
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.54401~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox1" class="timerBoxes"></div>
+ <div id="timerBox2" class="timerBoxes"></div>
+ <div id="timerBox3" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_goShopping/.tmp_index.html.94449~ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.94449~
new file mode 100755
index 0000000..b88c678
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.94449~
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Go Shopping</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ Go Shopping || <span id="currentTitle">किनमेल </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="left-side"></div>
+ <div id="right-side"></div>
+ <div id="checkSection">
+ <div id="checkButtons">
+ <img id="moneyOk" class="checkMoney" src="assets/image/moneyOk.png" />
+ <img id="moneyNeeded" class="checkMoney" src="assets/image/moneyNeeded.png" />
+ </div>
+ <div id="howmuchText"></div>
+ <div id="textDiv"></div>
+ <div id="checkDisplay"></div>
+ </div>
+ </div>
+ <div id="help"></div>
+ <div id="gameOver"></div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_goShopping/.tmp_index.html.99197~ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.99197~
new file mode 100755
index 0000000..3e635a2
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/.tmp_index.html.99197~
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="linkNextExercise" class ="linkNext"></div>
+ <div id="linkPrevExercise" class ="linkBack"></div>
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox3" class="timerBoxes">00</div>
+ <div id="timerBox2" class="timerBoxes">00</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_goShopping/assets/audio/correct.wav b/examples/lessons/6_Maths_goShopping/assets/audio/correct.wav
new file mode 100755
index 0000000..a49ba33
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/audio/correct.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/audio/incorrect.wav b/examples/lessons/6_Maths_goShopping/assets/audio/incorrect.wav
new file mode 100755
index 0000000..906c6a3
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/audio/incorrect.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/apple.png b/examples/lessons/6_Maths_goShopping/assets/image/apple.png
new file mode 100755
index 0000000..8a982bd
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/apple.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/bag.png b/examples/lessons/6_Maths_goShopping/assets/image/bag.png
new file mode 100755
index 0000000..e41fd52
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/bag.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/balloon.png b/examples/lessons/6_Maths_goShopping/assets/image/balloon.png
new file mode 100755
index 0000000..21a5236
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/balloon.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/bg_footer.png b/examples/lessons/6_Maths_goShopping/assets/image/bg_footer.png
new file mode 100755
index 0000000..8982264
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/bg_header.png b/examples/lessons/6_Maths_goShopping/assets/image/bg_header.png
new file mode 100755
index 0000000..98213f7
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/bg_title_block.png b/examples/lessons/6_Maths_goShopping/assets/image/bg_title_block.png
new file mode 100755
index 0000000..2c9dacf
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/book.png b/examples/lessons/6_Maths_goShopping/assets/image/book.png
new file mode 100755
index 0000000..0648da7
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/book.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/bread.png b/examples/lessons/6_Maths_goShopping/assets/image/bread.png
new file mode 100755
index 0000000..eed6297
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/bread.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_back.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_help.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_next.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_ole.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_start.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/cake.png b/examples/lessons/6_Maths_goShopping/assets/image/cake.png
new file mode 100755
index 0000000..075571f
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/cake.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/cap.png b/examples/lessons/6_Maths_goShopping/assets/image/cap.png
new file mode 100755
index 0000000..0507d8f
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/cap.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/correct.png b/examples/lessons/6_Maths_goShopping/assets/image/correct.png
new file mode 100755
index 0000000..fff0b0f
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/doll.png b/examples/lessons/6_Maths_goShopping/assets/image/doll.png
new file mode 100755
index 0000000..282260e
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/doll.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/food.png b/examples/lessons/6_Maths_goShopping/assets/image/food.png
new file mode 100755
index 0000000..e584852
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/food.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/grapes.png b/examples/lessons/6_Maths_goShopping/assets/image/grapes.png
new file mode 100755
index 0000000..7398874
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/grapes.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/help.png b/examples/lessons/6_Maths_goShopping/assets/image/help.png
new file mode 100755
index 0000000..a59e1d9
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/howMuchLeft.png b/examples/lessons/6_Maths_goShopping/assets/image/howMuchLeft.png
new file mode 100755
index 0000000..9d39a6b
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/howMuchLeft.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/howMuchNeeded.png b/examples/lessons/6_Maths_goShopping/assets/image/howMuchNeeded.png
new file mode 100755
index 0000000..52afff3
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/howMuchNeeded.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/ice.png b/examples/lessons/6_Maths_goShopping/assets/image/ice.png
new file mode 100755
index 0000000..7248f45
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/ice.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/incorrect.png b/examples/lessons/6_Maths_goShopping/assets/image/incorrect.png
new file mode 100755
index 0000000..4a38e07
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/incorrect.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/lays.png b/examples/lessons/6_Maths_goShopping/assets/image/lays.png
new file mode 100755
index 0000000..1384186
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/lays.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/leftText.png b/examples/lessons/6_Maths_goShopping/assets/image/leftText.png
new file mode 100755
index 0000000..39eaa72
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/leftText.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/mango.png b/examples/lessons/6_Maths_goShopping/assets/image/mango.png
new file mode 100755
index 0000000..94ec9b7
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/mango.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/moneyNeeded.png b/examples/lessons/6_Maths_goShopping/assets/image/moneyNeeded.png
new file mode 100755
index 0000000..aeedb7d
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/moneyNeeded.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/moneyOk.png b/examples/lessons/6_Maths_goShopping/assets/image/moneyOk.png
new file mode 100755
index 0000000..4fc12f2
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/moneyOk.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/orange.png b/examples/lessons/6_Maths_goShopping/assets/image/orange.png
new file mode 100755
index 0000000..847f9c0
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/orange.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/papaya.png b/examples/lessons/6_Maths_goShopping/assets/image/papaya.png
new file mode 100755
index 0000000..ba6c598
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/papaya.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/pear.png b/examples/lessons/6_Maths_goShopping/assets/image/pear.png
new file mode 100755
index 0000000..958649c
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/pear.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/pen.png b/examples/lessons/6_Maths_goShopping/assets/image/pen.png
new file mode 100755
index 0000000..43f4f96
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/pen.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/pomogranate.png b/examples/lessons/6_Maths_goShopping/assets/image/pomogranate.png
new file mode 100755
index 0000000..84183ab
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/pomogranate.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rightText.png b/examples/lessons/6_Maths_goShopping/assets/image/rightText.png
new file mode 100755
index 0000000..0092ae6
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/rightText.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/roti.png b/examples/lessons/6_Maths_goShopping/assets/image/roti.png
new file mode 100755
index 0000000..3a62fc7
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/roti.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rs10.png b/examples/lessons/6_Maths_goShopping/assets/image/rs10.png
new file mode 100755
index 0000000..1ce7088
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/rs10.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rs100.png b/examples/lessons/6_Maths_goShopping/assets/image/rs100.png
new file mode 100755
index 0000000..156a236
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/rs100.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rs25.png b/examples/lessons/6_Maths_goShopping/assets/image/rs25.png
new file mode 100755
index 0000000..ff11e54
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/rs25.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rs5.png b/examples/lessons/6_Maths_goShopping/assets/image/rs5.png
new file mode 100755
index 0000000..4d9b758
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/rs5.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rs50.png b/examples/lessons/6_Maths_goShopping/assets/image/rs50.png
new file mode 100755
index 0000000..9b949f0
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/rs50.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/title_block_lt.png b/examples/lessons/6_Maths_goShopping/assets/image/title_block_lt.png
new file mode 100755
index 0000000..4696182
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/assets/image/title_block_rt.png b/examples/lessons/6_Maths_goShopping/assets/image/title_block_rt.png
new file mode 100755
index 0000000..37cc44a
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_goShopping/css/lesson.css b/examples/lessons/6_Maths_goShopping/css/lesson.css
new file mode 100755
index 0000000..4fc67bc
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/css/lesson.css
@@ -0,0 +1,299 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+/* Designed for 1200*900 px screen resolution */
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 75px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 6px;
+ padding-left: 15px;
+}
+
+
+ .linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ .linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 6px;
+ padding-right: 15px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ .linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ .linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ position:relative;
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ height: 75px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 0.7em;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ padding-right: 5px;
+ padding-top: 10px;
+}
+ #linkCheck{
+ margin: 1em 3em 0 0;
+ width: 101px; height: 30px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+#linkNextExercise{
+ position:absolute;
+ bottom: 75px;
+ right: 10px;
+}
+#linkPrevExercise{
+ position:absolute;
+ bottom: 75px;
+ left: 10px;
+}
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0 auto;
+ margin-top: 75px;
+ width: 95%;
+ height: 550px;
+ padding: 0.5em;
+}
+ #left-side{
+ position:relative;
+ margin: 60px auto;
+ margin-bottom:0;
+ padding-top:50px;
+ float:left;
+ width: 60%;
+ height: 350px;
+ border: 4px solid #000;
+ }
+ #leftText{
+ position:absolute;
+ top: -60px;
+ left: 100px;
+ text-align:center;
+ height: 40px;
+ font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman;
+ color: #FF0000;
+ }
+ .default{
+ float:left;
+ margin: 0px auto;
+ text-align:center;
+ width: 170px;
+ height: 44px;
+ }
+ .moneyPositions{
+ position:absolute;
+ width: 489px;
+ height: 199px;
+ }
+
+ #right-side{
+ position:relative;
+ margin: 60px auto;
+ margin-bottom:0;
+ padding-top: 50px;
+ float:right;
+ width: 35%;
+ height: 350px;
+ border: 4px solid #000;
+ }
+ #rightText{
+ position:absolute;
+ top: -60px;
+ left: 20px;
+ text-align:center;
+ height: 40px;
+ font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman;
+ color: #FF0000;
+ }
+ .thingsPositions{
+ position:absolute;
+ width: 150px;
+ height: 150px;
+ }
+ #checkSection{
+ position: static;
+ bottom: -25px;
+ left: 50%;
+ width: 40%;
+ height: 65px;
+ text-align:center;
+ }
+ .checkMoney{
+ float:left;
+ margin: 0.8em;
+ }
+ #howmuchText{
+ float:left;
+ margin: 0.5em 0 0.9em 1em ;
+ width: auto;
+ height: 35px;
+ }
+ #textDiv{
+ float:left;
+ width: 75px;
+ margin:0.5em 0 0 1em;
+ height: 35px;
+ }
+
+ input.textBox{
+ size:3;
+ font: 25px/30px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ height:35px;
+ width: 75px;
+ text-align:center;
+ }
+
+
+ .focus {
+ background-color: #FF9900;
+ }
+
+ #checkDisplay{
+ float:right;
+ width: 64px;
+ height: 64px;
+ margin: 0 0 0 1em;
+ }
+
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+ #help{
+ display:none;
+ position:absolute;
+ right: 60px;
+ top: 75px;;
+ width: 256px;
+ height: 600px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+
+ #gameOver{
+ opacity: 1;
+ display:none;
+ position:absolute;
+ top:45%;
+ left: 30%;
+ color: blue;
+ text-align:center;
+ font : bold 45px/65px Arial Black, Times New Roman;
+ }
+ #gameOverInfo{
+ margin-top: 35px;
+ text-align:center;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF0000;
+
+ }
+ .specialText{
+ margin-top: 1em;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF9900;
+ border-bottom: 2px dotted #CCC;
+
+ }
diff --git a/examples/lessons/6_Maths_goShopping/css/lesson.css~ b/examples/lessons/6_Maths_goShopping/css/lesson.css~
new file mode 100755
index 0000000..007715a
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/css/lesson.css~
@@ -0,0 +1,299 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+/* Designed for 1200*900 px screen resolution */
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 75px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 6px;
+ padding-left: 15px;
+}
+
+
+ .linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ .linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 6px;
+ padding-right: 15px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ .linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ .linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ position:relative;
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ height: 75px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 0.7em;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ padding-right: 5px;
+ padding-top: 10px;
+}
+ #linkCheck{
+ margin: 1em 3em 0 0;
+ width: 101px; height: 30px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+#linkNextExercise{
+ position:absolute;
+ bottom: 75px;
+ right: 10px;
+}
+#linkPrevExercise{
+ position:absolute;
+ bottom: 75px;
+ left: 10px;
+}
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0 auto;
+ margin-top: 75px;
+ width: 95%;
+ height: 550px;
+ padding: 0.5em;
+}
+ #left-side{
+ position:relative;
+ margin: 60px auto;
+ margin-bottom:0;
+ padding-top:50px;
+ float:left;
+ width: 60%;
+ height: 350px;
+ border: 4px solid #000;
+ }
+ #leftText{
+ position:absolute;
+ top: -60px;
+ left: 100px;
+ text-align:center;
+ height: 40px;
+ font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman;
+ color: #FF0000;
+ }
+ .default{
+ float:left;
+ margin: 0px auto;
+ text-align:center;
+ width: 170px;
+ height: 44px;
+ }
+ .moneyPositions{
+ position:absolute;
+ width: 489px;
+ height: 199px;
+ }
+
+ #right-side{
+ position:relative;
+ margin: 60px auto;
+ margin-bottom:0;
+ padding-top: 50px;
+ float:right;
+ width: 35%;
+ height: 350px;
+ border: 4px solid #000;
+ }
+ #rightText{
+ position:absolute;
+ top: -60px;
+ left: 20px;
+ text-align:center;
+ height: 40px;
+ font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman;
+ color: #FF0000;
+ }
+ .thingsPositions{
+ position:absolute;
+ width: 150px;
+ height: 150px;
+ }
+ #checkSection{
+ position: absolute;
+ bottom: -25px;
+ left: 50%;
+ width: 40%;
+ height: 65px;
+ text-align:center;
+ }
+ .checkMoney{
+ float:left;
+ margin: 0.8em;
+ }
+ #howmuchText{
+ float:left;
+ margin: 0.5em 0 0.9em 1em ;
+ width: auto;
+ height: 35px;
+ }
+ #textDiv{
+ float:left;
+ width: 75px;
+ margin:0.5em 0 0 1em;
+ height: 35px;
+ }
+
+ input.textBox{
+ size:3;
+ font: 25px/30px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ height:35px;
+ width: 75px;
+ text-align:center;
+ }
+
+
+ .focus {
+ background-color: #FF9900;
+ }
+
+ #checkDisplay{
+ float:right;
+ width: 64px;
+ height: 64px;
+ margin: 0 0 0 1em;
+ }
+
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+ #help{
+ display:none;
+ position:absolute;
+ right: 60px;
+ top: 75px;;
+ width: 256px;
+ height: 600px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+
+ #gameOver{
+ opacity: 1;
+ display:none;
+ position:absolute;
+ top:45%;
+ left: 30%;
+ color: blue;
+ text-align:center;
+ font : bold 45px/65px Arial Black, Times New Roman;
+ }
+ #gameOverInfo{
+ margin-top: 35px;
+ text-align:center;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF0000;
+
+ }
+ .specialText{
+ margin-top: 1em;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF9900;
+ border-bottom: 2px dotted #CCC;
+
+ }
diff --git a/examples/lessons/6_Maths_goShopping/css/ui.scoreboard.css b/examples/lessons/6_Maths_goShopping/css/ui.scoreboard.css
new file mode 100755
index 0000000..11cdbb5
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/css/ui.scoreboard.css
@@ -0,0 +1,62 @@
+.ui-scoreboard-container-h{
+max-width: 800em;
+max-height: 200px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+
+.ui-scoreboard-spacing-h{
+max-width: 200em;
+max-height: 300em;
+display:inline;
+margin-left:0.2em;
+margin-right:0.4em;
+}
+
+.ui-scoreboard-text{
+font-size:larger;
+text-align: center;
+}
+
+.ui-scoreboard-number-h {
+background-color:black;
+color: white;
+padding-left:0.4em;
+padding-right:0.4em;
+font-size:larger;
+}
+
+.ui-scoreboard-button{
+float:right;
+cursor:pointer;
+}
+
+button .ui-scoreboard-icon{
+float: left;
+margin-right:0.3em;
+}
+.ui-scoreboard-container-v{
+max-width: 200px;
+max-height: 400px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+.ui-scoreboard-spacing-v{
+display:block;
+margin: 0.4em;
+}
+
+.ui-scoreboard-number-v{
+background-color:black;
+color: white;
+width: 1em;
+text-align:center;
+margin-left:auto;
+margin-right: auto;
+padding:0.4em;
+font-size:larger;
+}
+
+
diff --git a/examples/lessons/6_Maths_goShopping/index.html b/examples/lessons/6_Maths_goShopping/index.html
new file mode 100755
index 0000000..b88c678
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/index.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Go Shopping</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ Go Shopping || <span id="currentTitle">किनमेल </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="left-side"></div>
+ <div id="right-side"></div>
+ <div id="checkSection">
+ <div id="checkButtons">
+ <img id="moneyOk" class="checkMoney" src="assets/image/moneyOk.png" />
+ <img id="moneyNeeded" class="checkMoney" src="assets/image/moneyNeeded.png" />
+ </div>
+ <div id="howmuchText"></div>
+ <div id="textDiv"></div>
+ <div id="checkDisplay"></div>
+ </div>
+ </div>
+ <div id="help"></div>
+ <div id="gameOver"></div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_goShopping/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_goShopping/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_goShopping/js/karma.js b/examples/lessons/6_Maths_goShopping/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_Maths_goShopping/js/lesson.js b/examples/lessons/6_Maths_goShopping/js/lesson.js
new file mode 100755
index 0000000..5236876
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/js/lesson.js
@@ -0,0 +1,259 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.wav'},
+ {'name':'incorrect','file':'incorrect.wav'}
+ ]});
+
+ k.ready(function(){
+ var i,j;
+ var checkId;
+ var correctCounter;
+ var totalCounter;
+ var TOTAL_THINGS = 19;
+ var TOTAL_MONEYS = 5;
+ var TOTAL_QUES = 10;
+ var flag_correct;
+ var flag_checked;
+ var checked;
+ var randThings = [];
+ var randMoneys = [];
+ var totalMoney;
+ var totalPrice;
+
+ var money = new Array(5,10,25,50,100);
+ var things = new Array('roti','pomogranate','pen','pear','papaya','orange','mango','lays','ice',
+ 'grapes','food','doll','cap','cake','bread','book','balloon','bag','apple'
+ );
+ var priceThings = new Array(15,5,41,3,7,5,9,19,13,11,45,89,65,33,23,65,25,87,15);
+
+ var scoreboard = $('#score_box').scoreboard({'layout':'horizontal',
+ 'winningScore': TOTAL_QUES});
+
+ var genRandomThings = function(){
+ randThings[0] = k.rand(0,TOTAL_THINGS-1);
+ for(i=1; i<TOTAL_THINGS; i++){
+ do{
+ flag = 0;
+ randThings[i] = k.rand(0,TOTAL_THINGS-1);
+ for(j=0; j<i; j++){
+ if(randThings[i]===randThings[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+
+ };
+
+ var genRandomMoneys = function(){
+ randMoneys[0] = k.rand(0,TOTAL_MONEYS-1);
+ for(i=1; i<TOTAL_MONEYS; i++){
+ do{
+ flag = 0;
+ randMoneys[i] = k.rand(0,TOTAL_MONEYS-1);
+ for(j=0; j<i; j++){
+ if(randMoneys[i]===randMoneys[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+
+ };
+
+
+
+
+ var generatePositions = function(side,posId,topPos,leftPos){
+ var side,posIdentify;
+ var zindexVal;
+ if(side === "left"){
+ if(posId === 1){
+ zindexVal = 1;
+ }
+ else if(posId === 3){
+ zindexVal = 1;
+ }
+ else{
+ zindexVal = 0;
+ }
+ $('#left-side').append('<div id="moneyPos'+posId+'" class="moneyPositions"></div>');
+ $('#moneyPos'+posId).css({'top':topPos+'px','left':leftPos+'px','z-index':zindexVal});
+ }
+ else{
+ $('#right-side').append('<div id="thingPos'+posId+'" class="thingsPositions"></div>');
+ $('#thingPos'+posId).css({'top':topPos+'px','left':leftPos+'px'});
+ }
+ };
+
+ var checkAnswer = function(){
+ if(flag_checked != 0){
+ if(checkId == "moneyOk" && totalMoney >= totalPrice){
+ flag_checked = 0;
+ $('#howmuchText').html('<img src="assets/image/howMuchLeft.png" />');
+ }
+ else if(checkId == "moneyNeeded" && totalMoney < totalPrice){
+ flag_checked = 0;
+ $('#howmuchText').html('<img src="assets/image/howMuchNeeded.png" />');
+ }
+ else{ //try again ur score wont increase
+ flag_correct = 0;
+ }
+ }
+ if(flag_checked === 0){
+ $('#textDiv').html('<input type="text" class="textBox" maxlength="3"/>');
+ $('.textBox').val('');
+ foucs_blur(); $('.textBox').focus();
+ }
+ };
+
+ var nextQuestions = function(){
+ $('#howmuchText').html('');
+ $('#textDiv').html('');
+
+ totalMoney = 0;
+ totalPrice = 0;
+ flag_correct = 1;
+ flag_checked = 1;
+ $('#left-side').html('').append('<img id="leftText" src="assets/image/leftText.png" />');
+ $('#right-side').html('').append('<img id="rightText" src="assets/image/rightText.png" />');
+
+ generatePositions('left',0,25,25);
+ generatePositions('left',1,75,325);
+ generatePositions('left',2,150,50);
+ generatePositions('left',3,180,350);
+
+ generatePositions('right',0,50,25);
+ generatePositions('right',1,25,220);
+ generatePositions('right',2,225,50);
+ generatePositions('right',3,200,275);
+
+ genRandomMoneys();
+ var currentMoneys = k.rand(1,4);
+ for(i = 0; i< currentMoneys ;i++){
+ var randMoney = randMoneys[i];
+ $('#moneyPos'+i).append('<img src = "assets/image/rs'+money[randMoney]+'.png" />');
+ totalMoney += money[randMoney];
+ }
+ genRandomThings();
+ var currentThings = k.rand(1,4);
+ for(i = 0; i< currentThings ;i++){
+ var randThing = randThings[i];
+ $('#thingPos'+i).append('<img src = "assets/image/'+things[randThing]+'.png" />');
+ totalPrice += priceThings[randThing];
+ }
+
+ $('.checkMoney').click(function(){
+ checkId = $(this).attr('id');
+ checkAnswer();
+ });
+ };
+
+
+
+ function gameStart(){
+ $('#content').removeClass('backOpaque');
+ $('#gameOver').hide();
+ totalCounter = 0;
+ correctCounter = 0;
+ nextQuestions();
+
+ }
+
+ var displayGameOver = function(){
+ $('#content').addClass('backOpaque');
+ $('#gameOver').show();
+ if(correctCounter === totalCounter){
+ $('#gameOver').html('बधाई छ !!! सबै उत्तर सहि भए !!! ');
+ }
+ else{
+ $('#gameOver').html('<div id="gameOverInfo">किन गलत भयो पत्ता लगाउ र अर्को पटक सहि बनाउने कोशिश गर । <br /> You Got <span class="specialText">'+correctCounter+
+ '</span> correct out of <span class="specialText">'+totalCounter+'</span> questions .</div>');
+ }
+ };
+
+ var delayCorrectShow = function(){
+ document.delayForm.delayval.value = 1;
+ if(checked === 1){
+ if(totalCounter === 10){
+ displayGameOver();
+ }
+ else{
+ nextQuestions();
+ }
+ }
+ $('#checkDisplay').html('');
+
+
+ };
+
+ var checkMoney = function(){
+ var flag_correctAns = 1;
+ var textVal = $('.textBox').val();
+ if( checkId === "moneyOk" && textVal == (totalMoney - totalPrice) ){
+ flag_correctAns = 1;
+ }
+ else if(checkId === "moneyNeeded" && textVal == (totalPrice - totalMoney)){
+ flag_correctAns = 1;
+ }
+ else{
+ flag_correctAns = 0;
+ }
+
+ if(flag_correctAns === 1){
+ checked = 1;
+ k.audio.correct.play();
+ if(flag_correct === 1){
+ correctCounter++;
+ scoreboard.scoreboard('inc');
+ }
+ totalCounter++;
+ scoreboard.scoreboard('incTotal');
+ $('#checkDisplay').html('<img src="assets/image/correct.png" />');
+
+ }
+ else{
+ flag_correct = 0;
+ checked = 0;
+ k.audio.incorrect.play();
+ $('#checkDisplay').html('<img src="assets/image/incorrect.png" />');
+ t=setTimeout(function(){delayCorrectShow();},1000);
+ }
+ t=setTimeout(function(){delayCorrectShow();},1000);
+
+ };
+
+ function foucs_blur(){
+ $('input[type="text"]')
+ .focus(function() {
+ $(this).addClass("focus");
+ })
+ .blur(function() {
+ $(this).removeClass("focus");
+ })
+ .keypress(function(event) {
+ if(event.which === 13){
+ checkMoney();
+ }
+
+ });
+
+ }
+
+ $('#linkStart').click(function(){
+ gameStart();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ gameStart();
+ });
+ $('#linkHelp').mouseover(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+
+ });
+ }); //end of k.ready
+ }); //end of document.read
+
diff --git a/examples/lessons/6_Maths_goShopping/js/ui.core.js b/examples/lessons/6_Maths_goShopping/js/ui.core.js
new file mode 100755
index 0000000..5493e0a
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/js/ui.core.js
@@ -0,0 +1,519 @@
+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+;jQuery.ui || (function($) {
+
+var _remove = $.fn.remove,
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+
+//Helper functions and ui object
+$.ui = {
+ version: "1.7.2",
+
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function(module, option, set) {
+ var proto = $.ui[module].prototype;
+ for(var i in set) {
+ proto.plugins[i] = proto.plugins[i] || [];
+ proto.plugins[i].push([option, set[i]]);
+ }
+ },
+ call: function(instance, name, args) {
+ var set = instance.plugins[name];
+ if(!set || !instance.element[0].parentNode) { return; }
+
+ for (var i = 0; i < set.length; i++) {
+ if (instance.options[set[i][0]]) {
+ set[i][1].apply(instance.element, args);
+ }
+ }
+ }
+ },
+
+ contains: function(a, b) {
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
+ },
+
+ hasScroll: function(el, a) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ($(el).css('overflow') == 'hidden') { return false; }
+
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
+ has = false;
+
+ if (el[scroll] > 0) { return true; }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[scroll] = 1;
+ has = (el[scroll] > 0);
+ el[scroll] = 0;
+ return has;
+ },
+
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
+ },
+
+ isOver: function(y, x, top, left, height, width) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+ },
+
+ keyCode: {
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+};
+
+// WAI-ARIA normalization
+if (isFF2) {
+ var attr = $.attr,
+ removeAttr = $.fn.removeAttr,
+ ariaNS = "http://www.w3.org/2005/07/aaa",
+ ariaState = /^aria-/,
+ ariaRole = /^wairole:/;
+
+ $.attr = function(elem, name, value) {
+ var set = value !== undefined;
+
+ return (name == 'role'
+ ? (set
+ ? attr.call(this, elem, name, "wairole:" + value)
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
+ : (ariaState.test(name)
+ ? (set
+ ? elem.setAttributeNS(ariaNS,
+ name.replace(ariaState, "aaa:"), value)
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
+ : attr.apply(this, arguments)));
+ };
+
+ $.fn.removeAttr = function(name) {
+ return (ariaState.test(name)
+ ? this.each(function() {
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
+ }) : removeAttr.call(this, name));
+ };
+}
+
+//jQuery plugins
+$.fn.extend({
+ remove: function() {
+ // Safari has a native remove event which actually removes DOM elements,
+ // so we have to use triggerHandler instead of trigger (#3037).
+ $("*", this).add(this).each(function() {
+ $(this).triggerHandler("remove");
+ });
+ return _remove.apply(this, arguments );
+ },
+
+ enableSelection: function() {
+ return this
+ .attr('unselectable', 'off')
+ .css('MozUserSelect', '')
+ .unbind('selectstart.ui');
+ },
+
+ disableSelection: function() {
+ return this
+ .attr('unselectable', 'on')
+ .css('MozUserSelect', 'none')
+ .bind('selectstart.ui', function() { return false; });
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ }
+});
+
+
+//Additional selectors
+$.extend($.expr[':'], {
+ data: function(elem, i, match) {
+ return !!$.data(elem, match[3]);
+ },
+
+ focusable: function(element) {
+ var nodeName = element.nodeName.toLowerCase(),
+ tabIndex = $.attr(element, 'tabindex');
+ return (/input|select|textarea|button|object/.test(nodeName)
+ ? !element.disabled
+ : 'a' == nodeName || 'area' == nodeName
+ ? element.href || !isNaN(tabIndex)
+ : !isNaN(tabIndex))
+ // the element and all of its ancestors must be visible
+ // the browser may report that the area is hidden
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
+ },
+
+ tabbable: function(element) {
+ var tabIndex = $.attr(element, 'tabindex');
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
+ }
+});
+
+
+// $.widget is a factory to create jQuery plugins
+// taking some boilerplate code out of the plugin code
+function getter(namespace, plugin, method, args) {
+ function getMethods(type) {
+ var methods = $[namespace][plugin][type] || [];
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
+ }
+
+ var methods = getMethods('getter');
+ if (args.length == 1 && typeof args[0] == 'string') {
+ methods = methods.concat(getMethods('getterSetter'));
+ }
+ return ($.inArray(method, methods) != -1);
+}
+
+$.widget = function(name, prototype) {
+ var namespace = name.split(".")[0];
+ name = name.split(".")[1];
+
+ // create plugin method
+ $.fn[name] = function(options) {
+ var isMethodCall = (typeof options == 'string'),
+ args = Array.prototype.slice.call(arguments, 1);
+
+ // prevent calls to internal methods
+ if (isMethodCall && options.substring(0, 1) == '_') {
+ return this;
+ }
+
+ // handle getter methods
+ if (isMethodCall && getter(namespace, name, options, args)) {
+ var instance = $.data(this[0], name);
+ return (instance ? instance[options].apply(instance, args)
+ : undefined);
+ }
+
+ // handle initialization and non-getter methods
+ return this.each(function() {
+ var instance = $.data(this, name);
+
+ // constructor
+ (!instance && !isMethodCall &&
+ $.data(this, name, new $[namespace][name](this, options))._init());
+
+ // method call
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
+ instance[options].apply(instance, args));
+ });
+ };
+
+ // create widget constructor
+ $[namespace] = $[namespace] || {};
+ $[namespace][name] = function(element, options) {
+ var self = this;
+
+ this.namespace = namespace;
+ this.widgetName = name;
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
+ this.widgetBaseClass = namespace + '-' + name;
+
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
+ this.element = $(element)
+ .bind('setData.' + name, function(event, key, value) {
+ if (event.target == element) {
+ return self._setData(key, value);
+ }
+ })
+ .bind('getData.' + name, function(event, key) {
+ if (event.target == element) {
+ return self._getData(key);
+ }
+ })
+ .bind('remove', function() {
+ return self.destroy();
+ });
+ };
+
+ // add widget prototype
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
+
+ // TODO: merge getter and getterSetter properties from widget prototype
+ // and plugin prototype
+ $[namespace][name].getterSetter = 'option';
+};
+
+$.widget.prototype = {
+ _init: function() {},
+ destroy: function() {
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
+ },
+
+ option: function(key, value) {
+ var options = key,
+ self = this;
+
+ if (typeof key == "string") {
+ if (value === undefined) {
+ return this._getData(key);
+ }
+ options = {};
+ options[key] = value;
+ }
+
+ $.each(options, function(key, value) {
+ self._setData(key, value);
+ });
+ },
+ _getData: function(key) {
+ return this.options[key];
+ },
+ _setData: function(key, value) {
+ this.options[key] = value;
+
+ if (key == 'disabled') {
+ this.element
+ [value ? 'addClass' : 'removeClass'](
+ this.widgetBaseClass + '-disabled' + ' ' +
+ this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
+ }
+ },
+
+ enable: function() {
+ this._setData('disabled', false);
+ },
+ disable: function() {
+ this._setData('disabled', true);
+ },
+
+ _trigger: function(type, event, data) {
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = $.Event(event);
+ event.type = eventName;
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if (event.originalEvent) {
+ for (var i = $.event.props.length, prop; i;) {
+ prop = $.event.props[--i];
+ event[prop] = event.originalEvent[prop];
+ }
+ }
+
+ this.element.trigger(event, data);
+
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
+ }
+};
+
+$.widget.defaults = {
+ disabled: false
+};
+
+
+/** Mouse Interaction Plugin **/
+
+$.ui.mouse = {
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ // Prevent text selection in IE
+ if ($.browser.msie) {
+ this._mouseUnselectable = this.element.attr('unselectable');
+ this.element.attr('unselectable', 'on');
+ }
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+
+ // Restore text selection in IE
+ ($.browser.msie
+ && this.element.attr('unselectable', this._mouseUnselectable));
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ // TODO: figure out why we have to use originalEvent
+ event.originalEvent = event.originalEvent || {};
+ if (event.originalEvent.mouseHandled) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ // preventDefault() is used to prevent the selection of text here -
+ // however, in Safari, this causes select boxes not to be selectable
+ // anymore, so this fix is needed
+ ($.browser.safari || event.preventDefault());
+
+ event.originalEvent.mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+};
+
+$.ui.mouse.defaults = {
+ cancel: null,
+ distance: 1,
+ delay: 0
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_goShopping/js/ui.scoreboard.js b/examples/lessons/6_Maths_goShopping/js/ui.scoreboard.js
new file mode 100755
index 0000000..53a930a
--- /dev/null
+++ b/examples/lessons/6_Maths_goShopping/js/ui.scoreboard.js
@@ -0,0 +1,107 @@
+(function($){
+ $.widget('ui.scoreboard',
+ {
+ getScore : function(){
+ return this._getData('score');
+ },
+ setScore : function(newScore){
+ this._setData('score', parseInt(newScore));
+ this._refresh();
+ },
+ getTotal : function(){
+ return this._getData('total');
+ },
+ setTotal : function(newTotal){
+ this._setData('total', parseInt(newTotal));
+ this._refresh();
+ },
+ reset : function(){
+ this._setData('score', this._getData('initialScore'));
+ this._setData('total', this._getData('initialTotal'));
+ this._refresh();
+ },
+ inc : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') + incVal);
+ this._refresh();
+ if(this._getData('winScore') === this._getData('score')){
+ this.element.trigger('winGame');
+ }
+ },
+ incTotal : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') + incVal);
+ this._refresh();
+ },
+ dec : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') - decVal);
+ this._refresh();
+ },
+ decTotal : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') - decVal);
+ this._refresh();
+ },
+ _init : function(){
+
+ var divDisplay = "inline";
+ var score = this.options.score;
+ var total = this.options.total;
+ var layoutId = "h";
+ var self = this;
+
+
+ this._setData('initialScore', parseInt(this.options.score));
+ this._setData('initialTotal', parseInt(this.options.total));
+ this._setData('score', parseInt(this.options.score));
+ this._setData('total', parseInt(this.options.total));
+ this._setData('winScore', parseInt(this.options.winningScore) || 0);
+
+ if(this.options.layout === "vertical"){
+ layoutId = "v";
+ }
+
+ this.evWinGame = document.createEvent('Events');
+
+ this.element.addClass('ui-scoreboard-container-' + layoutId +
+ ' ui-widget ui-widget-content ui-corner-all');
+
+ var clone = $('<div>')
+ .addClass('ui-scoreboard-spacing-' + layoutId);
+ this._scoreText = $("<div>Score</div>")
+ .addClass('ui-scoreboard-spacing-'+ layoutId +
+ ' ui-corner-all ui-scoreboard-text')
+ .appendTo(this.element);
+ this._score = $("<div>" + score + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ $("<div>Total</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-corner-all ' +
+ 'ui-scoreboard-text')
+ .appendTo(this.element);
+ this._total = $("<div>" + total + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ },
+ _refresh : function(){
+ this._score.text(this._getData('score'));
+ this._total.text(this._getData('total'));
+ },
+ destroy : function(){
+ this.element.remove();
+ $.widget.prototype.destroy.apply(this, arguments);
+ }
+
+
+ });
+
+ $.ui.scoreboard.getter = ['getScore', 'getTotal'];
+ $.ui.scoreboard.defaults = {
+ score: 0, total: 0, layout: "horizontal", winningScore: 0
+ };
+
+ })(jQuery); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_parallelLines/.tmp_index.html.30266~ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.30266~
new file mode 100755
index 0000000..0a633f5
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.30266~
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Go Shopping</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ Go Shopping || <span id="currentTitle">किनमेल </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="left-side"></div>
+ <div id="right-side"></div>
+ <div id="checkSection"></div>
+ </div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_parallelLines/.tmp_index.html.30807~ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.30807~
new file mode 100755
index 0000000..8ec61b6
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.30807~
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Parallel Lines</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ Parallel Lines || <span id="currentTitle"> समानान्तर रेखाहरु </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <div id="gameOver"></div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <a href="#"><div id="linkNextLesson" class ="linkNext"></div></a>
+ <a href="#"><div id="linkPrevLesson" class ="linkBack"></div></a>
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_parallelLines/.tmp_index.html.38007~ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.38007~
new file mode 100755
index 0000000..ccbe4d6
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.38007~
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox1" class="timerBoxes"></div>
+ <div id="timerBox2" class="timerBoxes"></div>
+ <div id="timerBox3" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_parallelLines/.tmp_index.html.44857~ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.44857~
new file mode 100755
index 0000000..0a633f5
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.44857~
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Go Shopping</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ Go Shopping || <span id="currentTitle">किनमेल </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="left-side"></div>
+ <div id="right-side"></div>
+ <div id="checkSection"></div>
+ </div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_parallelLines/.tmp_index.html.54401~ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.54401~
new file mode 100755
index 0000000..b2ecae3
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.54401~
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox1" class="timerBoxes"></div>
+ <div id="timerBox2" class="timerBoxes"></div>
+ <div id="timerBox3" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_parallelLines/.tmp_index.html.99197~ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.99197~
new file mode 100755
index 0000000..3e635a2
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/.tmp_index.html.99197~
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Syllabus</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ English Syllabus<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <div id="gameOver">Game Over!!!</div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="linkNextExercise" class ="linkNext"></div>
+ <div id="linkPrevExercise" class ="linkBack"></div>
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerBox3" class="timerBoxes">00</div>
+ <div id="timerBox2" class="timerBoxes">00</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_parallelLines/assets/audio/correct.wav b/examples/lessons/6_Maths_parallelLines/assets/audio/correct.wav
new file mode 100755
index 0000000..a49ba33
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/audio/correct.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/audio/incorrect.wav b/examples/lessons/6_Maths_parallelLines/assets/audio/incorrect.wav
new file mode 100755
index 0000000..906c6a3
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/audio/incorrect.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-003-660@141.png b/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-003-660@141.png
new file mode 100755
index 0000000..b42c1a5
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-003-660@141.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-012-500@152.png b/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-012-500@152.png
new file mode 100755
index 0000000..0765909
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-012-500@152.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/bg_footer.png b/examples/lessons/6_Maths_parallelLines/assets/image/bg_footer.png
new file mode 100755
index 0000000..8982264
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/bg_header.png b/examples/lessons/6_Maths_parallelLines/assets/image/bg_header.png
new file mode 100755
index 0000000..98213f7
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/bg_title_block.png b/examples/lessons/6_Maths_parallelLines/assets/image/bg_title_block.png
new file mode 100755
index 0000000..2c9dacf
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_back.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_help.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_next.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_start.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/correct.png b/examples/lessons/6_Maths_parallelLines/assets/image/correct.png
new file mode 100755
index 0000000..fff0b0f
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/defIntersectLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/defIntersectLines.png
new file mode 100755
index 0000000..679507d
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/defIntersectLines.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/defParallelLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/defParallelLines.png
new file mode 100755
index 0000000..7509883
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/defParallelLines.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/defParallelNo.png b/examples/lessons/6_Maths_parallelLines/assets/image/defParallelNo.png
new file mode 100755
index 0000000..2192e39
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/defParallelNo.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/defParallelYes.png b/examples/lessons/6_Maths_parallelLines/assets/image/defParallelYes.png
new file mode 100755
index 0000000..789c0c2
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/defParallelYes.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/help.png b/examples/lessons/6_Maths_parallelLines/assets/image/help.png
new file mode 100755
index 0000000..5bbec09
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/imgIntersectLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/imgIntersectLines.png
new file mode 100755
index 0000000..663bded
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/imgIntersectLines.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/imgNo.png b/examples/lessons/6_Maths_parallelLines/assets/image/imgNo.png
new file mode 100755
index 0000000..1aa8be9
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/imgNo.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/imgParallelLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/imgParallelLines.png
new file mode 100755
index 0000000..1aee838
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/imgParallelLines.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/imgYes.png b/examples/lessons/6_Maths_parallelLines/assets/image/imgYes.png
new file mode 100755
index 0000000..800f3bc
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/imgYes.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/incorrect.png b/examples/lessons/6_Maths_parallelLines/assets/image/incorrect.png
new file mode 100755
index 0000000..4a38e07
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/incorrect.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/infoIntersectLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/infoIntersectLines.png
new file mode 100755
index 0000000..a2c4224
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/infoIntersectLines.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/infoParallelLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/infoParallelLines.png
new file mode 100755
index 0000000..15616d7
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/infoParallelLines.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques0.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques0.png
new file mode 100755
index 0000000..d248d93
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/ques0.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques1.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques1.png
new file mode 100755
index 0000000..a6cb77b
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/ques1.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques2.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques2.png
new file mode 100755
index 0000000..61ec2da
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/ques2.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques3.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques3.png
new file mode 100755
index 0000000..b7a93a7
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/ques3.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques4.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques4.png
new file mode 100755
index 0000000..e036aeb
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/ques4.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques5.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques5.png
new file mode 100755
index 0000000..e1f0e08
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/ques5.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques6.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques6.png
new file mode 100755
index 0000000..3d53e8b
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/ques6.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques7.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques7.png
new file mode 100755
index 0000000..d58a860
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/ques7.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques8.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques8.png
new file mode 100755
index 0000000..aefe417
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/ques8.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques9.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques9.png
new file mode 100755
index 0000000..e554090
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/ques9.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/title_block_lt.png b/examples/lessons/6_Maths_parallelLines/assets/image/title_block_lt.png
new file mode 100755
index 0000000..4696182
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/title_block_rt.png b/examples/lessons/6_Maths_parallelLines/assets/image/title_block_rt.png
new file mode 100755
index 0000000..37cc44a
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/topText.png b/examples/lessons/6_Maths_parallelLines/assets/image/topText.png
new file mode 100755
index 0000000..7428709
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/assets/image/topText.png
Binary files differ
diff --git a/examples/lessons/6_Maths_parallelLines/css/lesson.css b/examples/lessons/6_Maths_parallelLines/css/lesson.css
new file mode 100755
index 0000000..92d8a18
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/css/lesson.css
@@ -0,0 +1,262 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+/* Designed for 1200*900 px screen resolution */
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 75px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 6px;
+ padding-left: 15px;
+}
+
+
+ .linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ .linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 6px;
+ padding-right: 15px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ .linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ .linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ position:relative;
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ height: 75px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 0.7em;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ padding-right: 5px;
+ padding-top: 10px;
+}
+ #linkCheck{
+ margin: 1em 3em 0 0;
+ width: 101px; height: 30px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+#linkNextLesson{
+ position:absolute;
+ bottom: 75px;
+ right: 10px;
+}
+#linkPrevLesson{
+ position:absolute;
+ bottom: 75px;
+ left: 10px;
+}
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0 auto;
+ margin-top: 75px;
+ width: 95%;
+ height: 550px;
+ padding: 0.5em;
+}
+ #lesson{
+ margin: 5px auto;
+ width: 650px;
+ height: 600px;
+ text-align:center;
+
+ }
+ #lessonHeader{
+ margin-top:10px;
+ }
+ #lessonImage{
+ margin-top: 50px;
+ }
+ #lessonInfo{
+ margin-top: 50px;
+ }
+
+ #quesDisplay{
+ margin: 10% 2% 1% 10% ;
+ float:left;
+ width: 150px;
+ height: 250px;
+ text-align:center;
+ }
+ #questionSection{
+ margin: 2% 30% 1% 2% ;
+ float:right;
+ width: 350px;
+ height: 260px;
+ }
+ #question{
+ margin: 0.5em;
+ float:right;
+ width: 250px;
+ height: 30px;
+ font: 20px/25px Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ }
+ #optionSection{
+ margin-top: 4em;
+ width: 300px;
+ height: 200px;
+ text-align:center;
+ }
+ .imgOption{
+ float:right;
+ widht:157px;
+ height:49px;
+ margin: 1em;
+ }
+ .checkDisplay{
+ float:left;
+ width: 64px;
+ height: 64px;
+ margin: 0 0 0 1em;
+ }
+ #defSection{
+ position:absolute;
+ bottom: 0;
+ left: 25%;
+ width: 526px;
+ height: 87px;
+ }
+
+
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+ #help{
+ display:none;
+ position:absolute;
+ right: 60px;
+ top: 75px;;
+ width: 256px;
+ height: 600px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+
+ #gameOver{
+ opacity: 1;
+ display:none;
+ position:absolute;
+ top:45%;
+ left: 30%;
+ color: blue;
+ text-align:center;
+ font : bold 45px/65px Arial Black, Times New Roman;
+ }
+ #gameOverInfo{
+ margin-top: 35px;
+ text-align:center;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF0000;
+
+ }
+ .specialText{
+ margin-top: 1em;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF9900;
+ border-bottom: 2px dotted #CCC;
+
+ }
diff --git a/examples/lessons/6_Maths_parallelLines/css/ui.scoreboard.css b/examples/lessons/6_Maths_parallelLines/css/ui.scoreboard.css
new file mode 100755
index 0000000..11cdbb5
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/css/ui.scoreboard.css
@@ -0,0 +1,62 @@
+.ui-scoreboard-container-h{
+max-width: 800em;
+max-height: 200px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+
+.ui-scoreboard-spacing-h{
+max-width: 200em;
+max-height: 300em;
+display:inline;
+margin-left:0.2em;
+margin-right:0.4em;
+}
+
+.ui-scoreboard-text{
+font-size:larger;
+text-align: center;
+}
+
+.ui-scoreboard-number-h {
+background-color:black;
+color: white;
+padding-left:0.4em;
+padding-right:0.4em;
+font-size:larger;
+}
+
+.ui-scoreboard-button{
+float:right;
+cursor:pointer;
+}
+
+button .ui-scoreboard-icon{
+float: left;
+margin-right:0.3em;
+}
+.ui-scoreboard-container-v{
+max-width: 200px;
+max-height: 400px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+.ui-scoreboard-spacing-v{
+display:block;
+margin: 0.4em;
+}
+
+.ui-scoreboard-number-v{
+background-color:black;
+color: white;
+width: 1em;
+text-align:center;
+margin-left:auto;
+margin-right: auto;
+padding:0.4em;
+font-size:larger;
+}
+
+
diff --git a/examples/lessons/6_Maths_parallelLines/index.html b/examples/lessons/6_Maths_parallelLines/index.html
new file mode 100755
index 0000000..8ec61b6
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/index.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Parallel Lines</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="#"><div id="linkBackLesson" class="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
+ Parallel Lines || <span id="currentTitle"> समानान्तर रेखाहरु </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content"></div>
+ <div id="help"></div>
+ <div id="gameOver"></div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <a href="#"><div id="linkNextLesson" class ="linkNext"></div></a>
+ <a href="#"><div id="linkPrevLesson" class ="linkBack"></div></a>
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_parallelLines/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_parallelLines/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_parallelLines/js/karma.js b/examples/lessons/6_Maths_parallelLines/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_Maths_parallelLines/js/lesson.js b/examples/lessons/6_Maths_parallelLines/js/lesson.js
new file mode 100755
index 0000000..a0c4a9f
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/js/lesson.js
@@ -0,0 +1,163 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.wav'},
+ {'name':'incorrect','file':'incorrect.wav'}
+ ]});
+
+ k.ready(function(){
+ var currentLesson;
+ var i,j;
+ var flag_correct;
+ var TOTAL_QUES = 10;
+ var currentQuestion;
+ var correctCounter;
+ var totalCounter;
+ var imgVal;
+ var checked;
+ var question = new Array('AB र CB समानान्तर रेखा','MN र PQ समानान्तर रेखा','XY र RS समानान्तर रेखा',
+ 'AB र CD समानान्तर रेखा','AB र CD समानान्तर रेखा','AB र BC समानान्तर रेखा','AB र CD समानान्तर रेखा',
+ 'XAY र BC समानान्तर रेखा','AB र BC समानान्तर रेखा','ABC र DE एक आपसमा समानान्तर रेखा'
+ );
+ var answers = new Array(1,0,0,0,1,1,0,0,1,1); //0 for yes and 1 for 1
+ var definitions = new Array('Yes','No');
+ var scoreboard = $('#score_box').scoreboard({'layout':'horizontal',
+ 'winningScore': TOTAL_QUES});
+
+ var displayLessons = function(){
+ $('#content').html('').append('<div id="lesson"></div>');
+ if(currentLesson === 0){
+ var imgDef = "defParallelLines";
+ var imgLesson = "imgParallelLines";
+ var imgInfo = "infoParallelLines";
+ }
+ else{
+ var imgDef = "defIntersectLines";
+ var imgLesson = "imgIntersectLines";
+ var imgInfo = "infoIntersectLines";
+ }
+ $('#lesson').append('<img id="lessonHeader" src="assets/image/'+imgDef+'.png" />');
+ $('#lesson').append('<img id="lessonImage" src="assets/image/'+imgLesson+'.png" />');
+ $('#lesson').append('<img id="lessonInfo" src="assets/image/'+imgInfo+'.png" />');
+ };
+
+ var assignOptions = function(imgId){
+ $('#optionSection').append('<div id="check'+imgId+'" class="checkDisplay"></div><img id="opt'+imgId+'" class="imgOption" src="assets/image/img'+definitions[imgId]+'.png" />');
+ $('#opt'+imgId).click(function(){
+ checkAnswer(imgId);
+ });
+ };
+
+ var nextQuestions = function(){
+ currentQuestion = totalCounter;
+ flag_correct = 1;
+ $('#content').html('').append('<img src="assets/image/topText.png" />');
+ $('#content').append('<div id="quesDisplay"></div>');
+ $('#content').append('<div id="questionSection"></div>');
+ $('#questionSection').append('<div id="question"></div>');
+ $('#questionSection').append('<div id="optionSection"></div>');
+ $('#content').append('<div id="defSection"></div>');
+
+ $('#quesDisplay').html('<img src="assets/image/ques'+currentQuestion+'.png />');
+ $('#question').html(question[currentQuestion]);
+ $('#optionSection').html('');
+ for(i = 0; i<2; i++){
+ assignOptions(i);
+ }
+ };
+
+ var displayGameOver = function(){
+ $('#content').addClass('backOpaque');
+ $('#gameOver').show();
+ if(correctCounter === totalCounter){
+ $('#gameOver').html('बधाई छ !!! सबै उत्तर सहि भए !!! ');
+ }
+ else{
+ $('#gameOver').html('<div id="gameOverInfo">किन गलत भयो पत्ता लगाउ र अर्को पटक सहि बनाउने कोशिश गर । <br /> You Got <span class="specialText">'+correctCounter+
+ '</span> correct out of <span class="specialText">'+totalCounter+'</span> questions .</div>');
+ }
+ };
+
+ var delayCorrectShow = function(){
+ document.delayForm.delayval.value = 1;
+ if(checked === 1){
+ if(totalCounter === 10){
+ displayGameOver();
+ }
+ else{
+ nextQuestions();
+ }
+ }
+ $('.checkDisplay').html('');
+ };
+
+ var checkAnswer = function(optId){
+ if(optId == answers[currentQuestion]){
+ checked = 1;
+ k.audio.correct.play();
+ if(flag_correct === 1){
+ correctCounter++;
+ scoreboard.scoreboard('inc');
+ }
+ totalCounter++;
+ scoreboard.scoreboard('incTotal');
+ $('#check'+optId).html('<img src="assets/image/correct.png" />');
+
+ }
+ else{
+ flag_correct = 0;
+ checked = 0;
+ k.audio.incorrect.play();
+ $('#check'+optId).html('<img src="assets/image/incorrect.png" />');
+ $('#defSection').html('<img src="assets/image/defParallel'+definitions[answers[currentQuestion]]+'.png" />');
+ }
+ t=setTimeout(function(){delayCorrectShow();},1000);
+ };
+
+ function gameStart(){
+ $('#linkNextLesson').hide();
+ $('#linkPrevLesson').hide();
+ totalCounter = 0;
+ correctCounter = 0;
+ nextQuestions();
+ }
+
+ function game(){
+ $('#linkPrevLesson').hide();
+ $('#content').removeClass('backOpaque');
+ $('#gameOver').hide();
+ currentLesson = 0;
+ displayLessons();
+ }
+
+ game();
+
+ $('#linkNextLesson').click(function(){
+ $('#linkNextLesson').hide();
+ $('#linkPrevLesson').show();
+ currentLesson = 1;
+ displayLessons();
+ });
+ $('#linkPrevLesson').click(function(){
+ $('#linkNextLesson').show();
+ $('#linkPrevLesson').hide();
+ currentLesson = 0;
+ displayLessons();
+ });
+ $('#linkStart').click(function(){
+ gameStart();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ game();
+ });
+ $('#linkHelp').mouseover(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+
+ });
+ }); //end of k.ready
+ }); //end of document.read
+
+
diff --git a/examples/lessons/6_Maths_parallelLines/js/ui.core.js b/examples/lessons/6_Maths_parallelLines/js/ui.core.js
new file mode 100755
index 0000000..5493e0a
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/js/ui.core.js
@@ -0,0 +1,519 @@
+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+;jQuery.ui || (function($) {
+
+var _remove = $.fn.remove,
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+
+//Helper functions and ui object
+$.ui = {
+ version: "1.7.2",
+
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function(module, option, set) {
+ var proto = $.ui[module].prototype;
+ for(var i in set) {
+ proto.plugins[i] = proto.plugins[i] || [];
+ proto.plugins[i].push([option, set[i]]);
+ }
+ },
+ call: function(instance, name, args) {
+ var set = instance.plugins[name];
+ if(!set || !instance.element[0].parentNode) { return; }
+
+ for (var i = 0; i < set.length; i++) {
+ if (instance.options[set[i][0]]) {
+ set[i][1].apply(instance.element, args);
+ }
+ }
+ }
+ },
+
+ contains: function(a, b) {
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
+ },
+
+ hasScroll: function(el, a) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ($(el).css('overflow') == 'hidden') { return false; }
+
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
+ has = false;
+
+ if (el[scroll] > 0) { return true; }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[scroll] = 1;
+ has = (el[scroll] > 0);
+ el[scroll] = 0;
+ return has;
+ },
+
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
+ },
+
+ isOver: function(y, x, top, left, height, width) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+ },
+
+ keyCode: {
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+};
+
+// WAI-ARIA normalization
+if (isFF2) {
+ var attr = $.attr,
+ removeAttr = $.fn.removeAttr,
+ ariaNS = "http://www.w3.org/2005/07/aaa",
+ ariaState = /^aria-/,
+ ariaRole = /^wairole:/;
+
+ $.attr = function(elem, name, value) {
+ var set = value !== undefined;
+
+ return (name == 'role'
+ ? (set
+ ? attr.call(this, elem, name, "wairole:" + value)
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
+ : (ariaState.test(name)
+ ? (set
+ ? elem.setAttributeNS(ariaNS,
+ name.replace(ariaState, "aaa:"), value)
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
+ : attr.apply(this, arguments)));
+ };
+
+ $.fn.removeAttr = function(name) {
+ return (ariaState.test(name)
+ ? this.each(function() {
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
+ }) : removeAttr.call(this, name));
+ };
+}
+
+//jQuery plugins
+$.fn.extend({
+ remove: function() {
+ // Safari has a native remove event which actually removes DOM elements,
+ // so we have to use triggerHandler instead of trigger (#3037).
+ $("*", this).add(this).each(function() {
+ $(this).triggerHandler("remove");
+ });
+ return _remove.apply(this, arguments );
+ },
+
+ enableSelection: function() {
+ return this
+ .attr('unselectable', 'off')
+ .css('MozUserSelect', '')
+ .unbind('selectstart.ui');
+ },
+
+ disableSelection: function() {
+ return this
+ .attr('unselectable', 'on')
+ .css('MozUserSelect', 'none')
+ .bind('selectstart.ui', function() { return false; });
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ }
+});
+
+
+//Additional selectors
+$.extend($.expr[':'], {
+ data: function(elem, i, match) {
+ return !!$.data(elem, match[3]);
+ },
+
+ focusable: function(element) {
+ var nodeName = element.nodeName.toLowerCase(),
+ tabIndex = $.attr(element, 'tabindex');
+ return (/input|select|textarea|button|object/.test(nodeName)
+ ? !element.disabled
+ : 'a' == nodeName || 'area' == nodeName
+ ? element.href || !isNaN(tabIndex)
+ : !isNaN(tabIndex))
+ // the element and all of its ancestors must be visible
+ // the browser may report that the area is hidden
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
+ },
+
+ tabbable: function(element) {
+ var tabIndex = $.attr(element, 'tabindex');
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
+ }
+});
+
+
+// $.widget is a factory to create jQuery plugins
+// taking some boilerplate code out of the plugin code
+function getter(namespace, plugin, method, args) {
+ function getMethods(type) {
+ var methods = $[namespace][plugin][type] || [];
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
+ }
+
+ var methods = getMethods('getter');
+ if (args.length == 1 && typeof args[0] == 'string') {
+ methods = methods.concat(getMethods('getterSetter'));
+ }
+ return ($.inArray(method, methods) != -1);
+}
+
+$.widget = function(name, prototype) {
+ var namespace = name.split(".")[0];
+ name = name.split(".")[1];
+
+ // create plugin method
+ $.fn[name] = function(options) {
+ var isMethodCall = (typeof options == 'string'),
+ args = Array.prototype.slice.call(arguments, 1);
+
+ // prevent calls to internal methods
+ if (isMethodCall && options.substring(0, 1) == '_') {
+ return this;
+ }
+
+ // handle getter methods
+ if (isMethodCall && getter(namespace, name, options, args)) {
+ var instance = $.data(this[0], name);
+ return (instance ? instance[options].apply(instance, args)
+ : undefined);
+ }
+
+ // handle initialization and non-getter methods
+ return this.each(function() {
+ var instance = $.data(this, name);
+
+ // constructor
+ (!instance && !isMethodCall &&
+ $.data(this, name, new $[namespace][name](this, options))._init());
+
+ // method call
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
+ instance[options].apply(instance, args));
+ });
+ };
+
+ // create widget constructor
+ $[namespace] = $[namespace] || {};
+ $[namespace][name] = function(element, options) {
+ var self = this;
+
+ this.namespace = namespace;
+ this.widgetName = name;
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
+ this.widgetBaseClass = namespace + '-' + name;
+
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
+ this.element = $(element)
+ .bind('setData.' + name, function(event, key, value) {
+ if (event.target == element) {
+ return self._setData(key, value);
+ }
+ })
+ .bind('getData.' + name, function(event, key) {
+ if (event.target == element) {
+ return self._getData(key);
+ }
+ })
+ .bind('remove', function() {
+ return self.destroy();
+ });
+ };
+
+ // add widget prototype
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
+
+ // TODO: merge getter and getterSetter properties from widget prototype
+ // and plugin prototype
+ $[namespace][name].getterSetter = 'option';
+};
+
+$.widget.prototype = {
+ _init: function() {},
+ destroy: function() {
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
+ },
+
+ option: function(key, value) {
+ var options = key,
+ self = this;
+
+ if (typeof key == "string") {
+ if (value === undefined) {
+ return this._getData(key);
+ }
+ options = {};
+ options[key] = value;
+ }
+
+ $.each(options, function(key, value) {
+ self._setData(key, value);
+ });
+ },
+ _getData: function(key) {
+ return this.options[key];
+ },
+ _setData: function(key, value) {
+ this.options[key] = value;
+
+ if (key == 'disabled') {
+ this.element
+ [value ? 'addClass' : 'removeClass'](
+ this.widgetBaseClass + '-disabled' + ' ' +
+ this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
+ }
+ },
+
+ enable: function() {
+ this._setData('disabled', false);
+ },
+ disable: function() {
+ this._setData('disabled', true);
+ },
+
+ _trigger: function(type, event, data) {
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = $.Event(event);
+ event.type = eventName;
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if (event.originalEvent) {
+ for (var i = $.event.props.length, prop; i;) {
+ prop = $.event.props[--i];
+ event[prop] = event.originalEvent[prop];
+ }
+ }
+
+ this.element.trigger(event, data);
+
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
+ }
+};
+
+$.widget.defaults = {
+ disabled: false
+};
+
+
+/** Mouse Interaction Plugin **/
+
+$.ui.mouse = {
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ // Prevent text selection in IE
+ if ($.browser.msie) {
+ this._mouseUnselectable = this.element.attr('unselectable');
+ this.element.attr('unselectable', 'on');
+ }
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+
+ // Restore text selection in IE
+ ($.browser.msie
+ && this.element.attr('unselectable', this._mouseUnselectable));
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ // TODO: figure out why we have to use originalEvent
+ event.originalEvent = event.originalEvent || {};
+ if (event.originalEvent.mouseHandled) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ // preventDefault() is used to prevent the selection of text here -
+ // however, in Safari, this causes select boxes not to be selectable
+ // anymore, so this fix is needed
+ ($.browser.safari || event.preventDefault());
+
+ event.originalEvent.mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+};
+
+$.ui.mouse.defaults = {
+ cancel: null,
+ distance: 1,
+ delay: 0
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_parallelLines/js/ui.scoreboard.js b/examples/lessons/6_Maths_parallelLines/js/ui.scoreboard.js
new file mode 100755
index 0000000..53a930a
--- /dev/null
+++ b/examples/lessons/6_Maths_parallelLines/js/ui.scoreboard.js
@@ -0,0 +1,107 @@
+(function($){
+ $.widget('ui.scoreboard',
+ {
+ getScore : function(){
+ return this._getData('score');
+ },
+ setScore : function(newScore){
+ this._setData('score', parseInt(newScore));
+ this._refresh();
+ },
+ getTotal : function(){
+ return this._getData('total');
+ },
+ setTotal : function(newTotal){
+ this._setData('total', parseInt(newTotal));
+ this._refresh();
+ },
+ reset : function(){
+ this._setData('score', this._getData('initialScore'));
+ this._setData('total', this._getData('initialTotal'));
+ this._refresh();
+ },
+ inc : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') + incVal);
+ this._refresh();
+ if(this._getData('winScore') === this._getData('score')){
+ this.element.trigger('winGame');
+ }
+ },
+ incTotal : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') + incVal);
+ this._refresh();
+ },
+ dec : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') - decVal);
+ this._refresh();
+ },
+ decTotal : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') - decVal);
+ this._refresh();
+ },
+ _init : function(){
+
+ var divDisplay = "inline";
+ var score = this.options.score;
+ var total = this.options.total;
+ var layoutId = "h";
+ var self = this;
+
+
+ this._setData('initialScore', parseInt(this.options.score));
+ this._setData('initialTotal', parseInt(this.options.total));
+ this._setData('score', parseInt(this.options.score));
+ this._setData('total', parseInt(this.options.total));
+ this._setData('winScore', parseInt(this.options.winningScore) || 0);
+
+ if(this.options.layout === "vertical"){
+ layoutId = "v";
+ }
+
+ this.evWinGame = document.createEvent('Events');
+
+ this.element.addClass('ui-scoreboard-container-' + layoutId +
+ ' ui-widget ui-widget-content ui-corner-all');
+
+ var clone = $('<div>')
+ .addClass('ui-scoreboard-spacing-' + layoutId);
+ this._scoreText = $("<div>Score</div>")
+ .addClass('ui-scoreboard-spacing-'+ layoutId +
+ ' ui-corner-all ui-scoreboard-text')
+ .appendTo(this.element);
+ this._score = $("<div>" + score + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ $("<div>Total</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-corner-all ' +
+ 'ui-scoreboard-text')
+ .appendTo(this.element);
+ this._total = $("<div>" + total + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ },
+ _refresh : function(){
+ this._score.text(this._getData('score'));
+ this._total.text(this._getData('total'));
+ },
+ destroy : function(){
+ this.element.remove();
+ $.widget.prototype.destroy.apply(this, arguments);
+ }
+
+
+ });
+
+ $.ui.scoreboard.getter = ['getScore', 'getTotal'];
+ $.ui.scoreboard.defaults = {
+ score: 0, total: 0, layout: "horizontal", winningScore: 0
+ };
+
+ })(jQuery); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_quickAddition/.tmp_index.html.46799~ b/examples/lessons/6_Maths_quickAddition/.tmp_index.html.46799~
new file mode 100755
index 0000000..100e6b7
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/.tmp_index.html.46799~
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Adding and Multiplying Variables</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Adding and Multiplying Variables || <span id="currentTitle"> चलको जोड र गुणन </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_quickAddition/.tmp_index.html.62537~ b/examples/lessons/6_Maths_quickAddition/.tmp_index.html.62537~
new file mode 100755
index 0000000..2c7544c
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/.tmp_index.html.62537~
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Quick Addition</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Quick Addition<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id ="timerBar">
+ <div id="timerTitle">Timer:</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_quickAddition/assets/audio/correct.wav b/examples/lessons/6_Maths_quickAddition/assets/audio/correct.wav
new file mode 100755
index 0000000..a49ba33
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/audio/correct.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/audio/incorrect.wav b/examples/lessons/6_Maths_quickAddition/assets/audio/incorrect.wav
new file mode 100755
index 0000000..906c6a3
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/audio/incorrect.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/bg_footer.png b/examples/lessons/6_Maths_quickAddition/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/bg_header.png b/examples/lessons/6_Maths_quickAddition/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/bg_title_block.png b/examples/lessons/6_Maths_quickAddition/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/borderWall.png b/examples/lessons/6_Maths_quickAddition/assets/image/borderWall.png
new file mode 100755
index 0000000..adbacdc
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/borderWall.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_back.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_help.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_next.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_start.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/cupBoard.png b/examples/lessons/6_Maths_quickAddition/assets/image/cupBoard.png
new file mode 100755
index 0000000..98e9985
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/cupBoard.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/help.png b/examples/lessons/6_Maths_quickAddition/assets/image/help.png
new file mode 100755
index 0000000..769ee27
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/title_block_lt.png b/examples/lessons/6_Maths_quickAddition/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/title_block_rt.png b/examples/lessons/6_Maths_quickAddition/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/tv.png b/examples/lessons/6_Maths_quickAddition/assets/image/tv.png
new file mode 100755
index 0000000..cbaa755
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/assets/image/tv.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickAddition/css/lesson.css b/examples/lessons/6_Maths_quickAddition/css/lesson.css
new file mode 100755
index 0000000..e649943
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/css/lesson.css
@@ -0,0 +1,300 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }bgCalculation
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: abbgCalculationsolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ /*width: 25bgCalculation1px;*/
+ padding-right: 5px;
+ padding-top: 5px;
+}
+ #linkCheck{
+ margin: 1em 3em 0 0;
+ width: 101px; height: 30px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0 auto;
+ margin-top: 85px;
+ width: 98%;
+ padding: 0.5em;
+ height: 375px;
+ background-color: #FCFFA4;
+}
+ #section{
+ width: 900px;
+ height: 375px;
+ margin: 0 auto;
+ z-index: 1;
+ }
+
+ #left-side{
+ float:left;
+ width: 360px;
+ height: 360px;
+ z-index: 2;
+ }
+ #tv{
+ position:relative;
+ margin-left: 12px;
+ width: 215px;
+ height: 191px;
+ background-image: url(../assets/image/tv.png);
+ z-index:5;
+ }
+ #tvLayer{
+ position:absolute;
+ top: 17px;
+ left: 16px;
+ width: 179px;
+ height: 128px;
+ font: 40px/60px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #FFF;
+ text-align:center;
+ font-weight:bold;
+ -moz-border-radius : 10px;
+ -webkit-border-radius : 10px;
+ border-radius : 10px;
+ z-index: 1;
+ }
+ .tvOff{
+ background-color: #78040E;
+ border: 2px solid #78040E;
+
+ }
+ .tvOn{
+ background-color: #0000FF;
+ border: 2px solid #0000FF;
+ }
+
+ #cupBoard{
+ width: 280px;
+ height: 259px;
+ background: url(../assets/image/cupBoard.png) no-repeat;
+ }
+
+ #right-side{
+ float:right;
+ width: 420px;
+ height: 365px;
+ }
+ #borderWall{
+ position:relative;
+ width: 420px;
+ height: 320px;
+ background: url(../assets/image/borderWall.png) no-repeat;
+ }
+ #imgDisplay{
+ position:absolute;
+ top: 53px;
+ left: 62px;
+ width: 294px;
+ height:210px;
+ }
+ .default{
+ float:left;
+ width: 69px;
+ height: 48px;
+ background-color:#FCFFA4;
+ border: 2px solid #FCFFA4;
+ }
+ .correct{
+ float:left;
+ width: 69px;
+ height: 48px;
+ background-color:#A6E4FE;
+ border: 2px solid #F9F900;
+ }
+ #calcSection{
+ margin-top: 10px;
+ width: 420px;
+ height: 35px;
+ text-align:center;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #000;
+ font-weight: bold;
+ }
+
+ input.textBox{
+ size:3;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ height:35px;
+ width: 60px;
+ text-align:center;
+ }
+ .focus {
+ background-color: #FF9900;
+ }
+ .incorrect{
+ background-color: #FFFF00;
+ }
+
+ #help{
+ display:none;
+ position:absolute;
+ right: 20%;
+ top: 1%;
+ width: 224px;
+ height: 525px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+ #timerBar {
+ float: left;
+ margin-left: 300px;
+ width: 150px;
+ height:35px;
+ padding-left: 10px;
+ padding-top: 0px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+ }
+ #timerTitle{
+ float: left;
+ margin-top: 20px;
+ width: 50px;
+ height: 35px;
+ }
+
+ .timerBoxes{ /* Show the timer running after the game has began.... */
+ float:right;
+ margin: 0.5em 0 0 0.1em;
+ width: 80px;
+ height: 30px;
+ border: 2px dotted green;
+ padding: 3px;
+ color: blue;
+ text-align:center;
+ font : bold 25px Arial Black, Times New Roman;
+ background: #ACC;
+ }
diff --git a/examples/lessons/6_Maths_quickAddition/index.html b/examples/lessons/6_Maths_quickAddition/index.html
new file mode 100755
index 0000000..f5f5afc
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/index.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Quick Addition</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Quick Addition<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id ="timerBar">
+ <div id="timerTitle">Timer:</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_quickAddition/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_quickAddition/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_quickAddition/js/karma.js b/examples/lessons/6_Maths_quickAddition/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_Maths_quickAddition/js/lesson.js b/examples/lessons/6_Maths_quickAddition/js/lesson.js
new file mode 100755
index 0000000..84fe327
--- /dev/null
+++ b/examples/lessons/6_Maths_quickAddition/js/lesson.js
@@ -0,0 +1,162 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.wav'},
+ {'name':'incorrect','file':'incorrect.wav'}
+ ]});
+
+ k.ready(function(){
+ var i,j;
+ var totalCounter;
+ var currentQuestion;
+ var TOTAL_QUES = 16;
+ var randPositions = [];
+ var numFst;
+ var num2nd;
+ var s = 0; var play = 0; var restart = 0;
+
+ var checkTime = function(timePara){
+ if (timePara<10 )
+ {
+ timePara="0" + timePara;
+ }
+ return timePara;
+ };
+
+
+ var startTimer = function(){
+ s=checkTime(s);
+ $('#timerBox1').html(s);
+ increaseTime();
+ };
+
+ var increaseTime = function(){
+ if(play == 1){
+ if(restart == 1){
+ s = 0;
+ }
+ s++;
+ s=checkTime(s);
+ $('#timerBox1').html(s);
+ var t=setTimeout(function(){increaseTime();},1000);
+ }
+ };
+
+ var genRandPosition=function (){correctCounter = 0;
+ randPositions[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+ var next_question = function (){
+ numFst = k.rand(10,99);
+ num2nd = k.rand(10,99);
+ $('#calcSection').html('').append(numFst +' + '+num2nd+' = ');
+ $('#calcSection').append('<input type="text" class="textBox" maxlength="3" />');
+ foucs_blur();
+ $('.textBox').focus(); correctCounter = 0;
+ };
+ correctCounter = 0;
+ function game_start(){
+ genRandPosition();
+ play = 1;
+ startTimer();
+ next_question();
+ }
+
+ function game() {
+ totalCounter = 0;
+ s = 0; play = 0; restart = 0;
+ $('#section').html('').append('<div id="left-side"></div>');
+ $('#left-side').append('<div id="tv"></div>');
+ $('#tv').append('<div id="tvLayer"></div>');
+ $('#tvLayer').addClass('tvOff');
+ $('#left-side').append('<div id="cupBoard"></div>');
+ $('#section').append('<div id="right-side"></div>');
+ $('#right-side').append('<div id="borderWall"></div>');
+ $('#borderWall').append('<div id="imgDisplay"></div>');
+ for(var i = 0; i< TOTAL_QUES; i++){
+ $('#imgDisplay').append('<div id="img'+i+'></div>');
+ $('#img'+i).addClass('default');
+ }
+ $('#right-side').append('<div id="calcSection"></div>');
+
+ $('#help').hide();
+
+ }
+ game();
+ var delay_nextQues = function(){
+ document.delayForm.delayval.value = 1;
+ next_question();
+ };
+
+ var delay_gameOver = function(){
+ document.delayForm.delayval.value = 1;
+ $('#calcSection').html('');
+ play = 0;
+ for(var i = 0; i< TOTAL_QUES; i++){
+ $('#imgDisplay').append('<div id="img'+i+'></div>');
+ $('#img'+i).removeClass('correct').addClass('default');
+ }
+ $('#tvLayer').addClass('tvOn').append('खेल खत्तम।');
+
+ };
+
+ var check_answer = function(){
+ textVal = $('.textBox').val();
+ if((numFst+num2nd) == textVal){
+ totalCounter++;
+ k.audio.correct.play();
+ $('#img'+randPositions[totalCounter]).removeClass('default').addClass('correct');
+ if(totalCounter === TOTAL_QUES){
+ t=setTimeout(function(){delay_gameOver();},1000);
+ }
+ else{
+ t=setTimeout(function(){delay_nextQues();},1000);
+ }
+ }
+ else{
+ k.audio.incorrect.play();
+ }
+ };
+
+ function foucs_blur(){
+ $('input[type="text"]')
+ .focus(function() {
+ $(this).removeClass('incorrect').addClass("focus");
+ })
+ .blur(function() {
+ $(this).removeClass("focus");
+ })
+ .keypress(function(event) {
+ if(event.which === 13){
+ check_answer();
+ }
+
+ });
+
+ }
+
+ $('#linkStart').click(function(){
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ game_start();
+ });
+ $('#linkHelp').click(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+ });
+ }); //end of k.ready
+}); //end of document.ready \ No newline at end of file
diff --git a/examples/lessons/6_Maths_quickDivision/.tmp_index.html.46799~ b/examples/lessons/6_Maths_quickDivision/.tmp_index.html.46799~
new file mode 100755
index 0000000..100e6b7
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/.tmp_index.html.46799~
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Adding and Multiplying Variables</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Adding and Multiplying Variables || <span id="currentTitle"> चलको जोड र गुणन </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_quickDivision/.tmp_index.html.5425~ b/examples/lessons/6_Maths_quickDivision/.tmp_index.html.5425~
new file mode 100755
index 0000000..f5f5afc
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/.tmp_index.html.5425~
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Quick Addition</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Quick Addition<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id ="timerBar">
+ <div id="timerTitle">Timer:</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_quickDivision/.tmp_index.html.62537~ b/examples/lessons/6_Maths_quickDivision/.tmp_index.html.62537~
new file mode 100755
index 0000000..2c7544c
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/.tmp_index.html.62537~
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Quick Addition</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Quick Addition<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id ="timerBar">
+ <div id="timerTitle">Timer:</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_quickDivision/assets/audio/correct.wav b/examples/lessons/6_Maths_quickDivision/assets/audio/correct.wav
new file mode 100755
index 0000000..a49ba33
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/audio/correct.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/audio/incorrect.wav b/examples/lessons/6_Maths_quickDivision/assets/audio/incorrect.wav
new file mode 100755
index 0000000..906c6a3
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/audio/incorrect.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/bg_footer.png b/examples/lessons/6_Maths_quickDivision/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/bg_header.png b/examples/lessons/6_Maths_quickDivision/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/bg_title_block.png b/examples/lessons/6_Maths_quickDivision/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/borderWall.png b/examples/lessons/6_Maths_quickDivision/assets/image/borderWall.png
new file mode 100755
index 0000000..adbacdc
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/borderWall.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_back.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_help.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_next.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_ole.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_play_again.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_start.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_quickDivision/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/cupBoard.png b/examples/lessons/6_Maths_quickDivision/assets/image/cupBoard.png
new file mode 100755
index 0000000..98e9985
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/cupBoard.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/help.png b/examples/lessons/6_Maths_quickDivision/assets/image/help.png
new file mode 100755
index 0000000..0b22aa4
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/title_block_lt.png b/examples/lessons/6_Maths_quickDivision/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/title_block_rt.png b/examples/lessons/6_Maths_quickDivision/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/assets/image/tv.png b/examples/lessons/6_Maths_quickDivision/assets/image/tv.png
new file mode 100755
index 0000000..cbaa755
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/assets/image/tv.png
Binary files differ
diff --git a/examples/lessons/6_Maths_quickDivision/css/lesson.css b/examples/lessons/6_Maths_quickDivision/css/lesson.css
new file mode 100755
index 0000000..e649943
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/css/lesson.css
@@ -0,0 +1,300 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }bgCalculation
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: abbgCalculationsolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ /*width: 25bgCalculation1px;*/
+ padding-right: 5px;
+ padding-top: 5px;
+}
+ #linkCheck{
+ margin: 1em 3em 0 0;
+ width: 101px; height: 30px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0 auto;
+ margin-top: 85px;
+ width: 98%;
+ padding: 0.5em;
+ height: 375px;
+ background-color: #FCFFA4;
+}
+ #section{
+ width: 900px;
+ height: 375px;
+ margin: 0 auto;
+ z-index: 1;
+ }
+
+ #left-side{
+ float:left;
+ width: 360px;
+ height: 360px;
+ z-index: 2;
+ }
+ #tv{
+ position:relative;
+ margin-left: 12px;
+ width: 215px;
+ height: 191px;
+ background-image: url(../assets/image/tv.png);
+ z-index:5;
+ }
+ #tvLayer{
+ position:absolute;
+ top: 17px;
+ left: 16px;
+ width: 179px;
+ height: 128px;
+ font: 40px/60px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #FFF;
+ text-align:center;
+ font-weight:bold;
+ -moz-border-radius : 10px;
+ -webkit-border-radius : 10px;
+ border-radius : 10px;
+ z-index: 1;
+ }
+ .tvOff{
+ background-color: #78040E;
+ border: 2px solid #78040E;
+
+ }
+ .tvOn{
+ background-color: #0000FF;
+ border: 2px solid #0000FF;
+ }
+
+ #cupBoard{
+ width: 280px;
+ height: 259px;
+ background: url(../assets/image/cupBoard.png) no-repeat;
+ }
+
+ #right-side{
+ float:right;
+ width: 420px;
+ height: 365px;
+ }
+ #borderWall{
+ position:relative;
+ width: 420px;
+ height: 320px;
+ background: url(../assets/image/borderWall.png) no-repeat;
+ }
+ #imgDisplay{
+ position:absolute;
+ top: 53px;
+ left: 62px;
+ width: 294px;
+ height:210px;
+ }
+ .default{
+ float:left;
+ width: 69px;
+ height: 48px;
+ background-color:#FCFFA4;
+ border: 2px solid #FCFFA4;
+ }
+ .correct{
+ float:left;
+ width: 69px;
+ height: 48px;
+ background-color:#A6E4FE;
+ border: 2px solid #F9F900;
+ }
+ #calcSection{
+ margin-top: 10px;
+ width: 420px;
+ height: 35px;
+ text-align:center;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #000;
+ font-weight: bold;
+ }
+
+ input.textBox{
+ size:3;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ height:35px;
+ width: 60px;
+ text-align:center;
+ }
+ .focus {
+ background-color: #FF9900;
+ }
+ .incorrect{
+ background-color: #FFFF00;
+ }
+
+ #help{
+ display:none;
+ position:absolute;
+ right: 20%;
+ top: 1%;
+ width: 224px;
+ height: 525px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+ #timerBar {
+ float: left;
+ margin-left: 300px;
+ width: 150px;
+ height:35px;
+ padding-left: 10px;
+ padding-top: 0px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+ }
+ #timerTitle{
+ float: left;
+ margin-top: 20px;
+ width: 50px;
+ height: 35px;
+ }
+
+ .timerBoxes{ /* Show the timer running after the game has began.... */
+ float:right;
+ margin: 0.5em 0 0 0.1em;
+ width: 80px;
+ height: 30px;
+ border: 2px dotted green;
+ padding: 3px;
+ color: blue;
+ text-align:center;
+ font : bold 25px Arial Black, Times New Roman;
+ background: #ACC;
+ }
diff --git a/examples/lessons/6_Maths_quickDivision/index.html b/examples/lessons/6_Maths_quickDivision/index.html
new file mode 100755
index 0000000..f7e030f
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/index.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Quick Division</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Quick Division<span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id ="timerBar">
+ <div id="timerTitle">Timer:</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_quickDivision/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_quickDivision/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_quickDivision/js/karma.js b/examples/lessons/6_Maths_quickDivision/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_Maths_quickDivision/js/lesson.js b/examples/lessons/6_Maths_quickDivision/js/lesson.js
new file mode 100755
index 0000000..6bbc937
--- /dev/null
+++ b/examples/lessons/6_Maths_quickDivision/js/lesson.js
@@ -0,0 +1,185 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.wav'},
+ {'name':'incorrect','file':'incorrect.wav'}
+ ]});
+
+ k.ready(function(){
+ var i,j;
+ var totalCounter;
+ var currentQuestion;
+ var TOTAL_QUES = 16;
+ var randPositions = [];
+ var numFst;
+ var num2nd;
+ var s = 0; var play = 0; var restart = 0;
+
+ var checkTime = function(timePara){
+ if (timePara<10 )
+ {
+ timePara="0" + timePara;
+ }
+ return timePara;
+ };
+
+ var startTimer = function(){
+ s=checkTime(s);
+ $('#timerBox1').html(s);
+ increaseTime();
+ };
+
+ var increaseTime = function(){
+ if(play == 1){
+ if(restart == 1){
+ s = 0;
+ }
+ s++;
+ s=checkTime(s);
+ $('#timerBox1').html(s);
+ var t=setTimeout(function(){increaseTime();},1000);
+ }
+ };
+
+ var genRandPosition=function (){correctCounter = 0;
+ randPositions[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+ var isInteger = function(s)
+ {
+ var i;
+ s = s.toString();
+ for (i = 0; i < s.length; i++)
+ {
+ var c = s.charAt(i);
+ if (isNaN(c))
+ {
+
+ return false;
+ }
+ }
+ return true;
+ };
+
+ var next_question = function (){
+
+ var flag_done = 0;
+ numFst = k.rand(12,99);
+ num2nd = k.rand(2,12);
+ do{
+ numFst = k.rand(20,99);
+ if(isInteger(numFst/num2nd)){
+ flag_done = 1;
+ }
+ }while(flag_done!=1);
+ $('#calcSection').html('').append(numFst +' &#247; '+num2nd+' = ');
+ $('#calcSection').append('<input type="text" class="textBox" maxlength="3" />');
+ foucs_blur();
+ $('.textBox').focus();
+
+ };
+
+ function game_start(){
+ genRandPosition();
+ play = 1;
+ startTimer();
+ next_question();
+ }
+
+ function game() {
+ totalCounter = 0;
+ s = 0; play = 0; restart = 0;
+ $('#section').html('').append('<div id="left-side"></div>');
+ $('#left-side').append('<div id="tv"></div>');
+ $('#tv').append('<div id="tvLayer"></div>');
+ $('#tvLayer').addClass('tvOff');
+ $('#left-side').append('<div id="cupBoard"></div>');
+ $('#section').append('<div id="right-side"></div>');
+ $('#right-side').append('<div id="borderWall"></div>');
+ $('#borderWall').append('<div id="imgDisplay"></div>');
+ for(var i = 0; i< TOTAL_QUES; i++){
+ $('#imgDisplay').append('<div id="img'+i+'></div>');
+ $('#img'+i).addClass('default');
+ }
+ $('#right-side').append('<div id="calcSection"></div>');
+
+ $('#help').hide();
+
+ }
+ game();
+ var delay_nextQues = function(){
+ document.delayForm.delayval.value = 1;
+ next_question();
+ };
+
+ var delay_gameOver = function(){
+ document.delayForm.delayval.value = 1;
+ $('#calcSection').html('');
+ play = 0;
+ for(var i = 0; i< TOTAL_QUES; i++){
+ $('#imgDisplay').append('<div id="img'+i+'></div>');
+ $('#img'+i).removeClass('correct').addClass('default');
+ }
+ $('#tvLayer').addClass('tvOn').append('खेल खत्तम।');
+
+ };
+
+ var check_answer = function(){
+ textVal = $('.textBox').val();
+ if((numFst/num2nd) == textVal){
+ totalCounter++;
+ k.audio.correct.play();
+ $('#img'+randPositions[totalCounter]).removeClass('default').addClass('correct');
+ if(totalCounter === TOTAL_QUES){
+ t=setTimeout(function(){delay_gameOver();},1000);
+ }
+ else{
+ t=setTimeout(function(){delay_nextQues();},1000);
+ }
+ }
+ else{
+ k.audio.incorrect.play();
+ }
+ };
+
+ function foucs_blur(){
+ $('input[type="text"]')
+ .focus(function() {
+ $(this).removeClass('incorrect').addClass("focus");
+ })
+ .blur(function() {
+ $(this).removeClass("focus");
+ })
+ .keypress(function(event) {
+ if(event.which === 13){
+ check_answer();
+ }
+
+ });
+
+ }
+
+ $('#linkStart').click(function(){
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ game_start();
+ });
+ $('#linkHelp').click(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+ });
+ }); //end of k.ready
+}); //end of document.ready \ No newline at end of file
diff --git a/examples/lessons/6_Maths_romanNumerals/.tmp_index.html.54396~ b/examples/lessons/6_Maths_romanNumerals/.tmp_index.html.54396~
new file mode 100755
index 0000000..9560a86
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/.tmp_index.html.54396~
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Articles</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Articles for Vowels and Consonants <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="frontDisplay">
+ <img src="assets/image/first_display.png">
+ </div>
+ <div id="section">
+ <div id="topText">
+ Choose the right article
+ </div>
+ <div id="articleImages"></div>
+ <div id="question"></div>
+ <div id="optionSection"></div>
+ <div id="answer"></div>
+ <div id="answerCheck"></div>
+ </div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <div id="score_box">
+ <form name="scoreForm">
+ अंक:
+ <input name="score" type="text" id="score" size="2" maxlength="2" /> |
+ <input name="full_mark" type="text" id="full_mark" size="2" maxlength="2"/>
+ </form>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_romanNumerals/.tmp_index.html.76681~ b/examples/lessons/6_Maths_romanNumerals/.tmp_index.html.76681~
new file mode 100755
index 0000000..a02c05a
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/.tmp_index.html.76681~
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Roman Numerals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ <span id="currentTitle">हिन्दु अरेबिक संख्या र रोमन संख्या </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+
+ </div>
+
+ <div id="content">
+ <div id="frontDisplay">
+ <img src="assets/image/image1.png">
+ </div>
+ <div id="section">
+ <div id="gameArea">
+
+ </div>
+ </div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerTitle">Timer:</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ <div id="timerBox2" class="timerBoxes"></div>
+ <div id="timerBox3" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_romanNumerals/.tmp_index.html.89199~ b/examples/lessons/6_Maths_romanNumerals/.tmp_index.html.89199~
new file mode 100755
index 0000000..9560a86
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/.tmp_index.html.89199~
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 English Articles</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ Articles for Vowels and Consonants <span id="currentTitle"></span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="frontDisplay">
+ <img src="assets/image/first_display.png">
+ </div>
+ <div id="section">
+ <div id="topText">
+ Choose the right article
+ </div>
+ <div id="articleImages"></div>
+ <div id="question"></div>
+ <div id="optionSection"></div>
+ <div id="answer"></div>
+ <div id="answerCheck"></div>
+ </div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <div id="score_box">
+ <form name="scoreForm">
+ अंक:
+ <input name="score" type="text" id="score" size="2" maxlength="2" /> |
+ <input name="full_mark" type="text" id="full_mark" size="2" maxlength="2"/>
+ </form>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/audio/correct.ogg b/examples/lessons/6_Maths_romanNumerals/assets/audio/correct.ogg
new file mode 100755
index 0000000..a0d9e3a
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/audio/correct.ogg
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/audio/incorrect.ogg b/examples/lessons/6_Maths_romanNumerals/assets/audio/incorrect.ogg
new file mode 100755
index 0000000..4805e55
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/audio/incorrect.ogg
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/bg_footer.png b/examples/lessons/6_Maths_romanNumerals/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/bg_header.png b/examples/lessons/6_Maths_romanNumerals/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/bg_title_block.png b/examples/lessons/6_Maths_romanNumerals/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_back.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_help.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_next.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_ole.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_start.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/confirm.png b/examples/lessons/6_Maths_romanNumerals/assets/image/confirm.png
new file mode 100755
index 0000000..bd0afcb
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/confirm.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/correct.png b/examples/lessons/6_Maths_romanNumerals/assets/image/correct.png
new file mode 100755
index 0000000..7e15698
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/gameOver.png b/examples/lessons/6_Maths_romanNumerals/assets/image/gameOver.png
new file mode 100755
index 0000000..81c403b
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/gameOver.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/image1.png b/examples/lessons/6_Maths_romanNumerals/assets/image/image1.png
new file mode 100755
index 0000000..5a4adc7
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/image1.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/img2title.png b/examples/lessons/6_Maths_romanNumerals/assets/image/img2title.png
new file mode 100755
index 0000000..31b1761
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/img2title.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/img_think.png b/examples/lessons/6_Maths_romanNumerals/assets/image/img_think.png
new file mode 100755
index 0000000..b212b67
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/img_think.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/incorrect.png b/examples/lessons/6_Maths_romanNumerals/assets/image/incorrect.png
new file mode 100755
index 0000000..e60c32d
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/incorrect.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/quesBox.png b/examples/lessons/6_Maths_romanNumerals/assets/image/quesBox.png
new file mode 100755
index 0000000..913c836
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/quesBox.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/title_block_lt.png b/examples/lessons/6_Maths_romanNumerals/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/title_block_rt.png b/examples/lessons/6_Maths_romanNumerals/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/assets/image/volume.png b/examples/lessons/6_Maths_romanNumerals/assets/image/volume.png
new file mode 100755
index 0000000..4cf5397
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/assets/image/volume.png
Binary files differ
diff --git a/examples/lessons/6_Maths_romanNumerals/css/lesson.css b/examples/lessons/6_Maths_romanNumerals/css/lesson.css
new file mode 100755
index 0000000..6cbe206
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/css/lesson.css
@@ -0,0 +1,302 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: absolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 10px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ width: 251px;
+ padding-right: 5px;
+ padding-top: 5px;
+}
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0px auto;
+ margin-top: 90px;
+ width: 95%;
+ height: 375px;
+
+}
+#frontDisplay{
+ width: 736px;
+ heigth: 350px;
+ margin: 0px auto;
+
+}
+#section{
+ display:none;
+ margin: 0px auto;
+}
+
+ #topText{
+ text-align:center;
+ margin: 2px auto;
+ width: 444px;
+ height:50px;
+ font: 25px/30px Arial, Helvetica, sans-serif;
+ background:url(../assets/image/img2title.png) no-repeat;
+ color: #D70123;
+ font-weight:bold;
+ }
+ #gameArea{
+ width:900px;
+ height: 400px;
+ }
+
+ .imgArea{
+ float:left;
+ margin-left: 15px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 2px;
+ width: 150px;
+ height: 135px;
+ }
+ .quesBox{
+ width: 125px;
+ height: 70px;
+ text-align:center;
+ background: url(../assets/image/quesBox.png);
+ font: 25px/70px Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ }
+ .textBox{
+ margin-top:0.1em;
+ width: 120px;
+ height: 25px;
+ text-align:center;
+ font: 20px/25px Arial, Helvetica, sans-serif;
+ background-color:#64CAFF;
+ border: 2px solid black;
+ color: black;
+ }
+
+ #confirmBtn{
+
+ position:absolute;
+ bottom: 100px;
+ right: 30px;
+ width: 101px;
+ height: 30px;
+ background: url(../assets/image/confirm.png) no-repeat;
+ cursor: hand;
+ }
+ .check{
+ float:right;
+ width: 24px;
+ height: 24px;
+ }
+ #imgStory{
+ position:absolute;
+ right: 5px;
+ bottom:200px;
+ width: 136px;
+ height:175px;
+ margin:0.5em;
+ background: url(../assets/image/img_think.png) no-repeat;
+ }
+
+ #answer{
+ margin-left: 100px;
+ padding:5px;
+ height:30px;
+ font: 20px/25px Arial, Helvetica, sans-serif;
+ color: #000000;
+ }
+ #answerCheck{
+ position:absolute;
+ top: 60%;
+ right: 20%;
+ width: 132px;
+ height: 122px;
+ }
+
+
+
+ .focus {
+ border: 2px solid #AA88FF;
+ background-color: #FFEEAA;
+
+ }
+
+
+#gameOver{
+ display:none;
+ position:absolute;
+ top: 40%;
+ left: 25%;
+ width: 500px;
+ text-align:center;
+ font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ color:red;
+}
+#gameOverInfo{
+ text-align:center;
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#000000;
+
+}
+.gameOverShow{
+ background-color: #AFF0FF;
+ opacity: 0.2;
+}
+.specialText{
+ font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif;
+ font-weight:bold;
+ color:#FF9900;
+ border: 2px dotted #CCC;
+
+}
+#timerBar {
+ float: left;
+ width: 215px;
+ height:35px;
+ padding-left: 10px;
+ padding-top: 0px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#timerTitle{
+ float: left;
+ margin-top: 20px;
+ width: 50px;
+ height: 35px;
+}
+
+.timerBoxes{ /* Show the timer running after the game has began.... */
+float:right;
+margin: 0.5em 0 0 0.1em;
+width: 35px;
+height: 30px;
+border: 2px dotted green;
+padding: 3px;
+color: blue;
+font : bold 25px Arial Black, Times New Roman;
+background: #ACC;
+}
+
+
diff --git a/examples/lessons/6_Maths_romanNumerals/index.html b/examples/lessons/6_Maths_romanNumerals/index.html
new file mode 100755
index 0000000..e5e8951
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/index.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Roman Numerals</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_left"><a href="#"><div id="linkBack"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ <span id="currentTitle">हिन्दु अरेबिक संख्या र रोमन संख्या </span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="topbtn_right"><a href="#"><div id="linkNext"></div></a></div>
+
+ </div>
+
+ <div id="content">
+ <div id="frontDisplay">
+ <img src="assets/image/image1.png">
+ </div>
+ <div id="section">
+ <div id="gameArea"></div>
+ </div>
+ <div id="confirmBtn"></div>
+ <div id="imgStory"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+
+ <div id="footer">
+ <!-- Timer Section -->
+ <div id ="timerBar">
+ <div id="timerTitle">Timer:</div>
+ <div id="timerBox1" class="timerBoxes"></div>
+ <div id="timerBox2" class="timerBoxes"></div>
+ <div id="timerBox3" class="timerBoxes"></div>
+ </div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_romanNumerals/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_romanNumerals/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_romanNumerals/js/jquery-1.4.js b/examples/lessons/6_Maths_romanNumerals/js/jquery-1.4.js
new file mode 100755
index 0000000..a448490
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/js/jquery-1.4.js
@@ -0,0 +1,5999 @@
+/*!
+ * jQuery JavaScript Library v1.4
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://docs.jquery.com/License
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Jan 13 15:23:05 2010 -0500
+ */
+(function( window, undefined ) {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
+
+ // Is it a simple selector
+ isSimple = /^.[^:#\[\.,]*$/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // Has the ready events already been bound?
+ readyBound = false,
+
+ // The functions to execute on DOM ready
+ readyList = [],
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ indexOf = Array.prototype.indexOf;
+
+jQuery.fn = jQuery.prototype = {
+ init: function( selector, context ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ match = quickExpr.exec( selector );
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
+ }
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ if ( elem ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $("TAG")
+ } else if ( !context && /^\w+$/.test( selector ) ) {
+ this.selector = selector;
+ this.context = document;
+ selector = document.getElementsByTagName( selector );
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return jQuery( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.isArray( selector ) ?
+ this.setArray( selector ) :
+ jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.4",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = jQuery( elems || null );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Force the current matched set of elements to become
+ // the specified array of elements (destroying the stack in the process)
+ // You should use pushStack() in order to do this, but maintain the stack
+ setArray: function( elems ) {
+ // Resetting the length to 0, then using the native Array push
+ // is a super-fast way to populate an object with array-like properties
+ this.length = 0;
+ push.apply( this, elems );
+
+ return this;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // If the DOM is already ready
+ if ( jQuery.isReady ) {
+ // Execute the function immediately
+ fn.call( document, jQuery );
+
+ // Otherwise, remember the function for later
+ } else if ( readyList ) {
+ // Add the function to the wait list
+ readyList.push( fn );
+ }
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || jQuery(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ // copy reference to target object
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging object literal values or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
+ var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
+ : jQuery.isArray(copy) ? [] : {};
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ window.$ = _$;
+
+ if ( deep ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // Handle when the DOM is ready
+ ready: function() {
+ // Make sure that the DOM is not already loaded
+ if ( !jQuery.isReady ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 13 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If there are functions bound, to execute
+ if ( readyList ) {
+ // Execute all of them
+ var fn, i = 0;
+ while ( (fn = readyList[ i++ ]) ) {
+ fn.call( document, jQuery );
+ }
+
+ // Reset the list of functions
+ readyList = null;
+ }
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyBound ) {
+ return;
+ }
+
+ readyBound = true;
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ return jQuery.ready();
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent("onreadystatechange", DOMContentLoaded);
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return toString.call(obj) === "[object Function]";
+ },
+
+ isArray: function( obj ) {
+ return toString.call(obj) === "[object Array]";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor
+ && !hasOwnProperty.call(obj, "constructor")
+ && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwnProperty.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ noop: function() {},
+
+ // Evalulates a script in a global context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test(data) ) {
+ // Inspired by code by Andrea Giammarchi
+ // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+ var head = document.getElementsByTagName("head")[0] || document.documentElement,
+ script = document.createElement("script");
+
+ script.type = "text/javascript";
+
+ if ( jQuery.support.scriptEval ) {
+ script.appendChild( document.createTextNode( data ) );
+ } else {
+ script.text = data;
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709).
+ head.insertBefore( script, head.firstChild );
+ head.removeChild( script );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction(object);
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( var value = object[0];
+ i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+ }
+ }
+
+ return object;
+ },
+
+ trim: function( text ) {
+ return (text || "").replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+ if ( array.indexOf ) {
+ return array.indexOf( elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length, j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [];
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ if ( !inv !== !callback( elems[ i ], i ) ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var ret = [], value;
+
+ // Go through the array, translating each of the items to their
+ // new value (or values).
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ proxy: function( fn, proxy, thisObject ) {
+ if ( arguments.length === 2 ) {
+ if ( typeof proxy === "string" ) {
+ thisObject = fn;
+ fn = thisObject[ proxy ];
+ proxy = undefined;
+
+ } else if ( proxy && !jQuery.isFunction( proxy ) ) {
+ thisObject = proxy;
+ proxy = undefined;
+ }
+ }
+
+ if ( !proxy && fn ) {
+ proxy = function() {
+ return fn.apply( thisObject || this, arguments );
+ };
+ }
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ if ( fn ) {
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+ }
+
+ // So proxy can be declared as an argument
+ return proxy;
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ var ret = { browser: "" };
+
+ ua = ua.toLowerCase();
+
+ if ( /webkit/.test( ua ) ) {
+ ret = { browser: "webkit", version: /webkit[\/ ]([\w.]+)/ };
+
+ } else if ( /opera/.test( ua ) ) {
+ ret = { browser: "opera", version: /version/.test( ua ) ? /version[\/ ]([\w.]+)/ : /opera[\/ ]([\w.]+)/ };
+
+ } else if ( /msie/.test( ua ) ) {
+ ret = { browser: "msie", version: /msie ([\w.]+)/ };
+
+ } else if ( /mozilla/.test( ua ) && !/compatible/.test( ua ) ) {
+ ret = { browser: "mozilla", version: /rv:([\w.]+)/ };
+ }
+
+ ret.version = (ret.version && ret.version.exec( ua ) || [0, "0"])[1];
+
+ return ret;
+ },
+
+ browser: {}
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+if ( indexOf ) {
+ jQuery.inArray = function( elem, array ) {
+ return indexOf.call( array, elem );
+ };
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch( error ) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+if ( indexOf ) {
+ jQuery.inArray = function( elem, array ) {
+ return indexOf.call( array, elem );
+ };
+}
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+// Mutifunctional method to get and set values to a collection
+// The value/s can be optionally by executed if its a function
+function access( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : null;
+}
+
+function now() {
+ return (new Date).getTime();
+}
+(function() {
+
+ jQuery.support = {};
+
+ var root = document.documentElement,
+ script = document.createElement("script"),
+ div = document.createElement("div"),
+ id = "script" + now();
+
+ div.style.display = "none";
+ div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+ var all = div.getElementsByTagName("*"),
+ a = div.getElementsByTagName("a")[0];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return;
+ }
+
+ jQuery.support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: div.firstChild.nodeType === 3,
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText insted)
+ style: /red/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: a.getAttribute("href") === "/a",
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: div.getElementsByTagName("input")[0].value === "on",
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
+
+ // Will be defined later
+ scriptEval: false,
+ noCloneEvent: true,
+ boxModel: null
+ };
+
+ script.type = "text/javascript";
+ try {
+ script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
+ } catch(e) {}
+
+ root.insertBefore( script, root.firstChild );
+
+ // Make sure that the execution of code works by injecting a script
+ // tag with appendChild/createTextNode
+ // (IE doesn't support this, fails, and uses .text instead)
+ if ( window[ id ] ) {
+ jQuery.support.scriptEval = true;
+ delete window[ id ];
+ }
+
+ root.removeChild( script );
+
+ if ( div.attachEvent && div.fireEvent ) {
+ div.attachEvent("onclick", function click() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ jQuery.support.noCloneEvent = false;
+ div.detachEvent("onclick", click);
+ });
+ div.cloneNode(true).fireEvent("onclick");
+ }
+
+ // Figure out if the W3C box model works as expected
+ // document.body must exist before we can do this
+ // TODO: This timeout is temporary until I move ready into core.js.
+ jQuery(function() {
+ var div = document.createElement("div");
+ div.style.width = div.style.paddingLeft = "1px";
+
+ document.body.appendChild( div );
+ jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+ document.body.removeChild( div ).style.display = 'none';
+ div = null;
+ });
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+ var eventSupported = function( eventName ) {
+ var el = document.createElement("div");
+ eventName = "on" + eventName;
+
+ var isSupported = (eventName in el);
+ if ( !isSupported ) {
+ el.setAttribute(eventName, "return;");
+ isSupported = typeof el[eventName] === "function";
+ }
+ el = null;
+
+ return isSupported;
+ };
+
+ jQuery.support.submitBubbles = eventSupported("submit");
+ jQuery.support.changeBubbles = eventSupported("change");
+
+ // release memory in IE
+ root = script = div = all = a = null;
+})();
+
+jQuery.props = {
+ "for": "htmlFor",
+ "class": "className",
+ readonly: "readOnly",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ rowspan: "rowSpan",
+ colspan: "colSpan",
+ tabindex: "tabIndex",
+ usemap: "useMap",
+ frameborder: "frameBorder"
+};
+var expando = "jQuery" + now(), uuid = 0, windowData = {};
+var emptyObject = {};
+
+jQuery.extend({
+ cache: {},
+
+ expando:expando,
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ "object": true,
+ "applet": true
+ },
+
+ data: function( elem, name, data ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ], cache = jQuery.cache, thisCache;
+
+ // Handle the case where there's no name immediately
+ if ( !name && !id ) {
+ return null;
+ }
+
+ // Compute a unique ID for the element
+ if ( !id ) {
+ id = ++uuid;
+ }
+
+ // Avoid generating a new cache unless none exists and we
+ // want to manipulate it.
+ if ( typeof name === "object" ) {
+ elem[ expando ] = id;
+ thisCache = cache[ id ] = jQuery.extend(true, {}, name);
+ } else if ( cache[ id ] ) {
+ thisCache = cache[ id ];
+ } else if ( typeof data === "undefined" ) {
+ thisCache = emptyObject;
+ } else {
+ thisCache = cache[ id ] = {};
+ }
+
+ // Prevent overriding the named cache with undefined values
+ if ( data !== undefined ) {
+ elem[ expando ] = id;
+ thisCache[ name ] = data;
+ }
+
+ return typeof name === "string" ? thisCache[ name ] : thisCache;
+ },
+
+ removeData: function( elem, name ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
+
+ // If we want to remove a specific section of the element's data
+ if ( name ) {
+ if ( thisCache ) {
+ // Remove the section of cache data
+ delete thisCache[ name ];
+
+ // If we've removed all the data, remove the element's cache
+ if ( jQuery.isEmptyObject(thisCache) ) {
+ jQuery.removeData( elem );
+ }
+ }
+
+ // Otherwise, we want to remove all of the element's data
+ } else {
+ // Clean up the element expando
+ try {
+ delete elem[ expando ];
+ } catch( e ) {
+ // IE has trouble directly removing the expando
+ // but it's ok with using removeAttribute
+ if ( elem.removeAttribute ) {
+ elem.removeAttribute( expando );
+ }
+ }
+
+ // Completely remove the data cache
+ delete cache[ id ];
+ }
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ if ( typeof key === "undefined" && this.length ) {
+ return jQuery.data( this[0] );
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ }
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ } else {
+ return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
+ jQuery.data( this, key, value );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ if ( !elem ) {
+ return;
+ }
+
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( !data ) {
+ return q || [];
+ }
+
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data) );
+
+ } else {
+ q.push( data );
+ }
+
+ return q;
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ), fn = queue.shift();
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function( i, elem ) {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ }
+});
+var rclass = /[\n\t]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rspecialurl = /href|src|style/,
+ rtype = /(button|input)/i,
+ rfocusable = /(button|input|object|select|textarea)/i,
+ rclickable = /^(a|area)$/i,
+ rradiocheck = /radio|checkbox/;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name, fn ) {
+ return this.each(function(){
+ jQuery.attr( this, name, "" );
+ if ( this.nodeType === 1 ) {
+ this.removeAttribute( name );
+ }
+ });
+ },
+
+ addClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.addClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ var classNames = (value || "").split( rspace );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className ) {
+ elem.className = value;
+
+ } else {
+ var className = " " + elem.className + " ";
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
+ elem.className += " " + classNames[c];
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.removeClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ var classNames = (value || "").split(rspace);
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ var className = (" " + elem.className + " ").replace(rclass, " ");
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[c] + " ", " ");
+ }
+ elem.className = className.substring(1, className.length - 1);
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value, isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className, i = 0, self = jQuery(this),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery.data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ if ( value === undefined ) {
+ var elem = this[0];
+
+ if ( elem ) {
+ if ( jQuery.nodeName( elem, "option" ) ) {
+ return (elem.attributes.value || {}).specified ? elem.value : elem.text;
+ }
+
+ // We need to handle select boxes special
+ if ( jQuery.nodeName( elem, "select" ) ) {
+ var index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ if ( option.selected ) {
+ // Get the specifc value for the option
+ value = jQuery(option).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ }
+
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+
+
+ // Everything else, we just grab the value
+ return (elem.value || "").replace(rreturn, "");
+
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction(value);
+
+ return this.each(function(i) {
+ var self = jQuery(this), val = value;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call(this, i, self.val());
+ }
+
+ // Typecast each time if the value is a Function and the appended
+ // value is therefore different each time.
+ if ( typeof val === "number" ) {
+ val += "";
+ }
+
+ if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
+ this.checked = jQuery.inArray( self.val(), val ) >= 0;
+
+ } else if ( jQuery.nodeName( this, "select" ) ) {
+ var values = jQuery.makeArray(val);
+
+ jQuery( "option", this ).each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ this.selectedIndex = -1;
+ }
+
+ } else {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attr: function( elem, name, value, pass ) {
+ // don't set attributes on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery(elem)[name](value);
+ }
+
+ var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
+ // Whether we are setting (or getting)
+ set = value !== undefined;
+
+ // Try to normalize/fix the name
+ name = notxml && jQuery.props[ name ] || name;
+
+ // Only do all the following if this is a node (faster for style)
+ if ( elem.nodeType === 1 ) {
+ // These attributes require special treatment
+ var special = rspecialurl.test( name );
+
+ // Safari mis-reports the default selected property of an option
+ // Accessing the parent's selectedIndex property fixes it
+ if ( name === "selected" && !jQuery.support.optSelected ) {
+ var parent = elem.parentNode;
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ }
+
+ // If applicable, access the attribute via the DOM 0 way
+ if ( name in elem && notxml && !special ) {
+ if ( set ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
+ throw "type property can't be changed";
+ }
+
+ elem[ name ] = value;
+ }
+
+ // browsers index elements by id/name on forms, give priority to attributes.
+ if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
+ return elem.getAttributeNode( name ).nodeValue;
+ }
+
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ if ( name === "tabIndex" ) {
+ var attributeNode = elem.getAttributeNode( "tabIndex" );
+
+ return attributeNode && attributeNode.specified ?
+ attributeNode.value :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+
+ return elem[ name ];
+ }
+
+ if ( !jQuery.support.style && notxml && name === "style" ) {
+ if ( set ) {
+ elem.style.cssText = "" + value;
+ }
+
+ return elem.style.cssText;
+ }
+
+ if ( set ) {
+ // convert the value to a string (all browsers do this but IE) see #1070
+ elem.setAttribute( name, "" + value );
+ }
+
+ var attr = !jQuery.support.hrefNormalized && notxml && special ?
+ // Some attributes require a special call on IE
+ elem.getAttribute( name, 2 ) :
+ elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return attr === null ? undefined : attr;
+ }
+
+ // elem is actually elem.style ... set the style
+ // Using attr for specific style information is now deprecated. Use style insead.
+ return jQuery.style( elem, name, value );
+ }
+});
+var fcleanup = function( nm ) {
+ return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
+ return "\\" + ch;
+ });
+};
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // For whatever reason, IE has trouble passing the window object
+ // around, causing it to be cloned in the process
+ if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
+ elem = window;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // if data is passed, bind to handler
+ if ( data !== undefined ) {
+ // Create temporary function pointer to original handler
+ var fn = handler;
+
+ // Create unique handler function, wrapped around original handler
+ handler = jQuery.proxy( fn );
+
+ // Store data in unique handler
+ handler.data = data;
+ }
+
+ // Init the element's event structure
+ var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
+ handle = jQuery.data( elem, "handle" ), eventHandle;
+
+ if ( !handle ) {
+ eventHandle = function() {
+ // Handle the second event of a trigger and when
+ // an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+
+ handle = jQuery.data( elem, "handle", eventHandle );
+ }
+
+ // If no handle is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !handle ) {
+ return;
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native
+ // event in IE.
+ handle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split( /\s+/ );
+ var type, i=0;
+ while ( (type = types[ i++ ]) ) {
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ handler.type = namespaces.slice(0).sort().join(".");
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = this.special[ type ] || {};
+
+
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = {};
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, handle, false );
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, handle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers );
+ if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
+ modifiedHandler.guid = modifiedHandler.guid || handler.guid;
+ handler = modifiedHandler;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers[ handler.guid ] = handler;
+
+ // Keep track of which events have been used, for global triggering
+ this.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ var events = jQuery.data( elem, "events" ), ret, type, fn;
+
+ if ( events ) {
+ // Unbind all events for the element
+ if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
+ for ( type in events ) {
+ this.remove( elem, type + (types || "") );
+ }
+ } else {
+ // types is actually an event object here
+ if ( types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(/\s+/);
+ var i = 0;
+ while ( (type = types[ i++ ]) ) {
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ var all = !namespaces.length,
+ cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ),
+ namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"),
+ special = this.special[ type ] || {};
+
+ if ( events[ type ] ) {
+ // remove the given handler for the given type
+ if ( handler ) {
+ fn = events[ type ][ handler.guid ];
+ delete events[ type ][ handler.guid ];
+
+ // remove all handlers for the given type
+ } else {
+ for ( var handle in events[ type ] ) {
+ // Handle the removal of namespaced events
+ if ( all || namespace.test( events[ type ][ handle ].type ) ) {
+ delete events[ type ][ handle ];
+ }
+ }
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, namespaces, fn);
+ }
+
+ // remove generic event handler if no more handlers exist
+ for ( ret in events[ type ] ) {
+ break;
+ }
+ if ( !ret ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
+ } else if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
+ }
+ }
+ ret = null;
+ delete events[ type ];
+ }
+ }
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ for ( ret in events ) {
+ break;
+ }
+ if ( !ret ) {
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) {
+ handle.elem = null;
+ }
+ jQuery.removeData( elem, "events" );
+ jQuery.removeData( elem, "handle" );
+ }
+ }
+ },
+
+ // bubbling is internal
+ trigger: function( event, data, elem /*, bubbling */ ) {
+ // Event object or event type
+ var type = event.type || event,
+ bubbling = arguments[3];
+
+ if ( !bubbling ) {
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[expando] ? event :
+ // Object literal
+ jQuery.extend( jQuery.Event(type), event ) :
+ // Just the event type (string)
+ jQuery.Event(type);
+
+ if ( type.indexOf("!") >= 0 ) {
+ event.type = type = type.slice(0, -1);
+ event.exclusive = true;
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // Don't bubble custom events when global (to avoid too much overhead)
+ event.stopPropagation();
+
+ // Only trigger if we've ever bound an event for it
+ if ( this.global[ type ] ) {
+ jQuery.each( jQuery.cache, function() {
+ if ( this.events && this.events[type] ) {
+ jQuery.event.trigger( event, data, this.handle.elem );
+ }
+ });
+ }
+ }
+
+ // Handle triggering a single element
+
+ // don't do events on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // Clean up in case it is reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone the incoming data, if any
+ data = jQuery.makeArray( data );
+ data.unshift( event );
+ }
+
+ event.currentTarget = elem;
+
+ // Trigger the event, it is assumed that "handle" is a function
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) {
+ handle.apply( elem, data );
+ }
+
+ var nativeFn, nativeHandler;
+ try {
+ if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
+ nativeFn = elem[ type ];
+ nativeHandler = elem[ "on" + type ];
+ }
+ // prevent IE from throwing an error for some elements with some event types, see #3533
+ } catch (e) {}
+
+ var isClick = jQuery.nodeName(elem, "a") && type === "click";
+
+ // Trigger the native events (except for clicks on links)
+ if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !isClick ) {
+ this.triggered = true;
+ try {
+ elem[ type ]();
+ // prevent IE from throwing an error for some hidden elements
+ } catch (e) {}
+
+ // Handle triggering native .onfoo handlers
+ } else if ( nativeHandler && elem[ "on" + type ].apply( elem, data ) === false ) {
+ event.result = false;
+ }
+
+ this.triggered = false;
+
+ if ( !event.isPropagationStopped() ) {
+ var parent = elem.parentNode || elem.ownerDocument;
+ if ( parent ) {
+ jQuery.event.trigger( event, data, parent, true );
+ }
+ }
+ },
+
+ handle: function( event ) {
+ // returned undefined or false
+ var all, handlers;
+
+ event = arguments[0] = jQuery.event.fix( event || window.event );
+ event.currentTarget = this;
+
+ // Namespaced event handlers
+ var namespaces = event.type.split(".");
+ event.type = namespaces.shift();
+
+ // Cache this now, all = true means, any handler
+ all = !namespaces.length && !event.exclusive;
+
+ var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
+
+ handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
+
+ for ( var j in handlers ) {
+ var handler = handlers[ j ];
+
+ // Filter the functions by class
+ if ( all || namespace.test(handler.type) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handler;
+ event.data = handler.data;
+
+ var ret = handler.apply( this, arguments );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+
+ }
+ }
+
+ return event.result;
+ },
+
+ props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+
+ fix: function( event ) {
+ if ( event[ expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var doc = document.documentElement, body = document.body;
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
+ event.which = event.charCode || event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( proxy, data, namespaces, live ) {
+ jQuery.extend( proxy, data || {} );
+
+ proxy.guid += data.selector + data.live;
+ jQuery.event.add( this, data.live, liveHandler, data );
+
+ },
+
+ remove: function( namespaces ) {
+ if ( namespaces.length ) {
+ var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
+
+ jQuery.each( (jQuery.data(this, "events").live || {}), function() {
+ if ( name.test(this.type) ) {
+ remove++;
+ }
+ });
+
+ if ( remove < 1 ) {
+ jQuery.event.remove( this, namespaces[0], liveHandler );
+ }
+ }
+ },
+ special: {}
+ },
+ beforeunload: {
+ setup: function( data, namespaces, fn ) {
+ // We only want to do this special case on windows
+ if ( this.setInterval ) {
+ this.onbeforeunload = fn;
+ }
+
+ return false;
+ },
+ teardown: function( namespaces, fn ) {
+ if ( this.onbeforeunload === fn ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+jQuery.Event = function( src ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = now();
+
+ // Mark it as fixed
+ this[ expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+ }
+ // otherwise set the returnValue property of the original event to false (IE)
+ e.returnValue = false;
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+ // Check if mouse(over|out) are still within the same parent element
+ var parent = event.relatedTarget;
+
+ // Traverse up the tree
+ while ( parent && parent !== this ) {
+ // Firefox sometimes assigns relatedTarget a XUL element
+ // which we cannot access the parentNode property of
+ try {
+ parent = parent.parentNode;
+
+ // assuming we've left the element since we most likely mousedover a xul element
+ } catch(e) {
+ break;
+ }
+ }
+
+ if ( parent !== this ) {
+ // set the correct event type
+ event.type = event.data;
+
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+jQuery.event.special.submit = {
+ setup: function( data, namespaces, fn ) {
+ if ( this.nodeName.toLowerCase() !== "form" ) {
+ jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ remove: function( namespaces, fn ) {
+ jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") );
+ jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") );
+ }
+};
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+var formElems = /textarea|input|select/i;
+
+function getVal( elem ) {
+ var type = elem.type, val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( elem.nodeName.toLowerCase() === "select" ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+}
+
+function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery.data( elem, "_change_data" );
+ val = getVal(elem);
+
+ if ( val === data ) {
+ return;
+ }
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery.data( elem, "_change_data", val );
+ }
+
+ if ( elem.type !== "select" && (data != null || val) ) {
+ e.type = "change";
+ return jQuery.event.trigger( e, arguments[1], this );
+ }
+}
+
+jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information/focus[in] is not needed anymore
+ beforeactivate: function( e ) {
+ var elem = e.target;
+
+ if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) {
+ jQuery.data( elem, "_change_data", getVal(elem) );
+ }
+ }
+ },
+ setup: function( data, namespaces, fn ) {
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] );
+ }
+
+ return formElems.test( this.nodeName );
+ },
+ remove: function( namespaces, fn ) {
+ for ( var type in changeFilters ) {
+ jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] );
+ }
+
+ return formElems.test( this.nodeName );
+ }
+};
+
+var changeFilters = jQuery.event.special.change.filters;
+
+}
+
+function trigger( type, elem, args ) {
+ args[0].type = type;
+ return jQuery.event.handle.apply( elem, args );
+}
+
+// Create "bubbling" focus and blur events
+if ( document.addEventListener ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ this.addEventListener( orig, handler, true );
+ },
+ teardown: function() {
+ this.removeEventListener( orig, handler, true );
+ }
+ };
+
+ function handler( e ) {
+ e = jQuery.event.fix( e );
+ e.type = fix;
+ return jQuery.event.handle.call( this, e );
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( jQuery.isFunction( data ) ) {
+ thisObject = fn;
+ fn = data;
+ data = undefined;
+ }
+
+ var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ }) : fn;
+
+ return type === "unload" && name !== "one" ?
+ this.one( type, data, fn, thisObject ) :
+ this.each(function() {
+ jQuery.event.add( this, type, handler, data );
+ });
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+ return this;
+ }
+
+ return this.each(function() {
+ jQuery.event.remove( this, type, fn );
+ });
+ },
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ var event = jQuery.Event( type );
+ event.preventDefault();
+ event.stopPropagation();
+ jQuery.event.trigger( event, data, this[0] );
+ return event.result;
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments, i = 1;
+
+ // link all the functions, so any of them can unbind this click handler
+ while ( i < args.length ) {
+ jQuery.proxy( fn, args[ i++ ] );
+ }
+
+ return this.click( jQuery.proxy( fn, function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ }));
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ },
+
+ live: function( type, data, fn ) {
+ if ( jQuery.isFunction( data ) ) {
+ fn = data;
+ data = undefined;
+ }
+
+ jQuery( this.context ).bind( liveConvert( type, this.selector ), {
+ data: data, selector: this.selector, live: type
+ }, fn );
+
+ return this;
+ },
+
+ die: function( type, fn ) {
+ jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
+ return this;
+ }
+});
+
+function liveHandler( event ) {
+ var stop = true, elems = [], selectors = [], args = arguments,
+ related, match, fn, elem, j, i, data,
+ live = jQuery.extend({}, jQuery.data( this, "events" ).live);
+
+ for ( j in live ) {
+ fn = live[j];
+ if ( fn.live === event.type ||
+ fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) {
+
+ data = fn.data;
+ if ( !(data.beforeFilter && data.beforeFilter[event.type] &&
+ !data.beforeFilter[event.type](event)) ) {
+ selectors.push( fn.selector );
+ }
+ } else {
+ delete live[j];
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ for ( j in live ) {
+ fn = live[j];
+ elem = match[i].elem;
+ related = null;
+
+ if ( match[i].selector === fn.selector ) {
+ // Those two events require additional checking
+ if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) {
+ related = jQuery( event.relatedTarget ).closest( fn.selector )[0];
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, fn: fn });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+ event.currentTarget = match.elem;
+ event.data = match.fn.data;
+ if ( match.fn.apply( match.elem, args ) === false ) {
+ stop = false;
+ break;
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "&")].join(".");
+}
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( fn ) {
+ return fn ? this.bind( name, fn ) : this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+// Prevent memory leaks in IE
+// Window isn't included so as not to unbind existing unload events
+// More info:
+// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
+if ( window.attachEvent && !window.addEventListener ) {
+ window.attachEvent("onunload", function() {
+ for ( var id in jQuery.cache ) {
+ if ( jQuery.cache[ id ].handle ) {
+ // Try/Catch is to handle iframes being unloaded, see #4280
+ try {
+ jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+ } catch(e) {}
+ }
+ }
+ });
+}
+/*!
+ * Sizzle CSS Selector Engine - v1.0
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function(){
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function(selector, context, results, seed) {
+ results = results || [];
+ var origContext = context = context || document;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+ var ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
+ }
+
+ if ( context ) {
+ var ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+ set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray(set);
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ var cur = parts.pop(), pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ throw "Syntax error, unrecognized expression: " + (cur || selector);
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+ } else if ( context && context.nodeType === 1 ) {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+ } else {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function(results){
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort(sortOrder);
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[i-1] ) {
+ results.splice(i--, 1);
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function(expr, set){
+ return Sizzle(expr, null, null, set);
+};
+
+Sizzle.find = function(expr, context, isXML){
+ var set, match;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var type = Expr.order[i], match;
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace(/\\/g, "");
+ set = Expr.find[ type ]( match, context, isXML );
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = context.getElementsByTagName("*");
+ }
+
+ return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+ var old = expr, result = [], curLoop = set, match, anyFound,
+ isXMLFilter = set && set[0] && isXML(set[0]);
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var filter = Expr.filter[ type ], found, item, left = match[1];
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+ } else {
+ curLoop[i] = false;
+ }
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ throw "Syntax error, unrecognized expression: " + expr;
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+var Expr = Sizzle.selectors = {
+ order: [ "ID", "NAME", "TAG" ],
+ match: {
+ ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
+ TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
+ CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+ },
+ leftMatch: {},
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+ attrHandle: {
+ href: function(elem){
+ return elem.getAttribute("href");
+ }
+ },
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !/\W/.test(part),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part){
+ var isPartStr = typeof part === "string";
+
+ if ( isPartStr && !/\W/.test(part) ) {
+ part = part.toLowerCase();
+
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+ } else {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+ "": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = part.toLowerCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+ },
+ "~": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = part.toLowerCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
+ }
+ },
+ find: {
+ ID: function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? [m] : [];
+ }
+ },
+ NAME: function(match, context){
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [], results = context.getElementsByName(match[1]);
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+ TAG: function(match, context){
+ return context.getElementsByTagName(match[1]);
+ }
+ },
+ preFilter: {
+ CLASS: function(match, curLoop, inplace, result, not, isXML){
+ match = " " + match[1].replace(/\\/g, "") + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+ ID: function(match){
+ return match[1].replace(/\\/g, "");
+ },
+ TAG: function(match, curLoop){
+ return match[1].toLowerCase();
+ },
+ CHILD: function(match){
+ if ( match[1] === "nth" ) {
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+ ATTR: function(match, curLoop, inplace, result, not, isXML){
+ var name = match[1].replace(/\\/g, "");
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+ PSEUDO: function(match, curLoop, inplace, result, not){
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+ return false;
+ }
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+ POS: function(match){
+ match.unshift( true );
+ return match;
+ }
+ },
+ filters: {
+ enabled: function(elem){
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+ disabled: function(elem){
+ return elem.disabled === true;
+ },
+ checked: function(elem){
+ return elem.checked === true;
+ },
+ selected: function(elem){
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ elem.parentNode.selectedIndex;
+ return elem.selected === true;
+ },
+ parent: function(elem){
+ return !!elem.firstChild;
+ },
+ empty: function(elem){
+ return !elem.firstChild;
+ },
+ has: function(elem, i, match){
+ return !!Sizzle( match[3], elem ).length;
+ },
+ header: function(elem){
+ return /h\d/i.test( elem.nodeName );
+ },
+ text: function(elem){
+ return "text" === elem.type;
+ },
+ radio: function(elem){
+ return "radio" === elem.type;
+ },
+ checkbox: function(elem){
+ return "checkbox" === elem.type;
+ },
+ file: function(elem){
+ return "file" === elem.type;
+ },
+ password: function(elem){
+ return "password" === elem.type;
+ },
+ submit: function(elem){
+ return "submit" === elem.type;
+ },
+ image: function(elem){
+ return "image" === elem.type;
+ },
+ reset: function(elem){
+ return "reset" === elem.type;
+ },
+ button: function(elem){
+ return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
+ },
+ input: function(elem){
+ return /input|select|textarea|button/i.test(elem.nodeName);
+ }
+ },
+ setFilters: {
+ first: function(elem, i){
+ return i === 0;
+ },
+ last: function(elem, i, match, array){
+ return i === array.length - 1;
+ },
+ even: function(elem, i){
+ return i % 2 === 0;
+ },
+ odd: function(elem, i){
+ return i % 2 === 1;
+ },
+ lt: function(elem, i, match){
+ return i < match[3] - 0;
+ },
+ gt: function(elem, i, match){
+ return i > match[3] - 0;
+ },
+ nth: function(elem, i, match){
+ return match[3] - 0 === i;
+ },
+ eq: function(elem, i, match){
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ } else {
+ throw "Syntax error, unrecognized expression: " + name;
+ }
+ },
+ CHILD: function(elem, match){
+ var type = match[1], node = elem;
+ switch (type) {
+ case 'only':
+ case 'first':
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ if ( type === "first" ) {
+ return true;
+ }
+ node = elem;
+ case 'last':
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ return true;
+ case 'nth':
+ var first = match[2], last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+ if ( first === 0 ) {
+ return diff === 0;
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+ ID: function(elem, match){
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+ TAG: function(elem, match){
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+ CLASS: function(elem, match){
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+ ATTR: function(elem, match){
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+ POS: function(elem, match, i, array){
+ var name = match[2], filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS;
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
+ return "\\" + (num - 0 + 1);
+ }));
+}
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 );
+
+// Provide a fallback method if it does not work
+} catch(e){
+ makeArray = function(array, results) {
+ var ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var i = 0, l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+ } else {
+ for ( var i = 0; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( "sourceIndex" in document.documentElement ) {
+ sortOrder = function( a, b ) {
+ if ( !a.sourceIndex || !b.sourceIndex ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.sourceIndex ? -1 : 1;
+ }
+
+ var ret = a.sourceIndex - b.sourceIndex;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( document.createRange ) {
+ sortOrder = function( a, b ) {
+ if ( !a.ownerDocument || !b.ownerDocument ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.ownerDocument ? -1 : 1;
+ }
+
+ var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
+ aRange.setStart(a, 0);
+ aRange.setEnd(a, 0);
+ bRange.setStart(b, 0);
+ bRange.setEnd(b, 0);
+ var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+function getText( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date).getTime();
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+ }
+ };
+
+ Expr.filter.ID = function(elem, match){
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+ root = form = null; // release memory in IE
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+ Expr.attrHandle.href = function(elem){
+ return elem.getAttribute("href", 2);
+ };
+ }
+
+ div = null; // release memory in IE
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle, div = document.createElement("div");
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && context.nodeType === 9 && !isXML(context) ) {
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(e){}
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ div = null; // release memory in IE
+ })();
+}
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function(match, context, isXML) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ div = null; // release memory in IE
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+var contains = document.compareDocumentPosition ? function(a, b){
+ return a.compareDocumentPosition(b) & 16;
+} : function(a, b){
+ return a !== b && (a.contains ? a.contains(b) : true);
+};
+
+var isXML = function(elem){
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function(selector, context){
+ var tmpSet = [], later = "", match,
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.getText = getText;
+jQuery.isXMLDoc = isXML;
+jQuery.contains = contains;
+
+return;
+
+window.Sizzle = Sizzle;
+
+})();
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ slice = Array.prototype.slice;
+
+// Implement the identical functionality for filter and not
+var winnow = function( elements, qualifier, keep ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return !!qualifier.call( elem, i, elem ) === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+};
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var ret = this.pushStack( "", "find", selector ), length = 0;
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( var n = length; n < ret.length; n++ ) {
+ for ( var r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && jQuery.filter( selector, this ).length > 0;
+ },
+
+ closest: function( selectors, context ) {
+ if ( jQuery.isArray( selectors ) ) {
+ var ret = [], cur = this[0], match, matches = {}, selector;
+
+ if ( cur && selectors.length ) {
+ for ( var i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[selector] ) {
+ matches[selector] = jQuery.expr.match.POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[selector];
+
+ if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
+ ret.push({ selector: selector, elem: cur });
+ delete matches[selector];
+ }
+ }
+ cur = cur.parentNode;
+ }
+ }
+
+ return ret;
+ }
+
+ var pos = jQuery.expr.match.POS.test( selectors ) ?
+ jQuery( selectors, context || this.context ) : null;
+
+ return this.map(function( i, cur ) {
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
+ return cur;
+ }
+ cur = cur.parentNode;
+ }
+ return null;
+ });
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ if ( !elem || typeof elem === "string" ) {
+ return jQuery.inArray( this[0],
+ // If it receives a string, the selector is used
+ // If it receives nothing, the siblings are used
+ elem ? jQuery( elem ) : this.parent().children() );
+ }
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context || this.context ) :
+ jQuery.makeArray( selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, slice.call(arguments).join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [], cur = elem[dir];
+ while ( cur && cur.nodeType !== 9 && (until === undefined || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
+ rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&\w+;/,
+ fcloseTag = function( all, front, tag ) {
+ return rselfClosing.test( tag ) ?
+ all :
+ front + "></" + tag + ">";
+ },
+ wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ area: [ 1, "<map>", "</map>" ],
+ _default: [ 0, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ return self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.getText( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append(this);
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ return this.each(function() {
+ var self = jQuery( this ), contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ clone: function( events ) {
+ // Do the clone
+ var ret = this.map(function() {
+ if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
+ // IE copies events bound via attachEvent when
+ // using cloneNode. Calling detachEvent on the
+ // clone will also remove the events from the orignal
+ // In order to get around this, we use innerHTML.
+ // Unfortunately, this means some modifications to
+ // attributes in IE that are actually only stored
+ // as properties will not be copied (such as the
+ // the name attribute on an input).
+ var html = this.outerHTML, ownerDocument = this.ownerDocument;
+ if ( !html ) {
+ var div = ownerDocument.createElement("div");
+ div.appendChild( this.cloneNode(true) );
+ html = div.innerHTML;
+ }
+
+ return jQuery.clean([html.replace(rinlinejQuery, "")
+ .replace(rleadingWhitespace, "")], ownerDocument)[0];
+ } else {
+ return this.cloneNode(true);
+ }
+ });
+
+ // Copy the events from the original to the clone
+ if ( events === true ) {
+ cloneCopyEvent( this, ret );
+ cloneCopyEvent( this.find("*"), ret.find("*") );
+ }
+
+ // Return the cloned set
+ return ret;
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !/<script/i.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery(this), old = self.html();
+ self.empty().append(function(){
+ return value.call( this, i, old );
+ });
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( !jQuery.isFunction( value ) ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling, parent = this.parentNode;
+
+ jQuery(this).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, value = args[0], scripts = [];
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ return self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ // If we're in a fragment, just use that instead of building a new one
+ if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
+ results = { fragment: args[0].parentNode };
+ } else {
+ results = buildFragment( args, this, scripts );
+ }
+
+ first = results.fragment.firstChild;
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ results.cacheable || this.length > 1 || i > 0 ?
+ results.fragment.cloneNode(true) :
+ results.fragment
+ );
+ }
+ }
+
+ if ( scripts ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+
+ function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+ }
+ }
+});
+
+function cloneCopyEvent(orig, ret) {
+ var i = 0;
+
+ ret.each(function() {
+ if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
+ return;
+ }
+
+ var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var handler in events[ type ] ) {
+ jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+ }
+ }
+ }
+ });
+}
+
+function buildFragment( args, nodes, scripts ) {
+ var fragment, cacheable, cached, cacheresults, doc;
+
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
+ cacheable = true;
+ cacheresults = jQuery.fragments[ args[0] ];
+ if ( cacheresults ) {
+ if ( cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ cached = true;
+ }
+ }
+
+ if ( !fragment ) {
+ doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+}
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [], insert = jQuery( selector );
+
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+ ret = ret.concat( elems );
+ }
+ return this.pushStack( ret, name, insert.selector );
+ };
+});
+
+jQuery.each({
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
+ if ( !keepData && this.nodeType === 1 ) {
+ cleanData( this.getElementsByTagName("*") );
+ cleanData( [ this ] );
+ }
+
+ if ( this.parentNode ) {
+ this.parentNode.removeChild( this );
+ }
+ }
+ },
+
+ empty: function() {
+ // Remove element nodes and prevent memory leaks
+ if ( this.nodeType === 1 ) {
+ cleanData( this.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( this.firstChild ) {
+ this.removeChild( this.firstChild );
+ }
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function() {
+ return this.each( fn, arguments );
+ };
+});
+
+jQuery.extend({
+ clean: function( elems, context, fragment, scripts ) {
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [];
+
+ jQuery.each(elems, function( i, elem ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ return;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" && !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+
+ } else if ( typeof elem === "string" ) {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, fcloseTag);
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( var j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = jQuery.makeArray( div.childNodes );
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+
+ });
+
+ if ( fragment ) {
+ for ( var i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ }
+});
+
+function cleanData( elems ) {
+ for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
+ if ( !jQuery.noData[elem.nodeName.toLowerCase()] && (id = elem[expando]) ) {
+ delete jQuery.cache[ id ];
+ }
+ }
+}
+// exclude the following css properties to add px
+var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+ ralpha = /alpha\([^)]*\)/,
+ ropacity = /opacity=([^)]*)/,
+ rfloat = /float/i,
+ rdashAlpha = /-([a-z])/ig,
+ rupper = /([A-Z])/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+
+ cssShow = { position: "absolute", visibility: "hidden", display:"block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+
+ // cache check for defaultView.getComputedStyle
+ getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
+ // normalize float css property
+ styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn.css = function( name, value ) {
+ return access( this, name, value, true, function( elem, name, value ) {
+ if ( value === undefined ) {
+ return jQuery.curCSS( elem, name );
+ }
+
+ if ( typeof value === "number" && !rexclude.test(name) ) {
+ value += "px";
+ }
+
+ jQuery.style( elem, name, value );
+ });
+};
+
+jQuery.extend({
+ style: function( elem, name, value ) {
+ // don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // ignore negative width and height values #1599
+ if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
+ value = undefined;
+ }
+
+ var style = elem.style || elem, set = value !== undefined;
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name === "opacity" ) {
+ if ( set ) {
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // Set the alpha filter to set the opacity
+ var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
+ var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
+ style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
+ }
+
+ return style.filter && style.filter.indexOf("opacity=") >= 0 ?
+ (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
+ "";
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( rfloat.test( name ) ) {
+ name = styleFloat;
+ }
+
+ name = name.replace(rdashAlpha, fcamelCase);
+
+ if ( set ) {
+ style[ name ] = value;
+ }
+
+ return style[ name ];
+ },
+
+ css: function( elem, name, force, extra ) {
+ if ( name === "width" || name === "height" ) {
+ var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
+
+ function getWH() {
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
+
+ if ( extra === "border" ) {
+ return;
+ }
+
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
+ }
+
+ if ( extra === "margin" ) {
+ val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
+ } else {
+ val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
+ }
+ });
+ }
+
+ if ( elem.offsetWidth !== 0 ) {
+ getWH();
+ } else {
+ jQuery.swap( elem, props, getWH );
+ }
+
+ return Math.max(0, Math.round(val));
+ }
+
+ return jQuery.curCSS( elem, name, force );
+ },
+
+ curCSS: function( elem, name, force ) {
+ var ret, style = elem.style, filter;
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
+ ret = ropacity.test(elem.currentStyle.filter || "") ?
+ (parseFloat(RegExp.$1) / 100) + "" :
+ "";
+
+ return ret === "" ?
+ "1" :
+ ret;
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( rfloat.test( name ) ) {
+ name = styleFloat;
+ }
+
+ if ( !force && style && style[ name ] ) {
+ ret = style[ name ];
+
+ } else if ( getComputedStyle ) {
+
+ // Only "float" is needed here
+ if ( rfloat.test( name ) ) {
+ name = "float";
+ }
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ var defaultView = elem.ownerDocument.defaultView;
+
+ if ( !defaultView ) {
+ return null;
+ }
+
+ var computedStyle = defaultView.getComputedStyle( elem, null );
+
+ if ( computedStyle ) {
+ ret = computedStyle.getPropertyValue( name );
+ }
+
+ // We should always get a number back from opacity
+ if ( name === "opacity" && ret === "" ) {
+ ret = "1";
+ }
+
+ } else if ( elem.currentStyle ) {
+ var camelCase = name.replace(rdashAlpha, fcamelCase);
+
+ ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+ // Remember the original values
+ var left = style.left, rsLeft = elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret;
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( var name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth, height = elem.offsetHeight,
+ skip = elem.nodeName.toLowerCase() === "tr";
+
+ return width === 0 && height === 0 && !skip ?
+ true :
+ width > 0 && height > 0 && !skip ?
+ false :
+ jQuery.curCSS(elem, "display") === "none";
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+var jsc = now(),
+ rscript = /<script(.|\s)*?\/script>/gi,
+ rselectTextarea = /select|textarea/i,
+ rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
+ jsre = /=\?(&|$)/,
+ rquery = /\?/,
+ rts = /(\?|&)_=.*?(&|$)/,
+ rurl = /^(\w+:)?\/\/([^\/?#]+)/,
+ r20 = /%20/g;
+
+jQuery.fn.extend({
+ // Keep a copy of the old load
+ _load: jQuery.fn.load,
+
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" ) {
+ return this._load( url );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf(" ");
+ if ( off >= 0 ) {
+ var selector = url.slice(off, url.length);
+ url = url.slice(0, off);
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = null;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ context:this,
+ complete: function( res, status ) {
+ // If successful, inject the HTML into all the matched elements
+ if ( status === "success" || status === "notmodified" ) {
+ // See if a selector was specified
+ this.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div />")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(res.responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ res.responseText );
+ }
+
+ if ( callback ) {
+ this.each( callback, [res.responseText, status, res] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param(this.serializeArray());
+ },
+ serializeArray: function() {
+ return this.map(function() {
+ return this.elements ? jQuery.makeArray(this.elements) : this;
+ })
+ .filter(function() {
+ return this.name && !this.disabled &&
+ (this.checked || rselectTextarea.test(this.nodeName) ||
+ rinput.test(this.type));
+ })
+ .map(function( i, elem ) {
+ var val = jQuery(this).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray(val) ?
+ jQuery.map( val, function( val, i ) {
+ return { name: elem.name, value: val };
+ }) :
+ { name: elem.name, value: val };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
+ jQuery.fn[o] = function( f ) {
+ return this.bind(o, f);
+ };
+});
+
+jQuery.extend({
+
+ get: function( url, data, callback, type ) {
+ // shift arguments if data argument was omited
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = null;
+ }
+
+ return jQuery.ajax({
+ type: "GET",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get(url, null, callback, "script");
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get(url, data, callback, "json");
+ },
+
+ post: function( url, data, callback, type ) {
+ // shift arguments if data argument was omited
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = {};
+ }
+
+ return jQuery.ajax({
+ type: "POST",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ ajaxSetup: function( settings ) {
+ jQuery.extend( jQuery.ajaxSettings, settings );
+ },
+
+ ajaxSettings: {
+ url: location.href,
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ username: null,
+ password: null,
+ traditional: false,
+ */
+ // Create the request object; Microsoft failed to properly
+ // implement the XMLHttpRequest in IE7 (can't request local files),
+ // so we use the ActiveXObject when it is available
+ // This function can be overriden by calling jQuery.ajaxSetup
+ xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
+ function() {
+ return new window.XMLHttpRequest();
+ } :
+ function() {
+ try {
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
+ } catch(e) {}
+ },
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ script: "text/javascript, application/javascript",
+ json: "application/json, text/javascript",
+ text: "text/plain",
+ _default: "*/*"
+ }
+ },
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajax: function( origSettings ) {
+ var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
+
+ var jsonp, status, data,
+ callbackContext = s.context || s,
+ type = s.type.toUpperCase();
+
+ // convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Handle JSONP Parameter Callbacks
+ if ( s.dataType === "jsonp" ) {
+ if ( type === "GET" ) {
+ if ( !jsre.test( s.url ) ) {
+ s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+ }
+ } else if ( !s.data || !jsre.test(s.data) ) {
+ s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+ }
+ s.dataType = "json";
+ }
+
+ // Build temporary JSONP function
+ if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
+ jsonp = s.jsonpCallback || ("jsonp" + jsc++);
+
+ // Replace the =? sequence both in the query string and the data
+ if ( s.data ) {
+ s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
+ }
+
+ s.url = s.url.replace(jsre, "=" + jsonp + "$1");
+
+ // We need to make sure
+ // that a JSONP style response is executed properly
+ s.dataType = "script";
+
+ // Handle JSONP-style loading
+ window[ jsonp ] = window[ jsonp ] || function( tmp ) {
+ data = tmp;
+ success();
+ complete();
+ // Garbage collect
+ window[ jsonp ] = undefined;
+
+ try {
+ delete window[ jsonp ];
+ } catch(e) {}
+
+ if ( head ) {
+ head.removeChild( script );
+ }
+ };
+ }
+
+ if ( s.dataType === "script" && s.cache === null ) {
+ s.cache = false;
+ }
+
+ if ( s.cache === false && type === "GET" ) {
+ var ts = now();
+
+ // try replacing _= if it is there
+ var ret = s.url.replace(rts, "$1_=" + ts + "$2");
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
+ }
+
+ // If data is available, append data to url for get requests
+ if ( s.data && type === "GET" ) {
+ s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
+ }
+
+ // Watch for a new set of requests
+ if ( s.global && ! jQuery.active++ ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // Matches an absolute URL, and saves the domain
+ var parts = rurl.exec( s.url ),
+ remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
+
+ // If we're requesting a remote document
+ // and trying to load JSON or Script with a GET
+ if ( s.dataType === "script" && type === "GET" && remote ) {
+ var head = document.getElementsByTagName("head")[0] || document.documentElement;
+ var script = document.createElement("script");
+ script.src = s.url;
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ // Handle Script loading
+ if ( !jsonp ) {
+ var done = false;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function() {
+ if ( !done && (!this.readyState ||
+ this.readyState === "loaded" || this.readyState === "complete") ) {
+ done = true;
+ success();
+ complete();
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+ }
+ };
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+
+ // We handle everything using the script element injection
+ return undefined;
+ }
+
+ var requestDone = false;
+
+ // Create the request object
+ var xhr = s.xhr();
+
+ if ( !xhr ) {
+ return;
+ }
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open(type, s.url, s.async, s.username, s.password);
+ } else {
+ xhr.open(type, s.url, s.async);
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ // Set the correct header, if data is being sent
+ if ( s.data || origSettings && origSettings.contentType ) {
+ xhr.setRequestHeader("Content-Type", s.contentType);
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[s.url] ) {
+ xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
+ }
+
+ if ( jQuery.etag[s.url] ) {
+ xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
+ }
+ }
+
+ // Set header so the called script knows that it's an XMLHttpRequest
+ // Only send the header if it's not a remote XHR
+ if ( !remote ) {
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
+ s.accepts[ s.dataType ] + ", */*" :
+ s.accepts._default );
+ } catch(e) {}
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+
+ // close opended socket
+ xhr.abort();
+ return false;
+ }
+
+ if ( s.global ) {
+ trigger("ajaxSend", [xhr, s]);
+ }
+
+ // Wait for a response to come back
+ var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
+ // The request was aborted
+ if ( !xhr || xhr.readyState === 0 ) {
+ // Opera doesn't call onreadystatechange before this point
+ // so we simulate the call
+ if ( !requestDone ) {
+ complete();
+ }
+
+ requestDone = true;
+ if ( xhr ) {
+ xhr.onreadystatechange = jQuery.noop;
+ }
+
+ // The transfer is complete and the data is available, or the request timed out
+ } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
+ requestDone = true;
+ xhr.onreadystatechange = jQuery.noop;
+
+ status = isTimeout === "timeout" ?
+ "timeout" :
+ !jQuery.httpSuccess( xhr ) ?
+ "error" :
+ s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
+ "notmodified" :
+ "success";
+
+ if ( status === "success" ) {
+ // Watch for, and catch, XML document parse errors
+ try {
+ // process the data (runs the xml through httpData regardless of callback)
+ data = jQuery.httpData( xhr, s.dataType, s );
+ } catch(e) {
+ status = "parsererror";
+ }
+ }
+
+ // Make sure that the request was successful or notmodified
+ if ( status === "success" || status === "notmodified" ) {
+ // JSONP handles its own success callback
+ if ( !jsonp ) {
+ success();
+ }
+ } else {
+ jQuery.handleError(s, xhr, status);
+ }
+
+ // Fire the complete handlers
+ complete();
+
+ if ( isTimeout === "timeout" ) {
+ xhr.abort();
+ }
+
+ // Stop memory leaks
+ if ( s.async ) {
+ xhr = null;
+ }
+ }
+ };
+
+ // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
+ // Opera doesn't fire onreadystatechange at all on abort
+ try {
+ var oldAbort = xhr.abort;
+ xhr.abort = function() {
+ if ( xhr ) {
+ oldAbort.call( xhr );
+ if ( xhr ) {
+ xhr.readyState = 0;
+ }
+ }
+
+ onreadystatechange();
+ };
+ } catch(e) { }
+
+ // Timeout checker
+ if ( s.async && s.timeout > 0 ) {
+ setTimeout(function() {
+ // Check to see if the request is still happening
+ if ( xhr && !requestDone ) {
+ onreadystatechange( "timeout" );
+ }
+ }, s.timeout);
+ }
+
+ // Send the data
+ try {
+ xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
+ } catch(e) {
+ jQuery.handleError(s, xhr, null, e);
+ // Fire the complete handlers
+ complete();
+ }
+
+ // firefox 1.5 doesn't fire statechange for sync requests
+ if ( !s.async ) {
+ onreadystatechange();
+ }
+
+ function success() {
+ // If a local callback was specified, fire it and pass it the data
+ if ( s.success ) {
+ s.success.call( callbackContext, data, status, xhr );
+ }
+
+ // Fire the global callback
+ if ( s.global ) {
+ trigger( "ajaxSuccess", [xhr, s] );
+ }
+ }
+
+ function complete() {
+ // Process result
+ if ( s.complete ) {
+ s.complete.call( callbackContext, xhr, status);
+ }
+
+ // The request was completed
+ if ( s.global ) {
+ trigger( "ajaxComplete", [xhr, s] );
+ }
+
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+
+ function trigger(type, args) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
+ }
+
+ // return XMLHttpRequest to allow aborting the request etc.
+ return xhr;
+ },
+
+ handleError: function( s, xhr, status, e ) {
+ // If a local callback was specified, fire it
+ if ( s.error ) {
+ s.error.call( s.context || window, xhr, status, e );
+ }
+
+ // Fire the global callback
+ if ( s.global ) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
+ }
+ },
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Determines if an XMLHttpRequest was successful or not
+ httpSuccess: function( xhr ) {
+ try {
+ // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
+ return !xhr.status && location.protocol === "file:" ||
+ // Opera returns 0 when status is 304
+ ( xhr.status >= 200 && xhr.status < 300 ) ||
+ xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
+ } catch(e) {}
+
+ return false;
+ },
+
+ // Determines if an XMLHttpRequest returns NotModified
+ httpNotModified: function( xhr, url ) {
+ var lastModified = xhr.getResponseHeader("Last-Modified"),
+ etag = xhr.getResponseHeader("Etag");
+
+ if ( lastModified ) {
+ jQuery.lastModified[url] = lastModified;
+ }
+
+ if ( etag ) {
+ jQuery.etag[url] = etag;
+ }
+
+ // Opera returns 0 when status is 304
+ return xhr.status === 304 || xhr.status === 0;
+ },
+
+ httpData: function( xhr, type, s ) {
+ var ct = xhr.getResponseHeader("content-type") || "",
+ xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
+ data = xml ? xhr.responseXML : xhr.responseText;
+
+ if ( xml && data.documentElement.nodeName === "parsererror" ) {
+ throw "parsererror";
+ }
+
+ // Allow a pre-filtering function to sanitize the response
+ // s is checked to keep backwards compatibility
+ if ( s && s.dataFilter ) {
+ data = s.dataFilter( data, type );
+ }
+
+ // The filter can actually parse the response
+ if ( typeof data === "string" ) {
+ // Get the JavaScript object, if JSON is used.
+ if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if (/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
+ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
+ .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
+
+ // Try to use the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ data = window.JSON.parse( data );
+
+ } else {
+ data = (new Function("return " + data))();
+ }
+
+ } else {
+ throw "Invalid JSON: " + data;
+ }
+
+ // If the type is "script", eval it in global context
+ } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
+ jQuery.globalEval( data );
+ }
+ }
+
+ return data;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+
+ var s = [];
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ function add( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction(value) ? value() : value;
+ s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray(a) || a.jquery ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ jQuery.each( a, function buildParams( prefix, obj ) {
+
+ if ( jQuery.isArray(obj) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ jQuery.each( obj, function( k, v ) {
+ buildParams( prefix + "[" + k + "]", v );
+ });
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+ });
+ }
+
+ // Return the resulting serialization
+ return s.join("&").replace(r20, "+");
+ }
+
+});
+var elemdisplay = {},
+ rfxtypes = /toggle|show|hide/,
+ rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ];
+
+jQuery.fn.extend({
+ show: function( speed, callback ) {
+ if ( speed != null ) {
+ return this.animate( genFx("show", 3), speed, callback);
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var old = jQuery.data(this[i], "olddisplay");
+
+ this[i].style.display = old || "";
+
+ if ( jQuery.css(this[i], "display") === "none" ) {
+ var nodeName = this[i].nodeName, display;
+
+ if ( elemdisplay[ nodeName ] ) {
+ display = elemdisplay[ nodeName ];
+
+ } else {
+ var elem = jQuery("<" + nodeName + " />").appendTo("body");
+
+ display = elem.css("display");
+
+ if ( display === "none" ) {
+ display = "block";
+ }
+
+ elem.remove();
+
+ elemdisplay[ nodeName ] = display;
+ }
+
+ jQuery.data(this[i], "olddisplay", display);
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var j = 0, k = this.length; j < k; j++ ) {
+ this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, callback ) {
+ if ( speed != null ) {
+ return this.animate( genFx("hide", 3), speed, callback);
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var old = jQuery.data(this[i], "olddisplay");
+ if ( !old && old !== "none" ) {
+ jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var j = 0, k = this.length; j < k; j++ ) {
+ this[j].style.display = "none";
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2 ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete );
+ }
+
+ return this[ optall.queue === false ? "each" : "queue" ](function() {
+ var opt = jQuery.extend({}, optall), p,
+ hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
+ self = this;
+
+ for ( p in prop ) {
+ var name = p.replace(rdashAlpha, fcamelCase);
+
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ p = name;
+ }
+
+ if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
+ return opt.complete.call(this);
+ }
+
+ if ( ( p === "height" || p === "width" ) && this.style ) {
+ // Store display property
+ opt.display = jQuery.css(this, "display");
+
+ // Make sure that nothing sneaks out
+ opt.overflow = this.style.overflow;
+ }
+
+ if ( jQuery.isArray( prop[p] ) ) {
+ // Create (if needed) and add to specialEasing
+ (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
+ prop[p] = prop[p][0];
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ opt.curAnim = jQuery.extend({}, prop);
+
+ jQuery.each( prop, function( name, val ) {
+ var e = new jQuery.fx( self, opt, name );
+
+ if ( rfxtypes.test(val) ) {
+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+
+ } else {
+ var parts = rfxnum.exec(val),
+ start = e.cur(true) || 0;
+
+ if ( parts ) {
+ var end = parseFloat( parts[2] ),
+ unit = parts[3] || "px";
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ self.style[ name ] = (end || 1) + unit;
+ start = ((end || 1) / e.cur(true)) * start;
+ self.style[ name ] = start + unit;
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ });
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function( clearQueue, gotoEnd ) {
+ var timers = jQuery.timers;
+
+ if ( clearQueue ) {
+ this.queue([]);
+ }
+
+ this.each(function() {
+ // go in reverse order so anything added to the queue during the loop is ignored
+ for ( var i = timers.length - 1; i >= 0; i-- ) {
+ if ( timers[i].elem === this ) {
+ if (gotoEnd) {
+ // force the next step to be the last
+ timers[i](true);
+ }
+
+ timers.splice(i, 1);
+ }
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if ( !gotoEnd ) {
+ this.dequeue();
+ }
+
+ return this;
+ }
+
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, callback ) {
+ return this.animate( props, speed, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? speed : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function() {
+ if ( opt.queue !== false ) {
+ jQuery(this).dequeue();
+ }
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ if ( !options.orig ) {
+ options.orig = {};
+ }
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+ // Set display property to block for height/width animations
+ if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
+ this.elem.style.display = "block";
+ }
+ },
+
+ // Get the current size
+ cur: function( force ) {
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var r = parseFloat(jQuery.css(this.elem, this.prop, force));
+ return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ this.startTime = now();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || "px";
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ var self = this;
+ function t( gotoEnd ) {
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval(jQuery.fx.tick, 13);
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var t = now(), done = true;
+
+ if ( gotoEnd || t >= this.options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ this.options.curAnim[ this.prop ] = true;
+
+ for ( var i in this.options.curAnim ) {
+ if ( this.options.curAnim[i] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ if ( this.options.display != null ) {
+ // Reset the overflow
+ this.elem.style.overflow = this.options.overflow;
+
+ // Reset the display
+ var old = jQuery.data(this.elem, "olddisplay");
+ this.elem.style.display = old ? old : this.options.display;
+
+ if ( jQuery.css(this.elem, "display") === "none" ) {
+ this.elem.style.display = "block";
+ }
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( this.options.hide ) {
+ jQuery(this.elem).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( this.options.hide || this.options.show ) {
+ for ( var p in this.options.curAnim ) {
+ jQuery.style(this.elem, p, this.options.orig[p]);
+ }
+ }
+
+ // Execute the complete function
+ this.options.complete.call( this.elem );
+ }
+
+ return false;
+
+ } else {
+ var n = t - this.startTime;
+ this.state = n / this.options.duration;
+
+ // Perform the easing function, defaults to swing
+ var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
+ var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
+ this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
+ this.now = this.start + ((this.end - this.start) * this.pos);
+
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ var timers = jQuery.timers;
+
+ for ( var i = 0; i < timers.length; i++ ) {
+ if ( !timers[i]() ) {
+ timers.splice(i--, 1);
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style(fx.elem, "opacity", fx.now);
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ jQuery.offset.initialize();
+
+ var offsetParent = elem.offsetParent, prevOffsetParent = elem,
+ doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
+ body = doc.body, defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop, left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+ initialize: function() {
+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
+ html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
+
+ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+ container.innerHTML = html;
+ body.insertBefore( container, body.firstChild );
+ innerDiv = container.firstChild;
+ checkDiv = innerDiv.firstChild;
+ td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
+ // safari subtracts parent border width here which is 5px
+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+ checkDiv.style.position = checkDiv.style.top = "";
+
+ innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+ body.removeChild( container );
+ body = container = innerDiv = checkDiv = table = td = null;
+ jQuery.offset.initialize = jQuery.noop;
+ },
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop, left = body.offsetLeft;
+
+ jQuery.offset.initialize();
+
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0;
+ left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ // set position first, in-case top/left are set even on static elem
+ if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
+ elem.style.position = "relative";
+ }
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0,
+ curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ var props = {
+ top: (options.top - curOffset.top) + curTop,
+ left: (options.left - curOffset.left) + curLeft
+ };
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0;
+ offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0;
+ parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function(val) {
+ var elem = this[0], win;
+
+ if ( !elem ) {
+ return null;
+ }
+
+ if ( val !== undefined ) {
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery(win).scrollLeft(),
+ i ? val : jQuery(win).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ } else {
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+ };
+});
+
+function getWindow( elem ) {
+ return ("scrollTo" in elem && elem.document) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn["inner" + name] = function() {
+ return this[0] ?
+ jQuery.css( this[0], type, false, "padding" ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn["outer" + name] = function( margin ) {
+ return this[0] ?
+ jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
+ elem.document.body[ "client" + name ] :
+
+ // Get document width or height
+ (elem.nodeType === 9) ? // is it a document
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ ) :
+
+ // Get or set width or height on the element
+ size === undefined ?
+ // Get width or height on the element
+ jQuery.css( elem, type ) :
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ this.css( type, typeof size === "string" ? size : size + "px" );
+ };
+
+});
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+
+})(window);
diff --git a/examples/lessons/6_Maths_romanNumerals/js/lesson.js b/examples/lessons/6_Maths_romanNumerals/js/lesson.js
new file mode 100755
index 0000000..0baa99a
--- /dev/null
+++ b/examples/lessons/6_Maths_romanNumerals/js/lesson.js
@@ -0,0 +1,288 @@
+$(document).ready(function() {
+ var i,j,flag;
+ var clickedObject; //store the clicked image id
+ var correctCounter = 0;
+ var totalCounter = 0;
+ var randQues = [];
+ var currentQuestion;
+ var TOTAL_QUES = 10;
+ var flag_correct;
+ var sectionNum = 0; //store the current section of game
+ var firstClickObj;
+ var flag_questionClick; //if set to 0, question is clicked so disable click in image
+ var imgCurrent;
+ var play = 0;
+ var restart = 0;//pause the timer
+ var s,h,m;
+ var t;
+
+ var questions1 = new Array(3,16,62,59,127,355,400,757,935,1205);
+ var questions2 = new Array(10,2,150,50,500,1500,12,120,250,40);
+
+ var startTimer = function(){
+ s=checkTime(s);
+ m=checkTime(m);
+ h=checkTime(h);
+ $('#timerBox1').html(s);
+ $('#timerBox2').html(m);
+ $('#timerBox3').html(h);
+ };
+
+ var increaseTime = function(){
+ if(play === 1){
+ if(restart === 1){
+ s = 0;
+ m = 0;
+ h = 0;
+ restart = 0;
+ }
+ clearTimeout(t);
+ s++;
+ if(s>60){
+ m++;
+ m=checkTime(m);
+ $('#timerBox2').html(m);
+ s = 0;
+ }
+ if(m>60){
+ h++;
+ h=checkTime(h);
+ $('#timerBox3').html(h);
+ m=0;
+
+ }
+ s=checkTime(s);
+ $('#timerBox1').html(s);
+ var t=setTimeout(function(){increaseTime();},1000);
+
+ }
+ };
+
+ function checkTime(timePara){
+ if (timePara<10 ){
+ timePara="0" + timePara;
+ }
+ return timePara;
+ };
+
+ var hide_textboxAnswers = function(){
+ for(var i=0; i< TOTAL_QUES;i++){
+ $('#checkFirst'+i).html('');
+ $('#checkSecond'+i).html('');
+ $('#ansBoxCorrect'+i).hide();
+ }
+ };
+
+ function delay(){
+ document.delayForm.delayval.value = 1;
+ hide_textboxAnswers();
+ }
+
+
+ var randNumber = function(limit){ //generate random number between any two ranges
+ var rand_no = Math.floor(limit*Math.random());
+ return rand_no;
+ };
+
+ var generate_random_questions = function(){
+ randQues[0] = randNumber(TOTAL_QUES);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randQues[i] = randNumber(TOTAL_QUES);
+ for(j=0; j<i; j++){
+ if(randQues[i]===randQues[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+
+ // Convert from Roman Numerals
+ function deromanize( roman ) {
+ var roman = roman.toUpperCase(),
+ lookup = {I:1,V:5,X:10,L:50,C:100,D:500,M:1000},
+ arabic = 0,
+ i = roman.length;
+ while (i--) {
+ if ( lookup[roman[i]] < lookup[roman[i+1]] )
+ arabic -= lookup[roman[i]];
+ else
+ arabic += lookup[roman[i]];
+ }
+ return arabic;
+ }
+
+ //Convert to roman numerals
+ function romanize(num) {
+ var lookup = {M:1000,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},
+ roman = '',
+ i;
+ for ( i in lookup ) {
+ while ( num >= lookup[i] ) {
+ roman += i;
+ num -= lookup[i];
+ }
+ }
+ return roman;
+ }
+
+
+
+ var display_game_over = function(){
+ $('#section').show();
+ $('#section').addClass('gameOverShow');
+ $('#gameOver').show();
+ $('#gameOver').html('<img src="assets/image/gameOver.png');
+ $('#gameOver').append('<div class="specialText">Click Play Again to play the game again or next/back to different game.</div>');
+ };
+
+
+ var check_answers = function(){
+ var counter = 0;
+ var ques;
+ var flag_correct = 0;
+ for(var i = 0; i< TOTAL_QUES;i++){
+ if(sectionNum === 1){
+ ques = questions1[i];
+ }
+ else{
+ ques = questions2[i];
+ }
+ var x = $('#ansBox'+i).val();
+ $('#checkFirst'+i).html('');
+ $('#checkSecond'+i).html('');
+ $('#ansBoxCorrect'+i).hide();
+ if(ques === deromanize(x) && x!= ""){
+ $('#checkFirst'+i).append('<img src = "assets/image/correct.png">');
+ counter++;
+ flag_correct = 1;
+ }
+ else{
+ flag_correct = 0;
+ $('#checkFirst'+i).append('<img src = "assets/image/incorrect.png">');
+ }
+ if(flag_correct === 0){
+ $('#ansBoxCorrect'+i).show();
+ $('#checkSecond'+i).html('<img src = "assets/image/correct.png">');
+ $('input#ansBoxCorrect'+i).val(romanize(ques));
+ }
+ }
+ if(counter != TOTAL_QUES){
+ t=setTimeout(function(){delay();},3000); //give chance to see for 3 sec if incorrect
+ }
+ else{
+ play = 0;
+ display_game_over();
+ }
+
+ };
+
+ var assignQuestions = function (square){
+ //var question = randQues[square];
+ var ques;
+
+ if(sectionNum === 1){
+ ques = questions1[square];
+ }
+ else{
+ ques = questions2[square];
+ }
+
+ $('#gameArea').append('<div id="imageArea'+square+'" class="imgArea"></div>');
+ $('#imageArea'+square).append('<div id="ques'+square+'" class="quesBox"></div>');
+ $('#ques'+square).html(ques);
+ $('#imageArea'+square).append('<input id="ansBox'+square+'" type="text" class="textBox" maxlength="10" size="10">');
+ $('#imageArea'+square).append('<div id="checkFirst'+square+'" class="check"></div>');
+ $('#imageArea'+square).append('<input id="ansBoxCorrect'+square+'" type="text" style="display:none" class="textBox" maxlength="10" size="10">');
+ $('#imageArea'+square).append('<div id="checkSecond'+square+'" class="check"></div>');
+ };
+
+ function game(){
+
+ $('#frontDisplay').show();
+ $('#imgStory').hide();
+ $('#topText').hide();
+ $('#gameOver').hide();
+ $('#section').hide();
+ $('#linkBack').hide();
+ $('#confirmBtn').hide();
+ $('#linkNext').show();
+ $('#timerBar').hide();
+ sectionNum = 0;
+ }
+ function game_start(){
+ clearTimeout(t);
+ if(sectionNum === 1){
+ $('#linkNext').show();
+ $('#linkBack').show();
+ }
+ else{
+ $('#linkNext').hide();
+ $('#linkBack').show();
+ }
+ //alert(sectionNum);
+ play = 1;
+ s = 0; h = 0; m = 0;
+ startTimer();
+ increaseTime();
+ $('#imgStory').show();
+ $('#frontDisplay').hide();
+ $('#gameOver').hide();
+ $('#confirmBtn').show();
+ $('#timerBar').show();
+ $('#currentTitle').html('').append('तिम्रो सम्झने शक्ति को जाँच');
+ $('#section').show();
+ $('#section').removeClass('gameOverShow');
+ $('#gameArea').html('').append('<div id="topText"></div>');
+
+ for(var i = 0; i < TOTAL_QUES; i++){
+ assignQuestions(i);
+ }
+ focus_blur();
+ }
+ $('#confirmBtn').click(function(){
+ check_answers();
+ });
+ $('#linkStart').click(function(){
+ sectionNum = 1;
+ game_start();
+
+ });
+
+ $('#linkPlayAgain').click(function(){
+ restart = 0;
+ game_start();
+
+ });
+ $('#linkBack').click(function(){
+ if(sectionNum === 1){
+ game();
+ }
+ else if(sectionNum === 2){
+ sectionNum = 1;
+ game_start();
+ }
+
+ });
+ $('#linkNext').click(function(){
+ sectionNum += 1;
+ game_start();
+
+ });
+ function focus_blur(){
+ $('input[type="text"]').focus(function() {
+ $(this).addClass("focus");
+ });
+ $('input[type="text"]').blur(function() {
+ $(this).removeClass("focus");
+ });
+ }
+
+ game();
+
+
+
+});//end of DOM
diff --git a/examples/lessons/6_Maths_variables/assets/audio/correct.wav b/examples/lessons/6_Maths_variables/assets/audio/correct.wav
new file mode 100755
index 0000000..a49ba33
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/audio/correct.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/audio/incorrect.wav b/examples/lessons/6_Maths_variables/assets/audio/incorrect.wav
new file mode 100755
index 0000000..906c6a3
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/audio/incorrect.wav
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/bgAns.png b/examples/lessons/6_Maths_variables/assets/image/bgAns.png
new file mode 100755
index 0000000..9ff65f4
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/bgAns.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/bgMessage.png b/examples/lessons/6_Maths_variables/assets/image/bgMessage.png
new file mode 100755
index 0000000..b56f2c0
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/bgMessage.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/bgQues.png b/examples/lessons/6_Maths_variables/assets/image/bgQues.png
new file mode 100755
index 0000000..c4624d3
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/bgQues.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/bgQuestion.png b/examples/lessons/6_Maths_variables/assets/image/bgQuestion.png
new file mode 100755
index 0000000..a0552f3
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/bgQuestion.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/bg_footer.png b/examples/lessons/6_Maths_variables/assets/image/bg_footer.png
new file mode 100755
index 0000000..4bd44fa
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/bg_footer.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/bg_header.png b/examples/lessons/6_Maths_variables/assets/image/bg_header.png
new file mode 100755
index 0000000..f421817
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/bg_header.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/bg_title_block.png b/examples/lessons/6_Maths_variables/assets/image/bg_title_block.png
new file mode 100755
index 0000000..7311891
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/bg_title_block.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_back.png b/examples/lessons/6_Maths_variables/assets/image/btn_back.png
new file mode 100755
index 0000000..d9fbf14
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_back.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_variables/assets/image/btn_back_hover.png
new file mode 100755
index 0000000..0911fcc
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_back_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_help.png b/examples/lessons/6_Maths_variables/assets/image/btn_help.png
new file mode 100755
index 0000000..6753e9c
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_variables/assets/image/btn_help_hover.png
new file mode 100755
index 0000000..d3ccd92
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_help_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_next.png b/examples/lessons/6_Maths_variables/assets/image/btn_next.png
new file mode 100755
index 0000000..9d70993
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_next.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_variables/assets/image/btn_next_hover.png
new file mode 100755
index 0000000..2cd4d37
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_next_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_ole.png b/examples/lessons/6_Maths_variables/assets/image/btn_ole.png
new file mode 100755
index 0000000..0e775e9
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_ole.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_variables/assets/image/btn_ole_hover.png
new file mode 100755
index 0000000..c43c5f7
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_ole_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_play_again.png b/examples/lessons/6_Maths_variables/assets/image/btn_play_again.png
new file mode 100755
index 0000000..3594d18
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_play_again.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_variables/assets/image/btn_play_again_hover.png
new file mode 100755
index 0000000..ebb8f8c
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_play_again_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_variables/assets/image/btn_play_again_mouse_down.png
new file mode 100755
index 0000000..07d6e45
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_start.png b/examples/lessons/6_Maths_variables/assets/image/btn_start.png
new file mode 100755
index 0000000..32e5f20
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_start.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_variables/assets/image/btn_start_hover.png
new file mode 100755
index 0000000..811ce78
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_start_hover.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_variables/assets/image/btn_start_mouse_down.png
new file mode 100755
index 0000000..5acd43b
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/btn_start_mouse_down.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/check.png b/examples/lessons/6_Maths_variables/assets/image/check.png
new file mode 100755
index 0000000..bd0afcb
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/check.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/correct.png b/examples/lessons/6_Maths_variables/assets/image/correct.png
new file mode 100755
index 0000000..ca9b9db
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/correct.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/gameOver.png b/examples/lessons/6_Maths_variables/assets/image/gameOver.png
new file mode 100755
index 0000000..81c403b
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/gameOver.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/help.png b/examples/lessons/6_Maths_variables/assets/image/help.png
new file mode 100755
index 0000000..b9b5607
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/help.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img0.png b/examples/lessons/6_Maths_variables/assets/image/img0.png
new file mode 100755
index 0000000..eaa4be6
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img0.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img0Clicked.png b/examples/lessons/6_Maths_variables/assets/image/img0Clicked.png
new file mode 100755
index 0000000..2914e3e
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img0Clicked.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img1.png b/examples/lessons/6_Maths_variables/assets/image/img1.png
new file mode 100755
index 0000000..1cff36f
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img1.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img1Clicked.png b/examples/lessons/6_Maths_variables/assets/image/img1Clicked.png
new file mode 100755
index 0000000..4ad6fa9
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img1Clicked.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img2.png b/examples/lessons/6_Maths_variables/assets/image/img2.png
new file mode 100755
index 0000000..290b0a9
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img2.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img2Clicked.png b/examples/lessons/6_Maths_variables/assets/image/img2Clicked.png
new file mode 100755
index 0000000..967ee3d
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img2Clicked.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img3.png b/examples/lessons/6_Maths_variables/assets/image/img3.png
new file mode 100755
index 0000000..933ce84
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img3.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img3Clicked.png b/examples/lessons/6_Maths_variables/assets/image/img3Clicked.png
new file mode 100755
index 0000000..59aebbc
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img3Clicked.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img4.png b/examples/lessons/6_Maths_variables/assets/image/img4.png
new file mode 100755
index 0000000..7f52375
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img4.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img4Clicked.png b/examples/lessons/6_Maths_variables/assets/image/img4Clicked.png
new file mode 100755
index 0000000..279e50a
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img4Clicked.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img5.png b/examples/lessons/6_Maths_variables/assets/image/img5.png
new file mode 100755
index 0000000..9131ce0
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img5.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img5Clicked.png b/examples/lessons/6_Maths_variables/assets/image/img5Clicked.png
new file mode 100755
index 0000000..7db2250
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img5Clicked.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img6.png b/examples/lessons/6_Maths_variables/assets/image/img6.png
new file mode 100755
index 0000000..9131ce0
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img6.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img6Clicked.png b/examples/lessons/6_Maths_variables/assets/image/img6Clicked.png
new file mode 100755
index 0000000..48eddc4
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img6Clicked.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img7.png b/examples/lessons/6_Maths_variables/assets/image/img7.png
new file mode 100755
index 0000000..7543550
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img7.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/img7Clicked.png b/examples/lessons/6_Maths_variables/assets/image/img7Clicked.png
new file mode 100755
index 0000000..6f754a8
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/img7Clicked.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/incorrect.png b/examples/lessons/6_Maths_variables/assets/image/incorrect.png
new file mode 100755
index 0000000..49ee2a2
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/incorrect.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/title_block_lt.png b/examples/lessons/6_Maths_variables/assets/image/title_block_lt.png
new file mode 100755
index 0000000..b1c0e90
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/title_block_lt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/assets/image/title_block_rt.png b/examples/lessons/6_Maths_variables/assets/image/title_block_rt.png
new file mode 100755
index 0000000..275daaf
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/assets/image/title_block_rt.png
Binary files differ
diff --git a/examples/lessons/6_Maths_variables/css/lesson.css b/examples/lessons/6_Maths_variables/css/lesson.css
new file mode 100755
index 0000000..98c9a00
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/css/lesson.css
@@ -0,0 +1,248 @@
+@CHARSET "UTF-8";
+/****** Page Styles ****/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0px;
+ background-color: #FFFFCC;
+}
+#header {
+ background-image: url(../assets/image/bg_header.png);
+ background-repeat: repeat-x;
+ height: 89px;
+ width: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+#topbtn_left {
+ float: left;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-left: 5px;
+}
+
+
+ #linkBack{
+ width: 60px; height: 59px;
+ background:url(../assets/image/btn_back.png);
+ }
+ #linkBack:hover{
+ background:url(../assets/image/btn_back_hover.png);
+ }
+
+#lesson_title {
+ float: left;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-left: 10px;
+ background-image: url(../assets/image/bg_title_block.png);
+}
+#topbtn_right {
+ float: right;
+ height: 60px;
+ width: 60px;
+ padding-top: 13px;
+ padding-right: 5px;
+}
+ #linkHelp{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_help.png);
+ }
+ #linkHelp:hover{
+ background:url(../assets/image/btn_help_hover.png);
+ }
+ #linkOle{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_ole.png);
+ }
+ #linkOle:hover{
+ background:url(../assets/image/btn_ole_hover.png);
+ }
+ #linkNext{
+ width: 60px; height: 60px;
+ background:url(../assets/image/btn_next.png);
+ }
+ #linkNext:hover{
+ background:url(../assets/image/btn_next_hover.png);
+ }
+#footer {
+ background-image: url(../assets/image/bg_footer.png);
+ background-repeat: repeat-x;
+ position: absolute;
+ height: 69px;
+ width: 100%;
+ left: 0px;
+ bottom: 0px;
+}
+#score_box {
+ float: left;
+ padding-left: 5px;
+ padding-top: 10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #FFFF00;
+ font-size: 16pt;
+ font-weight: bold;
+}
+#botbtn_right {
+ float: right;
+ height: 55px;
+ /*width: 251px;*/
+ padding-right: 5px;
+ padding-top: 5px;
+}
+ #linkCheck{
+ margin: 1em 3em 0 0;
+ width: 101px; height: 30px;
+ background-image: url(../assets/image/check.png);
+ }
+
+ #linkStart{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_start.png);
+ }
+ #linkStart:hover{
+ background:url(../assets/image/btn_start_hover.png);
+ }
+ #linkStart:active{
+ background:url(../assets/image/btn_start_mouse_down.png);
+ }
+ #linkPlayAgain{
+ width: 251px; height: 55px;
+ background:url(../assets/image/btn_play_again.png);
+ }
+ #linkPlayAgain:hover{
+ background:url(../assets/image/btn_play_again_hover.png);
+ }
+ #linkPlayAgain:active{
+ background:url(../assets/image/btn_play_again_mouse_down.png);
+ }
+
+/**** End of the page style ****/
+
+/**** Game Styles ****/
+
+a{
+ color:#FFFFCC;
+}
+#currentTitle{
+ width: 150px;
+ height: 80xp;
+ font:25px/30px "Courier New", Courier, monospace;
+ font-weight: bold;
+ color: red;
+}
+#content{
+ margin: 0 auto;
+ margin-top: 85px;
+ width: 95%;
+ padding: 1em;
+ height: 380px;
+
+}
+ #section{
+ width: 900px;
+ height: 400px;
+ margin: 0 auto;
+ }
+
+ #left-side{
+ float:left;
+ width: 350px;
+ height: 360px;
+ }
+ #topText{
+ width: 350px;
+ height: 30px;
+ font: 25px/30px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #0000FF;
+ }
+ .bgQues{
+ margin: 0.5em auto;
+
+ width: 295px;
+ height: 225px;
+ background: url(../assets/image/bgQues.png) no-repeat;
+ padding-top: 1.5em;
+ text-align:center;
+ }
+ .bgAns{
+ margin: 1em 0 0 0;
+ width: 350px;
+ height: 74px;
+ background: url(../assets/image/bgAns.png) no-repeat;
+ text-align:center;
+ padding-top: 1em;
+ }
+ #right-side{
+ float:right;
+ width: 350px;
+ height: 360px;
+ }
+
+ .bgQuestion{
+ margin: 0.1em auto;
+ width: 325px;
+ height: 105px;
+ background: url(../assets/image/bgQuestion.png) no-repeat;
+ text-align:center;
+ padding-top: 1em;
+ }
+ .bgInfo{
+ margin: 0.1em auto;
+ width: 325px;
+ height: 105px;
+ background: url(../assets/image/bgMessage.png) no-repeat;
+ text-align:center;
+ padding-top: 1em;
+ }
+ .quesText{
+
+ font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #000000;
+ }
+ input.textBox{
+ size:2;
+ font: 15px/20px Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ height:20px;
+ width: 25px;
+ text-align:center;
+ }
+ .focus {
+ background-color: #FFEEAA;
+ }
+ .correct{
+ background-color: #C0F9F3;
+ }
+ .incorrect{
+ background-color: #FFFF00;
+ }
+
+ #help{
+ display:none;
+ position:absolute;
+ right: 20%;
+ top: 1%;
+ width: 224px;
+ height: 525px;
+ background:url(../assets/image/help.png);
+ z-index:40;
+ }
+ .backOpaque{
+ background-color: #A4A4A4;
+ opacity: 0.2;
+ }
+ #gameOver{
+ display:none;
+ position:absolute;
+ top: 40%;
+ left: 25%;
+ width: 432px;
+ height: 68px;
+ background: url('../assets/image/gameOver.png');
+ } \ No newline at end of file
diff --git a/examples/lessons/6_Maths_variables/css/ui.scoreboard.css b/examples/lessons/6_Maths_variables/css/ui.scoreboard.css
new file mode 100755
index 0000000..11cdbb5
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/css/ui.scoreboard.css
@@ -0,0 +1,62 @@
+.ui-scoreboard-container-h{
+max-width: 800em;
+max-height: 200px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+
+.ui-scoreboard-spacing-h{
+max-width: 200em;
+max-height: 300em;
+display:inline;
+margin-left:0.2em;
+margin-right:0.4em;
+}
+
+.ui-scoreboard-text{
+font-size:larger;
+text-align: center;
+}
+
+.ui-scoreboard-number-h {
+background-color:black;
+color: white;
+padding-left:0.4em;
+padding-right:0.4em;
+font-size:larger;
+}
+
+.ui-scoreboard-button{
+float:right;
+cursor:pointer;
+}
+
+button .ui-scoreboard-icon{
+float: left;
+margin-right:0.3em;
+}
+.ui-scoreboard-container-v{
+max-width: 200px;
+max-height: 400px;
+float:left;
+padding-top:0.4em;
+padding-bottom:0.4em;
+}
+.ui-scoreboard-spacing-v{
+display:block;
+margin: 0.4em;
+}
+
+.ui-scoreboard-number-v{
+background-color:black;
+color: white;
+width: 1em;
+text-align:center;
+margin-left:auto;
+margin-right: auto;
+padding:0.4em;
+font-size:larger;
+}
+
+
diff --git a/examples/lessons/6_Maths_variables/index.html b/examples/lessons/6_Maths_variables/index.html
new file mode 100755
index 0000000..d8510c0
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/index.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<head>
+ <title>Class 6 Maths Variables</title>
+ <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
+ <link type="text/css" rel="stylesheet" href="css/lesson.css" />
+ <link type="text/css" rel="stylesheet" href="css/ui.scoreboard.css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
+ <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="js/ui.core.js"></script>
+ <script type="text/javascript" src="js/ui.draggable.js"></script>
+ <script type="text/javascript" src="js/ui.droppable.js"></script>
+ <script type="text/javascript" src="js/karma.js"></script>
+ <script type="text/javascript" src="js/ui.scoreboard.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+</head>
+<body>
+ <div id="header">
+ <div id="topbtn_left"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ <div id="lesson_title">
+ <img src="assets/image/title_block_lt.png" width="33" height="89" align="absmiddle" />
+ <span id="currentTitle"> चल (Variables)</span>
+ <img src="assets/image/title_block_rt.png" width="33" height="89" align="absmiddle" />
+ </div>
+ <div id="topbtn_right"><a href="#"><div id="linkHelp"></div></a></div>
+ <div id="topbtn_right"><a href="http://olenepal.org"><div id="linkOle"></div></a></div>
+ </div>
+
+ <div id="content">
+ <div id="section"></div>
+ <div id="checkAnswer"></div>
+ <div id="displayImgArea"></div>
+ <div id="gameOver"></div>
+ <div id="help"></div>
+ </div>
+ <form name="delayForm">
+ <input type="hidden" name="delayval" size="5">
+ </form>
+
+ <div id="footer">
+ <div id="score_box"></div>
+ <div id="botbtn_right"><a href="#"><div id="linkStart"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkPlayAgain"></div></a></div>
+ <div id="botbtn_right"><a href="#"><div id="linkCheck"></div></a></div>
+ </div>
+</body>
+</html>
diff --git a/examples/lessons/6_Maths_variables/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_variables/js/jquery-1.3.2.min.js
new file mode 100755
index 0000000..b1ae21d
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/js/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/examples/lessons/6_Maths_variables/js/karma.js b/examples/lessons/6_Maths_variables/js/karma.js
new file mode 100755
index 0000000..03f027b
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/js/karma.js
@@ -0,0 +1,1018 @@
+/* Documentation Note:
+ * Public methods and properties are commented with /** some text *\/
+ * and private methods and properties are commented with //
+ *
+ * Please leave it that way to keep this documentation sane
+ */
+
+
+/*
+* Karma Framework
+* http://karmaeducation.org
+*
+* Copyright (c) 2009
+* Bryan W Berry bryan@olenepal.org
+* Felipe López Toledo zer.subzero@gmail.com
+*
+* Under MIT License:
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use,
+* copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following
+* conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/**
+* @fileOverview Contains karma library
+* @author Bryan Berry <bryan@olenepal.org>
+* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
+*/
+
+
+//common.js modules use exports object
+if(!this.exports) {
+ exports = {};
+}
+
+
+
+/** Checks if the current document type is set to HTML 5, throws
+ * an error otherwise, then initializes the karma object and returns
+ * a reference to that object.
+ * @namespace Global namespace for Karma library
+ * @param {Object} [options={}] options for intializing Karma library
+ * @param {String} [options.locale=''] sets current locale Not Yet Implemented
+ * @param {Array} [options.image=[]] array of images to be converted into a collection
+ * @param {Array} [options.audio=[]] array of audio to be converted into a collection
+ * @param {Array} [options.video=[]] array of videos to be converted into a collection
+ * @param {Array} [options.svg=[]] array of SVG elements to be
+ * converted into a collection. Each SVG element must already exist in the html document
+ * @param {Array} [options.canvas=[]] array of canvas elements
+ * to be converted into a collection. Each canvas element must already exist in the
+ * html document and width and height of each element must be set as attributes
+ * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
+ * <!DOCTYPE html>
+ * @throws {Error} If any of the initialization parameters are invalid values
+ * @returns {Object} Karma.karma -- reference to the initialized Karma library
+ * @example
+ *
+ * var k = Karma({
+ * image: [
+ * {name: "ninja", file: "ninja.png"},
+ * {name: "cowboy", file: "cowboy.png"}
+ * ],
+ * audio: [
+ * {name: "woosh", file: "woosh.ogg"},
+ * {name: "yeehaw", file: "yeehaw.ogg"}
+ * ],
+ * video: [
+ * {name: "attack", file: "attack.ogv"},
+ * {name: "ride", file: "ride.ogv"}
+ * ]
+ * canvas: [
+ * {name: "ninja", domId: "ninjaCanvas"},
+ * {name: "cowboy", domId: "cowboyCanvas"}
+ * ],
+ * svg: [
+ * {name: "ninja", domId: "ninjaSvg"},
+ * {name: "cowboy", domId: "cowboySvg"}
+ * ],
+ * });
+ * Next, call the ready function with a callback to your program code
+ *
+ * k.ready(function () { ... your application code . . . }
+ *
+ * after that you can access each asset like so
+ * k.image.ninja;
+ * k.svg.cowboy;
+ * k.audio.yeehaw.play();
+ * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
+ *
+ */
+var Karma = exports.Karma = function (options) {
+ Karma._isHtml5(document.doctype.nodeName);
+
+ if ( Karma.karma._initialized === true ) {
+ return Karma.karma;
+ } else {
+ return Karma.karma._init(options);
+ }
+};
+
+
+//helper functions
+
+/**This emulates the Object.create method in ecmascript 5 spec
+ * This isn't a full implementation as it doesn't support
+ * This has the same functionality as Crockford's beget method
+ * and this primary building block for prototypal inheritance in
+ * this library
+ * @param {Object} target that the new object's prototype should point to
+ * @returns {Object} object whose prototype points to target
+ * @example
+ *
+ * var ninja = { weapon : "sword" };
+ * var ninja1 = Karma.create(ninja);
+ * ninja1.sword === "sword"
+ */
+Karma.create = function (target){
+ function F () {};
+ F.prototype = target;
+ return new F();
+};
+
+/** Returns a shallow copy of the passed in object
+ * @param {Object} target to be copied
+ * @returns {Object} a shallow copy of target
+ */
+Karma.clone = function (target){
+ var copy = {};
+ for ( var i in target ) {
+ if(target.hasOwnProperty(i)){
+ copy[i] = target[i];
+ }
+ }
+ return copy;
+};
+
+/** Extends properties of the target object with those of
+ * the source object
+ * @param {Object} target object to be extended
+ * @param {Object} source whose properties will extend target
+ * @returns {Object} target extended by source
+ */
+Karma.objectPlus = function (target, source){
+ for ( var i in source){
+ if (source.hasOwnProperty(i)){
+ target[i] = source[i];
+ }
+ }
+ return target;
+};
+
+/** Creates a new object that is a prototype of the first argument
+ * then extends it with the properties of the second argument
+ * @param {Object} parent1 will be prototype of returned object
+ * @param {Object} parent2 will extend properties of returned object
+ * @returns {Object} object that whose prototype is parent1 and has
+ * been extended with properties of parent2
+ */
+Karma.copyObjectPlus = function (parent1, parent2){
+ function F () {};
+ F.prototype = parent1;
+ var G = new F();
+ return Karma.objectPlus(G, parent2);
+};
+
+//Enables function chaining for a specified list of function names
+//IMPORTANT: use of closures here with "this" and "that" is __very__
+//complicated here
+Karma._makeChain = function (chainingFunctions) {
+ var that = this;
+ var _chainFunction = function ( name ){
+ that[ name ] = function ( ){
+ var type = typeof this.ctx[name];
+ if ( type === "function") {
+ this.ctx[ name ].apply( this.ctx, arguments );
+ }else if ( type === "string" ){
+ this.ctx[ name ] = arguments[0];
+ }else {
+ throw ("wtf?!: impossible to chain " + name + "!");
+ }
+ return this;
+ };
+ };
+
+ for (var i = 0; i < chainingFunctions.length; i++){
+ _chainFunction( chainingFunctions[ i ] );
+ }
+};
+
+//Throws big ugly error if doctype isn't html5
+Karma._isHtml5 = function (doctype){
+ var regex = new RegExp('^html$', 'i');
+ if(!regex.test(doctype)){
+ var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
+ "in order to use Karma. Karma require you use html5";
+ var errorElem = document.createElement('div');
+ errorElem.setAttribute('id', 'errorDoctype');
+ errorElem.innerText = errorMsg;
+ document.body.appendChild(errorElem);
+ throw new Error(errorMsg);
+ }
+};
+
+
+/** Stores global settings for the Karma library
+ * @class This object stores the global settings for the Karma library
+ */
+Karma.karma = {
+ /** This is the global locale as passed to Karma(),
+ * such as "en", "es_SP"
+ * @type string
+ * @default undefined
+ */
+ locale : undefined,
+ /** Collection of images with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ image : {},
+ /** Collection of audio with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ audio : {},
+ /** Collection of canvas with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ canvas : {},
+ /** Collection of svgs with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ svg : {},
+ /** Collection of videos with special helper
+ * methods added to each reference
+ * @type object
+ * @default empty object
+ */
+ video : {},
+ _localized : false,
+ _assetPath : "assets/",
+ _localePath : "",
+ _initialized : false,
+ _statusDiv: undefined,
+ _loaderDiv : undefined,
+ _counters : { total : 0, errors : 0, loaded : 0},
+
+ //init initializes all the assets passed to Karma, that's it
+ //it returns 'this' so it can be used for function chaining
+ _init: function(options) {
+ this._initialized = true;
+
+ //set up message that show count of assets loaded
+ //and has an ordered list to append error messages to
+ var _statusDiv = this._statusDiv = document.createElement('div');
+ this._loaderDiv = this._loaderDiv = document.createElement('div');
+ var errorList = document.createElement('ol');
+
+ _statusDiv.setAttribute('id', 'karma-status');
+ _statusDiv.setAttribute('style', 'position:absolute;');
+ _statusDiv.innerHTML = 'Karma is loading ...';
+ this._loaderDiv.setAttribute('id', 'karma-loader');
+ this._loaderDiv.setAttribute('class', 'status');
+ errorList.setAttribute('id', 'errorList');
+
+ _statusDiv.appendChild(this._loaderDiv);
+ this._statusDiv.appendChild(errorList);
+ document.body.appendChild(_statusDiv);
+
+
+ //chain the functions for kCanvas and kSvg
+ Karma._makeChain.call(Karma.kCanvas,
+ Karma.kCanvas._chainingFunctions);
+ //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions);
+
+
+
+ //regular expression that matches the name of aprivate property
+ // the karma object
+ var regexPrivate = new RegExp('^_.*');
+
+ for ( var option in options ) {
+ if (options.hasOwnProperty(option)){
+ if (option === "image" || option === "audio" || option ===
+ "svg" || option === "video" || option === "canvas"){
+
+ if(!(options[option] instanceof Array)){
+ throw new Error("" + option + " must be an array");
+ } else if (options[option].length === 0){
+ continue;
+ }
+ } else if (regexPrivate.test(option)){
+ //don't overwrite a private property of karma object
+ continue;
+ }
+
+ switch (option){
+ case "locale":
+
+ if (this._isValidLocale(options[option])){
+ this.locale = this._normalizeLocale(options[option]);
+ this._localized = true;
+ this._localePath = Karma._computeLocalePath(this.locale);
+ } else {
+ throw new Error("locale provided to karma._init() is invalid");
+ }
+
+ break;
+ case "image":
+ options[option]._type = 'image';
+ Karma._makeImages(options[option]);
+ break;
+ case "audio":
+ options[option]._type = 'audio';
+ Karma._makeAudio(options[option]);
+ break;
+ case "video":
+ options[option]._type = 'video';
+ Karma._makeVideos(options[option]);
+ break;
+ case "svg":
+ options[option]._type = 'svg';
+ Karma._makeSvgs(options[option]);
+ break;
+ case "canvas":
+ options[option]._type = 'canvas';
+ Karma._makeCanvases(options[option]);
+ break;
+ }
+ }
+ }
+
+
+
+ return this;
+ },
+
+ /** Waits until all assets loaded, i.e. ready, then calls callback
+ * @param {Function} [cb] callback function
+ * @returns this
+ * @throws {Error} if Karma.karma is not initialized with the
+ * Karma({ options }) function
+ * @example
+ *
+ * var k = Karma({ . . . your assets here . . . });
+ * k.ready(function(){ .. your code here . . .});
+ *
+ * your code will not be called until all assets have been loaded
+ *
+ */
+ ready : function( cb ) {
+ var that = this;
+ if (Karma.karma._initialized !== true){
+ throw new Error("Karma.karma not initialized");
+ }
+
+ if (this._counters.loaded !== this._counters.total){
+ setTimeout(function(){ that.ready(cb);}, 5);
+ } else if (cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ cb();
+ } else if (!cb) {
+ //hide the "Karma is loading..." message
+ this._statusDiv.setAttribute('style', 'display:none;');
+
+ //if no options passed, show it works message
+ this._showStarterMessage();
+ }
+
+
+
+
+ return this;
+ },
+
+ //Display Apache-like "It works" message if no options
+ _showStarterMessage : function (){
+ var starterMsg = document.createElement('div');
+ starterMsg.setAttribute('id', 'starterMsg');
+ starterMsg.innerHTML = "<h1>It Works</h1>";
+ document.body.appendChild(starterMsg);
+ },
+
+ //Updates visible counter of how many assets are loaded
+ _updateStatus : function (errorMsg) {
+ var loaded = this._counters.loaded;
+ var total = this._counters.total;
+ var errors = this._counters.errors;
+ this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
+ "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
+ if (errorMsg) {
+ var liError = document.createElement('li');
+ liError.innerHTML = errorMsg;
+ var errorList = document.getElementById('errorList');
+ errorList.appendChild(liError);
+ }
+ },
+
+ //matches 2 letter country code then optionally
+ //a dash or underscore followed by a country or language identifier
+ //i currently only allow a language identifier 2-3 chars long
+ _isValidLocale : function (locale) {
+ var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
+ return localeRegex.test(locale);
+ },
+
+ _normalizeLocale : function(locale) {
+ var lang = "";
+ var country = "";
+ var divider = "";
+
+ lang = locale.slice(0, 2).toLowerCase();
+ divider = "_";
+ country = locale.slice(3, 6).toUpperCase();
+
+ return locale.length > 2 ? "" + lang + divider + country : lang;
+ },
+
+ // Below are geometry and math helper methods
+
+ /**
+ * Converts a value from degrees to radians.
+ * @param {Number} angle The angle in degrees
+ * @returns {Number} The angle in radians
+ */
+ radians : function( angle ){
+ return ( angle / 180 ) * Math.PI;
+ },
+ /**
+ * Gets the square of the Euclidian (ordinary) distance between 2 points.
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The square of the Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance2 : function ( p0, p1 ) {
+ return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
+ },
+ /**
+ * Gets the Euclidian (ordinary) distance between 2 points.<br>
+ * <b>Warning:</b> It's slower than distance2 function
+ * @param {Object} Point No. 0
+ * @param {Number} Point0.x
+ * @param {Number} Point0.y
+ * @param {Object} Point No. 1
+ * @param {Number} Point1.x
+ * @param {Number} Point1.y
+ * @returns {Number} The Euclidian distance
+ * @example
+ *
+ * p0 = {x:0, y:1};
+ * p1 = {x:50, y:70};
+ * var d = distance2(p0, p1);
+ *
+ */
+ distance : function ( p0, p1 ) {
+ return Math.sqrt( this.distance2( p0, p1 ) );
+ },
+ /** Returns a random number within the range provided
+ * @param {Number} lower limit of the range, lowest number that can be returned
+ * @param {Number} upper limit of the range, highest number that can be returned
+ * @returns {Number} number that is >= lower and <= upper
+ * @example
+ *
+ * var num = rand(0, 10);
+ *
+ * num could be 0, 1, 2, 3 ... or 10
+ *
+ */
+ rand : function ( lower, upper ){
+ return Math.round( Math.random() * (upper - lower) + lower );
+ }
+
+};
+
+/** Prototypal object for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @class This object is the prototype for images, videos, and audio files but
+ * does not include svg or canvas elements
+ * @ throws {Error} if the individual asset is set to be localized but
+ * the globale locale is not set on the Karma.karma object
+ * @ throws {Error} if the name and file properties are not supplied
+ * @example
+ * kMedia is the prototype object for images, audio, and videos.
+ * These 'media' assets are loaded in a distinctly different way
+ * from the canvas or svg assets. They also have distinctly different
+ * helper methods
+ *
+ * You initialize the kMedia assets by passing an array of objects
+ */
+Karma.kMedia = {
+ /** file location of asset
+ * @type String
+ * @default ""
+ */
+ file : "",
+ /** media object
+ * @type Audio|Image|Video
+ * @default undefined
+ */
+ media : undefined,
+ //actual path to the file
+ _path : "",
+ //if using localized version of this asset
+ _localized : false,
+ //audio, image, or video
+ _type : "",
+ //initializes kMedia instance with values provided by user
+ _init : function (asset) {
+ asset._localized = asset._localized || false;
+ Karma.karma._counters.total++;
+
+ if (asset.name === undefined || asset.file === undefined){
+ throw new Error("properties name and file have to be defined");
+ } else {
+ this.name = asset.name;
+ this.file = asset.file;
+ }
+
+ //_type is a private variable used internally
+ if (asset._type === undefined){
+ throw new Error("the _type property must be set. " +
+ "Blame the karma library authors as this is an internal value");
+ } else {
+ if (Karma._isValidType(asset._type)){
+ this._type = asset._type;
+ switch ( this._type ) {
+ case "image": this.media = new Image();
+ break;
+ case "audio": this.media = new Audio();
+ break;
+ //case "video":
+ //NYI
+ //this.media = new Video();
+ break;
+ default: throw new Error("Media type not supported");
+ }
+
+ } else {
+ throw new Error("the _type property supplied is invalid. " +
+ "Blame the karma library authors as this is an internal value");
+ }
+ }
+
+ if(Karma._isLocalized(asset._localized)){
+ this._localized = asset._localized;
+ this._path = Karma.karma._localePath +
+ this._type + "/";
+ } else {
+ this._path = Karma.karma._assetPath +
+ this._type + "/";
+ }
+
+
+ //IMPORTANT: This one magic line loads the file
+ this.media.src = this.src = this._path + this.file;
+
+ //add event handlers
+ this._addEventHandlers();
+
+ if (this._type === "audio"){
+ this.media.autobuffer = true;
+ this.media.load();
+ }
+
+
+ return this;
+ },
+ //Adds event handlers to update the counters when
+ //the asset is successfully or unsuccessfully loaded
+ _addEventHandlers : function () {
+ var that = this;
+ var loadEvent = "load";
+ //Browser Hack recommended by chromium devs
+ //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
+ if (this._type === "audio" || this._type === "video"){
+ loadEvent = "canplaythrough";
+ }
+
+ that.media.addEventListener(
+ loadEvent,
+ function (e) {
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";}, false);
+
+ that.media.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.media.addEventListener(
+ "abort",
+ function (e) {
+ Karma.karma._counters.total++;
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+
+};
+
+//determine if it is a valid type of asset
+Karma._isValidType = function (type){
+ return type === "image" ||
+ type === "svg" ||
+ type === "audio" ||
+ type === "video" ||
+ type === "canvas";
+};
+
+Karma._isLocalized = function (boolLocalized) {
+ if (typeof boolLocalized === "boolean" ) {
+ if(boolLocalized === true &&
+ Karma.karma.locale === undefined){
+ throw new Error("You cannot localize a media asset" +
+ " if the global locale for Karma isn't set");
+ } else {
+ return boolLocalized;
+ }
+ } else if (typeof boolLocalized === undefined){
+ return false;
+ } else{
+ throw new Error("This is not a valid value for the localized option");
+ }
+};
+
+Karma._computeLocalePath = function(locale) {
+ return Karma.karma._assetPath + locale + "/";
+};
+
+Karma._makeImages = function (imgConfigs){
+ var makeImage = function (imgConfig){
+ var image = undefined;
+ imgConfig._type = "image";
+ image = Karma.create(Karma.kMedia)._init(imgConfig);
+ Karma.karma.image[imgConfig.name] = image;
+ };
+
+ imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);});
+
+};
+
+Karma._makeAudio = function (audioConfigs){
+ var makeAudio = function (audioConfig){
+ var audio = undefined;
+ audioConfig._type = "audio";
+ audio = Karma.create(Karma.kMedia)._init(audioConfig);
+ audio.play = function () {
+ //hack to fix the audio "stuttering" problem
+ //more info: https://bugs.launchpad.net/karma/+bug/426108
+ this.media.currentTime = 0.1;
+ this.media.play();
+ };
+ Karma.karma.audio[audioConfig.name] = audio;
+ };
+
+ audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);});
+
+};
+
+
+Karma._makeCanvases = function (canvasConfigs){
+ var makeCanvas = function (canvasConfig){
+ var canvas = undefined;
+ canvas = Karma.create(Karma.kCanvas)._init(canvasConfig);
+ Karma.karma.canvas[canvasConfig.name] = canvas;
+ };
+
+ canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);});
+
+};
+
+/** Prototypal object for each canvas element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the canvas element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each canvas element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kCanvas = {
+ /** Name of the canvas, used internally by karma.js
+ * @type String
+ * @default ''
+ */
+ name : '',
+ /** Width of canvas element
+ * @type Number
+ * @default 0
+ */
+ width: 0,
+ /** Height of canvas element
+ * @type Number
+ * @default 0
+ */
+ height: 0,
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** The 2 Dimensional Rendering context property for this canvas
+ * @type 2DRenderingContext
+ * @default undefined
+ */
+ ctx: undefined,
+ /** Frames Per Second, I don't know what the purpose of this is,
+ * Felipe made it up
+ * @type Number
+ * @default 24
+ */
+ fps: 24,
+
+ //initializes object with values provides by user
+ _init: function (config) {
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = config[option];
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = parseInt(config.option, 10);
+ break;
+ case "fps":
+ this.fps = parseInt(config.option, 10);
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ this.ctx = this.node.getContext('2d');
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ return this;
+ },
+ /** Clear area of canvas element specified by parameters, if no
+ * parameters supplied, clears entire canvas
+ * @param {Number} [x=0] x coordinate, defaults to zero if left blank
+ * @param {Number} [y=0] y coordinate, defaults to zero if left blank
+ * @param {Number} [width=0] width of area to be cleared, defaults
+ * entire width of canvas
+ * @param {Number} [height=0] height of area to be cleared, defaults
+ * entire height of canvas
+ * @returns this
+ * @example
+ *
+ * k.canvas.ninja.clear();
+ * // clears the entire ninja canvas
+ *
+ * k.canvas.ninja.clear(0, 10, 20, 30);
+ * //clears a specific portion of the ninja canvas
+ *
+ */
+ clear : function ( x, y, width, height ) {
+ var that = this;
+ that.ctx.clearRect(
+ x || 0,
+ y || 0,
+ width || that.width,
+ height || that.height
+ );
+ return that;
+ },
+
+ //These are all properties or methods of the canvas element's
+ //2 dimensional context
+ _chainingFunctions : [
+ "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap",
+ "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save",
+ "restore", "scale", "rotate", "translate", "transform", "setTransform",
+ "clearRect", "fillRect", "strokeRect", "beginPath", "closePath",
+ "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo",
+ "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText",
+ "measureText", "isPointInPath", "strokeStyle", "fillStyle",
+ "createLinearGradient", "createRadialGradient", "createPattern",
+ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor",
+ //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText",
+ "mozTextAlongPath", "drawImage", "getImageData", "putImageData",
+ "createImageData", "drawWindow"
+ ]
+};
+
+
+
+Karma._makeSvgs = function (svgConfigs){
+ var makeSvg = function (svgConfig){
+ var svg = undefined;
+ svg = Karma.create(Karma.kSvg)._init(svgConfig);
+ Karma.karma.svg[svgConfig.name] = svg;
+ };
+
+ svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);});
+
+};
+
+/** Prototypal object for each svg element submitted to Karma in the
+ * Karma() method
+ * @throws {Error} if the name and domId for the svg element are not specified
+ * @thows {Error} if the supplied domId does not match an element in the DOM
+ * @class This object is the prototype for each svg element submitted to Karma in the
+ * Karma() method
+ */
+Karma.kSvg = {
+ /** name of instance, used internally
+ * @typeof string
+ * @default ""
+ */
+ name : "",
+ /** width of element
+ * @type number
+ * @default 0
+ */
+ width: 0,
+ /** height of element
+ * @type number
+ * @default 0
+ */
+ height: 0,
+ /** Status of element, either "loaded" or "error"
+ * @type string
+ * @default ""
+ */
+ status: "",
+ /** Whether canvas is visible
+ * @type boolean
+ * @default true
+ */
+ visible: true,
+ /** Element ID for canvas element in html document
+ * @type String
+ * @default undefined
+ */
+ domId: undefined,
+ /** Reference to the DOM element
+ * @type DOMElement
+ * @default undefined
+ */
+ node: undefined,
+ /** Reference to the SVGDocument
+ * @type SVGDocument
+ * @default undefined
+ */
+ doc: undefined,
+ /** Reference to the root element of the SVG Document
+ * @type DocumentElement
+ * @default undefined
+ */
+ root: undefined,
+ _localized : undefined,
+ _chainingFunctions: [],
+ _init: function (config) {
+ Karma.karma._counters.total++;
+
+ for (var option in config){
+ if (config.hasOwnProperty(option)){
+ switch (option){
+ case "name":
+ this.name = config[option];
+ break;
+ case "domId":
+ this.domId = config[option];
+ break;
+ case "width":
+ if(!this.height){
+ throw new Error("If you specify a width you must also" +
+ "specify a height");
+ }
+ this.width = parseInt(config[option], 10);
+ break;
+ case "height":
+ if(!this.width){
+ throw new Error("If you specify a height you must also" +
+ "specify a width");
+ }
+ this.height = config[option];
+ break;
+ case "fps":
+ this.fps = config[option];
+ break;
+ }
+ }
+ }
+
+ if(this.domId && document.getElementById(this.domId)){
+ this.node = document.getElementById(this.domId);
+ } else {
+ throw new Error('you must specify a valid domId that' +
+ 'is in your html page');
+ }
+
+ if(!config.height && !config.width){
+ this.width = parseInt(this.node.getAttribute('width'), 10);
+ this.height = parseInt(this.node.getAttribute('height'), 10);
+ }
+
+ var that = this;
+ that._addEventHandlers();
+
+ return this;
+
+
+ },
+ _addEventHandlers : function () {
+ var that = this;
+ that.doc = that.node.getSVGDocument();
+ that.node.addEventListener(
+ "load",
+ function (e) {
+ that.doc = that.node.getSVGDocument();
+ that.root = that.doc.documentElement;
+ Karma.karma._counters.loaded++;
+ Karma.karma._updateStatus();
+ that.status = "loaded";
+ }, false);
+
+ that.node.addEventListener(
+ "error",
+ function (e) {
+ Karma.karma._counters.loaded--;
+ Karma.karma._counters.errors++;
+ that.status = "error";
+ var errorMsg = "Error: " + that._type.toUpperCase() +
+ " " + that.name + " cannot be loaded.";
+ Karma.karma._updateStatus(errorMsg);
+ },
+ false);
+ that.node.addEventListener(
+ "abort",
+ function (e) {
+ that.status = "aborted";
+ var errorMsg = "ABORT: " + that._type.toUpperCase() +
+ " " + that.name + " loading was aborted.";
+ Karma.karma._updateStatus(errorMsg);
+
+ }, false);
+
+ }
+};
+
+Karma._makeVideos = function (video){
+
+};
diff --git a/examples/lessons/6_Maths_variables/js/lesson.js b/examples/lessons/6_Maths_variables/js/lesson.js
new file mode 100755
index 0000000..dd84b83
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/js/lesson.js
@@ -0,0 +1,191 @@
+$(document).ready(function(){
+ var k = Karma({
+ audio: [{'name':'correct','file':'correct.wav'},
+ {'name':'incorrect','file':'incorrect.wav'}
+ ]});
+
+ k.ready(function(){
+ var i,j;
+ var totalCounter;
+ var correctCounter;
+ var currentQuestion;
+ var TOTAL_QUES = 8;
+ var flag_correct;
+ var randPositions = [];
+
+ var question1 = new Array('एउटा झोलामा x ओटा आपहरु छन ',
+ 'एउटा बिस्कुटको प्याकेटमा x ओटा बिस्कुटहरु छन',
+ 'एउटा प्याकेटमा z ओटा कलमहरु छन',
+ 'एउटा झोलामा y ओटा आपहरु छन',
+ 'एउटा डालोमा y ओटा आपहरु छन',
+ 'एउटा बिस्कुटको प्याकेटमा x ओटा बिस्कुटहरु छन',
+ 'एउटा बिस्कुटको प्याकेटमा x ओटा बिस्कुटहरु छन',
+ 'एउटा बट्टामा z ओटा कलमहरु छन'
+ );
+ var question2 = new Array('x भनेको कति हो खनाएर हेर्दा थाहा हुन्छ',
+ 'x भनेको कति हो प्याकेट खोलेर हेर्दा थाहा हुन्छ',
+ 'z भनेको कति हो प्याकेट खोलेर हेर्दा थाहा हुन्छ',
+ 'y भनेको कति हो खनाएर हेर्दा थाहा हुन्छ',
+ 'y भनेको कति हो खनाएर हेर्दा थाहा हुन्छ',
+ 'x भनेको कति हो प्याकेट खोलेर हेर्दा थाहा हुन्छ',
+ 'x भनेको कति हो प्याकेट खोलेर हेर्दा थाहा हुन्छ',
+ 'z भनेको कति हो बट्टा खोलेर हेर्दा थाहा हुन्छ'
+ );
+ var infoQues = new Array('आप खन्याउन झोलामा क्लिक गर्नुहोस',
+ 'प्याकेट खोल्न प्याकेटमा क्लिक गर्नुहोस',
+ 'प्याकेट खोल्न प्याकेटमा क्लिक गर्नुहोस',
+ 'आप खन्याउन झोलामा क्लिक गर्नुहोस',
+ 'आप खन्याउन डालोमा क्लिक गर्नुहोस',
+ 'प्याकेट खोल्न प्याकेटमा क्लिक गर्नुहोस',
+ 'प्याकेट खोल्न प्याकेटमा क्लिक गर्नुहोस',
+ 'बट्टा खोल्न बट्टामा क्लिक गर्नुहोस'
+ );
+ var infoQuesClicked = new Array('एउटा झोलामा 12 ओटा आपहरु रहेछन',
+ 'एउटा प्याकेटमा 10 ओटा बिस्कुटहरु रहेछन',
+ 'एउटा प्याकेटमा 10 ओटा कलमहरु रहेछन',
+ 'एउटा झोलामा 9 ओटा आपहरु रहेछन',
+ 'एउटा डालोमा 10 ओटा आपहरु रहेछन',
+ 'एउटा प्याकेटमा 15 ओटा बिस्कुटहरु रहेछन',
+ 'एउटा प्याकेटमा 20 ओटा बिस्कुटहरु रहेछन',
+ 'एक बट्टामा 4 ओटा कलमहरु छन'
+ );
+
+ var answers = new Array('12','10','10','9','10','15','20','4');
+
+ var scoreboard = $('#score_box').scoreboard({'layout':'horizontal',
+ 'winningScore': TOTAL_QUES});
+
+ var genRandPosition=function (){
+ randPositions[0] = k.rand(0,TOTAL_QUES-1);
+ for(i=1; i<TOTAL_QUES; i++){
+ do{
+ flag = 0;
+ randPositions[i] = k.rand(0,TOTAL_QUES-1);
+ for(j=0; j<i; j++){
+ if(randPositions[i] === randPositions[j]){
+ flag++;
+ }
+ }
+ }while(flag != 0 ); //end of do while loop
+ }
+ };
+
+ var next_question = function (){
+ currentQuestion = randPositions[totalCounter];
+ flag_correct = 1;
+ $('.bgAns').hide();
+ $('#linkCheck').hide();
+ $('.bgQues').html('<img id="img'+currentQuestion+'" src="assets/image/img'+currentQuestion+'.png" />');
+ $('#question1').addClass('quesText').html(question1[currentQuestion]+' ।');
+ $('#question2').addClass('quesText').html(question2[currentQuestion]+' ।');
+ $('.bgInfo').addClass('quesText').html(infoQues[currentQuestion]+' ।');
+
+ $('#img'+currentQuestion).click(function(){
+ $('#linkCheck').show();
+ $('.bgQues').html('<img id="img'+currentQuestion+'" src="assets/image/img'+currentQuestion+'Clicked.png" />');
+ $('.bgAns').show();
+ $('.bgAns').html('').append('<div id="ans'+currentQuestion+'" class="quesText">तेसो भए यहा x = </div>');
+ $('#ans'+currentQuestion).append('<input type="text" class="textBox" maxlength = "2" />');
+ $('#ans'+currentQuestion).append(' हुन्छ ।');
+ $('.bgInfo').addClass('quesText').html(infoQuesClicked[currentQuestion]+' ।');
+ foucs_blur();
+ });
+
+ };
+
+ function game_start(){
+ $('#gameOver').hide();
+ $('#linkCheck').show();
+ $('#section').removeClass('backOpaque');
+ genRandPosition();
+ next_question();
+ }
+
+ function game() {
+ totalCounter = 0;
+ $('#section').html('').append('<div id="left-side"></div>');
+ $('#left-side').append('<div id="topText">चलको मान पत्ता लगाउ </div>');
+ $('#left-side').append('<div class="bgQues"></div>');
+ $('#left-side').append('<div class="bgAns"></div>');
+ $('#section').append('<div id="right-side"></div>');
+ $('#right-side').append('<div id="question1" class="bgQuestion"></div>');
+ $('#right-side').append('<div id="question2" class="bgQuestion"></div>');
+ $('#right-side').append('<div class="bgInfo"></div>');
+ $('#help').hide();
+ $('.bgAns').hide();
+ $('#linkCheck').hide();
+ $('#gameOver').hide();
+ }
+
+ game();
+
+ var delay_nextQues = function(){
+ document.delayForm.delayval.value = 1;
+ next_question();
+ }
+
+ var delay_gameOver = function(){
+ document.delayForm.delayval.value = 1;
+ $('#section').addClass('backOpaque');
+ $('#linkCheck').hide();
+ $('#gameOver').show();
+
+ };
+ var check_answer = function(){
+ var textVal = $('.textBox').val();
+ if(answers[currentQuestion] === textVal){
+ if(flag_correct === 1){
+ correctCounter++;
+ scoreboard.scoreboard('inc');
+ }
+ k.audio.correct.play();
+ totalCounter++;
+ scoreboard.scoreboard('incTotal');
+ if(totalCounter != TOTAL_QUES){
+ t=setTimeout(function(){delay_nextQues();},1000);
+ }
+ else{
+ t=setTimeout(function(){delay_gameOver();},1000);
+ }
+ }
+ else{
+ flag_correct = 0;
+ k.audio.incorrect.play();
+ }
+ };
+
+ function foucs_blur(){
+ $('input[type="text"]')
+ .focus(function() {
+ $(this).removeClass('incorrect').addClass("focus");
+ })
+ .blur(function() {
+ $(this).removeClass("focus");
+ })
+ .keypress(function(event) {
+ if(event.which === 13){
+ check_answer();
+ }
+ });
+
+ $('#linkCheck').click(function(){
+ check_answer();
+ });
+ }
+
+ $('#linkStart').click(function(){
+ game_start();
+ });
+
+ $('#linkPlayAgain').click(function(){
+ scoreboard.scoreboard('reset');
+ game_start();
+ });
+ $('#linkHelp').click(function(){
+ $('#help').slideDown(2000);
+ })
+ .mouseout(function(){
+ $('#help').slideUp(2000);
+ });
+ }); //end of k.ready
+}); //end of document.ready \ No newline at end of file
diff --git a/examples/lessons/6_Maths_variables/js/ui.core.js b/examples/lessons/6_Maths_variables/js/ui.core.js
new file mode 100755
index 0000000..5493e0a
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/js/ui.core.js
@@ -0,0 +1,519 @@
+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+;jQuery.ui || (function($) {
+
+var _remove = $.fn.remove,
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+
+//Helper functions and ui object
+$.ui = {
+ version: "1.7.2",
+
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
+ plugin: {
+ add: function(module, option, set) {
+ var proto = $.ui[module].prototype;
+ for(var i in set) {
+ proto.plugins[i] = proto.plugins[i] || [];
+ proto.plugins[i].push([option, set[i]]);
+ }
+ },
+ call: function(instance, name, args) {
+ var set = instance.plugins[name];
+ if(!set || !instance.element[0].parentNode) { return; }
+
+ for (var i = 0; i < set.length; i++) {
+ if (instance.options[set[i][0]]) {
+ set[i][1].apply(instance.element, args);
+ }
+ }
+ }
+ },
+
+ contains: function(a, b) {
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
+ },
+
+ hasScroll: function(el, a) {
+
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
+ if ($(el).css('overflow') == 'hidden') { return false; }
+
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
+ has = false;
+
+ if (el[scroll] > 0) { return true; }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[scroll] = 1;
+ has = (el[scroll] > 0);
+ el[scroll] = 0;
+ return has;
+ },
+
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
+ },
+
+ isOver: function(y, x, top, left, height, width) {
+ //Determines when x, y coordinates is over "b" element
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+ },
+
+ keyCode: {
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+};
+
+// WAI-ARIA normalization
+if (isFF2) {
+ var attr = $.attr,
+ removeAttr = $.fn.removeAttr,
+ ariaNS = "http://www.w3.org/2005/07/aaa",
+ ariaState = /^aria-/,
+ ariaRole = /^wairole:/;
+
+ $.attr = function(elem, name, value) {
+ var set = value !== undefined;
+
+ return (name == 'role'
+ ? (set
+ ? attr.call(this, elem, name, "wairole:" + value)
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
+ : (ariaState.test(name)
+ ? (set
+ ? elem.setAttributeNS(ariaNS,
+ name.replace(ariaState, "aaa:"), value)
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
+ : attr.apply(this, arguments)));
+ };
+
+ $.fn.removeAttr = function(name) {
+ return (ariaState.test(name)
+ ? this.each(function() {
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
+ }) : removeAttr.call(this, name));
+ };
+}
+
+//jQuery plugins
+$.fn.extend({
+ remove: function() {
+ // Safari has a native remove event which actually removes DOM elements,
+ // so we have to use triggerHandler instead of trigger (#3037).
+ $("*", this).add(this).each(function() {
+ $(this).triggerHandler("remove");
+ });
+ return _remove.apply(this, arguments );
+ },
+
+ enableSelection: function() {
+ return this
+ .attr('unselectable', 'off')
+ .css('MozUserSelect', '')
+ .unbind('selectstart.ui');
+ },
+
+ disableSelection: function() {
+ return this
+ .attr('unselectable', 'on')
+ .css('MozUserSelect', 'none')
+ .bind('selectstart.ui', function() { return false; });
+ },
+
+ scrollParent: function() {
+ var scrollParent;
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ scrollParent = this.parents().filter(function() {
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ } else {
+ scrollParent = this.parents().filter(function() {
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ }).eq(0);
+ }
+
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+ }
+});
+
+
+//Additional selectors
+$.extend($.expr[':'], {
+ data: function(elem, i, match) {
+ return !!$.data(elem, match[3]);
+ },
+
+ focusable: function(element) {
+ var nodeName = element.nodeName.toLowerCase(),
+ tabIndex = $.attr(element, 'tabindex');
+ return (/input|select|textarea|button|object/.test(nodeName)
+ ? !element.disabled
+ : 'a' == nodeName || 'area' == nodeName
+ ? element.href || !isNaN(tabIndex)
+ : !isNaN(tabIndex))
+ // the element and all of its ancestors must be visible
+ // the browser may report that the area is hidden
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
+ },
+
+ tabbable: function(element) {
+ var tabIndex = $.attr(element, 'tabindex');
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
+ }
+});
+
+
+// $.widget is a factory to create jQuery plugins
+// taking some boilerplate code out of the plugin code
+function getter(namespace, plugin, method, args) {
+ function getMethods(type) {
+ var methods = $[namespace][plugin][type] || [];
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
+ }
+
+ var methods = getMethods('getter');
+ if (args.length == 1 && typeof args[0] == 'string') {
+ methods = methods.concat(getMethods('getterSetter'));
+ }
+ return ($.inArray(method, methods) != -1);
+}
+
+$.widget = function(name, prototype) {
+ var namespace = name.split(".")[0];
+ name = name.split(".")[1];
+
+ // create plugin method
+ $.fn[name] = function(options) {
+ var isMethodCall = (typeof options == 'string'),
+ args = Array.prototype.slice.call(arguments, 1);
+
+ // prevent calls to internal methods
+ if (isMethodCall && options.substring(0, 1) == '_') {
+ return this;
+ }
+
+ // handle getter methods
+ if (isMethodCall && getter(namespace, name, options, args)) {
+ var instance = $.data(this[0], name);
+ return (instance ? instance[options].apply(instance, args)
+ : undefined);
+ }
+
+ // handle initialization and non-getter methods
+ return this.each(function() {
+ var instance = $.data(this, name);
+
+ // constructor
+ (!instance && !isMethodCall &&
+ $.data(this, name, new $[namespace][name](this, options))._init());
+
+ // method call
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
+ instance[options].apply(instance, args));
+ });
+ };
+
+ // create widget constructor
+ $[namespace] = $[namespace] || {};
+ $[namespace][name] = function(element, options) {
+ var self = this;
+
+ this.namespace = namespace;
+ this.widgetName = name;
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
+ this.widgetBaseClass = namespace + '-' + name;
+
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
+ this.element = $(element)
+ .bind('setData.' + name, function(event, key, value) {
+ if (event.target == element) {
+ return self._setData(key, value);
+ }
+ })
+ .bind('getData.' + name, function(event, key) {
+ if (event.target == element) {
+ return self._getData(key);
+ }
+ })
+ .bind('remove', function() {
+ return self.destroy();
+ });
+ };
+
+ // add widget prototype
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
+
+ // TODO: merge getter and getterSetter properties from widget prototype
+ // and plugin prototype
+ $[namespace][name].getterSetter = 'option';
+};
+
+$.widget.prototype = {
+ _init: function() {},
+ destroy: function() {
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
+ },
+
+ option: function(key, value) {
+ var options = key,
+ self = this;
+
+ if (typeof key == "string") {
+ if (value === undefined) {
+ return this._getData(key);
+ }
+ options = {};
+ options[key] = value;
+ }
+
+ $.each(options, function(key, value) {
+ self._setData(key, value);
+ });
+ },
+ _getData: function(key) {
+ return this.options[key];
+ },
+ _setData: function(key, value) {
+ this.options[key] = value;
+
+ if (key == 'disabled') {
+ this.element
+ [value ? 'addClass' : 'removeClass'](
+ this.widgetBaseClass + '-disabled' + ' ' +
+ this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
+ }
+ },
+
+ enable: function() {
+ this._setData('disabled', false);
+ },
+ disable: function() {
+ this._setData('disabled', true);
+ },
+
+ _trigger: function(type, event, data) {
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = $.Event(event);
+ event.type = eventName;
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if (event.originalEvent) {
+ for (var i = $.event.props.length, prop; i;) {
+ prop = $.event.props[--i];
+ event[prop] = event.originalEvent[prop];
+ }
+ }
+
+ this.element.trigger(event, data);
+
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
+ }
+};
+
+$.widget.defaults = {
+ disabled: false
+};
+
+
+/** Mouse Interaction Plugin **/
+
+$.ui.mouse = {
+ _mouseInit: function() {
+ var self = this;
+
+ this.element
+ .bind('mousedown.'+this.widgetName, function(event) {
+ return self._mouseDown(event);
+ })
+ .bind('click.'+this.widgetName, function(event) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ // Prevent text selection in IE
+ if ($.browser.msie) {
+ this._mouseUnselectable = this.element.attr('unselectable');
+ this.element.attr('unselectable', 'on');
+ }
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind('.'+this.widgetName);
+
+ // Restore text selection in IE
+ ($.browser.msie
+ && this.element.attr('unselectable', this._mouseUnselectable));
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ // TODO: figure out why we have to use originalEvent
+ event.originalEvent = event.originalEvent || {};
+ if (event.originalEvent.mouseHandled) { return; }
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var self = this,
+ btnIsLeft = (event.which == 1),
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ self.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return self._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return self._mouseUp(event);
+ };
+ $(document)
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ // preventDefault() is used to prevent the selection of text here -
+ // however, in Safari, this causes select boxes not to be selectable
+ // anymore, so this fix is needed
+ ($.browser.safari || event.preventDefault());
+
+ event.originalEvent.mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.browser.msie && !event.button) {
+ return this._mouseUp(event);
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
+ this._mouseStop(event);
+ }
+
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(event) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(event) {},
+ _mouseDrag: function(event) {},
+ _mouseStop: function(event) {},
+ _mouseCapture: function(event) { return true; }
+};
+
+$.ui.mouse.defaults = {
+ cancel: null,
+ distance: 1,
+ delay: 0
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_variables/js/ui.draggable.js b/examples/lessons/6_Maths_variables/js/ui.draggable.js
new file mode 100755
index 0000000..0402f0e
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/js/ui.draggable.js
@@ -0,0 +1,766 @@
+/*
+ * jQuery UI Draggable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * ui.core.js
+ */
+(function($) {
+
+$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
+
+ _init: function() {
+
+ if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
+ this.element[0].style.position = 'relative';
+
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
+
+ this._mouseInit();
+
+ },
+
+ destroy: function() {
+ if(!this.element.data('draggable')) return;
+ this.element
+ .removeData("draggable")
+ .unbind(".draggable")
+ .removeClass("ui-draggable"
+ + " ui-draggable-dragging"
+ + " ui-draggable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+
+ var o = this.options;
+
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
+ return false;
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle)
+ return false;
+
+ return true;
+
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if($.ui.ddmanager)
+ $.ui.ddmanager.current = this;
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css("position");
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.element.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
+ if(o.cursorAt)
+ this._adjustOffsetFromHelper(o.cursorAt);
+
+ //Set a containment if given in the options
+ if(o.containment)
+ this._setContainment();
+
+ //Call plugins and callbacks
+ this._trigger("start", event);
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(this, event);
+
+ this.helper.addClass("ui-draggable-dragging");
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ this._trigger('drag', event, ui);
+ this.position = ui.position;
+ }
+
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
+ dropped = $.ui.ddmanager.drop(this, event);
+
+ //if a drop comes from outside (a sortable)
+ if(this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ var self = this;
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ self._trigger("stop", event);
+ self._clear();
+ });
+ } else {
+ this._trigger("stop", event);
+ this._clear();
+ }
+
+ return false;
+ },
+
+ _getHandle: function(event) {
+
+ var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
+ $(this.options.handle, this.element)
+ .find("*")
+ .andSelf()
+ .each(function() {
+ if(this == event.target) handle = true;
+ });
+
+ return handle;
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options;
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
+
+ if(!helper.parents('body').length)
+ helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
+
+ if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
+ helper.css("position", "absolute");
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
+ if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
+ if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
+ po = { top: 0, left: 0 };
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition == "relative") {
+ var p = this.element.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
+ top: (parseInt(this.element.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var o = this.options;
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
+ ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+
+ if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
+ var ce = $(o.containment)[0]; if(!ce) return;
+ var co = $(o.containment).offset();
+ var over = ($(ce).css("overflow") != 'hidden');
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ } else if(o.containment.constructor == Array) {
+ this.containment = o.containment;
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) pos = this.position;
+ var mod = d == "absolute" ? 1 : -1;
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top // The absolute mouse position
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left // The absolute mouse position
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ var pageX = event.pageX;
+ var pageY = event.pageY;
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
+ if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
+ if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
+ }
+
+ if(o.grid) {
+ var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY // The absolute mouse position
+ - this.offset.click.top // Click offset (relative to the element)
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX // The absolute mouse position
+ - this.offset.click.left // Click offset (relative to the element)
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
+ //if($.ui.ddmanager) $.ui.ddmanager.current = null;
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function(type, event, ui) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call(this, type, [event, ui]);
+ if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
+ return $.widget.prototype._trigger.call(this, type, event, ui);
+ },
+
+ plugins: {},
+
+ _uiHash: function(event) {
+ return {
+ helper: this.helper,
+ position: this.position,
+ absolutePosition: this.positionAbs, //deprecated
+ offset: this.positionAbs
+ };
+ }
+
+}));
+
+$.extend($.ui.draggable, {
+ version: "1.7.2",
+ eventPrefix: "drag",
+ defaults: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input,option",
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ delay: 0,
+ distance: 1,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false
+ }
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+ start: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options,
+ uiSortable = $.extend({}, ui, { item: inst.element });
+ inst.sortables = [];
+ $(o.connectToSortable).each(function() {
+ var sortable = $.data(this, 'sortable');
+ if (sortable && !sortable.options.disabled) {
+ inst.sortables.push({
+ instance: sortable,
+ shouldRevert: sortable.options.revert
+ });
+ sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+
+ },
+ stop: function(event, ui) {
+
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+ var inst = $(this).data("draggable"),
+ uiSortable = $.extend({}, ui, { item: inst.element });
+
+ $.each(inst.sortables, function() {
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
+ if(this.shouldRevert) this.instance.options.revert = true;
+
+ //Trigger the stop of the sortable
+ this.instance._mouseStop(event);
+
+ this.instance.options.helper = this.instance.options._helper;
+
+ //If the helper has been the original item, restore properties in the sortable
+ if(inst.options.helper == 'original')
+ this.instance.currentItem.css({ top: 'auto', left: 'auto' });
+
+ } else {
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ this.instance._trigger("deactivate", event, uiSortable);
+ }
+
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), self = this;
+
+ var checkPos = function(o) {
+ var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
+ var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
+ var itemHeight = o.height, itemWidth = o.width;
+ var itemTop = o.top, itemLeft = o.left;
+
+ return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
+ };
+
+ $.each(inst.sortables, function(i) {
+
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
+ this.instance.positionAbs = inst.positionAbs;
+ this.instance.helperProportions = inst.helperProportions;
+ this.instance.offset.click = inst.offset.click;
+
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
+
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+ if(!this.instance.isOver) {
+
+ this.instance.isOver = 1;
+ //Now we fake the start of dragging for the sortable instance,
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+ this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+ this.instance.options.helper = function() { return ui.helper[0]; };
+
+ event.target = this.instance.currentItem[0];
+ this.instance._mouseCapture(event, true);
+ this.instance._mouseStart(event, true, true);
+
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+ this.instance.offset.click.top = inst.offset.click.top;
+ this.instance.offset.click.left = inst.offset.click.left;
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+ inst._trigger("toSortable", event);
+ inst.dropped = this.instance.element; //draggable revert needs that
+ //hack so receive/update callbacks work (mostly)
+ inst.currentItem = inst.element;
+ this.instance.fromOutside = inst;
+
+ }
+
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+ if(this.instance.currentItem) this.instance._mouseDrag(event);
+
+ } else {
+
+ //If it doesn't intersect with the sortable, and it intersected before,
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+ if(this.instance.isOver) {
+
+ this.instance.isOver = 0;
+ this.instance.cancelHelperRemoval = true;
+
+ //Prevent reverting on this forced stop
+ this.instance.options.revert = false;
+
+ // The out event needs to be triggered independently
+ this.instance._trigger('out', event, this.instance._uiHash(this.instance));
+
+ this.instance._mouseStop(event, true);
+ this.instance.options.helper = this.instance.options._helper;
+
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+ this.instance.currentItem.remove();
+ if(this.instance.placeholder) this.instance.placeholder.remove();
+
+ inst._trigger("fromSortable", event);
+ inst.dropped = false; //draggable revert needs that
+ }
+
+ };
+
+ });
+
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function(event, ui) {
+ var t = $('body'), o = $(this).data('draggable').options;
+ if (t.css("cursor")) o._cursor = t.css("cursor");
+ t.css("cursor", o.cursor);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if (o._cursor) $('body').css("cursor", o._cursor);
+ }
+});
+
+$.ui.plugin.add("draggable", "iframeFix", {
+ start: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+ $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
+ .css({
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+ position: "absolute", opacity: "0.001", zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo("body");
+ });
+ },
+ stop: function(event, ui) {
+ $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data('draggable').options;
+ if(t.css("opacity")) o._opacity = t.css("opacity");
+ t.css('opacity', o.opacity);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data('draggable').options;
+ if(o._opacity) $(ui.helper).css('opacity', o._opacity);
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function(event, ui) {
+ var i = $(this).data("draggable");
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
+ },
+ drag: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options, scrolled = false;
+
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
+
+ if(!o.axis || o.axis != 'x') {
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+ else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+ else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(!o.axis || o.axis != 'x') {
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+
+ if(!o.axis || o.axis != 'y') {
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+ $.ui.ddmanager.prepareOffsets(i, event);
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function(event, ui) {
+
+ var i = $(this).data("draggable"), o = i.options;
+ i.snapElements = [];
+
+ $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
+ var $t = $(this); var $o = $t.offset();
+ if(this != i.element[0]) i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ });
+
+ },
+ drag: function(event, ui) {
+
+ var inst = $(this).data("draggable"), o = inst.options;
+ var d = o.snapTolerance;
+
+ var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (var i = inst.snapElements.length - 1; i >= 0; i--){
+
+ var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
+ t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
+
+ //Yes, I know, this is insane ;)
+ if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
+ if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if(o.snapMode != 'inner') {
+ var ts = Math.abs(t - y2) <= d;
+ var bs = Math.abs(b - y1) <= d;
+ var ls = Math.abs(l - x2) <= d;
+ var rs = Math.abs(r - x1) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+ }
+
+ var first = (ts || bs || ls || rs);
+
+ if(o.snapMode != 'outer') {
+ var ts = Math.abs(t - y1) <= d;
+ var bs = Math.abs(b - y2) <= d;
+ var ls = Math.abs(l - x1) <= d;
+ var rs = Math.abs(r - x2) <= d;
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+ }
+
+ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ };
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function(event, ui) {
+
+ var o = $(this).data("draggable").options;
+
+ var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
+ return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
+ });
+
+ $(group).each(function(i) {
+ this.style.zIndex = o.stack.min + i;
+ });
+
+ this[0].style.zIndex = o.stack.min + group.length;
+
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function(event, ui) {
+ var t = $(ui.helper), o = $(this).data("draggable").options;
+ if(t.css("zIndex")) o._zIndex = t.css("zIndex");
+ t.css('zIndex', o.zIndex);
+ },
+ stop: function(event, ui) {
+ var o = $(this).data("draggable").options;
+ if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
+ }
+});
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_variables/js/ui.droppable.js b/examples/lessons/6_Maths_variables/js/ui.droppable.js
new file mode 100755
index 0000000..8e7be33
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/js/ui.droppable.js
@@ -0,0 +1,282 @@
+/*
+ * jQuery UI Droppable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * ui.core.js
+ * ui.draggable.js
+ */
+(function($) {
+
+$.widget("ui.droppable", {
+
+ _init: function() {
+
+ var o = this.options, accept = o.accept;
+ this.isover = 0; this.isout = 1;
+
+ this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
+ return d.is(accept);
+ };
+
+ //Store the droppable's proportions
+ this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
+
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
+ $.ui.ddmanager.droppables[this.options.scope].push(this);
+
+ (this.options.addClasses && this.element.addClass("ui-droppable"));
+
+ },
+
+ destroy: function() {
+ var drop = $.ui.ddmanager.droppables[this.options.scope];
+ for ( var i = 0; i < drop.length; i++ )
+ if ( drop[i] == this )
+ drop.splice(i, 1);
+
+ this.element
+ .removeClass("ui-droppable ui-droppable-disabled")
+ .removeData("droppable")
+ .unbind(".droppable");
+ },
+
+ _setData: function(key, value) {
+
+ if(key == 'accept') {
+ this.options.accept = value && $.isFunction(value) ? value : function(d) {
+ return d.is(value);
+ };
+ } else {
+ $.widget.prototype._setData.apply(this, arguments);
+ }
+
+ },
+
+ _activate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.addClass(this.options.activeClass);
+ (draggable && this._trigger('activate', event, this.ui(draggable)));
+ },
+
+ _deactivate: function(event) {
+ var draggable = $.ui.ddmanager.current;
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ (draggable && this._trigger('deactivate', event, this.ui(draggable)));
+ },
+
+ _over: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
+ this._trigger('over', event, this.ui(draggable));
+ }
+
+ },
+
+ _out: function(event) {
+
+ var draggable = $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
+
+ if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('out', event, this.ui(draggable));
+ }
+
+ },
+
+ _drop: function(event,custom) {
+
+ var draggable = custom || $.ui.ddmanager.current;
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
+
+ var childrenIntersection = false;
+ this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
+ var inst = $.data(this, 'droppable');
+ if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
+ childrenIntersection = true; return false;
+ }
+ });
+ if(childrenIntersection) return false;
+
+ if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
+ this._trigger('drop', event, this.ui(draggable));
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function(c) {
+ return {
+ draggable: (c.currentItem || c.element),
+ helper: c.helper,
+ position: c.position,
+ absolutePosition: c.positionAbs, //deprecated
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.extend($.ui.droppable, {
+ version: "1.7.2",
+ eventPrefix: 'drop',
+ defaults: {
+ accept: '*',
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: 'default',
+ tolerance: 'intersect'
+ }
+});
+
+$.ui.intersect = function(draggable, droppable, toleranceMode) {
+
+ if (!droppable.offset) return false;
+
+ var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
+ y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
+ var l = droppable.offset.left, r = l + droppable.proportions.width,
+ t = droppable.offset.top, b = t + droppable.proportions.height;
+
+ switch (toleranceMode) {
+ case 'fit':
+ return (l < x1 && x2 < r
+ && t < y1 && y2 < b);
+ break;
+ case 'intersect':
+ return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
+ && x2 - (draggable.helperProportions.width / 2) < r // Left Half
+ && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
+ && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
+ break;
+ case 'pointer':
+ var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
+ isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
+ return isOver;
+ break;
+ case 'touch':
+ return (
+ (y1 >= t && y1 <= b) || // Top edge touching
+ (y2 >= t && y2 <= b) || // Bottom edge touching
+ (y1 < t && y2 > b) // Surrounded vertically
+ ) && (
+ (x1 >= l && x1 <= r) || // Left edge touching
+ (x2 >= l && x2 <= r) || // Right edge touching
+ (x1 < l && x2 > r) // Surrounded horizontally
+ );
+ break;
+ default:
+ return false;
+ break;
+ }
+
+};
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { 'default': [] },
+ prepareOffsets: function(t, event) {
+
+ var m = $.ui.ddmanager.droppables[t.options.scope];
+ var type = event ? event.type : null; // workaround for #2317
+ var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
+
+ droppablesLoop: for (var i = 0; i < m.length; i++) {
+
+ if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
+ for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
+ m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
+
+ m[i].offset = m[i].element.offset();
+ m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
+
+ if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
+
+ }
+
+ },
+ drop: function(draggable, event) {
+
+ var dropped = false;
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(!this.options) return;
+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
+ dropped = this._drop.call(this, event);
+
+ if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
+ this.isout = 1; this.isover = 0;
+ this._deactivate.call(this, event);
+ }
+
+ });
+ return dropped;
+
+ },
+ drag: function(draggable, event) {
+
+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
+
+ //Run through all droppables and check their positions based on specific tolerance options
+
+ $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+
+ if(this.options.disabled || this.greedyChild || !this.visible) return;
+ var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
+
+ var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
+ if(!c) return;
+
+ var parentInstance;
+ if (this.options.greedy) {
+ var parent = this.element.parents(':data(droppable):eq(0)');
+ if (parent.length) {
+ parentInstance = $.data(parent[0], 'droppable');
+ parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
+ }
+ }
+
+ // we just moved into a greedy child
+ if (parentInstance && c == 'isover') {
+ parentInstance['isover'] = 0;
+ parentInstance['isout'] = 1;
+ parentInstance._out.call(parentInstance, event);
+ }
+
+ this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
+ this[c == "isover" ? "_over" : "_out"].call(this, event);
+
+ // we just moved out of a greedy child
+ if (parentInstance && c == 'isout') {
+ parentInstance['isout'] = 0;
+ parentInstance['isover'] = 1;
+ parentInstance._over.call(parentInstance, event);
+ }
+ });
+
+ }
+};
+
+})(jQuery);
diff --git a/examples/lessons/6_Maths_variables/js/ui.scoreboard.js b/examples/lessons/6_Maths_variables/js/ui.scoreboard.js
new file mode 100755
index 0000000..53a930a
--- /dev/null
+++ b/examples/lessons/6_Maths_variables/js/ui.scoreboard.js
@@ -0,0 +1,107 @@
+(function($){
+ $.widget('ui.scoreboard',
+ {
+ getScore : function(){
+ return this._getData('score');
+ },
+ setScore : function(newScore){
+ this._setData('score', parseInt(newScore));
+ this._refresh();
+ },
+ getTotal : function(){
+ return this._getData('total');
+ },
+ setTotal : function(newTotal){
+ this._setData('total', parseInt(newTotal));
+ this._refresh();
+ },
+ reset : function(){
+ this._setData('score', this._getData('initialScore'));
+ this._setData('total', this._getData('initialTotal'));
+ this._refresh();
+ },
+ inc : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') + incVal);
+ this._refresh();
+ if(this._getData('winScore') === this._getData('score')){
+ this.element.trigger('winGame');
+ }
+ },
+ incTotal : function(val){
+ var incVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') + incVal);
+ this._refresh();
+ },
+ dec : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('score', this._getData('score') - decVal);
+ this._refresh();
+ },
+ decTotal : function(val){
+ var decVal = parseInt(val) || 1;
+ this._setData('total', this._getData('total') - decVal);
+ this._refresh();
+ },
+ _init : function(){
+
+ var divDisplay = "inline";
+ var score = this.options.score;
+ var total = this.options.total;
+ var layoutId = "h";
+ var self = this;
+
+
+ this._setData('initialScore', parseInt(this.options.score));
+ this._setData('initialTotal', parseInt(this.options.total));
+ this._setData('score', parseInt(this.options.score));
+ this._setData('total', parseInt(this.options.total));
+ this._setData('winScore', parseInt(this.options.winningScore) || 0);
+
+ if(this.options.layout === "vertical"){
+ layoutId = "v";
+ }
+
+ this.evWinGame = document.createEvent('Events');
+
+ this.element.addClass('ui-scoreboard-container-' + layoutId +
+ ' ui-widget ui-widget-content ui-corner-all');
+
+ var clone = $('<div>')
+ .addClass('ui-scoreboard-spacing-' + layoutId);
+ this._scoreText = $("<div>Score</div>")
+ .addClass('ui-scoreboard-spacing-'+ layoutId +
+ ' ui-corner-all ui-scoreboard-text')
+ .appendTo(this.element);
+ this._score = $("<div>" + score + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ $("<div>Total</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-corner-all ' +
+ 'ui-scoreboard-text')
+ .appendTo(this.element);
+ this._total = $("<div>" + total + "</div>")
+ .addClass('ui-scoreboard-spacing-' + layoutId +
+ ' ui-scoreboard-number-' + layoutId)
+ .appendTo(this.element);
+ },
+ _refresh : function(){
+ this._score.text(this._getData('score'));
+ this._total.text(this._getData('total'));
+ },
+ destroy : function(){
+ this.element.remove();
+ $.widget.prototype.destroy.apply(this, arguments);
+ }
+
+
+ });
+
+ $.ui.scoreboard.getter = ['getScore', 'getTotal'];
+ $.ui.scoreboard.defaults = {
+ score: 0, total: 0, layout: "horizontal", winningScore: 0
+ };
+
+ })(jQuery); \ No newline at end of file