var isNS4
var isIE4
var isIE5
var	isNS6
var  ns
var  ie
var numMainTabs = 5


//**********//
function identifyBrowser()
{
	isNS4 = (document.layers) ? true : false;
	isIE4 = (document.all  && !document.getElementById) ? true : false;
	isIE5 = (document.all  &&  document.getElementById) ? true : false;
	isNS6 = (!document.all &&  document.getElementById) ? true : false;

  ns = (isNS4 || isNS6) ? true:false
  ie = (isIE4 || isIE5) ? true:false

} //*** end identifyBrowser() ***


//**********//
function mouseOverMainTab(whichTab)
{
  if (whichTab != currMainTab)
  {
    if (ie)
    {
      eval("imgMain"+whichTab+".src = '../common/images/tab_" + whichTab + "_RO.gif'")
    }
    else if (ns)
    {
      eval("document.images.imgMain"+whichTab+".src = '../common/images/tab_" + whichTab + "_RO.gif'")
    }
    else
    {
//      alert("mouseOverMainTab: neither IE nor Netscape")
    }
  }
} //*** end mouseOverMainTab() ***


//**********//
function mouseOutMainTab(whichTab)
{
  if (whichTab != currMainTab)
  {
    if (ie)
    {
      eval("imgMain"+whichTab+".src = '../common/images/tab_" + whichTab + "_unsel.gif'")
    }
    else if (ns)
    {
      eval("document.images.imgMain"+whichTab+".src = '../common/images/tab_" + whichTab + "_unsel.gif'")
    }
    else
    {
//      alert("mouseOutMainTab: Neither IE nor Netscape")
    }
  }
} //*** end mouseOutMainTab() ***


//**********//
function setMainTabSel(which)
{
  var fileName

  ns = (document.layers)? true:false
  ie = (document.all)? true:false

  currMainTab = which
  if (ie)
  {
    for (var i=1; i<=numMainTabs; i++) // this so when Back thru content files, tabs change
    {
      fileName = "../common/images/tab_" + i + "_unsel.gif"
      eval("imgMain" + i).src = fileName
    }
    fileName = "../common/images/tab_" + currMainTab + "_sel.gif"
    eval("imgMain" + currMainTab).src = fileName
  }
  else if (ns)
  {
    for (var i=1; i<=numMainTabs; i++) // this so when Back thru content files, tabs change
    {
      eval("document.imgMain"+i).src = "../common/images/tab_" + eval(i) + "_unsel.gif"
    }
    eval("document.imgMain"+which).src = "../common/images/tab_" + eval(which) + "_sel.gif"
  }
  else
  {
//    alert("setMainTabSel: Neither IE nor Netscape\nie = "+ie+"\nns = "+ns)
  }
} //*** end setMainTabSel() ***


//**********//
function mouseOverSubTab(whichTab)
{
  if (whichTab != currSubTab)
  {
    if (ie)
    {
      eval("imgSub"+whichTab+".src = '../common/images/tab_" + currMainTab +"_sub_" + whichTab + "_RO.gif'")
    }
    else if (ns)
    {
      eval("document.images.imgSub"+whichTab+".src = '../common/images/tab_" + currMainTab +"_sub_" + whichTab + "_RO.gif'")
    }
    else
    {
//      alert("mouseOverSubTab: neither IE nor Netscape")
    }
  }
} //*** end mouseOverSubTab() ***//


//**********//
function mouseOutSubTab(whichTab)
{
  if (whichTab != currSubTab)
  {
    if (ie)
    {
      eval("imgSub"+whichTab+".src = '../common/images/tab_" + currMainTab +"_sub_" + whichTab + "_unsel.gif'")
    }
    else if (ns)
    {
      eval("document.images.imgSub"+whichTab+".src = '../common/images/tab_" + currMainTab +"_sub_" + whichTab + "_unsel.gif'")
    }
    else
    {
//      alert("mouseOutSubTab: Neither IE nor Netscape")
    }
  }
} //*** end mouseOutSubTab() ***//


