 function tax_calcutate(str,j)
 {  
	var divid="divTaxAmount"+j;
   	if (str=="")
	{
		document.getElementById(divid).innerHTML="";
		return;
	}
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			document.getElementById(divid).innerHTML=xmlhttp.responseText;
		}
	}
 	xmlhttp.open("GET","CountTaxAmount.php?Taxid="+str+"&id="+j,true);
	xmlhttp.send();
 }
 
 //--------------  ADD Sub charges----------------------------------
function cal_surcharges(id)
{
	   
	   document.getElementById("hidden_percent_inclusivecharge").value=id;
}
 
function cal_surcharges1()
{
   var surcharge=document.getElementById("hidden_percent_inclusivecharge").value;
    
 	 if(surcharge=='SUR'){  
 	 document.getElementById('tax_suroct_value').value=(parseFloat(document.getElementById('tax_chargeamount').value) *  parseFloat(document.getElementById('percent_inclusive').value))/100;
	 }
	 if(surcharge=='OCT'){
		 
	  $totals=parseInt(document.getElementById('itemamount').value)+parseInt(document.getElementById('tax_chargeamount').value);
	 document.getElementById('tax_suroct_value').value=($totals *  parseInt(document.getElementById('percent_inclusive').value))/100;
		 }
}

//****************************************************************************************************************
var TotalPercent=0;
var TotalAmnt=0;
var finalAmount=0;

function ChargeCalculater(Amt,Amtid)
  {
 	 
	 var myCars=new Array();
 	  for(i=0;i<myCars.length; i++)
	  {
		 myCars[i]=Amtid;
		  
	  }
     var AsPerActual=document.getElementById(Amtid).value;
 	 var ActualType=document.getElementById("AsPerActual_" +Amtid).value;
  	 if(AsPerActual !='')
	 {
 	     document.getElementById("actual_"+Amtid).value=AsPerActual; 
		  TotalAmnt=parseFloat(TotalAmnt) + parseFloat(AsPerActual) ;
  		  document.getElementById("chargeamount").value=parseFloat(TotalAmnt);
		 
		  
	}
	return true;
  
  }
 