What you are doing is, before the page is done loading, you are looking for a control called alabel. Because the page is not done loading (the control has not been rendered), it can not find the control. So now aLabe is null.
You either want to put line 3 inside the init function or put the script at the end of the page (just before the closing body tag).
Oh! so its not that the aLabe isn't available inside the function , its just that the var aLabe is null, because its being called before our div#label exists on the page. Thanks much for clearing this up for me.