Call of function not working
<p>I think I'm having a problem with the <code>this</code> element in the code below</p>

<p>I'm trying to call a function in two way's but the second way dosen't work:</p>

<p>The function validate_email is not responding, I think the call for it is wrong in the second example. </p>

<p><strong>The working way is:</strong></p>

<pre><code>checking = {};
checking.form = function(){
    return{

validate_mail: function(a){
    var c=true;
    var email_filter = /^[\w.-]+@[\w.-]+([\.]+([\w]+[\.])?)+[a-zA-Z]{2,6}$/i;
    if( $.trim(a)!=""  &amp;&amp; !$.trim(a).match(email_filter) )
    c=false;
    return c;
},
check_mail: function(div_id, error) {

        var email = $(div_id + ' input[name=email]').val();
        var check = this.validate_mail(email);
        if(check==false &amp;&amp; $(div_id).is(':visible') )
         {
            $(div_id + ' '+ error).html('&lt;b&gt;some error&lt;/b&gt;');   
        } else {
            $(div_id + ' ' + error).text('');
        }

    }
 }
}();


$(function(){
    $('#register input[name=email]').blur(function(){
         checking.form.check_mail("#register", ".error_email");
         });
}
</code></pre>

<p><strong>The not working way is:</strong></p>

<pre><code>checking = {};
checking.form = function(){
    return{

validate_mail: function(a){
    var c=true;
    var email_filter = /^[\w.-]+@[\w.-]+([\.]+([\w]+[\.])?)+[a-zA-Z]{2,6}$/i;
    if( $.trim(a)!=""  &amp;&amp; !$.trim(a).match(email_filter) )
    c=false;
    return c;
},
check_mail: function(div_id, error) {
            return function(){ //**made the change  nr. 1**

        var email = $(div_id + ' input[name=email]').val();
        var check = this.validate_mail(email);
        if(check==false &amp;&amp; $(div_id).is(':visible') )
         {
            $(div_id + ' '+ error).html('&lt;b&gt;some error&lt;/b&gt;');   
        } else {
            $(div_id + ' ' + error).text('');
        }
      }
    }
 }
}();


$(function(){ //**made the change nr. 2**
    $('#register input[name=email]').blur(   
         checking.form.check_mail("#register", ".error_email")
        );

}
</code></pre>

<p>I need some help with this. I believe I'm not useing the <code>this</code> element in the right way</p>

<p>Any help is appreciated !!</p>
