ajax not working

ajax not working

Dear Sir

Refer  http://webvikas.net.in/goregaonbiz/bigsale.php

after typing name say "an" I get auto suggested names

When  I select "Anjali ..."
text box near Shop Search is populated with the id of the selected name


Shop Search 











Value of selected name is filled up in field near

Shop Search


Following code is used for this 
  1. <script type="text/javascript">
  2.  
  3. $(function() {
  4.  
  5. $("#searchname").autocomplete({
  6.  source: "shopnamesearchautofill.php",

  7. minLength: 2,
  8. select: function(event, ui) {
  9. $('#searchid').val(ui.item.recid);        <--- value of selected id is filled up
  10. },
  11.  
  12. //html: true,
  13.  
  14. open: function(event, ui) {
  15. $(".ui-autocomplete").css("z-index", 1000);
  16. }
  17. });

  18.  
  19.  
  20. });
  21. </script>  

My problem is After this when I click  
following script is NOT executed please help

  1. $('#showdetails').click(function() {
  2.   var id = $('#searchid').val();
  3.   alert(id);
  4.    var url='shopdetail.php?id='+id;
  5.    alert(url);
  6.    window.location.replace(url);
  7.  });
  8.