/* 
 * This file contains functions used by the Image Editor 
 */

//this function helps to show the form for getting a message
       function search_showKeywordSearchBox()
 {    
       var action_file_path = "search/index.php";
       var actioncmd = "?show_keyword_search_box_request=1";
       var url = action_file_path+actioncmd;
       url=url+"&sid="+Math.random();

       //get the content to display using ajax
        $.ajax({
            method: "get",url:url,data: "page",
            beforeSend: function()
                {
                   showSpinner('div_keyword_search');
                },
            complete: function(){}, 
            success: function(html)
            {
            $("#div_keyword_search").html(html);
            }
       }); //close $.ajax()

 }//search_showKeywordSearchBox()



//this function validates the search keyword
///this function also helps in searching for the occurance of the word in the whole database
function search_doKeywordSearch()
{
      //name
      var search_keyword = document.getElementById("txt_keyword_search").value;

       //validate before sending
         if((!search_keyword)||("Search"==search_keyword))
        {
          alert("Please type here what you are looking for ");
          return;
        }    
       
         var action_file_path = "search/index.php";
         var actioncmd = "?do_keyword_search_request=1&&"+
                           "search_keyword="+search_keyword;

        var url = action_file_path+actioncmd;
        url=url+"&sid="+Math.random();

            $.ajax({
                method: "get",url:url,data: "page",
                beforeSend: function()
                {
                   showSpinner('div_main_content_area');
                },
                complete: function()
                {},

                success: function(html)
                {
                    $("#div_main_content_area").html(html);
                }
     }); //close $.ajax()



      
   }//validate_validateCarCaptchaCode()
   
