// TRZ Devotional Thoughts and script © 2010, 2011 TeamRhinoZone.com
// ----

urltest = document.location.hostname;
urltest2 = document.location.pathname;
ChangeMode = 1;
photo_string = "";

if ((urltest != 'www.rhinoprints.com' & urltest != 'www.rhinoprints.net') || (urltest2 == '/devotional_popup.html'))
 {
   targettxt = " target='_blank'";
 }
else
 {
   targettxt = "";
 }

if ((urltest != 'www.teamrhinozone.com' & urltest != 'www.rhinoprints.net') || (urltest2 == '/devotional_popup.html'))
 {
   targettxt2 = " target='_blank'";
 }
else
 {
   targettxt2 = "";
 }

GetRandomColor();

GetDailyVerse();
 //Verse4DayNbr = 54; // TEST

function GetRandomPhoto(ChangeMode)
{
  var imgnbr = 0;

  cameraimg = "<a href='javascript:ChangePhoto(2);'><img src = 'http://www.teamrhinozone.com/images/camera_icon.gif' border=0 width=10 height=8 title='Change Random Photo'></a>";

  if (PhotoParm != 0 & ChangeMode != 2)
   {
    var imgnbr = PhotoParm;
   }
  else if (VersePics[Verse4DayNbr] == null || VersePics[Verse4DayNbr] == '' || ChangeMode == '2')
   {
    var imgnbr = Math.round(TotNbrPhotos * Math.random());
   }
  else
   {
    var imgnbr = VersePics[Verse4DayNbr];
   }

  // imgnbr = 1; // TEST

  searchstring = "/" + imgnbr + "/";
  var ans = DoNotUsePhotos.search(searchstring);

  if(ans != -1 || imgnbr == 0)
   {
     var repimgnbr = Math.round(RepPicsNbr * Math.random());
     if (repimgnbr == 0)
      {
       rpn_photo = "<a href='http://www.teamrhinozone.com' target='" + targettxt2 + "'><img src='http://www.teamrhinozone.com/images/tr_gadget_img.gif' border=0 title='Go to TeamRhinoZone'></a>";
      }
     else
      {
       rpn_photo = "<a href='http://www.rhinoprints.net/photography/photo_finder.html?p=" + RepPicsArray[repimgnbr] + "' target='" + targettxt + "'><img src='http://www.rhinoprints.net/photography/images/gallery/" + RepPicsArray[repimgnbr] + ".jpg' border=0 title='View larger image at RhinoPrints Photo Galleries'></a>";
      }
   }
  else
   {
     rpn_photo = "<a href='http://www.rhinoprints.net/photography/photo_finder.html?p=" + imgnbr + "' target='" + targettxt + "'><img src='http://www.rhinoprints.net/photography/images/gallery/" + imgnbr + ".jpg' border=0 title='View larger image at RhinoPrints Photo Galleries'></a>";
   }

  photo_string = "<img src='http://www.teamrhinozone.com/images/blank.gif' height=3 width=1><font size=1><br></font><table height=150 border=0 cellpadding=0 cellspacing=0><tr><td width=20>&nbsp;</td><td width=250><center>" + rpn_photo + "</center></td><td width=20 align='right' valign='bottom'>" + cameraimg + "</td></tr></table><img src='http://www.teamrhinozone.com/images/blank.gif' height=3 width=1><font size=1><br></font>";

  if (ChangeMode == 2)
   {
    RndLnkAreaText = "";
    GetRandomLink();
    RndLnkArea4.innerHTML = RndLnkAreaText;
   }
}

function ChangePhoto(ChangeMode)
{
  GetRandomPhoto(ChangeMode);
  PhotoArea.innerHTML = photo_string;
}

document.write("<center><table border='0' cellpadding='4' width=300 cellspacing='0' bgcolor='" + clrval + "'>");
if (ShowPicFlag == "Y")
 {
  MainHeight = 439;
 }
