Javascript

Javascript - just a scripting language
Javascript - /shudders
Javascript - "easy"

I've worked with web-developers who have 5x the experience
working with Javascript than I do, who can't easily explain the below question.
var count = 5;
var foo = {
    count:10,
    bar: function () {
        var count = 15;
        setTimeout(function(){
            alert (this.count);
        }, 500);
    }
};
foo.bar (); 
What prints? Why?
How would you purposefully get output for-> 5, 10 or 15 ?
If it's possible, explain which are possible and by which mechanism they are possible.