
function showHideLayers(strElementName,strAction) {

	if (strAction=="show") {
		document.getElementById(strElementName).style.display = "block";
	}
	else {
		document.getElementById(strElementName).style.display = "none";
	}
}

function PositionElement (strElement,iLeft,iTop) {
	var PageLeft = getLeftOffset(document.getElementById("Content"));
	document.getElementById(strElement).style.left = (PageLeft + iLeft) + "px";
	document.getElementById(strElement).style.top = iTop + "px";
}

function ChangeImgSize(searchClass,iWidth,iHeight) {

	if (document.getElementsByTagName) {
		var objList = document.getElementsByTagName('img');
//	var contentDiv = document.getElementById(container);
		for(var i=0;i < objList.length;i++) {
//alert(objList.childNodes[i].tag);
			if (hasClassName(objList[i], searchClass)) {
				objList[i].width = iWidth;
				objList[i].height = iHeight;
			}
		}
	}
}
function hasClassName(el, name) {

  var i, list;

  if (el.className) {
		list = el.className.split(" ");
  	for (i = 0; i < list.length; i++)
  	  if (list[i] == name)
  	    return true;
	}
  return false;
}
function getContainerWith(node, tagName, className) {

  // Starting with the given node, find the nearest containing element
  // with the specified tag name and style class.

  while (node != null) {
    if (node.tagName != null && node.tagName == tagName &&
        hasClassName(node, className))
      return node;
    node = node.parentNode;
  }

  return node;
}

function getLeftOffset(el) {
// Return the x coordinate of an element relative to the page.
  var x;
  x = el.offsetLeft;
  if (el.offsetParent != null)
    x += getLeftOffset(el.offsetParent);
  return x;
}

function getTopOffset(el) {
// Return the x coordinate of an element relative to the page.
	var y;
  y = el.offsetTop;
  if (el.offsetParent != null)
    y += getTopOffset(el.offsetParent);
  return y;
}