else
 {
  MainHeight = 283;
 }
document.write("<tr><td height='" + MainHeight + "' valign='top'><center>");
document.write("<img src='http://www.teamrhinozone.com/images/mem_vs_border.gif'><font size=1><br></font><img src='http://www.teamrhinozone.com/images/blank.gif' height=3 width=1><font size=1><br></font>");

DevoText = DevThot[Verse4DayNbr];
if (user_version == "RV")
 {
   DevoText = DevoSp[Verse4DayNbr];
 }

devo_string = "<img src='http://www.teamrhinozone.com/images/blank.gif' height=5 width=1><font size=1><br></font><table border=1 bgcolor='" + bgColorDark + "' bordercolor=#ff6600 width=298 cellpadding=2 cellspacing=0><tr><td><center><font face='Arial' color='white' size='2'>" + DevoText + "<font size=1><br>&copy; 2010-" + year + " TRZ</font></font></center></td></tr></table><img src='http://www.teamrhinozone.com/images/blank.gif' height=3 width=1><font size=1><br></font>";

popuptxt = "";
popupimg = "<img src = 'http://www.teamrhinozone.com/images/popup_icon.gif' width=8 height=8 border=0 title='Open " + user_version + " Daily Verse Devo in pop-up window'>";

AllVslnk = "<img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'><a href='http://www.teamrhinozone.com/verses.html' target='_blank'><img src='http://www.teamrhinozone.com/images/all_icon.gif' border=0 width=13 height=8 title='See ALL TRZ Bible Memory Verses and resources here'></a>";

parimglnk = "<a href='http://www.rhinoprints.net/teamrhino/mem_verses_parallel.html?ver=" + Verse4DayNbr + "' target='_blank'><img src='http://www.teamrhinozone.com/images/parallel_icon2.gif' border=0 width=15 height=9 title='Open printer friendly page showing this verse in NIV 1984 and 2011, KJV, NLT, NASB, and Spanish RV together'></a>" + AllVslnk;

// show TRZ comic strip link for verse:
if (memVsComStr[Verse4DayNbr] != null & memVsComStr[Verse4DayNbr] != '')
 {
  CSimgLink = "&nbsp;<a href='http://www.rhinoprints.net/teamrhino/trz_comics.html?c=" + memVsComStr[Verse4DayNbr] + "' target='_blank'><img src='http://www.teamrhinozone.com/images/cs_icon.gif' width=20 height=9 title='View a TRZ comic strip using this verse' border='0'></a>";
 }
else
 {
  CSimgLink = "";
 }

if (user_version == "KJV")
 {
  if (urltest2 != '/devotional_popup.html')
   {
    popuptxt = " <a href='javascript:openDailyPopUp(2)'>" + popupimg + "</a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'>";
   }
  FlCrdLink = "<a href='javascript:openFlashCard(2," + Verse4DayNbr + ");'><img src='http://www.teamrhinozone.com/images/flashcard_icon.gif' border=0 width=8 height=8 title='Pop-Up Flash Card for this verse'></a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'><a href='http://www.teamrhinozone.com/bible_study_topics.html?Verse=" + Verse4DayNbr + "#seltop' target='_blank'><img src='http://www.teamrhinozone.com/images/study_icon2.gif' width=8 height=9 border=0 title='Go to Bible Study topics for this verse'></a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='3'>";
  document.write(popuptxt + "<font face='Arial' color=white size='2'><b>TRZ Daily Memory Verse Devotional</b><font size=1><br></font><img src='http://www.teamrhinozone.com/images/blank.gif' height=7 width=1><font size=1><br></font>");
  document.write("<table border=1 bgcolor='" + bgColorDark + "' bordercolor=#ff6600 width=298 cellpadding=2 cellspacing=0><tr><td><center><i><font face='Arial' color='yellow' size='2'>" + memkjv[Verse4DayNbr] + "</font>");
  document.write("</i><font size=1><br></font><font size=1 color=white>" + memref[Verse4DayNbr] + " (KJV) " + FlCrdLink + parimglnk + CSimgLink + "<br></font></center></td></tr></table>");
 }
