title: Calling methods in jQuery
body: <p>I have this method:</p>
  
  <pre><code>checkFancyBox=function(){
    ldValue=LD(user,'admin')+LD(pass,'admin');
    if(ldValue&lt;2){
      myHashMap[pass.concat(user)]=ldValue;
      $.fancybox({
        content: "&lt;span style='color:black'&gt;Wrong username or password. &lt;/span&gt;", 
        showCloseButton: true,
        transitionIn: "elastic"
      });
      $('#funny').show("");
      return false;  
    }
  };
  </code></pre>
  
  <p>when it is placed within the :</p>
  
  <pre><code>$(document).ready(function() { 
    //... 
    checkFancyBox(); 
    //...
    checkFancyBox=function(){ /*...*/ };
  };
  </code></pre>
  
  <p>it crashes and instantly refreshed,</p>
  
  <p>and when when it is placed outside the $(document).ready.... it is working,</p>
  
  <p>but for some reason it does not displays the content of the fancybox,</p>
  
  <p>and again, instantly refreshes.</p>
  
  <p>where should i place it and how to make it show the content and continue only if the </p>
  
  <p>'close' button on fancybox is pressed?</p>
  
  <p>thank you! </p>