about "this" statement in javascript

You might see "this" statement usually in code who js programmer writes it.
For js bignner, it is difficult or can not understand about meaning.
what? it is.
follow this code.

function This_test(){
   this.o = "pinko";
};

This_test.prototype.wrap=function(){

  function tag(){
     alert(this.o);
  }
  tag();
}

var p = new This_test();
p.wrap();

It will alert undefined.
because, this.o dose not define in wrap function.
you have defined this.o is not refer from tag function!
this reason is scope that effective variable dose not exist in wrap function.

function This_test(){
   this.o = "pinko";
};

This_test.prototype.wrap = function(){
  var self = this;

  function tag(){
     alert(self.o);
  }
  tag();
}

var p = new This_test();
p.wrap();

"this" refers object of position where it is called.
example above, self is role that it refers function This_test.
This_test defines this.o, In a word, this has position of object and information about object.
You must notice that effective scope of variable!