var classrq = [];
var progress = [];

/* Recruitment Bar - Class Needs
 ********************************************
- Each class variable is set up as follows:
   class.push ([ "Thumbnail Image URL",
    "Class Name",
    "Class Needs"
   ])
- recruitKeyWord defines the word to match in the "Class Needs" to
  set icon dimmer, the text is case sensitive.
 ******************************************** */
var recruitTitle = "Recruitment";
var recruitKeyWord = "Closed";
var recruitIconsPerRow = 10;
var recruitTooltipWidth = 150;
var linkToRecruitmentPost = "http://recruitme.com";

classrq.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/dk.png",
 "<font color=#c41f3b>Death Knight</font>",
 "Only Gnomes need apply!"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/druid.gif",
 "<img src='http://www.guildportal.com/GuildImages/WOWRosterImages/druid.gif' style='float:right;'><font color=#ff7d0a>Druid</font>",
 "Feral<br>Resto"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/hunter.gif",
 "<font color=#abd473>Hunter</font>",
 "BM with an annoyingly large Dinosaur"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/mage.gif",
 "<font color=#69ccf0>Mage</font>",
 "Frost/Arcane"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/paladin.gif",
 "<font color=#f58cba>Paladin</font>",
 "Prot<br>Holy"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/priest.gif",
 "<font color=#ffffff>Priest</font>",
 "Shadow<br>Holy"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/rogue.gif",
 "<font color=#fff569>Rogue</font>",
 "Closed"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/shaman.gif",
 "<font color=#2459ff>Shaman</font>",
 "Resto"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/warlock.gif",
 "<font color=#9482c9>Warlock</font>",
 "Affliction"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/warrior.gif",
 "<font color=#c79c6e>Warrior</font>",
 "Closed"
]);

/* Progress Bar - Instance and Boss status
********************************************
- Each progression variable is set up as follows:
   wowWotLK.push ([
    ["Thumbnail Image URL"],
    ["Instance Name", "Instance Status - 10 man", "Instance Status - 25 man"],
    ["Instance Boss #1", "Boss #1 Status - 10 man", "Boss #1 Status - 25 man"],
    ["Instance Boss #2", "Boss #2 Status - 10 man", "Boss #2 Status - 10 man"],
    ...
    ["Last Instance Boss", "Last Boss Status - 10 man", "Last Boss Status - 10 man"]
   ]);
- The "raidingKeyWord" defines the word to match in the "Instance Status"
  to set icon dimmer, the text is case sensitive. Default is set to "No"...
  so, the words "No", "Not", "None" and "Noogies" will all cause the
  instance icon to dim. Also, leaving the "Instance Status" and the first
  boss status ("Boss #1 Status") blank will dim the icon.
- The "bossKilledKeyWord" defines the word to match to then apply the
  "killedBoss" and "killedText" CSS classes to the text.
******************************************** */
var raidingTitle = "Progression";
var raidingKeyWord = "No|closed|unknown";
var bossKilledKeyWord = "Killed";
var bossAttemptedKeyWord = "Attempted|%";
var raidingIconsPerRow = 10;
var tooltipBossWidth = 275;
var tooltipKilledWidth = 80;
var linkToRaidingSite = "http://www.wowprogress.com/guild/eu/the-venture-co/Veneficus+Ex";

/* ********************************************
   Wrath of the Lich King
   ******************************************** */
// NAXXRAMAS II
progress.push ([
 ["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/Nax2.gif"]
,["Naxxramas II", "(10 man)<br>In Progress", "(25 man)"]
,["AW: Patchwerk", "Killed", "Killed"]
,["AW: Grobbulus", "Killed", "Killed"]
,["AW: Gluth", "Killed", "Killed"]
,["AW: Thaddius", "Killed", "Killed"]
,["PW: Noth the Plaguebringer", "Killed", "Killed"]
,["PW: Heigan the Unclean", "Killed", "Killed"]
,["PW: Loatheb", "Killed", "Killed"]
,["SW: Anub'Rekhan", "Killed", "Killed"]
,["SW: Grand Widow Faerlina", "Killed", "Killed"]
,["SW: Maexxna", "Killed", "Killed"]
,["DW: Instructor Razuvious", "Killed", "Killed"]
,["DW: Gothik the Harvester", "Killed", "Killed"]
,["DW: The Four Horsemen", "Killed", "Killed"]
,["FL: Sapphiron", "Killed", "Killed"]
,["KC: Kel'Thuzad", "Killed", "Killed"]
]);

// VAULT OF ARCHAVON
progress.push ([
 ["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/VoA.gif"]
,["Vault of Archavon", "(10 man)", "(25 man)"]
,["Archavon the Stone Watcher", "Killed", "Killed"]
,["Emalon the Storm Watcher", "Killed", "Killed"]
,["Kolaron the Flame Watcher", "Killed", "Killed"]
]);

// CHAMBER OF ASPECTS
progress.push ([
 ["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/OS.gif"]
,["Chamber of Aspects", "(10 man)", "(25 man)"]
,["Sartharion the Onyx Guardian", "Killed", "Killed"]
,["Sartharion + 1 Drake", "Killed", "Killed"]
,["Sartharion + 2 Drakes", "Killed", "Killed"]
,["Sartharion + 3 Drakes", "Killed", "Killed"]
]);

// THE EYE OF ETERNITY
progress.push ([
 ["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/EoE.gif"]
,["The Eye of Eternity", "(10 man)", "(25 man)"]
,["Malygos", "Killed", "Killed"]
]);

// ULDUAR
progress.push ([
 ["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/ulduar.gif"]
,["Ulduar", "(10 man)", "(25 man)"]
,["Flame Leviathan", "Killed", "Killed"]
,["Ignis the Furnace Master", "Killed", "Killed"]
,["Razorscale", "Killed", "Killed"]
,["XT-002 Deconstructor", "Killed", "Killed"]
,["The Iron Council", "Killed", "Killed"]
,["Kologarn", "Killed", "Killed"]
,["Auriya", "Killed", "Killed"]
,["Mimiron", "Killed", "Killed"]
,["Watcher Freya", "Killed", "Killed"]
,["Watcher Thorim", "Killed", "Killed"]
,["Watcher Hodir", "Killed", "Killed"]
,["General Vezax", "Killed", "Killed"]
,["Yogg-Saron", "Killed", ""]
,["Algalon the Observer", "Killed", ""]
]);

// ONYXIA
progress.push ([
 ["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/onx.gif"]
,["Onyxia", "(10 Heroic)", "(25 Heroic)"]
,["Onyxia", "Killed", "Killed"]
]);

// TRIAL OF THE CRUSADER
progress.push([
 ["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/Crusader.gif"]
,["Trial of the Crusader", "(10 man)", "(25 man)"]
,["Northrend Beasts", "Killed", "Killed"]
,["Lord Jaraxxus", "Killed", "Killed"]
,["Faction Champions", "Killed", "Killed"]
,["Twin Val'kyr", "Killed", "Killed"]
,["Anub'arak", "Killed", "Killed"]
]);

// TRIAL OF THE GRAND CRUSADER (HEROIC)
progress.push([
 ["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/GrandCrusader.gif"]
,["Trial of the Grand Crusader", "(10 Heroic)", "(25 Heroic)"]
,["Northrend Beasts", "Killed", "Killed"]
,["Lord Jaraxxus", "Killed", "Killed"]
,["Faction Champions", "Killed", ""]
,["Twin Val'kyr", "Killed", ""]
,["Anub'arak", "Killed", ""]
]);