else if (user_version == "NAS")
 {
  if (urltest2 != '/devotional_popup.html')
   {
    popuptxt = " <a href='javascript:openDailyPopUp(3)'>" + popupimg + "</a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'>";
   }
  FlCrdLink = "<a href='javascript:openFlashCard(3," + Verse4DayNbr + ");'><img src='http://www.teamrhinozone.com/images/flashcard_icon.gif' border=0 width=8 height=8 title='Pop-Up Flash Card for this verse'></a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'><a href='http://www.teamrhinozone.com/bible_study_topics.html?Verse=" + Verse4DayNbr + "#seltop' target='_blank'><img src='http://www.teamrhinozone.com/images/study_icon2.gif' width=8 height=9 border=0 title='Go to Bible Study topics for this verse'></a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='3'>";
  document.write(popuptxt + "<font face='Arial' color=white size='2'><b>TRZ Daily Memory Verse Devotional</b><font size=1><br></font><img src='http://www.teamrhinozone.com/images/blank.gif' height=7 width=1><font size=1><br></font>");
  document.write("<table border=1 bgcolor='" + bgColorDark + "' bordercolor=#ff6600 width=298 cellpadding=2 cellspacing=0><tr><td><center><i><font face='Arial' color='yellow' size='2'>" + memnas[Verse4DayNbr] + "</font>");
  document.write("</i><font size=1><br></font><font size=1 color=white>" + memref[Verse4DayNbr] + " (NASB <a href='javascript:NASBcopyright();'><img src='http://www.teamrhinozone.com/images/copyright.gif' border=0 width=7 height=7></a>) " + FlCrdLink + parimglnk + CSimgLink + "<br></font></center></td></tr></table>");
 }
else if (user_version == "NLT")
 {
  if (urltest2 != '/devotional_popup.html')
   {
    popuptxt = " <a href='javascript:openDailyPopUp(4)'>" + popupimg + "</a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'>";
   }
  FlCrdLink = "<a href='javascript:openFlashCard(4," + Verse4DayNbr + ");'><img src='http://www.teamrhinozone.com/images/flashcard_icon.gif' border=0 width=8 height=8 title='Pop-Up Flash Card for this verse'></a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'><a href='http://www.teamrhinozone.com/bible_study_topics.html?Verse=" + Verse4DayNbr + "#seltop' target='_blank'><img src='http://www.teamrhinozone.com/images/study_icon2.gif' width=8 height=9 border=0 title='Go to Bible Study topics for this verse'></a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='3'>";
  document.write(popuptxt + "<font face='Arial' color=white size='2'><b>TRZ Daily Memory Verse Devotional</b><font size=1><br></font><img src='http://www.teamrhinozone.com/images/blank.gif' height=7 width=1><font size=1><br></font>");
  document.write("<table border=1 bgcolor='" + bgColorDark + "' bordercolor=#ff6600 width=298 cellpadding=2 cellspacing=0><tr><td><center><i><font face='Arial' color='yellow' size='2'>" + memnlt[Verse4DayNbr] + "</font>");
  document.write("</i><font size=1><br></font><font size=1 color=white>" + memref[Verse4DayNbr] + " (NLT <a href='javascript:NLTcopyright();'><img src='http://www.teamrhinozone.com/images/copyright.gif' border=0 width=7 height=7></a>) " + FlCrdLink + parimglnk + CSimgLink + "<br></font></center></td></tr></table>");
 }
