var browsername = navigator.appName;
var opera = (navigator.userAgent.search("Opera")>=0) ? 1:0;
var nsadv = ((document.layers) && parseInt(navigator.appVersion)>=4) ? 1:0;
var ieadv = ((document.all) && parseInt(navigator.appVersion)>=4) ? 1:0;

function DoExplain(trigger) 
{
  theText='';
  switch (trigger)
  {
    case 0: theText="<h3>Key figures</h3>Samuel<br>c. 1075-1020 BCE<br>Leads from c. 1060 BCE";break;
    case 1: theText="<h3>Key figures</h3>Saul<br>Rules Israel c. 1052-1012 BCE<br>The exact length of his reign is difficult to ascertain.";break;
    case 2: theText="<h3>Key figures</h3>David<br>c. 1050-972 BCE<br>Rules Israel from c. 1012 BCE";break;
    case 3: theText="<h3>Key figures</h3>Jonathan<br>c. 1010-937 BCE<br>Rules Israel from c. 977 BCE";break;
    case 4: theText="<h3>Key figures</h3>Solomon<br>c. 1790-1690 BCE";break;
    case 5: theText="<h3>Key figures</h3>Rehoboam<br>c. 937-921 BCE<br>Southern kingdom - Judah";break;
    case 6: theText="<h3>Key figures</h3>Abijam<br>c. 921-916 BCE<br>Southern kingdom - Judah";break;
    case 7: theText="<h3>Key figures</h3>Asa<br>c. 916-876 BCE<br>Southern kingdom - Judah";break;
    case 8: theText="<h3>Key figures</h3>Jeroboam<br>c. 937-913 BCE<br>Northern kingdom - Israel";break;
    case 9: theText="<h3>Key figures</h3>Nadab<br>c. 913-912 BCE<br>Northern kingdom - Israel";break;
    case 10: theText="<h3>Key figures</h3>Baasha<br>c. 912-889 BCE<br>Northern kingdom - Israel";break;
  }
  if (ieadv)
  {
    expl.innerHTML=theText;
  }
  if (nsadv)
  { 
    document.expl.document.write(theText);
    document.expl.document.close();
  } 
}

function ClearExplain()
{
  HideLoc();
}

function DoPosition() {
  if (ieadv)
  {
    exp=expl.style;
    leg=legend.style;
    nts=notes.style;
    tm1=tmisr1.style;
    tm2=tmisr2.style;
    tm3=tmisr3.style;
    tm4=tmisr4.style;
    tm5=tmisr5.style;
  }
  if (nsadv)
  { 
    exp=document.expl;
    leg = document.legend;
    nts = document.notes;
    tm1 = document.tmisr1;
    tm2 = document.tmisr2;
    tm3 = document.tmisr3;
    tm4 = document.tmisr4;
    tm5 = document.tmisr5;
  }
  if (ieadv||nsadv)
  {
    exp.left=10;
    exp.top=225;
    exp.width=240; 
    exp.height=475;
    exp.visibility="visible";
    leg.left=650;
    leg.top=225;
    leg.width=200; 
    leg.height=475;
    leg.visibility="visible";
    nts.left=10;
    nts.top=725;
    nts.visibility="visible";
    tm1.left=260;
    tm1.top=250;
    tm1.width=100; 
    tm1.height=150;
    tm1.visibility="visible";
    tm2.left=360;
    tm2.top=300;
    tm2.width=100; 
    tm2.height=200;
    tm2.visibility="visible";
    tm3.left=330;
    tm3.top=350;
    tm3.width=50; 
    tm3.height=200;
    tm3.visibility="visible";
    tm4.left=365;
    tm4.top=500;
    tm4.width=100; 
    tm4.height=100;
    tm4.visibility="visible";
    tm5.left=260;
    tm5.top=500;
    tm5.width=100; 
    tm5.height=100;
    tm5.visibility="visible";
  }
}

function ShowLoc(index, e) {
  var thetext='<font color=blue>';
  switch (index) {
    case 0: thetext += '1 Samuel'; break;
    case 1: thetext += '1 Samuel'; break;
    case 2: thetext += '1 Samuel'; break;
    case 3: thetext += '1 Samuel'; break;
    case 4: thetext += '2 Samuel'; break;
    case 5: thetext += '1 Kings'; break;
    case 6: thetext += '1 Kings'; break;
    case 7: thetext += '1 Kings'; break;
    case 8: thetext += '1 Kings'; break;
    case 9: thetext += '1 Kings'; break;
    case 10: thetext += '1 Kings'; break;
  }
  thetext += '</font>' 
  if (ieadv) {
    commenttext.innerHTML = thetext;
	commentbubble.style.left = e.x - 25 + document.body.scrollLeft;
	commentbubble.style.top = e.y - 140 + document.body.scrollTop;
	commenttext.style.left = e.x + document.body.scrollLeft;
	commenttext.style.top = e.y - 110 + document.body.scrollTop;
	commentbubble.style.visibility = 'visible';
	commenttext.style.visibility = 'visible';
  }
  if (nsadv) {
    vbub=document.commentbubble;
	vbub.document.write('<img src=images/comment.gif>');
	vbub.document.close();
	vbub.moveTo(e.x+250,e.y-80);
    vtext=document.commenttext;
	vtext.document.write('<font color=#006600>' + thetext + '</font>');
	vtext.document.close();
	vtext.y = e.y - 45;
	vtext.x = e.x+275;
	vbub.visibility = "visible";
	vtext.visibility = "visible";
  }
}

function HideLoc() {
  if (ieadv) {
    commenttext.style.visibility = 'hidden';
    commentbubble.style.visibility = 'hidden';
    commenttext.innerHTML = '';
  }
  if (nsadv) {
	vbub=document.layers['commentbubble'];
        vtext=document.layers['commenttext'];
	vtext.visibility = "hidden";
	vbub.visibility = "hidden";
	vtext.document.write('');
	vtext.document.close();
  }
}


