function ord (n) {

  if ((n != 11) && (n%10 == 1)) return n+"st"; 

  if ((n != 12) && (n%10 == 2)) return n+"nd"; 

  if ((n != 13) && (n%10 == 3)) return n+"rd";

  return n+"th"; 

}





function removeChildren(node) {

  var children = node.childNodes;

  if (children.length == 0) return;

  for (var i = 0; i < children.length; i++) {

    node.removeChild(children[i]); 

  }

}



function createHidden(name, value) {

	var el = document.createElement("input");

	el.setAttribute("type", "hidden");

	el.setAttribute("name", name);

	el.setAttribute("value", value);

	return el;

}



function makeSecure(form) {

  var formUrl = document.location;

  form.action = "https://"+document.location.hostname+document.location.pathname;

}



function setBackgroundCol(el, col) {

  if (typeof el != "object") return;

  if (el == null) return;

  if ((el.nodeName) && (el.nodeName == "TD"))

    el.style.backgroundColor = col; 

  for (var e = 0; e < el.childNodes.length; e++) {

    if (el.childNodes[e].style)

      setBackgroundCol(el.childNodes[e], col);

  }

}



function wait () {

	var waitBlock = document.getElementById("waitBlock");

	if (waitBlock == null) return;

	waitBlock.style.display = "block";

	if (waitBlock.tagName.toLowerCase() == "iframe") {

		waitBlock.src = waitBlock.src;

	}	

}