// JavaScript Document

<!--

var IE4 = (document.all) ? true : false;
var NS4 = (document.layers) ? true : false;

function getSrc(id) {
  if (NS4) {return eval("document." + id + ".document." + id + "img.src")}
  else {return eval("document.all." + id + "img.src")}
}

function setSrc(id, url) {
  if (NS4) {eval("document." + id + ".document." + id + "img").src = url}
  else {eval("document.all." + id + "img").src = url}
}

function getWidth(id) {
  if (NS4) {return eval("document." + id + ".clip.width")}
  else {return eval("document.all." + id + ".style.pixelWidth")}
}

function getVisibility(id) {
  if (NS4) {
    if (eval("document." + id).visibility == "show") return true
    else return false;
  }
  else {
   if (eval("document.all." + id).style.visibility == "visible") return true
    else return false;
  }
}

function setVisibility(id, flag) {
  if (NS4) {
    var str = (flag) ? 'show' : 'hide';
    eval("document." + id).visibility = str;
  }
  else {
    var str = (flag) ? 'visible' : 'hidden';
    eval("document.all." + id).style.visibility = str;
  }
}

function setPosFromLeft(id, xCoord) {
  if (NS4) {eval("document." + id).left = xCoord}
  else {eval("document.all." + id).style.left = xCoord}
}

function setZposition(id, z) {
  if (NS4) {eval("document." + id).zIndex = z}
  else {eval("document.all." + id).style.zIndex = z}
}

function makeImage(imgID,          // given id
                   imgURL,         // image URL
                   imgHeight,      // image height
                   imgWidth,       // image width
                   imgAlt,         // alternative image
                   posFromLeft,    // absolute position from left of window
                   posFromTop,     // absolute position from top of window
                   clickParam1,    // parameter passed to "onclick" handler
                   clickParam2)    // parameter passed to "onclick" handler
  {
  document.write(
    '<STYLE TYPE="text/css">',
    '#', imgID, ' {',
      'position: absolute;',
      'left: ', posFromLeft, ';',
      'top: ', posFromTop, ';',
      'width: ', imgWidth, ';',
      'z-index: 1',
    '}',
    '</STYLE>',
    '<DIV ID="', imgID, '">',
    '<A HREF="javascript:', "handleImageClick('", imgID, "'", ',',
    clickParam1, ',', clickParam2, ')">',
    '<IMG NAME="', imgID, 'img" ID="', imgID, 'img" SRC="', imgURL,
    '" ALT="', imgAlt, '" BORDER="0" ', 'HEIGHT="', imgHeight, '" WIDTH="',
    imgWidth, '">', '</A></DIV>'
  );
}

function makeBox(boxID,           // given id
                 htmlFiller,      // HTML filler
                 boxWidth,        // box width
                 posFromLeft,     // absolute position from left of window
                 posFromTop,      // absolute position from top of window
                 boxBg,           // box background color
                 boxColor,        // html filler text color
                 boxVisibility)   // visibility

 {
  var padding = (NS4) ? '' : 'padding: 3 0 3 3;';
  var visibility = (boxVisibility) ? 'visible' : 'hidden';
  document.write(
    '<STYLE TYPE="text/css">',
    '#', boxID, ' {',
      'position: absolute;',
      'left: ', posFromLeft, '; top: ', posFromTop, ';',
      'width: ', boxWidth, ';',
      'layer-background-color: ', boxBg, ';',
      'background-color: ', boxBg, ';',
      'visibility: ', visibility, ';',
      'border-width: 2;',
      'border-style: solid;',
      'border-color: ', boxColor, ';',
      padding,
      'z-index: 1',
    '}',
    '</STYLE>',
    '<DIV ID="', boxID, '">',
    htmlFiller,
    '</DIV>'
  );
}
function docjslib_getRealLeft(imgElem) {
	xPos = eval(imgElem).offsetLeft;
	tempEl = eval(imgElem).offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	return xPos;
}

function docjslib_getRealTop(imgElem) {
	yPos = eval(imgElem).offsetTop;
	tempEl = eval(imgElem).offsetParent;
	while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	return yPos;
}

//sets an image position relative to another image
function setImgPos(img,RelImg,xOffSet,yOffSet){
	
	  if (document.getElementById)
	  {
		this.obj = document.getElementById(img);
		this.style = document.getElementById(img).style;
	  }
	  else if (document.all)
	  {
		this.obj = document.all[img];
		this.style = document.all[img].style;
	  }
	  else if (document.layers)
	  {
		this.obj = document.layers[img];
		this.style = document.layers[img];
	  }

	this.style.top = docjslib_getRealTop(RelImg) + yOffSet + "px";
	this.style.left = docjslib_getRealLeft(RelImg) + xOffSet + "px";
	
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
