/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function pop_chapters(id) {
    durl="http://"+document.location.hostname+"/includes/content/ajax/populate.php";

    $.get(durl, { book: id },
   function(data){
     document.getElementById('chapter_input').innerHTML=data;

});
}

function pop_verse(chapter,book) {
   //alert(chapter, book);
    durl="http://"+document.location.hostname+"/includes/content/ajax/verses.php";
   $.get(durl, {chapter: chapter,book: book},
   function(data) {
       document.getElementById('verse_input').innerHTML=data;
});
}

function output_found_verse(book,chapter,verse) {
    durl="http://"+document.location.hostname+"/includes/content/ajax/output_verse.php";
   $.get(durl, {book:book,chapter:chapter,verse:verse},
   function(data) {
       document.getElementById('verse_output').innerHTML=data;
   });
}

function updateLastCompleted() {
   if(confirm('Are you sure that you want to mark this reading as completed?')) {
    durl="http://"+document.location.hostname+"/includes/content/ajax/update_daily.php";
      $.get(durl,
         function(data){
     alert("This daily reading has been completed! ");
    aurl="http://"+document.location.hostname+"/?p=365_day_bible";
     window.location=(aurl);
   });
   }
}

function paginatedaily(thechosenone) {
     $('div[name|="dailypage"]').each(function(index) {
          if ($(this).attr("id") == thechosenone) {
               $(this).fadeIn(1000);
          }
          else {
               $(this).hide();
          }
     });
}


