var popupwnd = null;

function popup(xs,ys,url,resizable) {
  if (popupwnd != null && !popupwnd.closed) {
    popupwnd.focus();
  }
  if (xs <= 0 || xs > window.screen.width-20) xs = window.screen.width-20;
  if (ys <= 0 || ys > window.screen.height-60) ys = window.screen.height-60;
  x = window.screen.width;
  y = window.screen.height;
  if (x != 0 && y != 0) {
    x = (x - (xs + 20)) / 2;
    y = (y - (ys + 60)) / 2;
  }
  coords = ",screenx=" + x + ",screeny=" + y + ",left=" + x + ",top=" + y;
  popupwnd = window.open(url,"sciweb","toolbar=no,directories=no,menubar=no,width="+xs+",height="+ys+",scrollbars=yes,resizable="+(resizable?"yes":"no")+coords);
}

var popupwnd2 = null;

function popup2(xs,ys,url,resizable) {
  if (popupwnd2 != null && !popupwnd2.closed) {
    popupwnd2.focus();
  }
  if (xs <= 0 || xs > window.screen.width-20) xs = window.screen.width-20;
  if (ys <= 0 || ys > window.screen.height-60) ys = window.screen.height-60;
  x = window.screen.width;
  y = window.screen.height;
  if (x != 0 && y != 0) {
    x = (x - (xs + 20)) / 2;
    y = (y - (ys + 60)) / 2;
  }
  coords = ",screenx=" + x + ",screeny=" + y + ",left=" + x + ",top=" + y;
  popupwnd = window.open(url,"sciweb2","toolbar=no,directories=no,menubar=no,width="+xs+",height="+ys+",scrollbars=yes,resizable="+(resizable?"yes":"no")+coords);
}

function bgon(item) {
	item.oldclassName = item.className;
	item.className = "tablehover";
}
function bgoff(item) {
  item.className = item.oldclassName;
}

function oninputfocus(item) {
	item.className = "input_selected";
}
function oninputblur(item) {
  item.className = "input_normal";
}

function imgover(item, img) {
  item.oldsrc = item.src
  item.src = img;
}
function imgout(item) {
  item.src = img.oldsrc;
}
function toggleVisibility(objId)
{
    var obj = document.getElementById(objId);
    if(obj != null)
    {
        //obj.style.visibility = (obj.style.visibility == 'hidden'?'visible':'hidden');
        obj.style.display = (obj.style.display == 'none'?'block':'none');
    }
}
function hideObj(objId)
{
    var object = document.getElementById(objId);
    if(object != null)
        object.style.display = "none";
}
