title: setTimeout not working for delay
body: <p>I have a user defined function i want to delay it's execution. want to
   delay fancy() and I am using setTimeout. But it runs instantaneously.I have also set different time delays
   but it does not effect.Is there any other method or I am using it wrong?? please help.</p>
  
  <p>Thanks in advance.
  Ali</p>
  
  <pre><code>$('a.vid').click(function(){
  
  
          setTimeout(fancy(this) ,2000 );
  
  
  });
  
  
  
  function fancy(that){
  
              var videoFile = $(that).attr('videofile');
              var videoWidth = Number($(that).attr('videowidth'));
              var videoHeight =Number( $(that).attr('videoheight'));
  
              var videoCode = '&lt;video width="'+videoWidth+'" height="'+videoHeight+'" controls autoplay autobuffer&gt;&lt;source src="includes/video/'+videoFile+'.ogv" type="video/ogg" /&gt;&lt;source src="includes/video/'+videoFile+'.mp4" type="video/mp4" /&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+videoWidth+'" height="'+(videoHeight+40)+'" id="lynda_video_player" align="middle"&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="movie" value="lynda_video_player.swf?videoFile=includes/video/'+videoFile+'.mp4&amp;amp;skinFile=lynda_video_skin.swf&amp;amp;videoFileWidth='+videoWidth+'&amp;amp;videoFileHeight='+videoHeight+'"&gt;&lt;param name="quality" value="high"&gt;&lt;param name="wmode" value="transparent"&gt;&lt;param name="scale" value="noscale"&gt;&lt;param name="salign" value="lt"&gt;&lt;embed src="lynda_video_player.swf?videoFile=includes/video/'+videoFile+'.mp4&amp;amp;skinFile=lynda_video_skin.swf&amp;amp;videoFileWidth='+videoWidth+'&amp;amp;videoFileHeight='+videoHeight+'" quality="high" width="'+videoWidth+'" height="'+(videoHeight+40)+'" name="lynda_video_player" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" scale="noscale" salign="lt" wmode="transparent" allowfullscreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/video&gt;';
  
  
              $('#videoPlayer').html(videoCode);
  
              $.fancybox({
  
                  'transitionIn' : 'fade',
                  'transitionOut' : 'fade',
                  'overlayColor' : '#000',
                  'overlayOpacity' : '.6',
                  'href' : '#videoPlayer'
  
  
                  });
  
      }
  </code></pre>