var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus)
{
	if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes";win=window.open(mypage,myname,settings);
	win.focus();
}

function expandList(whichEl){
    whichEl.style.display = (whichEl.style.display == "none" ) ? "" : "none";
}

function minimizeList() {
	if(document.all) {
		divColl = document.all.tags("TR");
		for (i=0; i<divColl.length; i++) {
			if (divColl(i).className == "INCLIST") {
				divColl(i).style.display = "none";
			}
		}
	}
}

function isWhiteSpace (c) {
  if (c == null) {
    return false;
  }

  return (c == '' || c == ' ' || c == '\t' ||
    c == '\n' || c == '\r' || c == '\f');
}

function ltrim (str) {
  if (str == null) {
    return str;
  }
  var nonBlankFound = false;
  for (var i = 0; i < str.length; i++) {
    var c = str.charAt(i);
    if (!isWhiteSpace (c)) {
      nonBlankFound = true;
      return str.slice(i);
    }
  }

  return "";
}

function rtrim (str) {
  if (str == null || str.length == 0) {
    return str;
  }
  var nonBlankFound = false;
  for (var i = str.length - 1; i >= 0; i--) {
    var c = str.charAt(i);
    if (!isWhiteSpace (c)) {
      nonBlankFound = true;
      return str.slice(0, i + 1);
    }
  }

  return "";
}

function trim (str) {
  return ltrim(rtrim(str));
}

function isEmpty (str) {
  return (str != null && trim(str).length == 0);
}

function isBlank (str) {
  return (str == null || trim(str).length == 0);
}

function showDet (id, linkEle) {
  // alert ("in showDet");
  // alert (id);
  // alert (disp);
  var obj = eval (id);

  var str = linkEle.innerHTML.toLowerCase ();
  if (str.indexOf("more") != -1) {
    linkEle.innerHTML="<< less";
    obj.style.display = '';
  } else {
    linkEle.innerHTML="more >>";
    obj.style.display = 'none';
  }
}
