<!-- hiding script from incompatible browsers
// XxCavalierXx
// updated July 14, 2003
// Runscape hits lvl Calculation

function calchits()
{
	var error = 0;
	var attackxp = 0;
	var defensexp = 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.defense.value, 1, 99)){
		defensexp = xpforlvl[document.list.defense.value];
	} else {
		error++;
	}

	if(isValid("Strength", document.list.strength.value, 1, 99)){
		strengthxp = xpforlvl[document.list.strength.value];
	} else {
		error++;
	}

	if(!error && runescape){
		attackxp = xpforlvl[document.list.attack.value];
		defensexp = xpforlvl[document.list.defense.value];
		strengthxp = xpforlvl[document.list.strength.value];
		hitsxp = (attackxp + defensexp + strengthxp) / 3;
		hitsxp = parseInt(hitsxp);
		hitsxp += 1000;
		
		for(hitslvl=1; hitsxp > xpforlvl[hitslvl+1]; hitslvl++){
			document.list.hits.value = hitslvl;
		}

		if(hitslvl<10){
			hitslvl=10;
		}

		xpdiff = parseInt( (xpforlvl[hitslvl+1] - hitsxp) / 100);

		document.list.hits.value = hitslvl;
		document.getElementById("errplace").innerHTML = "Hits lvl is only an estimate!!<BR>About " + xpdiff/10 + "k xp for next hits lvl<BR><BR>";

	} else if(!runescape){
		clearerror();
		document.write("<BR>");
	} else {
		document.getElementById("errorflag").innerHTML = "<BR>";
	}
}
// end hiding script -->