else if (user_version == "RV")
 {
  if (urltest2 != '/devotional_popup.html')
   {
    popuptxt = " <a href='javascript:openDailyPopUp(5)'>" + popupimg + "</a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'>";
   }
  FlCrdLink = "<a href='javascript:openFlashCard(5," + Verse4DayNbr + ");'><img src='http://www.teamrhinozone.com/images/flashcard_icon.gif' border=0 width=8 height=8 title='Pop-Up Flash Card for this verse'></a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'><a href='http://www.teamrhinozone.com/bible_study_topics.html?Verse=" + Verse4DayNbr + "#seltop' target='_blank'><img src='http://www.teamrhinozone.com/images/study_icon2.gif' width=8 height=9 border=0 title='Go to Bible Study topics for this verse'></a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='3'>";
  document.write(popuptxt + "<font face='Arial' color=white size='2'><b>TRZ Daily Memory Verse Devotional</b><font size=1><br></font><img src='http://www.teamrhinozone.com/images/blank.gif' height=7 width=1><font size=1><br></font>");
  document.write("<table border=1 bgcolor='" + bgColorDark + "' bordercolor=#ff6600 width=298 cellpadding=2 cellspacing=0><tr><td><center><i><font face='Arial' color='yellow' size='2'>" + memrv[Verse4DayNbr] + "</font>");
  document.write("</i><font size=1><br></font><font size=1 color=white>" + memrefRV[Verse4DayNbr] + " (RV <a href='javascript:RVcopyright();'><img src='http://www.teamrhinozone.com/images/copyright.gif' border=0 width=7 height=7></a>) " + FlCrdLink + parimglnk + "<br></font></center></td></tr></table>");
 }
else // NIV
 {
  if (urltest2 != '/devotional_popup.html')
   {
    popuptxt = " <a href='javascript:openDailyPopUp(1)'>" + popupimg + "</a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'>";
   }
  FlCrdLink = "<a href='javascript:openFlashCard(1," + Verse4DayNbr + ");'><img src='http://www.teamrhinozone.com/images/flashcard_icon.gif' border=0 width=8 height=8 title='Pop-Up Flash Card for this verse'></a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='2'><a href='http://www.teamrhinozone.com/bible_study_topics.html?Verse=" + Verse4DayNbr + "#seltop' target='_blank'><img src='http://www.teamrhinozone.com/images/study_icon2.gif' width=8 height=9 border=0 title='Go to Bible Study topics for this verse'></a><img src='http://www.teamrhinozone.com/images/blank.gif' height='1' width='3'>";
  document.write(popuptxt + "<font face='Arial' color=white size='2'><b>TRZ Daily Memory Verse Devotional</b><font size=1><br></font><img src='http://www.teamrhinozone.com/images/blank.gif' height=7 width=1><font size=1><br></font>");
  document.write("<table border=1 bgcolor='" + bgColorDark + "' bordercolor=#ff6600 width=298 cellpadding=2 cellspacing=0><tr><td><center><i><font face='Arial' color='yellow' size='2'>" + memniv[Verse4DayNbr] + "</font>");
  document.write("</i><font size=1><br></font><font size=1 color=white>" + memref[Verse4DayNbr] + " (NIV <a href='javascript:NIVcopyright();'><img src='http://www.teamrhinozone.com/images/copyright.gif' border=0 width=7 height=7></a>) " + FlCrdLink + parimglnk + CSimgLink + "<br></font></center></td></tr></table>");
 }

document.write(devo_string);

if (ShowPicFlag == "Y")
 {
  GetRandomPhoto(1);
 }

document.write("<SPAN id=PhotoArea>" + photo_string + "</span>");

document.write("</center></td></tr>");

document.write("<tr><td height=12 valign=bottom><center>");

document.write("<SPAN id=RndLnkArea4> </span>");

RndLnkAreaText = "";

GetRandomLink();

RndLnkArea4.innerHTML = RndLnkAreaText;

document.write("</font><img src='http://www.teamrhinozone.com/images/blank.gif' height=2 width=1><font size=1><br></font><img src='http://www.teamrhinozone.com/images/mem_vs_border.gif'><font size=1><br></font></center></td></tr></table></center>");

