var presentation = ["Sierra Madre Occidental<\/word>","Sierra Madre Oriental<\/word>","Two major mountain ranges extend north and south along Mexico's coastlines and are actually extensions of southwestern US ranges. The Sierra Madre Occidental<\/strong> and the Sierra Madre Oriental<\/strong> run roughly parallel to each other. The Sierra Madre Occidental<\/strong>, an extension of the Sierra Nevada range, runs about 3,107 miles along the west coast, with peaks higher than 9,843 feet. The Sierra Madre Oriental<\/strong> is an extension of the Rocky Mountains and runs 808 miles along the east coast.<\/phrase>","Mexican Altiplano<\/word>","fertile farms<\/word>","productive ranch land<\/word>","Chihuahuan Desert<\/word>","Between these two mountain ranges lies a group of broad plateaus, including the Mexican Plateau, or Mexican Altiplano<\/strong> (a wide valley between mountain ranges). The central portions, with their rolling hills and broad valleys, include fertile farms<\/strong> and productive ranch land<\/strong>. The Mexican Altiplano<\/strong> is divided into northern and southern sections, with the northern section dominated by Mexico's most expansive desert, the Chihuahuan Desert<\/strong>.<\/phrase>","Cordillera Neovolc\u00e1nica range<\/word>","range of volcanoes<\/word>","dividing line<\/word>","Another prominent mountain range is the Cordillera Neovolc\u00e1nica range<\/strong>, which as its name suggests, is a range of volcanoes<\/strong> that runs nearly 620 miles east to west across the central and southern portion of the country. Geologically speaking, this range represents the dividing line<\/strong> between North and Central America. The peaks of the Cordillera Neovolc\u00e1nica can reach higher than 16,404 feet in height and are snow-covered year-round.<\/phrase>","Copper Canyon<\/word>","Copper Canyon<\/strong>, in the northern Mexican state of Chihuahua, is about seven times larger than the Grand Canyon. Copper Canyon<\/strong> was formed by six rivers flowing through a series of twenty different canyons. Besides covering a larger area than the Grand Canyon, at its deepest point, Copper Canyon<\/strong> is 1,462 feet deeper than the Grand Canyon.<\/phrase>","timber is an important natural resource<\/word>","biodiversity<\/word>","Though sandy beaches often come to mind when thinking about Mexico, the mountainous regions are home to pine-oak forests. More than a quarter of Mexico's landmass is covered in forests; as a result, timber is an important natural resource<\/strong>. Mexico ranks fourth in the world for biodiversity<\/strong>; it has the world's largest number of reptile species, ranks second for mammals, and ranks fourth for the number of amphibian and plant species.<\/phrase>","Forest depletion<\/word>","It is estimated that more than 10 percent of the world's species live here. Forest depletion<\/strong> is a key environmental concern, but timber remains an important natural resource. The loss of natural habitat coincides with depletion of natural resources and an increase in population.<\/phrase>","range of volcanoes<\/word>","Popocat\u00e9petl<\/word>","Ixtacc\u00edhuatl<\/word>","N\u00e1huatl language<\/word>","most active volcanoes in Mexico<\/word>","Mexico is home to a range of volcanoes<\/strong>, some of which are active. Popocat\u00e9petl<\/strong> and Ixtacc\u00edhuatl<\/strong> (\"Smoking Warrior\" and \"White Lady,\" respectively, in the N\u00e1huatl language<\/strong>-a primary language of the indigenous peoples in central Mexico) occasionally send out puffs of smoke clearly visible in Mexico City, reminding the city's inhabitants that eruption is a possibility. Popocat\u00e9petl<\/strong> is one of the most active volcanoes in Mexico<\/strong>, erupting fifteen times since the arrival of the Spanish in 1519 CE. This volcano is close enough to populations to threaten millions of people.<\/phrase>","Three tectonic plates<\/word>","seismically active regions<\/word>","Three tectonic plates<\/strong> underlie Mexico, making it one of the most seismically active regions<\/strong> on earth. In 1985, an earthquake centered off Mexico's Pacific coast killed more than ten thousand people in Mexico City and did significant damage to the city's infrastructure.<\/phrase>","natural resources lie beneath the surface<\/word>","Many of Mexico's natural resources lie beneath the surface<\/strong>. Mexico is rich in natural resources and has robust mining industries that tap large deposits of silver, copper, gold, lead, and zinc. Mexico also has a sizable supply of salt, fluorite, iron, manganese, sulfur, phosphate, tungsten, molybdenum, and gypsum. Natural gas and petroleum also make the list of Mexico's natural resources and are important export products to the United States. There has been some concern about declining petroleum resources; however, new reserves are being found offshore in the Gulf of Mexico.<\/phrase>","13 percent of Mexico's land area is cultivated<\/word>","Though only about 13 percent of Mexico's land area is cultivated<\/strong>, favorable climatic conditions mean that food products are also an important natural resource both for export and for the feeding the country's sizable population. Tomatoes, maize (corn), vanilla, avocado, beans, cotton, coffee, sugarcane, and fruit are harvested in sizable quantities. Of these, coffee, cotton, sugarcane, tomatoes, and fruit are primarily grown for export, with most products bound for the United States.<\/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':2869, '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':2869, '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':2869, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }