var rowCount = 0;
var prevItem = null;
var focusItem = null;
var firstItem = null;

function addTextField(txtName, defaultValue)
{
	newText=document.createElement("INPUT");
	newText.setAttribute("type","text");
	newText.setAttribute("size","5");
	newText.setAttribute("value",defaultValue);
	newText.setAttribute("id",txtName);
	newText.setAttribute("name",txtName);
	newText.setAttribute("className","textbox");
	return newText;
}
function AddRow()
{
	if(rowCount<1000)
	{
		var mytable=document.getElementById("myTable");
		var mytablebody = document.createElement("TBODY");
		var tblCell, currenttext;
		
		rowCount +=1;
		tblRow=document.createElement("TR");
		tblCell=document.createElement("TD");
		currenttext=document.createTextNode("SKUNO");
		tblCell.appendChild(currenttext);
		tblRow.appendChild(tblCell);
		mytablebody.appendChild(tblRow);
		tblRow=document.createElement("TR");
		tblCell=document.createElement("TD");
		focusItem = addTextField("skuno[]", "");
		if(rowCount==1)
			firstItem = focusItem;
		tblCell.appendChild(focusItem);
		tblRow.appendChild(tblCell);
	
		mytablebody.appendChild(tblRow);
		mytable.appendChild(mytablebody);
		focusItem.focus();
		document.getElementById("row").value=rowCount;
	}
	else
	{
			alert("Maximum order is 100 items");
	}
	
}