// ICECROWN CITADEL
progress.push ([
 ["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/icc.png"]
,["Icecrown Citadel", "(10 man)", "(25 man)"]
,["Lord Marrowgar", "Killed", "Killed"]
,["Lady Deathwhisper", "Killed", "Killed"]
,["Icecrown Gunship Battle", "Killed", "Killed"]
,["Deathbringer Saurfang", "Killed", "Killed"]
,["Festergut", "Killed", "Killed"]
,["Rotface", "Killed", "Killed"]
,["Professor Putricide", "Killed", "Killed"]
,["Blood Prince Council", "Killed", "Killed"]
,["Blood-Queen Lana'thel", "Killed", ""]
,["Valithria Dreamwalker", "Killed", ""]
,["Sindragosa", "Killed", ""]
,["The Lich King", "", ""]
]);

/*********************************************
 Don't change anything below
 *********************************************/
// Recruitment bar
var sQ = '&quot;';
var rb = '<div><a href="' + linkToRecruitmentPost + '">' + recruitTitle + '</a></div>';
 for (var j=0; j<classrq.length; j++) {
  rb += '<a href="' + linkToRecruitmentPost + '" class="tooltip" rel="' + recruitTooltipWidth + '" title="<span class=recruitToolTip>' +
   classrq[j][1].replace(/\"/g,sQ) + '</span><br>' + classrq[j][2].replace(/\"/g,sQ) + '"><img src="' + classrq[j][0].replace(/\"/g,sQ) + '"';
  if (classrq[j][2].match(recruitKeyWord)) { rb += ' class=dim'; }
  rb += '></a>';
  if ( (j+1)%recruitIconsPerRow == 0 ) { rb += '<br>'; }
 }
 rb += '</a>';

// Progression Bar
var pb = '<div><a href="' + linkToRaidingSite + '">' + raidingTitle + '</a></div>';
 for (var inst=0; inst < progress.length; inst++) {
  pb += '<a href="' + linkToRaidingSite + '" class="tooltip" title="<table><tr><td class=raidingToolTip width=' +
   tooltipBossWidth + '>' + progress[inst][1][0].replace(/\"/g,sQ) + '</td><td align=center valign=top nowrap width=' +
   tooltipKilledWidth + '>' + progress[inst][1][1].replace(/\"/g,sQ) + '</td><td align=center valign=top nowrap width=' +
   tooltipKilledWidth + '>' + progress[inst][1][2].replace(/\"/g,sQ) + '</td></tr>';
  for (var boss=2; boss<(progress[inst].length); boss++) {
   pb += '<tr><td';
   pb += (progress[inst][boss][1].match(bossKilledKeyWord) && progress[inst][boss][2].match(bossKilledKeyWord)) ? ' class=killedBoss>' : '>';
   pb += progress[inst][boss][0].replace(/\"/g,sQ) + '</td><td align=center';
   pb += (progress[inst][boss][1].match(bossAttemptedKeyWord)) ? ' class=attemptedBoss' : '';
   pb += (progress[inst][boss][1].match(bossKilledKeyWord)) ? ' class=killedText' : '';
   pb += '>' + progress[inst][boss][1] + '</td><td align=center';
   pb += (progress[inst][boss][2].match(bossAttemptedKeyWord)) ? ' class=attemptedBoss' : '';
   pb += (progress[inst][boss][2].match(bossKilledKeyWord)) ? ' class=killedText' : '';
   pb += '>' + progress[inst][boss][2] + '</td></tr>';
  }
  pb += '</table>" rel="' + (tooltipBossWidth + tooltipKilledWidth) + '"><img src="' + progress[inst][0] + '"';
  if (progress[inst][1][1].match(raidingKeyWord) || (progress[inst][1][1] == '' && progress[inst][2][1] == '')) pb += ' class=dim';
  pb += '></a>';
  if ( (inst+1)%raidingIconsPerRow == 0 ) { pb += '<br>'; }
 }
 pb += '</a>';
 $('#recruitBar').html(rb);
 $('#raidingBar').html(pb);