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 ShowLoc(index, e) {
  var thetext='<font color=blue>';
  switch (index) {
    case 0: thetext += 'Sargon 1'; break;
    case 1: thetext += 'Shulgi'; break;
    case 2: thetext += 'Shamshi-Adad 1'; break;
    case 3: thetext += 'Hammurabi'; break;
    case 4: thetext += 'Ammisaduga'; break;
    case 5: thetext += 'Intef 2'; break;
    case 6: thetext += 'Senuseret 2'; break;
    case 7: thetext += 'Amenemhat 3'; break;
    case 8: thetext += 'Abraham'; break;
    case 9: thetext += 'Isaac'; break;
    case 10: thetext += 'Ishmael'; break;
    case 11: thetext += 'Jacob'; break;
    case 12: thetext += 'Esau'; break;
    case 13: thetext += 'Joseph'; 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();
  }
}

function DoExplain(trigger) 
{
  theText='';
  switch (trigger)
  {
    case 0: theText="<h3>Patriarchs</h3>Abraham<br>c. 1950-1775 BCE. Abraham's wanderings took him from his family origins in Mesopotamia to Canaan, with a brief stay in Egypt.";break;
    case 1: theText="<h3>Patriarchs</h3>Isaac<br>c. 1850-1670 BCE. Abraham's second son, he lived a more settled life mostly in Canaan.";break;
    case 2: theText="<h3>Patriarchs</h3>Ishmael<br>c. 1860-1730 BCE. Abraham's older son, he moved away from Canaan to adopt a nomadic lifestyle in the surrounding regions.";break;
    case 3: theText="<h3>Patriarchs</h3>Jacob<br>c. 1790-1660 BCE. The younger of Isaac's twins, he used deceipt to secure inheritance and lived for many years away from home.";break;
    case 4: theText="<h3>Patriarchs</h3>Esau<br>c. 1790-1690 BCE. The older of Isaac's twins and the more faithful, he became estranged from other family members.";break;
    case 5: theText="<h3>Patriarchs</h3>Joseph<br>c. 1700-1590 BCE. Nearly the youngest of Jacob's sons, he was envied by them but ultimately was the instrument of family survival.";break;
    case 6: theText="<h3>Ebla archive</h3>The tablets found at Ebla describe influential nearby cities and record law codes and judicial decisions made at the city. The structure of laws and customs provides a good parallel for the Genesis accounts. Personal names matching those in Genesis are also found.";break;
    case 7: theText="<h3>Power alliances</h3>Alliances of large numbers of rulers on each side, such as described in Genesis 14, occur during a specific period of history, from the time of Sargon the Great of Akkad to that of Hammurabi. In later periods a different pattern is observed.";break;
    case 8: theText="<h3>Negev occupation</h3>Seasonal occupation of the Negev region, as described for Abraham and Isaac is archaeologically indicated during the Middle Bronze I period, but not for many years before and after.";break;
    case 9: theText="<h3>Proto-history</h3>The period between the flood and the life of Abraham contains few reliable time markers. Some tentative matching is shown on the <a href=protohistorycontext.htm>Proto-History page</a>.";break;
    case 10: theText="<h3>Sojourn in Egypt</h3>The Sojourn period begins with Joseph's rise to power in Egypt and ends with the Exodus. The fortunes of the Israelites in Egypt varied widely during this period. The era is discussed on the <a href=sojourncontext.htm>Sojourn in Egypt page</a>.";break;
    case 11: theText="<h3>Exodus/Judges</h3>After establishing a presence in the land of Canaan, the Israelite tribes were loosely organised and easily subdued by others. The duration of this period is difficult to estimate reliably. The issues involved are discussed on the <a href=exjudgescontext.htm>Exodus and Judges page</a>.";break;
    case 12: theText="<h3>Execration texts</h3>These contain descriptions of curses to be pronounced over cities or regions that had become odious to the Egyptians. Place names in Canaan and personal names akin to those of Genesis appear periodically through these texts.";break;
    case 13: theText="<h3>Cappadocian archive</h3>These are predominantly business documents, and illustrate commercial and negotiation practices used at this time. The term 'Habiru', commonly identified with the Biblical word Hebrew, appears in this archive. The <a href=transmon.htm>Transition to Monarchy pages</a> discuss this word further.";break;
    case 14: theText="<h3>Story of Sinuhe</h3>This is an account (either fictional or biographical) of an Egyptian who flees into exile on hearing of the death of Pharaoh Amenemhat I (first ruler of the 12th dynasty). The details mentioned in the story are accurate where they can be confirmed, and are consistent with the Genesis account.";break;
    case 15: theText="<h3>Mari archive</h3>Several thousand tablets were found at Mari, on the River Euphrates. These describe customs and give common names for both individuals and cities of the period in question. The term Habiru appears again in this archive.";break;
    case 16: theText="<h3>Nuzi archive</h3>Tablets found at Nuzi give insights into patriarchal customs that are recorded in the book of Genesis but fell into disuse by the first millennium. The late dating of this archive has led various people to call into question its value in providing support for the Genesis accounts.";break;
    case 17: theText="<h3>Akkad dynasty</h3>The most significant time of this dynasty was the reign of Sargon I, when power was exerted over all of Sumeria across to Syria and Anatolia. Akkad (or Agade) was warlike and regularly used military force to subdue cities.";break;
    case 18: theText="<h3>Gutian dynasty</h3>A tribal people who invaded Mesopotamia and caused the destruction of the Akkad dynasty.";break;
    case 19: theText="<h3>Ur 3 dynasty</h3>A high point of Mesopotamian culture, this arose out of the collapse of the Akkadian empire, taking advantage the Gutian defeat. City-states were arranged in a loose hegemony, and the rebellion-military suppression cycle seen in Akkad does not apear to have been needed.";break;
    case 20: theText="<h3>Larsa dynasty</h3>A city in the southern part of Mesopotamia which arose to dominance after the fall of Ur III. Its period of flourishing was marked by continual rivalry and conflict with Isin.";break;
    case 21: theText="<h3>Isin dynasty</h3>A city in the central part of Mesopotamia which arose to dominance after the fall of Ur III. Its period of flourishing was marked by continual rivalry and conflict with Larsa. ";break;
    case 22: theText="<h3>Old Babylonian period</h3>Early expansion led to conflict and the eventual capture of Isin and Larsa. At its height, the territory controlled was approximately the same as that of Ur III.";break;
    case 23: theText="<h3>Old Assyrian period</h3>This period is largely based on the city of Asshur, and extends well beyond patriarchal times.";break;
    case 24: theText="<h3>Old Kingdom</h3>The first great period of flourishing for Egypt, it lasted about 500 years through the second half of the 3rd millennium BCE.";break;
    case 25: theText="<h3>1st Intermediate period</h3>A time of short-lived and ineffectual rulers, often with contending dynasties holding separate parts of Egypt.";break;
    case 26: theText="<h3>Middle Kingdom</h3>From part-way through the 11th dynasty, central authority and unity were recovered, and Egypt once more took a prominent part in international affairs.";break;
    case 27: theText="<h3>2nd Intermediate period</h3>Another period of turmoil and confusion which lasted nearly 4 centuries until the establishment of the 18th dynasty.";break;
    case 28: theText="<h3>Old Kingdom</h3>6th dynasty<br><br>In the overlap between this dynasty and patriarchal times is the last few years of Pepi IIs long reign, and two brief successors.";break;
    case 29: theText="<h3>1st Intermediate period</h3>8th dynasty<br><br>This dynasty ruled from Thebes and produced no rulers of great note.";break;
    case 30: theText="<h3>1st Intermediate period</h3>10th dynasty<br><br>This was based at Herakleopolis. Many of the rulers names have been lost. A border feud with the Theban 11th dynasty led to its demise.";break;
    case 31: theText="<h3>1st Intermediate Period transition to Middle Kingdom</h3>11th dynasty<br><br>After early rulers successfully extended their sway throughout Egypt, later members were able to look again to international affairs.";break;
    case 32: theText="<h3>Middle Kingdom</h3>12th dynasty<br><br>An important and powerful dynasty, during which the power of local officials (nomarchs) was broken and authority centralised.";break;
    case 33: theText="<h3>2nd Intermediate period</h3>13th dynasty<br><br>Early weak, short-lived rulers were followed by stronger men who enforced Egyptian authority, but ended in collapse.";break;
    case 34: theText="<h3>2nd Intermediate period</h3>15th dynasty<br><br>A dynasty based around Thebes, existing in parallel with other contenders.";break;
  }
  if (ieadv)
  {
    expl.innerHTML=theText;
  }
  if (nsadv)
  { 
    exp=document.expl;
    theText="<table cellpadding=5 width=240 height=475 border=1><tr><td valign=top><font color='#006600'>"+theText+"</font></td></tr></table>";
    exp.document.write(theText);
    exp.document.close();
    exp.left=10;
    exp.top=75;
  } 
}

