var xmlHttp
function addmorepackage(str)
{
		
	document.getElementById('totcntw').value=str;
	//alert(document.getElementById('totcntw').value);
	var k = parseInt(str)-parseInt(1);
	//alert(document.getElementById('editcnt').value.length);
	if(document.getElementById('editcnt'))
	{
	
		var q = document.getElementById('editcnt').value;
		if(q > 0)
		{
			q = parseInt(q)+parseInt(1);
			document.getElementById('editcnt').value= q;
		}
	}

	
		/*if(document.getElementById('branch'+k).value==''){
		alert("Select the Brand");
		document.getElementById('branch'+k).focus();
		return false;
		}
		
		if(document.getElementById('literqty'+k).value==''){
		alert("Enter the liter");
		document.getElementById('literqty'+k).focus();
		return false;
		}
		
		
		if((document.getElementById('packqty'+k).value=='')){
		alert("Enter the Quantity");
		document.getElementById('packqty'+k).focus();
		return false;
		}*/
	
		/*if(document.getElementById('t'+k)){
		if(document.getElementById('t'+k).value=='' || document.getElementById('t'+k).value==0){
		alert("enter the bill values to this row");
		return false;
		}
	}*/
	
	
	if(document.getElementById('min'+k)){
		document.getElementById('min'+k).style.display='none';
	}
	if(document.getElementById('max'+k)){
		document.getElementById('max'+k).style.display='block';
	}
	var container_drp_val='';
if (str.length==0)
{ 
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="php/addmorepackage.php"
nid	=str
if(document.getElementById('divcnt')){
document.getElementById('divcnt').value=str;	
}
for(i=1;i<str;i++){
if(document.getElementById('s'+i)){
container_drp_val+="'"+document.getElementById('s'+i).value+"'"+',';	
}
}
url=url+"?div="+str;
if(container_drp_val && container_drp_val!=''){
url=url+"&container_drp_val="+container_drp_val;	
}
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{	
	if(document.getElementById('divcnt')){
	var divcnt=document.getElementById('divcnt').value;
	//alert(divcnt);
	var txtData="div"+divcnt;
	if(document.getElementById(txtData))
	document.getElementById(txtData).innerHTML=xmlHttp.responseText
	}else{
	var txtData="div2";
	if(document.getElementById(txtData))
	document.getElementById(txtData).innerHTML=xmlHttp.responseText
	}

	
} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
} 