coursexp=new Array() //This creates a new array in which we will put the experience

coursexp[0]=4.5 //bones
coursexp[1]=33 //loar remains
coursexp[2]=46.5 //phrin remains
coursexp[3]=59.5 //riyl remains
coursexp[4]=82.5 //asyn remains
coursexp[5]=100 //fiyr remains
coursexp[6]=30 //ghast
coursexp[7]=4.5 //burnt bones
coursexp[8]=5 //monkey bones
coursexp[9]=140 //ourg bones
coursexp[10]=96 //raurg bones
coursexp[11]=4.5 //wolf bones 
coursexp[12]=5.2 //bat bones
coursexp[13]=15 //big bones
coursexp[14]=30 //baby dragon bones
coursexp[15]=50 //wyvern bones
coursexp[16]=72 //dragon bones
coursexp[17]=22.5 //zogre bones
coursexp[18]=84 //fayrg bones
coursexp[19]=125 //dagannoth bones

//This is an array containing all the xp you need to get up a level in runescape
lvlxp=new Array()

lvlxp[0]=0

lvlxp[1]=1

lvlxp[2]=83

lvlxp[3]=174

lvlxp[4]=276

lvlxp[5]=388

lvlxp[6]=512

lvlxp[7]=650

lvlxp[8]=801

lvlxp[9]=969

lvlxp[10]=1154

lvlxp[11]=1358

lvlxp[12]=1584

lvlxp[13]=1833

lvlxp[14]=2107

lvlxp[15]=2411

lvlxp[16]=2746

lvlxp[17]=3115

lvlxp[18]=3523

lvlxp[19]=3973

lvlxp[20]=4470

lvlxp[21]=5018

lvlxp[22]=5624 //still the level xp array..........

lvlxp[23]=6291

lvlxp[24]=7028

lvlxp[25]=7842

lvlxp[26]=8740

lvlxp[27]=9730

lvlxp[28]=10824

lvlxp[29]=12031

lvlxp[30]=13363

lvlxp[31]=14833

lvlxp[32]=16456

lvlxp[33]=18247

lvlxp[34]=20224

lvlxp[35]=22406

lvlxp[36]=24815

lvlxp[37]=27473

lvlxp[38]=30408

lvlxp[39]=33648

lvlxp[40]=37224

lvlxp[41]=41171

lvlxp[42]=45529

lvlxp[43]=50339

lvlxp[44]=55649

lvlxp[45]=61512

lvlxp[46]=67983

lvlxp[47]=75127

lvlxp[48]=83014

lvlxp[49]=91721

lvlxp[50]=101333

lvlxp[51]=111945

lvlxp[52]=123660

lvlxp[53]=136594

lvlxp[54]=150872

lvlxp[55]=166636

lvlxp[56]=184040

lvlxp[57]=203254

lvlxp[58]=224466

lvlxp[59]=247886

lvlxp[60]=273742

lvlxp[61]=302288

lvlxp[62]=333804

lvlxp[63]=368599

lvlxp[64]=407015

lvlxp[65]=449428

lvlxp[66]=496254

lvlxp[67]=547953

lvlxp[68]=605032

lvlxp[69]=668051

lvlxp[70]=737627

lvlxp[71]=814445

lvlxp[72]=899257

lvlxp[73]=992895

lvlxp[74]=1096278

lvlxp[75]=1210421 //still the level xp array...

lvlxp[76]=1336443

lvlxp[77]=1475581

lvlxp[78]=1629200

lvlxp[79]=1798808

lvlxp[80]=1986068

lvlxp[81]=2192818

lvlxp[82]=2421087

lvlxp[83]=2673114

lvlxp[84]=2951373

lvlxp[85]=3258594

lvlxp[86]=3597792

lvlxp[87]=3972294

lvlxp[88]=4385776

lvlxp[89]=4842295

lvlxp[90]=5346332

lvlxp[91]=5902831

lvlxp[92]=6517253

lvlxp[93]=7195629

lvlxp[94]=7944614

lvlxp[95]=8771558

lvlxp[96]=9684577

lvlxp[97]=10692629

lvlxp[98]=11805606

lvlxp[99]=13034431; //end the level xp array!

//this makes some sort of cuntion thing which i'll subtly ignore. na, this function is called by the main page using params calc( desired level form field identifier , current experience );
function calc(Dlvl,Cxp){var xpdif=lvlxp[Dlvl]-Cxp


var x=0 //this makes a variable that lets us churn out all the numbers a few lines down in the script

var number=0 //set the default number to 0 and create the variable for later

//BELOW: this is a while { } loop, similar to in php. While the variable X is less than 50, the script repeats. You will notice that towards the end of the while function, there is "x = x++" which increases X by 1. this will happen until it is 50.
//!ignore: var arraynos = new Array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19);

while (x<50){
//	coursexp[x] = (coursexp[x]*3.5);

/* alert(coursexp[x] * 3.5); */
if(document.getElementById("ga2b").checked) { //g altar 2 burner
number=xpdif/(coursexp[x]*3.5)
}
else if(document.getElementById("ga1b").checked) { //g altar 1 burner
number=xpdif/(coursexp[x]*3)
}
else if(document.getElementById("ga").checked) { //g altar
number=xpdif/(coursexp[x]*2.5)
}
else if(document.getElementById("ecto").checked) { //g altar
number=xpdif/(coursexp[x]*4)
}
else
{
	number=xpdif/coursexp[x]
}
//if you want my opinion, the line below just confuses me.
if(number.length!=1){number=Math.ceil(number*Math.pow(10,0))/Math.pow(10,0)}

//if the variable 'x' is 0 / zero, tell the script to change the form field to var 'number'
if (x==0){document.output.bones.value=number
doimg(1, "imageone"); //makes red/green image appear on the main html/php page indicating if you can do the specified action. :)
}

if (x==1){document.output.loar.value=number
doimg(1, "imagetwo");
}

if (x==2){document.output.phrin.value=number
doimg(1, "imagethree");
}

if (x==3){document.output.riyl.value=number
doimg(1, "imagefour");
}

if (x==4){document.output.asyn.value=number
doimg(1, "imagefive");
}

if (x==5){document.output.fiyr.value=number
doimg(1, "imagesix");
}

if (x==6){document.output.ghast.value=number
doimg(1, "imageseven");
}

if (x==7){document.output.burnt.value=number
doimg(1, "imageeight");
}

if (x==8){document.output.monkey.value=number
doimg(1, "imagenine");
}

if (x==9){document.output.ourg.value=number
doimg(1, "imageten");
}

if (x==10){document.output.raurg.value=number
doimg(1, "imageeleven");
}

if (x==11){document.output.wolf.value=number
doimg(1, "imagetwelve");
}

if (x==12){document.output.bat.value=number
doimg(1, "imagethirteen");
}

if (x==13){document.output.bigbones.value=number
doimg(1, "imagefourteen");
}

if (x==14){document.output.babyd.value=number
doimg(1, "imagefifteen");
}

if (x==15){document.output.wyvern.value=number
doimg(1, "imagesixteen");
}

if (x==16){document.output.dragon.value=number
doimg(1, "imageseventeen");
}

if (x==17){document.output.zogre.value=number
doimg(1, "imageeighteen");
}

if (x==18){document.output.fayrg.value=number
doimg(1, "imagenineteen");
}

if (x==19){document.output.dagannoth.value=number
doimg(1, "imagetwenty");
}

//increase var 'x' by ONE.
x++

} //end while function
} //end calc(); function
