function tab_authorprog(req_n)
{
 document.getElementById("home-text2").style.display = "none";
 document.getElementById("home-text1").style.display = "";
 document.getElementById("tab-content2").style.display = "none";
 document.getElementById("tab-content1").style.display = "";

 if (navigator != null && navigator.plugins != null && navigator.plugins.length > 0 &&
     navigator.plugins["Shockwave Flash"] == null)
 {
  document.getElementById("tab-content1").innerHTML = '<img src="art/loop1.jpg" style="width:280px;height:210px">';
  return;
 }

 var sawMovie = document.cookie != null && document.cookie.indexOf("sawMovie=") >= 0;

 var tag = new FlashTag("runmovie.swf", 280, 210, "6.0.0.0");
 tag.setBgcolor("#000000");
 var n = req_n;
 if (req_n == null)
 {
  n = Math.floor(Math.random()*4)+1;
  tag.addFlashVar("delay", "5");
  tag.addFlashVar("imgurl", "art/loop1.jpg");
  if (sawMovie)
   tag.addFlashVar("wait", "1");
 }
 else
 {
  tag.addFlashVar("delay", "0");
 }
 if (n == 1)
  tag.addFlashVar("movieurl", "content/Art_TeachingBooks.swf");
 else if (n == 2)
  tag.addFlashVar("movieurl", "content/Science_TeachingBooks.swf");
 else if (n == 3)
  tag.addFlashVar("movieurl", "content/SocialStudies_TeachingBooks.swf");
 else // default
  tag.addFlashVar("movieurl", "content/Writing_TeachingBooks.swf");
 if (ismac && isie)
    document.getElementById("tab-content1").innerHTML = "";
 document.getElementById("tab-content1").innerHTML = tag.toString();

 if (!sawMovie)
 {
  // Set cookie for N days from now
  var days = 7;
  var now = new Date();
  var expdate = new Date(now.getTime() + days*24*60*60*1000);
  // "dd-MM-yyyy hh:mm:ss GMT"
  var mons = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
  var o = {
   D: expdate.getUTCDate(),
   M: mons[expdate.getUTCMonth()],
   Y: expdate.getUTCFullYear(),
   h: expdate.getUTCHours(),
   m: expdate.getUTCMinutes(),
   s: expdate.getUTCSeconds()
  };
  for (var i in o)
   if (i != "M" && o[i] < 10)
    o[i] = "0"+o[i];
  // BWC - 20051026
  // The first version was commented out. The second built the date
  // manually to match the cookie format. However it didn't have the day
  // of the week included. This worked in Firefox, but not in IE, which
  // then treated it like a session cookie (expiring when the browser
  // closed).  The toGMTString() produces the right format for both
  // browsers.
  //var expstr = expdate.toUTCString();
  //var expstr = o.D+"-"+o.M+"-"+o.Y+" "+o.h+":"+o.m+":"+o.s+" GMT";
  var expstr = expdate.toGMTString();
  document.cookie = "sawMovie=true; path=/; expires="+expstr;
 }
}
function tab_intromovie()
{
 document.getElementById("home-text1").style.display = "none";
 document.getElementById("home-text2").style.display = "";
 document.getElementById("tab-content1").style.display = "none";
 document.getElementById("tab-content2").style.display = "";

 if (navigator != null && navigator.plugins != null && navigator.plugins.length > 0 &&
     navigator.plugins["Shockwave Flash"] == null)
 {
  document.getElementById("tab-content1").innerHTML = '<img src="art/intro-movie.jpg" style="width:280px;height:210px">';
  return;
 }

 var tag = new FlashTag("runmovie.swf", 280, 210, "6.0.0.0");
 tag.setBgcolor("#000000");
 tag.addFlashVar("delay", "1");
 tag.addFlashVar("imgurl", "art/intro-movie.jpg");
 tag.addFlashVar("movieurl", "content/IntroMov_TeachingBooks.swf");
 document.getElementById("tab-content2").innerHTML = tag.toString();
}