//**********//
function doNewWindow(loc)
{
  window.open(loc,"subWindow", "left=40, top=20, height=390, width=700, fullscreen=0, toolbar=1, titlebar=1, menubar=1, resizable=1, scrollbars=1")

} //*** end doNewWindow() ***//


//**********//
function setSubTabSel(which)
{
  var fileName

  for (var i=1; i <= numSubTabs; i++)
  {
    if (i != which)
    {
      fileName = "../common/images/tab_" +currMainTab+ "_sub_" +i+ "_unsel.gif"

      if (ie)
        eval("document['imgSub" +i+"'].src = '"+fileName+"'")
      if (ns)
        eval("document.images.imgSub" +i+".src = '"+fileName+"'")
    }
  }

  fileName = "../common/images/tab_" +currMainTab+ "_sub_" +which+ "_sel.gif"

  if (ie)
    eval("document['imgSub" + which + "'].src = '" + fileName + "'")
  if (ns)
    eval("document.images.imgSub" +which+ ".src = '../common/images/tab_" +currMainTab+ "_sub_" +which+ "_sel.gif'")

  currSubTab = which

} //*** end setSubTabSel() ***//


//**********//
function clickSubTab(which)
{
  switch (currMainTab)
  {
    case 1: // About Our Course
      setSubTabSel(which)
      switch (currSubTab)
      {
        case 1:
          parent.frames.content.document.location = "general_info.htm"
          break

        case 2:
          parent.frames.content.document.location = "locations.htm"
          break

        case 3:
          parent.frames.content.document.location = "faculty.htm"
          break

        case 4:
          parent.frames.content.document.location = "materials.htm"
          break

        case 5:
          parent.frames.content.document.location = "CLE_credit.htm"
          break

        case 6:
          parent.frames.content.document.location = "tuition.htm"
          break

        case 7:
          parent.frames.content.document.location = "samples.htm"
          break
      }
      break;

    case 2: // Enrollment Information

      setSubTabSel(which)
      switch (currSubTab)
      {
        case 1:
          parent.frames.content.document.location = "application.asp"
          break

        case 2:
          parent.frames.content.document.location = "pb_registration.htm"
          break

        case 3:
          parent.frames.content.document.location = "dates.htm"
          break

        case 4:
          parent.frames.content.document.location = "assistance.htm"
          break

        case 5:
          parent.frames.content.document.location = "info_request.htm"
          break

        case 6:
          parent.frames.content.document.location = "books.htm"
          break
      }
      break;

    case 3: // Registered Students
      setSubTabSel(which)
      switch (currSubTab)
      {
        case 1:
          parent.frames.content.document.location = "software.htm"
          break

        case 2:
          parent.frames.content.location.href = "paced.htm"
          break

        case 3:
          parent.frames.content.document.location = "breaking_news.htm"
          break

        case 4:
          parent.frames.content.document.location = "score.htm"
          break

        case 5:
          parent.frames.content.document.location = "video.htm"
          break

        case 6:
          parent.frames.content.document.location = "evaluation.htm"
          break
      }
      break;

    case 4: // About The Patent Bar

      if (which <= 5)
      {
        setSubTabSel(which)

        switch (currSubTab)
        {
          case 1:
            parent.frames.content.document.location = "general_info.htm"
            break;

          case 2:
            parent.frames.content.document.location = "prereqs.htm"
            break;

          case 3:
            parent.frames.content.document.location = "dates_dead.htm"
            break;

          case 4:
            parent.frames.content.document.location = "applications.htm"
            break;

          case 5:
            parent.frames.content.document.location = "downexams.htm"
            break;
        }
      }
      else // which > 5
      {
        switch (which)
        {
          case 6:
            doNewWindow("http://www.uspto.gov")
            break;

          case 7:
            doNewWindow("http://www.uspto.gov/web/offices/dcom/gcounsel/oed.htm")
            break;
        }
      }
      break;

    case 5: // Contact Information
      setSubTabSel(which)
      switch (currSubTab)
      {
        case 1:
          parent.frames.content.document.location = "contact.htm"
          break
      }
      break;
  } // end switch on currMainTab
} //*** end clickSubTab() ***