// simple function to show a container
function show(arg) {
	var myObj = returnObject(arg);
	if (myObj != null) {
		myObj.style.display = "block";
	}
}

// simple function to hide a container
function hide(arg) {
	var myObj = returnObject(arg);
	if (myObj != null) {
		myObj.style.display = "none";
	}
}
function returnObject(arg, formObj) {
	var myObj = null;
	if (formObj != null) {
		myObj = formObj.elements[arg];
	} else if (typeof arg == 'string') {
		myObj = document.getElementById(arg);
	} else if (typeof arg == 'object') {
		myObj = arg;
	}

	return myObj;
}

// function to toggle between showing and hiding of a
// container depending on its current state.
// Note: this function is slightly buggy because it does not
// toggle properly unless style="display: none" is defined on the container  
function showHide(arg) {
  var myObj = returnObject(arg);
  if (myObj != null) {
      if(myObj.style.display && myObj.style.display != "none") {
          myObj.style.display="none";
      }
      else {
          myObj.style.display="block";
      }
   }
}

	function popup(theURL,winName,width,height) {
		var winWidth = width;
		var winHeight = height;
		var windowName = winName;
		var posLeft = (screen.width - winWidth) / 2;
		var posTop = 200;
		features = 'height=' + winHeight + ',width=' + winWidth + ',top=' + posTop + ',left=' + posLeft + ',scrollbars=yes, resizable=no';
		newWin = window.open(theURL,windowName,features);
	}
