var classrq = new Array();
var progress = new Array();

/* 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 recruitImagesPerRow = 10;
var linkToRecruitmentPost = "http://wow.mygamemug.com/register/user/?group_id=2488&t=BADGE_REF_CODE.xp2tdNH2gnipjCjBMKs6xw";

classrq.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/dk.png",
"<font color=#c41f3b>Death Knight</font>",
"DPS/Tank"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/druid.gif",
"<font color=#ff7d0a>Druid</font>",
"Feral/Resto/Boom"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/hunter.gif",
"<font color=#abd473>Hunter</font>",
"Open"
]);
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>",
"Closed"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/priest.gif",
"<font color=#ffffff>Priest</font>",
"Shadow/Holy"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/rogue.gif",
"<font color=#fff569>Rogue</font>",
"Open"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/shaman.gif",
"<font color=#2459ff>Shaman</font>",
"Resto/Elemental"
]);
classrq.push (["http://www.guildportal.com/GuildImages/WOWRosterImages/warlock.gif",
"<font color=#9482c9>Warlock</font>",
"Open"
]);
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:
progress.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 raidingImagesPerRow = 9;
var tooltipBossWidth = 275;
var tooltipKilledWidth = 80;
var linkToRaidingSite = "http://wow.guildprogress.com/US/Jaedenar/Phoenix_Rising";

/* ********************************************
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", ""]
,["AW: Gluth", "Killed", ""]
,["AW: Thaddius", "Killed", ""]
,["PW: Noth the Plaguebringer", "Killed", ""]
,["PW: Heigan the Unclean", "Killed", ""]
,["PW: Loatheb", "Killed", ""]
,["SW: Anub'Rekhan", "Killed", ""]
,["SW: Grand Widow Faerlina", "Killed", ""]
,["SW: Maexxna", "Killed", ""]
,["DW: Instructor Razuvious", "Killed", ""]
,["DW: Gothik the Harvester", "Killed", ""]
,["DW: The Four Horsemen", "Killed", ""]
,["FL: Sapphiron", "Killed", ""]
,["KC: Kel'Thuzad", "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", "", ""]
,["Kolaron the Flame Watcher", "", ""]
]);

// 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", "", ""]
,["Sartharion + 2 Drakes", "", ""]
,["Sartharion + 3 Drakes", "", ""]
]);

// 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", ""]
]);

// ULDUAR
progress.push ([
["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/ulduar.gif"]
,["Ulduar", "(10 man)", "(25 man)"]
,["Flame Leviathan", "Killed", ""]
,["Ignis the Furnace Master", "Killed", ""]
,["Razorscale", "Killed", ""]
,["XT-002 Deconstructor", "Killed", ""]
,["The Iron Council", "Killed", ""]
,["Kologarn", "Killed", ""]
,["Auriya", "Killed", ""]
,["Mimiron", "Killed", ""]
,["Watcher Freya", "Killed", ""]
,["Watcher Thorim", "Killed", ""]
,["Watcher Hodir", "Killed", ""]
,["General Vezax", "100%", ""]
,["Yogg-Saron", "100%", ""]
,["Algalon the Observer", "100%", ""]
]);


// 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", ""]
,["Lord Jaraxxus", "Killed", ""]
,["Faction Champions", "Killed", ""]
,["Twin Val'kyr", "Killed", ""]
,["Anub'arak", "Killed", ""]
]);

// TRIAL OF THE GRAND CRUSADER
progress.push([
["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/GrandCrusader.gif"]
,["Trial of the Grand Crusader", "(10 Heroic)", "(25 Heroic)"]
,["Northrend Beasts", "", ""]
,["Lord Jaraxxus", "", ""]
,["Faction Champions", "", ""]
,["Twin Val'kyr", "", ""]
,["Anub'arak", "", ""]
]);

// ICECROWN CITADEL
progress.push ([
["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/Unk-10.gif"]
,["Icecrown Citadel", "(10 man)<br>-closed-", "(25 man)<br>-closed-"]
,["-unknown-", "", ""]
,["The Lich King", "", ""]
]);

/* ********************************************
Don't change anything below
******************************************** */
// Recruitment bar
var sQ = "&#92;&#39;";
var rb = "<div><a href=\"" + linkToRecruitmentPost + "\">" + recruitTitle + "</a></div>";
for (var j=0; j<classrq.length; j++) {
rb += "<a href=\"" + linkToRecruitmentPost;
rb += "\" onMouseover=\"ddrivetip('<span class=recruitToolTip>";
rb += classrq[j][1].replace(/\'/g,sQ);
rb += "</span><br>" + classrq[j][2].replace(/\'/g,sQ);
rb += "', '', '300');\" onMouseout=\"hideddrivetip()\"><img src=\"";
rb += classrq[j][0].replace(/\'/g,sQ) + "\"";
if (classrq[j][2].match(recruitKeyWord)) { rb += " class=dim"; }
rb += "></a>";
if ( (j+1)%recruitImagesPerRow == 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 + "\" onMouseout=\"hideddrivetip()\"";
pb += " onMouseover=\"ddrivetip('<table><tr><td class=raidingToolTip width=" + tooltipBossWidth + "px>" + progress[inst][1][0].replace(/\'/g,sQ);
pb += "</td><td align=center valign=top nowrap width=" + tooltipKilledWidth + "px>" + progress[inst][1][1].replace(/\'/g,sQ);
pb += "</td><td align=center valign=top nowrap width=" + tooltipKilledWidth + "px>" + 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>', '', '" + (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)%raidingImagesPerRow == 0 ) { pb += "<br>"; }
}
pb += "</a>";
$('#recruitBar').html(rb);
$('#raidingBar').html(pb);
