﻿

// ***********************************************
// ***  FUNCTIONS FOR ARTIST LIST AND DISPLAY  ***
// ***********************************************

function getArtists() {
  for (x = 1; x <= 41; x++) {
      var artistName = eval('artistName' + x);

        if (artistName == '') {
           continue;
        }

      var artistURL = "AWDArtists/" + eval('artistURL' + x);
      var theArtist = '<A HREF="' + artistURL + '" onMouseOver="displayArtist(' + x + ')\;">' + artistName + '</A>';

      /* SET X to an ID in SPAN to establish a text color */

      var numberDiv = '<DIV CLASS="sideBarNumbers">' + '<SPAN ID="' + x + '">' + x + '</SPAN>' + '</DIV>';
      var theName = '<DIV CLASS="sideBarNames">' + numberDiv + theArtist + '</DIV>';

      var iHTML = document.getElementById('sideBarNavMap').innerHTML;        

      if (iHTML == "REPLACE ME") {
          iHTML = "";
      }
      else {
          iHTML = iHTML;
      }
      iHTML = iHTML + theName + '<BR>';

      document.getElementById('sideBarNavMap').innerHTML = iHTML;

      /* SET a text color according to "x" SPAN ID */

        if (x > 0) {document.getElementById(x).style.color = '#909';}
        if (x > 4) {document.getElementById(x).style.color = '#396';}
        if (x > 11) {document.getElementById(x).style.color = '#36C';}
        if (x > 21) {document.getElementById(x).style.color = '#C63';}
        if (x > 29) {document.getElementById(x).style.color = '#C36';}
        if (x > 38) {document.getElementById(x).style.color = '#FFFFCC';}

  }
}

function displayArtist(idx) {
  var theArtist = eval('artistName' + idx);
  var theDescription = eval('artistDescription' + idx);
  var theContact = eval('artistContact' + idx);

  var xx = idx;
  if (xx < 10) {
     xx = '0' + idx;
  }

  var artistPic = "AWDArtists/ArtistsThumbnails/" + "artist" + xx + ".jpg";
  var imgH;
  imgH = document.getElementById("artistImg");
  imgH.src = artistPic;

  document.getElementById('artistText').innerHTML = '<H1>' + theArtist + '</H1>' + '<P>' + theDescription + '<BR>' + theContact;
}

// ***************************************************
// ***  END FUNCTIONS FOR ARTIST LIST AND DISPLAY  ***
// ***************************************************
