// minerals.js - just in case I need to add scripts to the mineral gallery

gs = "*";
rotate=false;
metal = "w";
j4m_base = "/j4m_images/" + gs + "/";
j4m_url = "/j4m_images/";

function rotate_gs()
{
 if (gs == "*") rotate = true;
 if (rotate)
 { 
  if (gs == "01") gs = "02";
  else if (gs == "02") gs = "03";
  else if (gs == "03") gs = "04";
  else if (gs == "04") gs = "05";
  else if (gs == "05") gs = "CA"; 
  else if (gs == "CA") gs = "07"; 
  else if (gs == "07") gs = "08";
  else if (gs == "08") gs = "09";
  else if (gs == "09") gs = "10";
  else if (gs == "10") gs = "11";
  else if (gs == "11") gs = "12";
  else if (gs == "12") gs = "13";
  else if (gs == "13") gs = "PT";
  else gs = "01";
 }
 j4m_base = "/j4m_images/" + gs + "/";
// window.status = j4m_base;
// alert(j4m_base);
}

ring = 2;
ring_1 = "2186r";
ring_2 = "2064r";
ring_3 = "203R-14BS";
ring_4 = "829R-14BS";

function rotate_rings()
{
 rotate_gs();
 if (ring == 1) j4m_url = j4m_base + ring_1 + ".jpg";
 else if (ring == 2) j4m_url = j4m_base + ring_2 + ".jpg";
 else if (ring == 3) j4m_url = j4m_base + ring_3 + ".jpg";
 else if (ring == 4) j4m_url = j4m_base + ring_4 + ".jpg";
 //alert(j4m_url);
 rings.src = j4m_url;
 ring = ring + 1;
 if (ring > 4) ring=1;
 setTimeout("rotate_rings()",6000);
}

pendant = 2;
pendant_1 = "1861P";
pendant_2 = "1868P";
pendant_3 = "877P-14";
pendant_4 = "17CROSS";
pendant_5 = "267P-14";

function rotate_pendants()
{
 rotate_gs();
 if (gs == "CA" && pendant==4) pendant=5; // there is no created alexandrite 17cross
 if (pendant == 1) j4m_url = j4m_base + pendant_1 + ".jpg";
 else if (pendant == 2) j4m_url = j4m_base + pendant_2 + ".jpg";
 else if (pendant == 3) j4m_url = j4m_base + pendant_3 + ".jpg";
 else if (pendant == 4) j4m_url = j4m_base + pendant_4 + ".jpg";
 else if (pendant == 5) j4m_url = j4m_base + pendant_5 + ".jpg";
 //alert(j4m_url);
 pendants.src = j4m_url;
 pendant = pendant + 1;
 if (pendant > 5) pendant = 1;
 setTimeout("rotate_pendants()",6000);
}

earring = 2;
earring_1 = "1784E-14";
earring_2 = "1789E-14";
earring_3 = "1861E";
earring_4 = "1881E";

function rotate_earrings()
{
 rotate_gs();
 if (earring == 1) j4m_url = j4m_base + earring_1 + ".jpg";
 else if (earring == 2) j4m_url = j4m_base + earring_2 + ".jpg";
 else if (earring == 3) j4m_url = j4m_base + earring_3 + ".jpg";
 else if (earring == 4) j4m_url = j4m_base + earring_4 + ".jpg";
 //alert(j4m_url);
 earrings.src = j4m_url;
 earring = earring + 1;
 if (earring > 4) earring = 1;
 setTimeout("rotate_earrings()",6000);
}

