var presentation = ["AN INTRODUCTION TO THE HISTORY OF SCIENCE, BY WALTER LIBBY<\/phrase>","CHAPTER I\nSCIENCE AND PRACTICAL NEEDS--EGYPT AND BABYLONIA<\/phrase>","If you consult encyclopedias and special works in reference to the early\nhistory of any one of the sciences,--astronomy, geology, geometry,\nphysiology, logic, or political science, for example,--you will find\nstrongly emphasized the part played by the Greeks in the development of\norganized knowledge. Great, indeed, as we shall see in the next chapter,\nare the contributions to the growth of science of this highly rational\nand speculative people. It must be conceded, also, that the influence on\nWestern science of civilizations earlier than theirs has come to us, to\na considerable extent at least, through the channels of Greek\nliterature.<\/phrase>","Nevertheless, if you seek the very origins of the sciences, you will\ninevitably be drawn to the banks of the Nile, and to the valleys of the\nTigris and the Euphrates. Here, in Egypt, in Assyria and Babylonia,\ndwelt from very remote times nations whose genius was practical and\nreligious rather than intellectual and theoretical, and whose mental\nlife, therefore, was more akin to our own than was the highly evolved\nculture of the Greeks. Though more remote in time, the wisdom and\npractical knowledge of Thebes and Memphis, Nineveh and Babylon, are more\nreadily comprehended by our minds than the difficult speculations of\nAthenian philosophy.<\/phrase>","Much that we have inherited from the earliest civilizations is so\nfamiliar, so homely, that we simply accept it, much as we may light, or\nair, or water, without analysis, without inquiry as to its origin, and\nwithout full recognition of how indispensable it is. Why are there seven\ndays in the week, and not eight? Why are there sixty minutes in the\nhour, and why are there not sixty hours in the day? These artificial\ndivisions of time are accepted so unquestioningly that to ask a reason\nfor them may, to an indolent mind, seem almost absurd. This acceptance\nof a week of seven days and of an hour of sixty minutes (almost as if\nthey were natural divisions of time like day and night) is owing to a\ntradition that is Babylonian in its origin. From the Old Testament\n(which is one of the greatest factors in preserving the continuity of\nhuman culture, and the only ancient book which speaks with authority\nconcerning Babylonian history) we learn that Abraham, the progenitor of\nthe Hebrews, migrated to the west from southern Babylonia about\ntwenty-three hundred years before Christ. Even in that remote age,\nhowever, the Babylonians had established those divisions of time which\nare familiar to us. The seven days of the week were closely associated\nin men's thinking with the heavenly bodies. In our modern languages they\nare named after the sun, the moon, Mars, Mercury, Jupiter, Venus, and\nSaturn, which from the remotest times were personified and worshiped.\nThus we see that the usage of making seven days a unit of time depends\non the religious belief and astronomical science of a very remote\ncivilization. The usage is so completely established that by the\nmajority it is simply taken for granted.<\/phrase>",null,"It is well known that geometry had its origin in the valley of the Nile,\nthat it arose to meet a practical need, and that it was in the first\nplace, as its name implies, a measurement of the earth--a crude\nsurveying, employed in the restoration of boundaries obliterated by the\nannual inundations of the river. Egyptian geometry cared little for\ntheory. It addressed itself to actual problems, such as determining the\narea of a square or triangular field from the length of the sides. To\nfind the area of a circular field, or floor, or vessel, from the length\nof the diameter was rather beyond the science of 2000 B.C. This was,\nhowever, a practical problem which had to be solved, even if the\nsolution were not perfect. The practice was to square the diameter\nreduced by one ninth.<\/phrase>","In all the Egyptian mathematics of which we have record there is to be\nobserved a similar practical bent. In the construction of a temple or a\npyramid not merely was it necessary to have regard to the points of the\ncompass, but care must be taken to have the sides at right angles. This\nrequired the intervention of specialists, expert \"rope-fasteners,\" who\nlaid off a triangle by means of a rope divided into three parts, of\nthree, four, and five units. The Babylonians followed much the same\npractice in fixing a right angle. In addition they learned how to bisect\nand trisect the angle. Hence we see in their designs and ornaments the\ndivision of the circle into twelve parts, a division which does not\nappear in Egyptian ornamentation till after the incursion of Babylonian\ninfluence.<\/phrase>","There is no need, however, to multiply examples; the tendency of all\nEgyptian mathematics was, as already stated, concerned with the\npractical solution of concrete problems--mensuration, the cubical\ncontents of barns and granaries, the distribution of bread, the amounts\nof food required by men and animals in given numbers and for given\nperiods of time, the proportions and the angle of elevation (about 52\u00b0)\nof a pyramid, etc. Moreover, they worked simple equations involving one\nunknown, and had a hieroglyph for a million (the drawing of a man\novercome with wonder), and another for ten million.<\/phrase>","The Rhind mathematical papyrus in the British Museum is the main source\nof our present knowledge of early Egyptian arithmetic, geometry, and of\nwhat might be called their trigonometry and algebra. It describes itself\nas \"Instructions for arriving at the knowledge of all things, and of\nthings obscure, and of all mysteries.\" It was copied by a priest about\n1600 B.C.--the classical period of Egyptian culture--from a document\nseven hundred years older.<\/phrase>","[Illustration: EARLIEST PICTURE KNOWN OF A SURGICAL OPERATION. EGYPT,\n2500 B.C.]<\/phrase>","Medicine, which is almost certain to develop in the early history of a\npeople in response to their urgent needs, has been justly called the\nfoster-mother of many sciences. In the records of Egyptian medical\npractice can be traced the origin of chemistry, anatomy, physiology, and\nbotany. Our most definite information concerning Egyptian medicine\nbelongs to the same general period as the mathematical document to which\nwe have just referred. It is true something is known of remoter times.\nThe first physician of whom history has preserved the name, I-em-hetep\n(He-who-cometh-in-peace), lived about 4500 B.C. Recent researches have\nalso brought to light, near Memphis, pictures, not later than 2500 B.C.,\nof surgical operations. They were found sculptured on the doorposts at\nthe entrance to the tomb of a high official of one of the Pharaohs. The\npatients, as shown in the accompanying illustration, are suffering pain,\nand, according to the inscription, one cries out, \"Do this [and] let me\ngo,\" and the other, \"Don't hurt me so!\" Our most satisfactory data in\nreference to Egyptian medicine are derived, however, from the Ebers\npapyrus. This document displays some little knowledge of the pulse in\ndifferent parts of the body, of a relation between the heart and the\nother organs, and of the passage of the breath to the lungs (and heart).\nIt contains a list of diseases. In the main it is a collection of\nprescriptions for the eyes, ears, stomach, to reduce tumors, effect\npurgation, etc. There is no evidence of a tendency to homeopathy, but\nmental healing seems to have been called into play by the use of\nnumerous spells and incantations. Each prescription, as in medical\npractice to-day, contains as a rule several ingredients. Among the seven\nhundred recognized remedies are to be noted poppy, castor-oil, gentian,\ncolchicum, squills, and many other familiar medicinal plants, as well as\nbicarbonate of soda, antimony, and salts of lead and copper. The fat of\nthe lion, hippopotamus, crocodile, goose, serpent, and wild goat, in\nequal parts, served as a prescription for baldness. In the interests of\nhis art the medical practitioner ransacked the resources of organic and\ninorganic nature. The Ebers papyrus shows that the Egyptians knew of the\ndevelopment of the beetle from the egg, of the blow-fly from the larva,\nand of the frog from the tadpole. Moreover, for precision in the use of\nmedicaments weights of very small denominations were employed.<\/phrase>","The Egyptian embalmers relied on the preservative properties of common\nsalt, wine, aromatics, myrrh, cassia, etc. By the use of linen smeared\nwith gum they excluded all putrefactive agencies. They understood the\nvirtue of extreme dryness in the exercise of their antiseptic art. Some\nknowledge of anatomy was involved in the removal of the viscera, and\nmuch more in a particular method they followed in removing the brain.<\/phrase>","In their various industries the Egyptians made use of gold, silver,\nbronze (which on analysis is found to consist of copper, tin, and a\ntrace of lead, etc.), metallic iron and copper and their oxides,\nmanganese, cobalt, alum, cinnabar, indigo, madder, brass, white lead,\nlampblack. There is clear evidence that they smelted iron ore as early\nas 3400 B.C. maintaining a blast by means of leather tread-bellows. They\nalso contrived to temper the metal, and to make helmets, swords,\nlance-points, ploughs, tools, and other implements of iron. Besides\nmetallurgy they practiced the arts of weaving, dyeing, distillation.\nThey produced soap (from soda and oil), transparent and colored glass,\nenamel, and ceramics. They were skilled in the preparation of leather.\nThey showed aptitude for painting, and for the other fine arts. They\nwere expert builders, and possessed the engineering skill to erect\nobelisks weighing hundreds of tons. They cultivated numerous vegetables,\ngrains, fruits, and flowers. They had many domestic animals. In seeking\nthe satisfaction of their practical needs they laid the foundation of\ngeometry, botany, chemistry (named, as some think, from the Egyptian\nKhem, the god of medicinal herbs), and other sciences. But their\npractical achievements far transcended their theoretical formulations.\nTo all time they will be known as an artistic, noble, and religious\npeople, who cherished their dead and would not allow that the good and\nbeautiful and great should altogether pass away.<\/phrase>","Excavations in Assyria and Babylonia, especially since 1843, have\nbrought to our knowledge an ancient culture stretching back four or five\nthousand years before the beginning of the Christian era. The records of\nAssyria and Babylonia, like those of Egypt, are fragmentary and still in\nneed of interpretation. Here again, however, it is the fundamental, the\nindispensable, the practical forms of knowledge that stand revealed\nrather than the theoretical, speculative, and purely intellectual.<\/phrase>","By the Babylonian priests the heavens were made the object of expert\nobservation as early as 3800 B.C. The length of the year, the length of\nthe month, the coming of the seasons, the course of the sun in the\nheavens, the movements of the planets, the recurrence of eclipses,\ncomets, and meteors, were studied with particular care. One motive was\nthe need of a measurement of time, the same motive as underlies the\ncommon interest in the calendar and almanac. It was found that the year\ncontained more than 365 days, the month (synodic) more than 29 days, 12\nhours, and 44 minutes. The sun's apparent diameter was contained 720\ntimes in the ecliptic, that is, in the apparent path of the sun through\nthe heavens. Like the Egyptians, the Babylonians took special note of\nthe stars and star-groups that were to be seen at dawn at different\ntimes of the year. These constellations, lying in the imaginary\nbelt encircling the heavens on either side of the ecliptic, bore\nnames corresponding to those we have adopted for the signs of the\nzodiac,--Balance, Ram, Bull, Twins, Scorpion, Archer, etc. The\nBabylonian astronomers also observed that the successive vernal (or\nautumnal) equinoxes follow each other at intervals of a few seconds\nless than a year.<\/phrase>","A second motive that influenced the Babylonian priests in studying the\nmovements of the heavenly bodies was the hope of foretelling events. The\nplanets, seen to shift their positions with reference to the other\nheavenly bodies, were called messengers, or angels. The appearance of\nMars, perhaps on account of its reddish color, was associated in their\nimaginations with war. Comets, meteors, and eclipses were considered as\nomens portending pestilence, national disaster, or the fate of kings.\nThe fortunes of individuals could be predicted from a knowledge of the\naspect of the heavens at the hour of their birth. This interest in\nastrology, or divination by means of the stars, no doubt stimulated the\npriests to make careful observations and to preserve religiously the\nrecord of astronomical phenomena. It was even established that there is\na cycle in which eclipses, solar and lunar, repeat themselves, a period\n(_saros_) somewhat more than eighteen years and eleven months. Moreover,\nfrom the Babylonians we derive some of our most sublime religious and\nscientific conceptions. They held that strict law governs the apparently\nerratic movements of the heavenly bodies. Their creation myth proclaims:\n\"Merodach next arranged the stars in order, along with the sun and moon,\nand gave them laws which they were never to transgress.\"<\/phrase>","The mathematical knowledge of the Babylonians is related on the one hand\nto their astronomy and on the other to their commercial pursuits. They\npossessed highly developed systems of measuring, weighing, and\ncounting--processes, which, as we shall see in the sequel, are essential\nto scientific thought. About 2300 B.C. they had multiplication tables\nrunning from 1 to 1350, which were probably used in connection with\nastronomical calculations. Unlike the Egyptians they had no symbol for a\nmillion, though the \"ten thousand times ten thousand\" of the Bible\n(Daniel VII: 10) may indicate that the conception of even larger numbers\nwas not altogether foreign to them. They counted in sixties as well as\nin tens. Their hours and minutes had each sixty subdivisions. They\ndivided the circle into six parts and into six-times-sixty subdivisions.\nTables of squares and cubes discovered in southern Babylonia were\ninterpreted correctly only on a sexagesimal basis, the statement that 1\nplus 4 is the square of 8 implying that the first unit is 60. As we have\nalready seen, considerable knowledge of geometry is apparent in\nBabylonian designs and constructions.<\/phrase>","According to a Greek historian of the fifth century B.C., there were no\nphysicians at Babylon, while a later Greek historian (of the first\ncentury B.C.) speaks of a Babylonian university which had attained\ncelebrity, and which is now believed to have been a school of medicine.\nModern research has made known letters by a physician addressed to an\nAssyrian king in the seventh century B.C. referring to the king's chief\nphysician, giving directions for the treatment of a bleeding from the\nnose from which a friend of the prince was suffering, and reporting the\nprobable recovery of a poor fellow whose eyes were diseased. Other\nletters from the same general period mention the presence of physicians\nat court. We have even recovered the name (Ilu-bani) of a physician who\nlived in southern Babylonia about 2700 B.C. The most interesting\ninformation, however, in reference to Babylonian medicine dates from the\ntime of Hammurabi, a contemporary of the patriarch Abraham. It appears\nfrom the code drawn up in the reign of that monarch that the Babylonian\nsurgeons operated in case of cataract; that they were entitled to twenty\nsilver shekels (half the sum for which Joseph was sold into slavery, and\nequivalent to seven or eight dollars) for a successful operation; and\nthat in case the patient lost his life or his sight as the result of an\nunsuccessful operation, the surgeon was condemned to have his hands\namputated.<\/phrase>","The Babylonian records of medicine like those of astronomy reveal the\nprevalence of many superstitious beliefs. The spirits of evil bring\nmaladies upon us; the gods heal the diseases that afflict us. The\nBabylonian books of medicine contained strange interminglings of\nprescription and incantation. The priests studied the livers of\nsacrificial animals in order to divine the thoughts of the gods--a\npractice which stimulated the study of anatomy. The maintenance of state\nmenageries no doubt had a similar influence on the study of the natural\nhistory of animals.<\/phrase>","The Babylonians were a nation of agriculturists and merchants. Sargon of\nAkkad, who founded the first Semitic empire in Asia (3800 B.C.), was\nbrought up by an irrigator, and was himself a gardener. Belshazzar, the\nson of the last Babylonian king, dealt in wool on a considerable scale.\nExcavation in the land watered by the Tigris and Euphrates tells the\ntale of the money-lenders, importers, dyers, fullers, tanners,\nsaddlers, smiths, carpenters, shoemakers, stonecutters, ivory-cutters,\nbrickmakers, porcelain-makers, potters, vintners, sailors, butchers,\nengineers, architects, painters, sculptors, musicians, dealers in rugs,\nclothing and fabrics, who contributed to the culture of this great\nhistoric people. It is not surprising that science should find its\nmatrix in so rich a civilization.<\/phrase>","The lever and the pulley, lathes, picks, saws, hammers, bronze\noperating-lances, sundials, water-clocks, the gnomon (a vertical pillar\nfor determining the sun's altitude) were in use. Gem-cutting was highly\ndeveloped as early as 3800 B.C. The Babylonians made use of copper\nhardened with antimony and tin, lead, incised shells, glass, alabaster,\nlapis-lazuli, silver, and gold. Iron was not employed before the period\nof contact with Egyptian civilization. Their buildings were furnished\nwith systems of drains and flushes that seem to us altogether modern.\nOur museums are enriched by specimens of their handicraft--realistic\nstatuary in dolerite of 2700 B.C.; rock crystal worked to the form of a\nplano-convex lens, 3800 B.C.; a beautiful silver vase of the period 3950\nB.C.; and the head of a goat in copper about 4000 B.C.<\/phrase>","Excavation has not disclosed nor scholarship interpreted the full record\nof this ancient people in the valley of the Tigris and the Euphrates,\nnot far from the Gulf of Persia, superior in religious inspiration, not\ninferior in practical achievements to the Egyptians. Both these great\nnations of antiquity, however, failed to carry the sciences that arose\nin connection with their arts to a high degree of generalization. That\nwas reserved for another people of ancient times, namely, the Greeks.<\/phrase>","REFERENCES<\/phrase>","F. H. Garrison, _An Introduction to the History of Medicine_.<\/phrase>","H. V. Hilprecht, _Excavations in Assyria and Babylonia_.<\/phrase>","Max Neuburger, _History of Medicine_.<\/phrase>","A. H. Sayce, _Babylonians and Assyrians_.<\/phrase>"]; var currentPosition = 0; var totalPositions = 0; var timePerWord = 1500; var timePerPhraseWord = 120 var readAheadPlayerTimer; var autoPlay = true; var setMinimized = false; var wordSpeedOptions = {'Slower':2000,'Moderate':1200,'Fast':800}; var phraseSpeedOptions = {'Slower':280,'Moderate':200,'Fast':80}; var defaultWordSpeedOption = 'Moderate'; var defaultPhraseSpeedOption = 'Moderate'; var logToLTI = false; $(window).load(function(){ totalPositions = presentation.length; if (totalPositions > 0){ $('body').prepend('
'); $('body').prepend('
'); $('#read_ahead_player').prepend('
'); initializeReadAheadControls(); initializeReadAheadSlider(); initializeReadAheadSpeedOptions(); currentReadAheadControls(); resumeReadAheadPlayback(); } }); $(document).keyup(function(e){ switch(e.which) { case 37: pauseReadAheadPresentation(); priorReadAheadPresentationItem(); break; case 39: pauseReadAheadPresentation(); nextReadAheadPresentationItem(); break; default: break; } }); function initializeReadAheadControls(){ var s = ''; s += ''; s += ''; s += ''; s += '
'; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += '
'; $('#read_ahead_player').append(s); } function initializeReadAheadSlider(){ var s = ''; s += '
'; s += '
'; s += '
'; $('#read_ahead_controls').prepend(s); updateReadAheadSliderPosition(); } function initializeReadAheadSpeedOptions(){ var s = '
'; s += '
'; s += ' Word Speed
'; s += '
'; optionCount = 0; for (index in wordSpeedOptions) { optionCount++; } optionWidth = 100 / optionCount; for (index in wordSpeedOptions) { var option = wordSpeedOptions[index]; if (index == defaultWordSpeedOption) { s += ''; updateReadAheadWordSpeed(option); } else { s += ''; } } s += '
'; s += '
'; s += '
'; s += ' Phrase Speed
'; s += '
'; optionCount = 0; for (index in phraseSpeedOptions) { optionCount++; } optionWidth = 100 / optionCount; for (index in phraseSpeedOptions) { var option = phraseSpeedOptions[index]; if (index == defaultWordSpeedOption) { s += ''; updateReadAheadPhraseSpeed(option); } else { s += ''; } } s += '
'; s += '
'; s += '
'; $('#read_ahead_controls').append(s); } function updateReadAheadWordSpeed(microseconds,sender) { microseconds = microseconds != undefined && microseconds > 0 ? microseconds : 0; if (microseconds > 0) { timePerWord = microseconds; } if (sender!=undefined) { $('#slider_control_word_speed').find('a').removeClass('current_speed'); $(sender).addClass('current_speed'); } logReadAheadPlayerAction('updateReadAheadWordSpeed','Presentation',microseconds); } function updateReadAheadPhraseSpeed(microseconds,sender) { microseconds = microseconds != undefined && microseconds > 0 ? microseconds : 0; if (microseconds > 0 ) { timePerPhraseWord = microseconds; } if (sender!=undefined) { $('#slider_control_phrase_speed').find('a').removeClass('current_speed'); $(sender).addClass('current_speed'); } logReadAheadPlayerAction('updateReadAheadPhraseSpeed','Presentation',microseconds); } function updateReadAheadSliderPosition(){ var currentSliderBarWidth = 100 - (100 / totalPositions * (currentPosition + 1)); $('#readAheadSliderBar').css('width',currentSliderBarWidth+'%'); } function currentReadAheadControls(){ $('#read_ahead_player_pause_play').show(); if (currentPosition < totalPositions - 1) { $('#read_ahead_player_next_word').removeClass('disabled'); } else { $('#read_ahead_player_next_word').addClass('disabled'); } if (currentPosition > 0) { $('#read_ahead_player_previous_word').removeClass('disabled'); } else { $('#read_ahead_player_previous_word').addClass('disabled'); } } function restartReadAheadPresentation(){ currentPosition = 0; logReadAheadPlayerAction('restartReadAheadPresentation','Presentation',''); resumeReadAheadPlayback(); } function resumeReadAheadPlayback(){ $('.fa-repeat').removeClass('fa-repeat').addClass('fa-play'); $('#read_ahead_player_pause_play').each(function(){ $(this).find('.fa-play').removeClass('fa-play').addClass('fa-pause'); $(this).off('click'); $(this).attr('onclick','pauseReadAheadPresentation()'); }); logReadAheadPlayerAction('resumeReadAheadPlayback','Presentation',''); playReadAheadPresentation(); } function pauseReadAheadPresentation(){ $('#read_ahead_player_pause_play').each(function(){ $(this).find('.fa-pause').removeClass('fa-pause').addClass('fa-play'); $(this).off('click'); $(this).attr('onclick','resumeReadAheadPlayback()'); }); logReadAheadPlayerAction('pauseReadAheadPresentation','Presentation',''); read_ahead_pause(); } function endReadAheadPresentation(){ $('.fa-play').removeClass('fa-play').addClass('fa-repeat'); $('.fa-pause').removeClass('fa-pause').addClass('fa-repeat'); $('#read_ahead_player_pause_play').each(function(){ $(this).off('click'); $(this).attr('onclick','restartReadAheadPresentation()'); }); logReadAheadPlayerAction('endReadAheadPresentation','Presentation',''); logLTIEndPresentation(); } function playReadAheadPresentation(){ autoPlay=true; currentPosition--; logReadAheadPlayerAction('playReadAheadPresentation','Presentation',''); nextReadAheadPresentationItem(); } function startReadAheadStepper(timeDisplayWord){ clearInterval(readAheadPlayerTimer); readAheadPlayerTimer = setTimeout(function() { read_ahead_step(); },timeDisplayWord); } function stopReadAheadStepper(){ clearInterval(readAheadPlayerTimer); } function read_ahead_step(){ if (autoPlay) { nextReadAheadPresentationItem(); } } function read_ahead_pause(){ autoPlay=false; stopReadAheadStepper(); } function showReadAheadPresentationItem(index){ currentPosition = index; currentPresentationItem = presentation[currentPosition] != undefined ? presentation[currentPosition].trim() : ""; if (currentPresentationItem != "") { currentItemWordCount = presentation[currentPosition].replace("\n","").split(" ").length; if (currentPresentationItem.startsWith("")){ startReadAheadStepper(currentItemWordCount*timePerWord); $('#read_ahead_player_field').html('
'+currentPresentationItem+'
'); logReadAheadPlayerAction('showReadAheadPresentationItem','Word',currentPresentationItem); } else { startReadAheadStepper(currentItemWordCount*timePerPhraseWord); $('#read_ahead_player_field').html('
'+currentPresentationItem.replace("\n","
")+'
'); logReadAheadPlayerAction('showReadAheadPresentationItem','Phrase',''); } } else { if (currentPosition < totalPositions) { nextReadAheadPresentationItem(); } else { endReadAheadPresentation(); read_ahead_minimize(); } } currentReadAheadControls(); updateReadAheadSliderPosition(); saveReadAheadPosition(); } function priorReadAheadPresentationItem(){ stopReadAheadStepper(); logReadAheadPlayerAction('priorReadAheadPresentationItem','Controls',''); showReadAheadPresentationItem(currentPosition-1); } function nextReadAheadPresentationItem(){ stopReadAheadStepper(); logReadAheadPlayerAction('nextReadAheadPresentationItem','Controls',''); showReadAheadPresentationItem(currentPosition+1); } function read_ahead_playAgain(){ currentWordIndex = 0; logReadAheadPlayerAction('read_ahead_playAgain','Controls',''); playReadAheadPresentation(); } function read_ahead_minimize(){ setMinimized = true; logReadAheadPlayerAction('read_ahead_minimize','Controls',''); read_ahead_switch_min_max(); } function read_ahead_maximize(){ setMinimized = false; logReadAheadPlayerAction('read_ahead_maximize','Controls',''); read_ahead_switch_min_max(); } function read_ahead_switch_min_max(forceSwitch){ forceSwitch = forceSwitch != undefined ? forceSwitch : false; if (forceSwitch) { setMinimized = !setMinimized; } if (setMinimized) { $('#read_ahead_player_back').fadeOut(); $('#read_ahead_player').addClass('minimize'); $('.player-icons .fa-stack').removeClass('fa-lg').addClass('fa-sm'); $('.player-icons .fa-minus').removeClass('fa-minus').addClass('fa-expand'); logReadAheadPlayerAction('read_ahead_switch_min_max','Min',''); //$('#read_ahead_player_max_min').each(function(){ // $(this).off('click'); // $(this).attr('onclick','read_ahead_maximize()'); //}); } else { $('#read_ahead_player_back').fadeIn(); $('#read_ahead_player').removeClass('minimize'); $('.player-icons .fa-stack').removeClass('fa-sm').addClass('fa-lg'); $('.player-icons .fa-expand').removeClass('fa-expand').addClass('fa-minus'); logReadAheadPlayerAction('read_ahead_switch_min_max','Max',''); //$('#read_ahead_player_max_min').each(function(){ // $(this).off('click'); // $(this).attr('onclick','read_ahead_minimize()'); //}); } } function saveReadAheadPosition(){ $.ajax({ type:'POST', url:'/ajax/save_user_presentation_position.php', data: { 'id':221, 'position': currentPosition } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); } function logLTIEndPresentation(action) { if (!logToLTI) { return; } $.ajax({ type:'POST', url:'/lti/presentationEnded.php', data: { 'documentId':221, 'userId':0, } }) } function logReadAheadPlayerAction(action,area,details){ var d = new Date(); var t = d.getTime(); action = action != undefined ? action.trim() : 'UNKNOWN'; area = area != undefined ? area.trim() : ''; details = details != undefined ? details : ''; // If we are about to show a new word, increase the number of keywords // reinforced so we can log that for the Dashboard page. if (area == 'Word') { window.keywordCount++; } $.ajax({ type:'POST', url:'/logging/logPlayerAction.php', data: { 'documentId':221, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }