/* --------- Faction Lore ------------- */
loreTexts["alliance"] = "<h3>Honor Hold</h3>\
Honor Hold stands to the south of both the Path of Glory and Hellfire Citadel. After the Second War, an expedition was sent through the Dark Portal to put an end to the orcish threat once and for all. Led by the valiant General Turalyon and the archmage Khadgar, the expedition did its best to fulfill its mission, waging fierce battles on the orcs of Draenor. Yet when reckless magic began to tear Draenor apart, the expedition members had to sacrifice their only chance of returning home by closing the Draenor end of the Dark Portal. Back on Azeroth, the expedition members were honored for their sacrifice and presumed dead.\
<br /><br />\
Cut off from Azeroth for almost twenty years, the expedition fought to maintain a foothold on Outland. They took to calling themselves the Sons of Lothar in honor of the late Anduin Lothar. The recent reactivation of the Dark Portal brought turmoil to Outland, but also led to Azeroth's discovery that there were survivors from the long-lost expedition. Reinforcements from Azeroth hastened to aid the Sons of Lothar, who were still holding several strongholds on Outland, including Honor Hold. Although the orc race remains undefeated, the Sons of Lothar, including those in Honor Hold, have new hope. Bolstered by fresh troops, the expedition members struggle to complete their original mission and return home to Azeroth at last.\
<br /><br />\
Such a task remains fraught with peril, though, for Honor Hold is caught between two dangerous enemies. In Hellfire Citadel, orcish forces are assembling once again. Whatever the reason for the fel orcs' presence at the citadel may be, their growing military strength could have dire consequences for both Outland and Azeroth. Furthermore, the Burning Legion has arrived in Hellfire Peninsula. Demons are pouring out of Legion gateways near the Dark Portal in alarming numbers, threatening to overrun the portal. Fresh troops from Azeroth, both Horde and Alliance, are fighting to keep the demons from entering the portal.\
<br /><br />";
loreTexts["horde"] = "<h3>Thrallmar</h3>\
The Horde's newly established base of operations in Hellfire Peninsula is Thrallmar, which overlooks the Path of Glory and Hellfire Citadel from the north. Shortly after arriving in Outland, a Horde expeditionary force set up this new base, but they were soon cut off from Azeroth by Legion forces that moved in to retake the Dark Portal. Now the people of Thrallmar are caught between a rock and a hard place.\
<br /><br />\
To the north and east, the Burning Legion has constructed forge camps that provide the Legion with regular reinforcements. These camps are fortified by powerful cannons, and the demons there are a constant threat to Thrallmar. If the forge camps are allowed to remain, it will be only a matter of time before Legion forces invade Thrallmar. To the south of Thrallmar, at the massive stronghold dominating the Path of Glory, an orcish army is forming once again. However, these orcs are different from the original occupants of the gargantuan fortress: the forces amassing at Hellfire Citadel are red, furious fel orcs. Whatever authority these orcs answer to is unknown, but it is a strongly held belief that they are not working for the Burning Legion.\
<br /><br />\
For the most part, Thrallmar has been cut off from regular reinforcements. As a result, its inhabitants are forced to rely on the help of Horde adventurers to aid Thrallmar in its struggle against the many threats of Hellfire Peninsula.\
<br /><br />";

//CONSTRUCTOR

function RewardItem(playerFaction, itemName, itemIcon, itemMoneyPrice, itemHonorPrice, itemTokenPrice, itemCost, itemStats, itemHTML)
{													//Constructor for RewardItem datatype; accepts up to 7 arguments
  this.playerFaction	 		= playerFaction;					//string variable, can be "alliance", "horde" or "both"
  this.itemName		 	 			= itemName;								//string variable, contains the name shown in the rewards list
  this.itemIcon		 	 			= itemIcon;								//string variable, contains path to item icon to be used
  this.itemMoneyPrice			=	itemMoneyPrice;
  this.itemHonorPrice		 	= itemHonorPrice;					//how much the item costs, in HONOR POINTS
  this.itemTokenPrice			= itemTokenPrice;
  this.itemCost						= itemCost;
	this.itemStats		 			= itemStats;							//Array
  this.itemHTML			 			= itemHTML;								//string variable, contains the HTML code for the item
}

tokenIcons = new Array("honorholdtoken","thrallmartoken","nether","warsong");
//(thisObject.itemTokenPrice) ? processPrice(thisObject.itemHonorPrice[thisBracket],thisObject.itemTokenPrice[thisBracket]) : 
function selectBracket(thisObject,thisBracket)
{
  if (thisBracket >= 0)
  {
    if (thisObject.itemStats[thisBracket])
		{
			thisObject.itemCost = generateCostString(thisObject,thisBracket);
			thisObject.itemHTML = thisObject.itemStats[thisBracket];
		}
    else
		{
			thisObject.itemHTML = "none";
			thisObject.itemCost = "none";
			selectBracket(thisObject,thisBracket-1);
		}
  }
}

function generateCostString(thisObject,thisBracket)
{
	outPutString = "";
	if(thisObject.itemMoneyPrice && thisObject.itemMoneyPrice[thisBracket])
	{
		copperPart = thisObject.itemMoneyPrice[thisBracket];
		goldPart = Math.floor(copperPart / 10000);
		if (goldPart >= 1) copperPart -= goldPart * 10000;
		silverPart = Math.floor(copperPart / 100);
		if (silverPart >= 1) copperPart -= silverPart * 100;
		if (goldPart > 0) outPutString += goldPart+"<img src='/info/basics/factions/images/icons/gold.gif'>&nbsp;";
		if (silverPart > 0) outPutString += silverPart+"<img src='/info/basics/factions/images/icons/silver.gif'>&nbsp;";
		if (copperPart > 0) outPutString += copperPart+"<img src='/info/basics/factions/images/icons/copper.gif'>&nbsp;";
	}
	if(thisObject.itemHonorPrice && thisObject.itemHonorPrice[thisBracket])
	{
		outPutString += thisObject.itemHonorPrice[thisBracket]+"<img src='/info/basics/factions/images/icons/"+thisObject.playerFaction+"-honor.gif'>&nbsp;";
	}
	if(thisObject.itemTokenPrice && thisObject.itemTokenPrice[thisBracket])
	{
		for(carl=0; carl<thisObject.itemTokenPrice[thisBracket].length; carl++)
		{
			if (thisObject.itemTokenPrice[thisBracket][carl] > 0) outPutString += thisObject.itemTokenPrice[thisBracket][carl]+"<img src='/info/basics/factions/images/icons/"+tokenIcons[carl]+".gif'>&nbsp;";
		}
	}
	return outPutString;
}

//------BEGIN REWARDS DEFINITION------
i = 0;
var RewardItems = new Array();

var fMightyBloodGarnet = new RewardItem("alliance","Mighty Blood Garnet","/info/basics/factions/images/icons/INV_Misc_Gem_Bloodstone_02.gif");
fMightyBloodGarnet.itemTokenPrice = new Array();
fMightyBloodGarnet.itemTokenPrice[0] = new Array(10,0,0,0);
fMightyBloodGarnet.itemStats = new Array();
fMightyBloodGarnet.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Mighty Blood Garnet</span>\
<br>Binds when picked up<br>Unique<br>\
<br>+14 Attack Power<br>\
<span class=\"myYellow\">\"Matches a Red Socket.\"</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fMightyBloodGarnet; ++i;

var fStarkBloodGarnet = new RewardItem("alliance","Stark Blood Garnet","/info/basics/factions/images/icons/INV_Misc_Gem_Ruby_01.gif");
fStarkBloodGarnet.itemTokenPrice = new Array();
fStarkBloodGarnet.itemTokenPrice[0] = new Array(10,0,0,0);
fStarkBloodGarnet.itemStats = new Array();
fStarkBloodGarnet.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Stark Blood Garnet</span>\
<br>Binds when picked up<br>Unique<br>\
<br>+8 Spell Damage<br>\
<span class=\"myYellow\">\"Matches a Red Socket.\"</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fStarkBloodGarnet; ++i;


var fBarbedDeepPeridot = new RewardItem("alliance","Barbed Deep Peridot","/info/basics/factions/images/icons/INV_Misc_Gem_EmeraldRough_0.gif");
fBarbedDeepPeridot.itemTokenPrice = new Array();
fBarbedDeepPeridot.itemTokenPrice[0] = new Array(10,0,0,0);
fBarbedDeepPeridot.itemStats = new Array();
fBarbedDeepPeridot.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Barbed Deep Peridot</span>\
<br>Binds when picked up<br>Unique<br>\
<br>+3 Stamina, +4 Critical Strike Rating<br>\
<span class=\"myYellow\">\"Matches a Yellow or Blue Socket.\"</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fBarbedDeepPeridot; ++i;

var fNotchedDeepPeridot = new RewardItem("alliance","Notched Deep Peridot","/info/basics/factions/images/icons/INV_Misc_Gem_DeepPeridot_03.gif");
fNotchedDeepPeridot.itemTokenPrice = new Array();
fNotchedDeepPeridot.itemTokenPrice[0] = new Array(10,0,0,0);
fNotchedDeepPeridot.itemStats = new Array();
fNotchedDeepPeridot.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Notched Deep Peridot</span>\
<br>Binds when picked up<br>Unique<br>\
<br>+3 Stamina, +4 Spell Critical Strike Rating<br>\
<span class=\"myYellow\">\"Matches a Yellow or Blue Socket.\"</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fNotchedDeepPeridot; ++i;

var fBandOfTheVictor = new RewardItem("alliance","Band of the Victor","/info/basics/factions/images/icons/INV_jewelry_ring_36_aee84_8.gif");
fBandOfTheVictor.itemTokenPrice = new Array();
fBandOfTheVictor.itemTokenPrice[0] = new Array(15,0,0,0);
fBandOfTheVictor.itemStats = new Array();
fBandOfTheVictor.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Band of the Victor</span>\
<br>Binds when picked up<br>Unique<br>Finger<br>+25 Stamina<br>Requires Level 60<br>\
Red Socket<br>\
Socket Bonus: +4 Attack Power<br>\
<span class=\"myGreen\">Equip: Improves critical strike rating by 13.</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fBandOfTheVictor; ++i;

var fCircletOfTheVictor = new RewardItem("alliance","Circlet of the Victor","/info/basics/factions/images/icons/INV_jewelry_ring_36_aee84_8.gif");
fCircletOfTheVictor.itemTokenPrice = new Array();
fCircletOfTheVictor.itemTokenPrice[0] = new Array(15,0,0,0);
fCircletOfTheVictor.itemStats = new Array();
fCircletOfTheVictor.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Circlet of the Victor</span>\
<br>Binds when picked up<br>Unique<br>Finger<br>+25 Stamina<br>Requires Level 60<br>\
Red Socket<br>\
Socket Bonus: +2 Spell Damage<br>\
<span class=\"myGreen\">Equip: Improves spell critical strike rating by 13.</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fCircletOfTheVictor; ++i;

var fHonorHoldFavor = new RewardItem("alliance","Honor Hold Favor","/info/basics/factions/images/icons/INV_Banner_02.gif");
fHonorHoldFavor.itemTokenPrice = new Array();
fHonorHoldFavor.itemTokenPrice[0] = new Array(5,0,0,0);
fHonorHoldFavor.itemStats = new Array();
fHonorHoldFavor.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span>Honor Hold Favor<br>Binds when picked up<br>\
<span class=\"myGreen\">Use: In Hellfire Peninsula and Hellfire Citadel, increases Honor Hold reputation gained from killing monsters by 25% and experience gained by 5%.  30 minute duration.</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fHonorHoldFavor; ++i;



//-------------------------------------------------------------------
//---Horde below

var fMightyBloodGarnet = new RewardItem("horde","Mighty Blood Garnet","/info/basics/factions/images/icons/INV_Misc_Gem_Bloodstone_02.gif");
fMightyBloodGarnet.itemTokenPrice = new Array();
fMightyBloodGarnet.itemTokenPrice[0] = new Array(0,10,0,0);
fMightyBloodGarnet.itemStats = new Array();
fMightyBloodGarnet.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Mighty Blood Garnet</span>\
<br>Binds when picked up<br>Unique<br>\
<br>+14 Attack Power<br>\
<span class=\"myYellow\">\"Matches a Red Socket.\"</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fMightyBloodGarnet; ++i;

var fStarkBloodGarnet = new RewardItem("horde","Stark Blood Garnet","/info/basics/factions/images/icons/INV_Misc_Gem_Ruby_01.gif");
fStarkBloodGarnet.itemTokenPrice = new Array();
fStarkBloodGarnet.itemTokenPrice[0] = new Array(0,10,0,0);
fStarkBloodGarnet.itemStats = new Array();
fStarkBloodGarnet.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Stark Blood Garnet</span>\
<br>Binds when picked up<br>Unique<br>\
<br>+8 Spell Damage<br>\
<span class=\"myYellow\">\"Matches a Red Socket.\"</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fStarkBloodGarnet; ++i;


var fBarbedDeepPeridot = new RewardItem("horde","Barbed Deep Peridot","/info/basics/factions/images/icons/INV_Misc_Gem_EmeraldRough_0.gif");
fBarbedDeepPeridot.itemTokenPrice = new Array();
fBarbedDeepPeridot.itemTokenPrice[0] = new Array(0,10,0,0);
fBarbedDeepPeridot.itemStats = new Array();
fBarbedDeepPeridot.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Barbed Deep Peridot</span>\
<br>Binds when picked up<br>Unique<br>\
<br>+3 Stamina, +4 Critical Strike Rating<br>\
<span class=\"myYellow\">\"Matches a Yellow or Blue Socket.\"</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fBarbedDeepPeridot; ++i;

var fNotchedDeepPeridot = new RewardItem("horde","Notched Deep Peridot","/info/basics/factions/images/icons/INV_Misc_Gem_DeepPeridot_03.gif");
fNotchedDeepPeridot.itemTokenPrice = new Array();
fNotchedDeepPeridot.itemTokenPrice[0] = new Array(0,10,0,0);
fNotchedDeepPeridot.itemStats = new Array();
fNotchedDeepPeridot.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Notched Deep Peridot</span>\
<br>Binds when picked up<br>Unique<br>\
<br>+3 Stamina, +4 Spell Critical Strike Rating<br>\
<span class=\"myYellow\">\"Matches a Yellow or Blue Socket.\"</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fNotchedDeepPeridot; ++i;

var fBandOfTheVictor = new RewardItem("horde","Band of the Victor","/info/basics/factions/images/icons/INV_jewelry_ring_36_aee84_8.gif");
fBandOfTheVictor.itemTokenPrice = new Array();
fBandOfTheVictor.itemTokenPrice[0] = new Array(0,15,0,0);
fBandOfTheVictor.itemStats = new Array();
fBandOfTheVictor.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Band of the Victor</span>\
<br>Binds when picked up<br>Unique<br>Finger<br>+25 Stamina<br>Requires Level 60<br>\
Red Socket<br>\
Socket Bonus: +4 Attack Power<br>\
<span class=\"myGreen\">Equip: Improves critical strike rating by 13.</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fBandOfTheVictor; ++i;

var fCircletOfTheVictor = new RewardItem("horde","Circlet of the Victor","/info/basics/factions/images/icons/INV_jewelry_ring_36_aee84_8.gif");
fCircletOfTheVictor.itemTokenPrice = new Array();
fCircletOfTheVictor.itemTokenPrice[0] = new Array(0,15,0,0);
fCircletOfTheVictor.itemStats = new Array();
fCircletOfTheVictor.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div>\
<div class=\"myTable\"><span class=\"myBlue\">Circlet of the Victor</span>\
<br>Binds when picked up<br>Unique<br>Finger<br>+25 Stamina<br>Requires Level 60<br>\
Red Socket<br>\
Socket Bonus: +2 Spell Damage<br>\
<span class=\"myGreen\">Equip: Improves spell critical strike rating by 13.</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fCircletOfTheVictor; ++i;

var fThrallmarFavor = new RewardItem("horde","Thrallmar Favor","/info/basics/factions/images/icons/Racial_Orc_BerserkerStrengt.gif");
fThrallmarFavor.itemTokenPrice = new Array();
fThrallmarFavor.itemTokenPrice[0] = new Array(0,5,0,0);
fThrallmarFavor.itemStats = new Array();
fThrallmarFavor.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span>Thrallmar Favor<br>Binds when picked up<br>\
<span class=\"myGreen\">Use: In Hellfire Peninsula and Hellfire Citadel, increases Thrallmar reputation gained from killing monsters by 25% and experience gained by 5%.  30 minute duration.</span></div>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fThrallmarFavor; ++i;





//------END REWARDS DEFINITION------
