// JavaScript Document

//*************** Verification Function***************************************
// this funtion make an Ajax request and sent it to login.php via post method 
// when it send the request to server it called the Progress function
// and when it finished and take the request from server it call a function that called response.
//**************************************************************************
function search_me(){  
 var word=$F('word');
 para='word='+word;
 var MyReq=new Ajax.Request('search.php',{method:'post' , parameters: para ,onLoading :Progress,onComplete :Response});
 //new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: showLoad, onComplete: showResponse} );
}

//**********************Progress Function ********************
// this funtion will show the progress indicator when Ajax request send to server
//************************************************************
function Progress(){
  $('prgrs').style.display="block";
}
//**********************Response Function ********************
// this funtion will dissaper the progress indicator when Ajax response send back to client
// if the response text was 'failed' it means the login was faile So,it pulsate the login form 
// using Aculo Ajax Pulsate Effect and appear an error message on screen
//otherwise the response text will send to screen.
//************************************************************
function Response(result){
  $('prgrs').style.display="none";
  $('result').innerHTML=result.responseText;
}

