var max_ammo_texts = 14;
ammotext = new Array(max_ammo_texts);
for (i=0;i<max_ammo_texts;i++)
{
	ammotext[i] = new Object();
	ammotext[i].counter = -1;
	ammotext[i].text = "";
}

var tweap_type = new Array();
tweap_type[0] = "9mm bullets";
tweap_type[1] = "Hand grenades";
tweap_type[2] = ".357cal bullets";
tweap_type[3] = "12 gauge slugs";
tweap_type[4] = "5.56mm bullets";
tweap_type[5] = "40mm grenades";
tweap_type[6] = "Rockets";
tweap_type[7] = "Railshots";
tweap_type[8] = "Shrap. slugs";
tweap_type[9] = "Oblit. charges";
tweap_type[10] = "Adrenaline";
tweap_type[11] = "Armour";
tweap_type[12] = "20mm shells";
tweap_type[13] = "Sword";

var atext_fade = 20;

function AddAmmoHudText(ammo_type, amt,string)
{
	var counter_max = 100;
	var selecty=0;
	var cmin=counter_max+1;

	for (aa=0;aa<max_ammo_texts;aa++)
	{
		if (ammotext[aa].counter <0)
		{
			selecty = aa;
			break;
		}
		else if (ammotext[aa].counter < cmin)
		{
			cmin = ammotext[aa].counter;
			selecty = aa;
		}
	}
	
	//assign it to selecty;
	ammotext[selecty].counter = counter_max;
	if (string != undefined)
		ammotext[selecty].text = string;
	else
		ammotext[selecty].text = tweap_type[ammo_type]+": +"+amt;
}