function ClearExplain()
{
}

function DoPosition() {
  if (ieadv)
  {
    exp=expl.style;
    leg=legend.style;
    pp = patriarchspic.style;
    pe = patriarchsexpl.style;
    ep = eblapic.style;
    ee = eblaexpl.style;
    pop = powerpic.style;
    poe = powerexpl.style;
    np = negevpic.style;
    ne = negevexpl.style;
    excp = execpic.style;
    exce = execexpl.style;
    cp = capppic.style;
    ce = cappexpl.style;
    sp = sinuhepic.style;
    se = sinuheexpl.style;
    mp = maripic.style;
    me = mariexpl.style;
    nzp = nuzipic.style;
    nze = nuziexpl.style;
    prp = protopic.style;
    pre = protoexpl.style;
    sjp = sojournpic.style;
    sje = sojournexpl.style;
    ejp = exjudgespic.style;
    eje = exjudgesexpl.style;
    nts = notes.style;
    mcp = mesocomparepic.style;
    mce = mesocompareexpl.style;
    ecp = egyptcomparepic.style;
    ece = egyptcompareexpl.style;
  }
  if (nsadv)
  { 
    exp=document.expl;
    leg=document.legend;
    pp=document.patriarchspic;
    pe=document.patriarchsexpl;
    ep=document.eblapic;
    ee=document.eblaexpl;
    pop=document.powerpic;
    poe=document.powerexpl;
    np=document.negevpic;
    ne=document.negevexpl;
    excp=document.execpic;
    exce=document.execexpl;
    cp=document.capppic;
    ce=document.cappexpl;
    sp=document.sinuhepic;
    se=document.sinuheexpl;
    mp=document.maripic;
    me=document.mariexpl;
    nzp=document.nuzipic;
    nze=document.nuziexpl;
    prp=document.protopic;
    pre=document.protoexpl;
    sjp=document.sojournpic;
    sje=document.sojournexpl;
    ejp=document.exjudgespic;
    eje=document.exjudgesexpl;
    nts = document.notes;
    mcp = document.mesocomparepic;
    mce = document.mesocompareexpl;
    ecp = document.egyptcomparepic;
    ece = document.egyptcompareexpl;
  }
  if (ieadv||nsadv)
  {
    exp.left=10;
    exp.top=225;
    exp.width=240; 
    exp.height=475;
    exp.visibility="visible";
    leg.left=249;
    leg.top=610;
    leg.width=640; 
    leg.height=90;
    leg.visibility="visible";
    nts.top = 750;
    nts.left = 10;
    nts.visibility = "visible";
    pp.left = 250;
    pp.top = 292;
    pp.visibility = "visible";
    pe.left = 250;
    pe.top = 255;
    pe.visibility = "visible";
    ep.left = 350;
    ep.top = 225;
    ep.visibility = "visible";
    ee.left = 320;
    ee.top = 225;
    ee.visibility = "visible";
    pop.left = 375;
    pop.top = 225;
    pop.visibility = "visible";
    poe.left = 365;
    poe.top = 205;
    poe.visibility = "visible";
    np.left = 400;
    np.top = 225;
    np.visibility = "visible";
    ne.left = 400;
    ne.top = 230;
    ne.visibility = "visible";
    excp.left = 425;
    excp.top = 327;
    excp.visibility = "visible";
    exce.left = 425;
    exce.top = 275;
    exce.visibility = "visible";
    cp.left = 450;
    cp.top = 327;
    cp.visibility = "visible";
    ce.left = 450;
    ce.top = 315;
    ce.visibility = "visible";
    sp.left = 350;
    sp.top = 327;
    sp.visibility = "visible";
    se.left = 320;
    se.top = 325;
    se.visibility = "visible";
    mp.left = 525;
    mp.top = 327;
    mp.visibility = "visible";
    me.left = 475;
    me.top = 370;
    me.visibility = "visible";
    nzp.left = 500;
    nzp.top = 477;
    nzp.visibility = "visible";
    nze.left = 500;
    nze.top = 450;
    nze.visibility = "visible";
    prp.left = 550;
    prp.top = 225;
    prp.visibility = "visible";
    pre.left = 580;
    pre.top = 225;
    pre.visibility = "visible";
    sjp.left = 550;
    sjp.top = 407;
    sjp.visibility = "visible";
    sje.left = 540;
    sje.top = 385;
    sje.visibility = "visible";
    ejp.left = 575;
    ejp.top = 477;
    ejp.visibility = "visible";
    eje.left = 605;
    eje.top = 470;
    eje.visibility = "visible";
    mcp.left = 650;
    mcp.top = 259;
    mcp.visibility = "visible";
    mce.left = 650;
    mce.top = 230;
    mce.visibility = "visible";
    ecp.left = 760;
    ecp.top = 259;
    ecp.visibility = "visible";
    ece.left = 760;
    ece.top = 230;
    ece.visibility = "visible";
  }
}

