function character(used, type, m, ws, bs, s, t, w, i, a, ld, mount, equip, magic, cost) {
	this.used=used; this.type=type; this.m=m; this.ws=ws; this.bs=bs; this.s=s; this.t=t
	this.w=w; this.i=i; this.a=a; this.ld=ld; this.mount=mount; this.equip=equip
	this.magic=magic; this.cost=cost
}
function regiment(used, amount, type, m, ws, bs, s, t, w, i, a, ld, mount, equip, stand, music, banner, cost) {
	this.used=used; this.amount=amount; this.type=type; this.m=m; this.ws=ws; this.bs=bs
	this.s=s; this.t=t; this.w=w; this.i=i; this.a=a; this.ld=ld; this.mount=mount
	this.equip=equip; this.stand=stand; this.music=music; this.banner=banner; this.cost=cost
}
function mRegiment(amount, type, m, ws, bs, s, t, w, i, a, ld, cost) {
	this.amount=amount; this.type=type; this.m=m; this.ws=ws; this.bs=bs
	this.s=s; this.t=t; this.w=w; this.i=i; this.a=a; this.ld=ld; this.cost=cost
}
function mount(name, m, ws, bs, s, t, w, i, a, ld) {
	this.name=name; this.m=m; this.ws=ws; this.bs=bs; this.s=s; this.t=t; this.w=w; this.i=i
	this.a=a; this.ld=ld
}
function chariot(name, m, ws, bs, s, t, w, i, a, ld, amountB, beasts) {
	this.name=name; this.m=m; this.ws=ws; this.bs=bs; this.s=s; this.t=t; this.w=w; this.i=i
	this.a=a; this.ld=ld; this.amountB=amountB; this.beasts=beasts
}
mounts=new Array()
mounts[0]=new mount("None")
mounts[1]=new mount("Horse", 8, 0, 0, 3, 3, 1, 3, 0, 5)
mounts[2]=new mount("Warhorse", 8, 3, 0, 3, 3, 1, 3, 1, 5)
mounts[3]=new mount("Elven Steed", 9, 3, 0, 3, 3, 1, 4, 1, 5)
mounts[4]=new mount("Dark Steed", 9, 3, 0, 3, 3, 1, 4, 1, 5)
mounts[5]=new mount("Cold One", 8, 3, 0, 4, 4, 1, 1, 2, 3)
mounts[6]=new mount("Warboar", 7, 4, 0, 3, 4, 1, 3, 1, 3)
mounts[7]=new mount("Giant Wolf", 9, 4, 0, 3, 3, 1, 3, 1, 3)
mounts[8]=new mount("Giant Spider", 7, 3, 0, 4, 3, 1, 1, 1, 5)
mounts[9]=new mount("Chaos Steed", 8, 4, 0, 4, 4, 1, 4, 1, 5)
mounts[10]=new mount("Tuskgor", 7, 3, 0, 4, 4, 2, 2, 1, 3)
mounts[11]=new mount("Skeleton Steed")
mounts[12]=new mount("Chaos Dragon", 6, 6, 0, 7, 7, 7, 6, 8, 8)
mounts[13]=new mount("Chimera", 6, 4, 0, 7, 6, 6, 4, 6, 8)
mounts[14]=new mount("Cockatrice", 4, 3, 0, 4, 4, 2, 4, 3, 6)
mounts[15]=new mount("________Dragon", 6, 6, 0, 6, 6, 7, 8, 7, 7)
mounts[16]=new mount("________Great Dragon", 6, 7, 0, 7, 7, 8, 7, 8, 8)
mounts[17]=new mount("________Emperor Dragon", 6, 8, 0, 8, 8, 9, 6, 9, 9)
mounts[18]=new mount("Giant Scorpion", 5, 3, 0, 5, 4, 4, 1, 2, 7)
mounts[19]=new mount("Gigantic Spider", 5, 3, 0, 5, 4, 4, 1, 2, 7)
mounts[20]=new mount("Gorgon", 4, 2, 3, 3, 3, 3, 5, 1, 9)
mounts[21]=new mount("Great Eagle", 2, 7, 0, 5, 4, 3, 5, 2, 8)
mounts[22]=new mount("Great Taurus", 6, 6, 0, 6, 6, 5, 7, 4, 8)
mounts[23]=new mount("Griffon", 6, 5, 0, 6, 5, 5, 7, 4, 8)
mounts[24]=new mount("Hippogriff", 8, 5, 0, 6, 5, 5, 6, 3, 8)
mounts[25]=new mount("Hydra", 6, 3, 0, 5, 6, 7, 3, 5, 6)
mounts[26]=new mount("War Hydra", 6, 4, 0, 5, 6, 7, 3, 5, 8)
mounts[27]=new mount("Lammasu", 6, 6, 0, 6, 7, 5, 6, 3, 8)
mounts[28]=new mount("Manticore", 6, 6, 0, 7, 7, 5, 4, 4, 8)
mounts[29]=new mount("Pegasus", 8, 3, 0, 4, 4, 3, 4, 2, 5)
mounts[30]=new mount("Dark Pegasus", 8, 3, 0, 4, 4, 3, 4, 2, 5)
mounts[31]=new mount("Unicorn", 9, 5, 0, 4, 4, 3, 4, 2, 9)
mounts[32]=new mount("Wyvern", 6, 5, 0, 5, 6, 4, 4, 3, 5)
mounts[33]=new mount("Juggernaut of Khorne", 7, 3, 0, 5, 5, 3, 2, 2, 10)
mounts[34]=new mount("Beast of Nurgle", 3, 3, 0, 3, 5, 3, 3, "D6", 6)
mounts[35]=new mount("Disk of Tzeentch", 12, 3, 0, 3, 3, 1, 3, 1, 10)
mounts[36]=new mount("Steed of Slaanesh", 12, 3, 0, 4, 5, 1, 6, 1, 10)
coldOneB=new mount("Cold Ones", 8, 3, 0, 4, 4, 1, 4, 2, 3)
mounts[37]=new chariot("Black Chariot", "-", "-", "-", 7, 7, 3, "-", "D6", "-", 2, coldOneB) // for witch king  
mounts[38]=new chariot("Chariot", "-", "-", "-", 7, 7, 3, 1, "-", "-", 2, mounts[9])	// \
mounts[39]=new chariot("Chariot", "-", "-", "-", 7, 7, 3, 1, "-", "-", 2, mounts[2])	//  \
mounts[40]=new chariot("Chariot", "-", "-", "-", 7, 7, 3, 1, "-", "-", 2, mounts[33])	//   \
mounts[41]=new chariot("Chariot", "-", "-", "-", 7, 7, 3, 1, "-", "-", 2, mounts[34])	//   / Chaos Chariots
mounts[42]=new chariot("Chariot", "-", "-", "-", 7, 7, 3, 1, "-", "-", 2, mounts[35])	//  /
mounts[43]=new chariot("Chariot", "-", "-", "-", 7, 7, 3, 1, "-", "-", 2, mounts[36])	// /
mounts[44]=new chariot("Chariot", "-", "-", "-", 7, 7, 3, 1, "-", "-", 2, mounts[10])	// Beatstman chariot


