<!-- hiding script from incompatible browsers
// XxCavalierXx
// updated May 24, 2002
// Runscape hits lvl Calculation

function calchits()
{
	var error = 0;
	var attackxp = 0;
	var defencexp = 0;
	var strengthxp = 0;
	var hitsxp = 0;
	var hitslvl = 10;
	var correction = 0;
	var xpdiff = 0;

	clearerror();


	if(isValid("Attack", document.list.attack.value, 1, 99)){
		attackxp = xpforlvl[document.list.attack.value];
	} else {
		error++;
	}

	if(isValid("Defense", document.list.defence.value, 1, 99)){
		defencexp = xpforlvl[document.list.defence.value];
	} else {
		error++;
	}

	if(isValid("Strength", document.list.strength.value, 1, 99)){
		strengthxp = xpforlvl[document.list.strength.value];
	} else {
		error++;
	}

	if(!error){
		attackxp = xpforlvl[document.list.attack.value];
		defencexp = xpforlvl[document.list.defence.value];
		strengthxp = xpforlvl[document.list.strength.value];
		hitsxp = (attackxp + defencexp + strengthxp) / 3;
		hitsxp = parseInt(hitsxp);
		hitsxp += 1300;
		
		for(hitslvl=1; hitsxp > xpforlvl[hitslvl+1]; hitslvl++){
			document.list.hits.value = hitslvl;
		}

		xpdiff = parseInt( (xpforlvl[hitslvl+1] - hitsxp) / 100);

		document.list.hits.value = hitslvl;
		document.getElementById("errplace").innerHTML = "Hits lvl is a close minimum estimate!!<BR>About " + xpdiff/10 + "k xp for next hits lvl<BR><BR>";

		if(hitspopup){
	 		alert("The hits lvl has been recorded on the table.\nIt is only an estimate!!\n\nKeep in mind that how far into each lvl you become,\nand what quests you complete, affects your hits xp differently.\n\nThis means that a 100% accurate calculator is NOT possible.\n\nAlso: The character type you choose when you start can affect your hits xp by the hundreds,\nmeaning it probably wont be too accurate for lower lvl players.");
			hitspopup = 0;
		}

	} else {
		document.getElementById("errorflag").innerHTML = "<BR>";
	}
}
// end hiding script -->