ClearTimeout with condition is not working
<p>Does any one know why this is not working?</p>

<p><a href="http://jsfiddle.net/jonevar/2Z2NQ/5/" rel="nofollow">http://jsfiddle.net/jonevar/2Z2NQ/5/</a></p>

<p>Here is the whole code:</p>

<pre><code>function ag_alert(message) {

    event.preventDefault();

    //SetTimeout in case didn't close manualy
    var timer = setTimeout(cls_message, 5000),
        cur_url = window.location.href;

    //Check if its already on
    if (! $('.ag_alert_wrapper').is(':visible') ) {

        //Set the language
        (cur_url.indexOf('/en/') &gt;= 0) ? cls_txt = "close" : cls_txt = "閉じる" ;

        $('&lt;div class="ag_mess ag_alert_wrapper"&gt;&lt;/div&gt;&lt;div class="ag_mess ag_alert_wrapper_close"&gt;'+ cls_txt +'&lt;/div&gt;')
            .prependTo('body');
        $('.ag_alert_wrapper')
            .append('&lt;p&gt;'+ message +'&lt;/p&gt;')
            .animate({top : 0}, 200, function() {
                $('.ag_alert_wrapper_close')
                .animate({top : 90}, 200)
                .on({
                    mouseenter : function () {
                        $(this).animate({
                            top : 100
                        }, 200);
                    },
                    mouseleave : function () {
                        $(this).animate({
                            top : 90
                        }, 200);
                    },
                    click : function () {
                        cls_message();
                    }
                });
            });

        //Setups ESC key to close message
        $(document).keydown(function(e) {
            if (e.keyCode === 27) {
                cls_message();
            }
        });

    } else {
        //if Alert is already visible
        $('.ag_alert_wrapper')
            .children('p').html(message)
            .end()
            .effect("highlight", {
                color : '#FF0'
            }, 1000);

        clearTimeout(timer);
    }

}


function cls_message() {
    $('.ag_mess').animate({
        top : -200
    }, 200, function () {
        $('.ag_mess').remove();
    });
}
</code></pre>