function calcCommon(army, c) {
	for (i=0; i<c; i++) { if (chars[i].used==true) { charTotal+=chars[i].cost } }
	for (i=0; i<11; i++) { if (units[i].used==true) { regTotal+=units[i].cost } }
	monstTotal+=parseInt(document.monsters.monsterTotal.value)
	miscTotal+=parseInt(document.misc.misc.value)
}
function checkCommon(army) {
	if (charTotal>(size/2)) {
		over=charTotal-(size/2); allowed=false
		alert("You are "+over+" points over your character allowance")
	}
	if (regTotal<(size/4)) {
		under=(size/4)-regTotal; allowed=false
		alert("You need "+under+" more points of regiments to fill the regiment requirements")
	}
	if (warTotal>(size/4)) {
		over=warTotal-(size/4); allowed=false
		alert("You are "+over+" points over your war machine allowance")
	}
	if (monstTotal>(size/4)) {
		over=monstTotal-(size/4); allowed=false
		alert("You are "+over+" points over your monster allowance")
	}
	total+=charTotal; total+=regTotal; total+=warTotal; total+=monstTotal; total+=miscTotal
	if (total>size) {
		over=total-size; allowed=false
		alert("Your army is "+over+" points over the size you have indicated.")
	}
}
function wr(toType) { p.document.write(toType) }