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://rebirthhome.guildportal.com/Guild.aspx?ForumID=730388&GuildID=155118&TabID=2125156";

classrq.push (["http://home.comcast.net/~tank_dawg/class/deathknight.gif",
 "<font color=#c41f3b>Death Knight</font>",
 "Blood <br> Frost <br> Unholy"
]);
classrq.push (["http://home.comcast.net/~tank_dawg/class/druid.gif",
 "<font color=#ff7d0a>Druid</font>",
 "Balance <br> Ferel <br> Restoration"
]);
classrq.push (["http://home.comcast.net/~tank_dawg/class/hunter.gif",
 "<font color=#abd473>Hunter</font>",
 "Beastmaster <br> Marksmanship <br> Survivalists"
]);
classrq.push (["http://home.comcast.net/~tank_dawg/class/mage.gif",
 "<font color=#69ccf0>Mage</font>",
 "Arcane <br> Fire <br> Frost"
]);
classrq.push (["http://home.comcast.net/~tank_dawg/class/paladin.gif",
 "<font color=#f58cba>Paladin</font>",
 "Protection <br> Retribution <br> Holy"
]);
classrq.push (["http://home.comcast.net/~tank_dawg/class/priest.gif",
 "<font color=#ffffff>Priest</font>",
 "Dicipline <br> Holy <br> Shadow"
]);
classrq.push (["http://home.comcast.net/~tank_dawg/class/rogue.gif",
 "<font color=#fff569>Rogue</font>",
 "Assassination <br> Combat <br> Sublety"
]);
classrq.push (["http://home.comcast.net/~tank_dawg/class/shaman.gif",
 "<font color=#2459ff>Shaman</font>",
 "Elemental <br> Enhancement <br> Restoration"
]);
classrq.push (["http://home.comcast.net/~tank_dawg/class/warlock.gif",
 "<font color=#9482c9>Warlock</font>",
 "Affliction <br> Demonology <br> Destruction"
]);
classrq.push (["http://home.comcast.net/~tank_dawg/class/warrior.gif",
 "<font color=#c79c6e>Warrior</font>",
 "Arms <br> Fury <br> Protection"
]);

/* 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 raidingImagesPerRow = 7;
var tooltipBossWidth = 350;
var tooltipKilledWidth = 80;
var linkToRaidingSite = "http://www.wowjutsu.com/us/";

/* ********************************************
   Wrath of the Lich King
   ******************************************** */
// NAXXRAMAS II
progress.push ([
 ["http://home.comcast.net/~tank_dawg/raid/Nax.gif"]
,["Naxxramas II", "(10 man)<br>", "(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"]
]);

// THE EYE OF ETERNITY
progress.push ([
 ["http://home.comcast.net/~tank_dawg/raid/EoE.gif"]
,["The Eye of Eternity", "(10 man)", "(25 man)"]
,["Malygos", "Killed", "Killed"]
]);

// VAULT OF ARCHAVON
progress.push ([
 ["http://home.comcast.net/~tank_dawg/raid/VoA.gif"]
,["Vault of Archavon", "(10 man)", "(25 man)"]
,["Archavon the Stone Watcher", "Killed", "Killed"]
]);

// CHAMBER OF ASPECTS
progress.push ([
 ["http://home.comcast.net/~tank_dawg/raid/OS.gif"]
,["Chamber of Aspects", "(10 man)", "(25 man)"]
,["Sartharion the Onyx Guardian", "Killed", "Killed"]
,["Sartharion & 1 Drake", "Killed", "Killed"]
,["Sartharion & 2 Drakes", "", ""]
,["Sartharion & 3 Drakes", "", ""]
]);


// ULDUAR RAID
progress.push ([
 ["http://home.comcast.net/~tank_dawg/raid/uld.png"]
,["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", ""]
,["Watcher Hodir", "Killed", "Killed"]
,["General Vezax", "Killed", ""]
,["Yogg-Saron", "", ""]
,["Algalon the Observer", "", ""]
]);

// AZJOL-NERUB RAID (10 man)
progress.push ([
 ["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/Unk-10.gif"]
,["Azjol-Nerub Raid", "(10 man)<br>-closed-", "(25 man)<br>-closed-"]
,["-unknown-", "", ""]
]);

// 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 class=notkilled align=center valign=top nowrap width=" + tooltipKilledWidth + "px>" + progress[inst][1][1].replace(/\'/g,sQ);
  pb += "</td><td class=notkilled 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>" : " class=notkilled>";
   pb += progress[inst][boss][0].replace(/\'/g,sQ) + "</td><td align=center";
   pb += (progress[inst][boss][1].match(bossKilledKeyWord)) ? " class=killedText>" : ">"
   pb += progress[inst][boss][1] + "</td><td align=center";
   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>";
 document.getElementById('recruitBar').innerHTML = rb;
 document.getElementById('raidingBar').innerHTML = pb;
