//
// Function get_suggestions 
// Provide dropdown suggestions for TITLESEARCH. 
// These scripts require jquery.js to run properly....
// <script src="http://code.jquery.com/jquery-latest.min.js"></script>
//


function get_suggestions(keyed_data)
{
  var status_update;
  //  Use this to determine if Friend or Family was chosen.
  window.status = "Get_Suggestions Activated";
var y=document.getElementById(keyed_data).value;  
$.get('ajax_response.php', { TITLESEARCH: y } , function(data) {
  $('#recommendations').html(data); });



}

// function hide_message
// This routine will hide the message  from view 

function hide_message(msg)
{
  var status_update;
  //  Use this to determine if Friend or Family was chosen.
  window.status = "get_message Activated";
 
  //var y=document.getElementById(msg).value;
  var y = msg;
  var view = 'order_' + y;
  // alert(view);
  $.get('ajax_response.php', { hide: y } , function(data) {
  $('#' + view ).html(data); });
  

}

//  function get_message 
//  routine to populate a specific div 


function get_message(msg)
{
  var status_update;
  //  Use this to determine if Friend or Family was chosen.
  window.status = "get_message Activated";
 
  //var y=document.getElementById(msg).value;
  var y = msg;
  var view = 'order_' + y;
  // alert(view);
  $.get('ajax_response.php', { msg: y } , function(data) {
  $('#' + view ).html(data); });
  

}

/*  Get related items, based on the UId value of the current book.... and Page number selected. Not yet active...   */
function get_related(uid)
{
  var status_update;
  //  Use this to determine if Friend or Family was chosen.
  window.status = "Get_Suggestions Activated";

  var y=document.getElementById(uid).value;
  new Ajax.Updater('related', 'ajax_response.php', {
  parameters: {
    uid:
      y
    }
  });

}


