ms = (document.all) ? true : false

function layerObj(vName) {
  return (ms) ? document.all[vName] : document.layers[vName]
}	

function moveTo(vLayer,x,y) {
  if (ms) {vLayer.style.left = x; vLayer.style.top = y}
  else {vLayer.left = x; vLayer.top = y}
}

function writeLayer(vLayer,vText) {
  if (ms) vLayer.innerHTML = vText
  else {
    with (vLayer.document) {open(); write(vText); close()}
  }
}  

function showLayer(vLayer) {
  if (ms) vLayer.style.visibility = "visible"
  else vLayer.visibility = "show"
}

function hideLayer(vLayer) {
  if (ms) vLayer.style.visibility = "hidden"
  else vLayer.visibility = "hide"
}

function init() {
  dText = layerObj("TextLayer")
  dImage = layerObj("ImageLayer")
dCloak = layerObj("CloakLayer")
}

function popImage(vImage,vText,vY) {
  hideLayer(dImage)
hideLayer(dCloak)
  moveTo(dImage,360,vY)
  vStr = "<table border='0' cellpadding='0' cellspacing='0' valign='top' align='left' width='250'><tr><td>"
  vStr += "<img src='"+vImage+"' border='0' hspace='0' vspace='0' align='left'></td></tr>"
  vStr += "<tr><td class='captiontext'>"+vText+"</td></tr></table>"
  writeLayer(dImage,vStr)
  showLayer(dImage)
}

function popImageLeft(vImage,vText,vY) {
  hideLayer(dImage)
hideLayer(dCloak)
  moveTo(dImage,10,vY)
  vStr = "<table border='0' cellpadding='0' cellspacing='0' valign='top' align='left' width='250'><tr><td>"
  vStr += "<img src='"+vImage+"' border='0' hspace='0' vspace='0' align='left'></td></tr>"
  vStr += "<tr><td class='captiontext'>"+vText+"</td></tr></table>"
  writeLayer(dImage,vStr)
  showLayer(dImage)
}

function showOutline() {

// NOTE: You can adjust the size of the Outline window by
// changing the width and height parameters in the vStr variable below

  var vStr = "width=300,height=200,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"
  wOrder = window.open("outline.htm",null,vStr)
}

function showInset() {

// NOTE: You can adjust the size of the Outline window by
// changing the width and height parameters in the vStr variable below

  var vStr = "width=210,height=475,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"
  wOrder = window.open("inset.htm",null,vStr)
}

function showWindow(vSrc,vWidth,vHeight) {
// Example of use in an <A> tag:
// href="javascript:showWindow('outline2.htm',400,350)"
  var vStr = "width="+vWidth+",height="+vHeight+",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"
  wOrder = window.open(vSrc,null,vStr)
}

// Add to this array the names of all the documents 
// you want the visitor to be able to access via the Random button. 
// Don't include the .htm filename extension. 

aPages = new Array("c11","c12","c13","c14","c15","c16","c17","c17a","c17b","c18","c19","c110","c111","c112","c113","c113c","c114","c114a","c114b","c115","c115a","c115b","c115c","c21","c22","c23","c24","c24a","c24b","c25","c26","c27","c113a","c113b","c31","c32","c33","c34","c35","c36","c36a","c36b","c36c","c36d","c36e","c37","c37a","c37b","c37c","c37d","c37e","c38","c41","c42","c43","c43a","c44","c45","c46","c51","c52","c53","c54","c55","c56","c57") 
  
  

// Reference this function in the Random button's <a> tag: 
//   <a href="javascript:randomPage()"> 

function randomPage() { 
  var NumPages = aPages.length 
  var RandomPage = aPages[Math.round(NumPages*Math.random())]+".htm" 
  document.location = RandomPage 
} 

