I am new to Xwiki and am having an extremely hard time finding documentation for anything.  Let me give you an example.  I took a look at the code for the Create New Page panel.  It starts like this:

#if($hasedit)
#panelheader($msg.get("Create"))
<form method="post" action="$doc.getURL("view", "xpage=create")" onsubmit="cancelCancelEdit()">

It seems interesting, so I want to know more about it:

What is $hasedit and where is it documented?
What is $msg.get and where is it documented? 
What is cancelCancelEdit() and where is it documented?

At least I can find document.getURL() in the API.  Why not the others?

This is only the first 3 lines of code, and already I have wasted 2 hours on Google.  What am I doing wrong?  I would like to be able to develop with Xwiki, but it will not be possible like this.  Please give me some advice.

Thank you.