function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}

function popup(page) {
window.open(page,'popup','width=550,height=275,toolbar=false,scrollbars=false');
}

    var origWidth, origHeight;
	if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
	}

	var cur_lyr;
	function swapLayers(id) {
	if (cur_lyr) hideLayer(cur_lyr);
    showLayer(id);
    cur_lyr = id;
 }

	function showLayer(id) {
	var lyr = getElemRefs(id);
    if (lyr && lyr.css) lyr.css.visibility = "visible";
 }

 function hideLayer(id) {
   var lyr = getElemRefs(id);
   if (lyr && lyr.css) lyr.css.visibility = "hidden";
 }

  function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
  }
