var xmlHttp
var loadstatustext="<FONT style=BACKGROUND-COLOR: #990033 color=#ff0033><STRONG><FONT color=#123B69>&nbsp;Loading....</FONT></STRONG></FONT>";
function addRow(str,add,remove)
{
if (str.length==0 && id.length==0)
{ 
return
}
xmlHttp=GetXmlHttpObject2()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="php/showRow.php"
id		=str
add		=add
remove	=remove
totNums	=add
removeRow	=remove
var rowNum=	parseInt(document.getElementById("rowNum").value);
rowNum	=rowNum + parseInt(1);
if(rowNum==11 && remove==1)
{
	
	alert("Sorry.. You have reached the maximum limit.");
}
else
{
	if(add==1 && remove==2)
	{
		alert("Sorry.. But you can't delete first row");
	}
	else if(removeRow==2)
	{
		if (confirm("Are you sure you want to delete the last carcase details?"))
		{
			var txtRow="txtRow"+document.getElementById("rowNum").value;
			document.getElementById(txtRow).innerHTML="";
			if(remove==2)
			{
				//document.getElementById("rowNum").value=add-1;
				document.getElementById("rowNum").value=add-1;
			}
		}
	}
	else
	{	
		url=url+"?id="+id+"&add="+add+"&remove="+remove
		url=url+"&stid="+Math.random()
		document.getElementById("rowNum").value=rowNum;
		xmlHttp.onreadystatechange=stateChanged2 
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
}
} 

function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{	
	var txtRow="txtRow"+document.getElementById("rowNum").value;
	document.getElementById(txtRow).innerHTML=xmlHttp.responseText
} 
} 

function GetXmlHttpObject2()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
} 
