// Start crossbrowser insertAdjacentHTML function
if(typeof HTMLElement!="undefined" && !
HTMLElement.prototype.insertAdjacentElement){
HTMLElement.prototype.insertAdjacentElement = function
(where,parsedNode)
{
switch (where){
case "beforeBegin":
this.parentNode.insertBefore(parsedNode,this)
break;
case "afterBegin":
this.insertBefore(parsedNode,this.firstChild);
break;
case "beforeEnd":
this.appendChild(parsedNode);
break;
case "afterEnd":
if (this.nextSibling)
this.parentNode.insertBefore(parsedNode,this.nextSibling);
else this.parentNode.appendChild(parsedNode);
break;
}
}
HTMLElement.prototype.insertAdjacentHTML = function
(where,htmlStr)
{
var r = this.ownerDocument.createRange();
r.setStartBefore(this);
var parsedHTML = r.createContextualFragment(htmlStr);
this.insertAdjacentElement(where,parsedHTML)
}
HTMLElement.prototype.insertAdjacentText = function
(where,txtStr)
{
var parsedText = document.createTextNode(txtStr)
this.insertAdjacentElement(where,parsedText)
}
}
// End crossbrowser insertAdjeacentHTML function

// Start crossbrowser object selection function
var layerRef="";
var endLayerRef="";
var styleRef="";

function initDHTML()
  {
  if (document.getElementById)
  {
    layerRef = "document.getElementById('";
    endLayerRef = "')";
    styleRef = ".style" ; 
  }
  else if (document.all)
  {
    layerRef = "document.all['";
    endLayerRef = "']";
    styleRef = ".style"; 
  }
  else if (document.layers)
  {
    layerRef = "document.";
    endLayerRef = "";
    styleRef = "";
  }
} 

function getObject(strObj){
  var curObject;
  eval("curObject = " + layerRef + strObj + endLayerRef);
  return curObject;
}

function getStyleObject(strObj){
  var curObject = getObject(strObj);
  var curStyleObject;
  eval ("curStyleObject = curObject " + styleRef);
  return curStyleObject;
}

function showObject(strObj){
  var curStyleObject = getStyleObject(strObj);
  curStyleObject.display = "block";
}

function hideObject(strObj){
  var curStyleObject = getStyleObject(strObj);
  curStyleObject.display = "none";
}

function toggleVisibility(strObj){
  var curObject = getStyleObject(strObj);
  curObject.display == "block" ? curObject.display = "none" : curObject.display = "block";
}
// End crossbrowser object selection function

