using date picker

using date picker

I am trying to use jquery ui date picker.   I want to  open the date picker  only when user clicks on  the  image next to input field   , I followed the example it did not work , may be  I am doing something wrong please help 

here is the html
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  5.   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  6.   <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  7.   
  8. <script>
  9.  $(document).ready(function() {
  10.     $(".datepicker").datepicker({showButtonPanel: true,closeText: 'X',buttonImage: 'calendar.gif'  });
  11.   }); </script>
  12. </head>
  13. <body style="font-size:62.5%;">
  14.   
  15. <input  type="text" class="datepicker"/>

  16. <br>
  17. <input  type="text" class="datepicker"/>


  18. </body>
  19. </html>
I want the   calendar img to be displayed next to   input filed and  when user clicks on the calendar icon popup calendar should open .
here is the link for datepicker api


please help me.