greetings everyone!

this is my first time trying to join this javascript
community.

Well then, now I'm telling about my miss-understanding
of this keywords of javascript here...

here's the html
Code:
<fieldset > <legend>Attachment</legend>
            <table id="attachment" style="height: 50px;" width="200" border="0">
                <th width="19%">Title</th>
                <th width="26%">File</th>
                <th width="41%">Description</th>
                <th width="6%">Upload</th>
                <th width="6%">More File</th>
                <tr>
                    <td><input name="title" type="text" value="- none -" size="33" maxlength="50"></td>
                    <td><input name="filepath" type="file" size="33"></td>
                    <td><input name="description" type="text" value="- none -" size="60" maxlength="200"></td>
                    <td><input name="upload" type="button" value=" Upload " onclick="upload(this)"> </td>
                    <td><div align="center">
                            <input onclick="addMoreFile()" type="button" value="+">
                        </div></td>
                </tr>
            </table>
            <!-- end Attachment --> </fieldset>
the aim is that the upload button would eventually changed into image
and then changed back to a link.
That one is already done here's the javascript

Code:
var attRow;

function upload(obj){

	// obtain the table pointer
	var attTable = document.getElementById('attachment');
	
	// post file into the jsp file
	
	// changing the image
	// get parent pointer of this element
	var par = obj.parentNode;
	
	var loImage = document.createElement('img');
	loImage.setAttribute('src', 'images/loading1.gif');
	
	par.innerHTML = '';
	par.appendChild(loImage);
		
	// create the removal link
	var text = document.createTextNode('remove');
	
	var liRem = document.createElement('a');
	liRem.setAttribute('href','javascript:removeFile(this)');
	liRem.appendChild(text);
	
	par.innerHTML = '';
	par.appendChild(liRem);
	
}

function removeFile(obj){
	
	// post fileid 
	
	// change the image
	
}

function addMoreFile(){
	
	// create fully file upload row
	// consist of two text elements, file element, and 1 button.  
	var nFileTitle = document.createElement('input');
	nFileTitle.setAttribute('name','title');
	nFileTitle.setAttribute('type','text');
	nFileTitle.setAttribute('size', '33');
	nFileTitle.setAttribute('value','- none -');
	nFileTitle.setAttribute('maxlength','50');
	
	var nFilePath = document.createElement('input');
	nFilePath.setAttribute('name', 'filepath');
	nFilePath.setAttribute('type', 'file');
	nFilePath.setAttribute('size', '33');
	
	var nDesc = document.createElement('input');
	nDesc.setAttribute('name', 'description');
	nDesc.setAttribute('type', 'text');
	nDesc.setAttribute('value','- none -');
	nDesc.setAttribute('size', '60');
	nDesc.setAttribute('maxlength', '200');
	
	
	var nUpButton = document.createElement('input');
	nUpButton.setAttribute('name', 'upload');
	nUpButton.setAttribute('type', 'button');
	nUpButton.setAttribute('value', ' Upload ');
	nUpButton.setAttribute('onclick', 'upload(this)');
	
	// empty element
	var ksg = document.createTextNode(' ');
	
	// obtain the table pointer
	var attTable = document.getElementById('attachment');
	attRow = attTable.rows.length;
	alert(attRow);
	
	var nextRow = attTable.insertRow(attRow);
	var ceL = nextRow.insertCell(0);
	
	ceL.appendChild(nFileTitle);
	
	ceL = nextRow.insertCell(1);
	
	ceL.appendChild(nFilePath);
	
	ceL = nextRow.insertCell(2);
	
	ceL.appendChild(nDesc);
	
	ceL = nextRow.insertCell(3);
	
	ceL.appendChild(nUpButton);
	
	ceL = nextRow.insertCell(4);
	
	ceL.appendChild(ksg);
	
}
the problem arise when I try to use the removeFile() function using this keywords.
into these;

Code:
function removeFile(obj){
	
	// post fileid 
	
	// change the image back
	// get parent pointer of this element
	var par = obj.parentNode;
	
	var loImage = document.createElement('img');
	loImage.setAttribute('src', 'images/loading1.gif');

	
}
I try to apply the same approach as the upload() function.
But instead the this object which is pointing at the parent node seems unreliable. Is there any missing point i haven't observed?