Undefined function error
<p>Function <code>letswin()</code> not working. I couldnt find a way to fix. Thank you for your helps.</p>

<pre><code>var pathArray = window.location.pathname.split( '.html' );
var pathArray = pathArray.reverse();
var pathArray = pathArray .join('');
var pathArray= pathArray .split('/');
var bidnum=pathArray[3];
$(document).ready(function(){           
    $('body').append("&lt;div id=\"cdjs\" style=\"position: absolute; top: 30px; background-color: gray; box-shadow: 0px 0px 0px 3px; left: 30px;\" onClick=\"letswin()\"&gt;Click to start&lt;/div&gt;");
});

function checkandbid(){
    $.get("http://www.bigibid.com/LiveResponder/LR.bid?_as="+bidnum, function(data){
        Marray = data.split("'te':'")
        time = Marray[1].split("'")
        time = time[0]
        $('#cdjs').html(time);
        if (time &lt; 2 &amp;&amp; able==1){
            able=0;
            $('#ctl00_ContentPlaceHolder1_ibBid').click();
        } else {
            able=1;
        }
    });
}

function letswin(){
    setInterval(checkandbid, 300);
}
</code></pre>

<p>here you can use <a href="http://jsfiddle.net/LKZcT/3/" rel="nofollow">jsFiddle</a></p>
