
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function popup(url,width,height)
{
 popupwindow= window.open(url, 'popwin','width='+width+',height='+height+',top=200,left=200,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes');
}

function rotater()
{
document["spotrotate"].src = rImg[k].src;
if( k < (imgAr.length-1))
{ 	k= k+1;  }
else
{	k = 0;   }
rTimer = setTimeout('rotater()', 10000 );
}

function rotatercaption()
{
document["spotrotate"].src = rImg[k].src;
MM_setTextOfLayer('CaptionText','',capAr[k]);
if( k < (imgAr.length-1))
{ 	k= k+1;  }
else
{	k = 0;   }
rTimer = setTimeout('rotatercaption()', 10000 );
}

function spotload(spotnum)
{
var spotimg = new Array()
var spottxt = new Array()
var spottit = new Array()

if(spotnum == null) {spotnum = 3;}

url="/v2/song/index.php";

spotimg[0] = "url(/v2/xobjects/images/spotlights/spotlight_blue.jpg)"
spottit[0] = "Shop our EFFE <br>Bookstore"
spottxt[0] = "<a href='https://effebooks.com/v2/shop/'><img src='/v2/xobjects/images/book1_sm.gif' border='0'></a>"

spotimg[1] = "url(/v2/xobjects/images/spotlights/spotlight_green.jpg)"
spottit[1] = "Page of the<br>Week"
spottxt[1] = "<table width='200'><tr><td><img src='/v2/xobjects/images/bk2pg31potw.gif'></td><td></td></tr><tr><td><a href='http://www.effebooks.com/v2/pages/bk2/bk2pg31.pdf' target='_blank' class='ContentBodyHyperlink'>Click here to find out more</a></td></tr></table>"

spotimg[2] = "url(/v2/xobjects/images/spotlights/spotlight_orange.jpg)"
spottit[2] = "Where in the<br>World???"
spottxt[2] = "<table width='200'><tr><td><img src='/v2/xobjects/images/bk2pg27witw.jpg'></td><td></td></tr><tr><td><a href='http://www.effebooks.com/v2/whereintheworld/index.php' class='ContentBodyHyperlink'>Click here to find out!</a></td></tr></table>"

spotimg[3] = "url(/v2/xobjects/images/spotlights/spotlight_purple.jpg)"
spottit[3] = "Pronunciation<br>Key"
spottxt[3] = "<img src='/v2/xobjects/images/pronunciation02.gif'>"

spotimg[4] = "url(/v2/xobjects/images/spotlights/spotlight_red.jpg)"
spottit[4] = "Play the EFFE Songs"
spottxt[4] = "<table width='200'><tr><td align='center'><img src='/v2/xobjects/images/button_effesong.gif' width='136' height='46'></td></tr><tr><td align='center'><p><a href='#' onclick='javascript:window.open(&quot;http://www.effebooks.com/v2/song/index.php&quot;,&quot;popwin&quot;,&quot;width=370,height=120&quot;,&quot;top=200,left=200,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes&quot;)' class='ContentBodyHyperlink'>Click here and sing along!</a></p><p><a href='http://www.macromedia.com/shockwave/download/' target='_blank' class='ContentBodyHyperlink'>Get the Flash player here.</a><br><img src='/v2/xobjects/images/flash.jpg' alt='Flash picture' width='34' height='36'></p></td></tr></table>"

spotimg[5] = "url(/v2/xobjects/images/spotlights/spotlight_yellow.jpg)"
spottit[5] = "Mixed up Fact of<br>the Week"
spottxt[5] = "<table width='200'><tr><td><img src='/v2/xobjects/images/bk2pg32muf.gif'></td><td></td></tr><tr><td><a href='http://www.effebooks.com/v2/mixedupfact/index.php' class='ContentBodyHyperlink'>Click here to find out!</a></td></tr></table>"

spotimg[6] = "url(/v2/xobjects/images/spotlights/spotlight_pink.jpg)"
spottit[6] = "Did you know???<br>"
spottxt[6] = "<table width='200'><tr><td class='ContentBodyBold'>The largest land animal in the United States is neither the polar bear nor the moose. In fact, the United States largest land animal is the bison (or buffalo), which can weigh up to 2,000 pounds.</td><td></td></tr><tr><td></td></tr></table>"

  MM_changeProp('Spotlight1','','style.backgroundImage',spotimg.splice(0,1),'LAYER')
  MM_setTextOfLayer('Spotlight1'+'Title','',spottit.splice(0,1))
  MM_setTextOfLayer('Spotlight1'+'Text','',spottxt.splice(0,1))  

for (i=2;i<=spotnum;i++)
{
  var randomnumber=Math.floor(Math.random()*spotimg.length)
  MM_changeProp('Spotlight'+i,'','style.backgroundImage',spotimg.splice(randomnumber,1),'LAYER')
  MM_setTextOfLayer('Spotlight'+i+'Title','',spottit.splice(randomnumber,1))
  MM_setTextOfLayer('Spotlight'+i+'Text','',spottxt.splice(randomnumber,1))  
}

}
