function eval_getElementById(id)
{
  eval("var e=self." + id + ";");
  return e;
}

function exec_getElementById(id)
{
  window.execScript("var e=self." + id + ";", "JavaScript");
  return e;
}

function null_getElementById(id)
{
  return null;
}

if (document.getElementById)
{
  ; // do nothing
}
else if(document.all)
{
  document.getElementById = function (id)
  {
    return document.all[id];
  }
}
else if(eval && self)
{
  document.getElementById = eval_getElementById;
}
else if (window.execScript && self)
{
  document.getElementById = exec_getElementById;
}
else
{
  document.getElementById = null_getElementById;
}

function setNewsPosition()
{
	var hdr=document.getElementById("header");
	var nws=document.getElementById("news");
	nws.style.position='absolute';
	nws.style.left = hdr.offsetLeft + 666;
	nws.style.top = hdr.offsetTop + 143;
	//var hdr=document.getElementById("himg4");
	//nws.style.left = hdr.offsetLeft + 716;
	//nws.style.top = hdr.offsetTop + 159;
}

window.onresize = setNewsPosition;

function addParam(s, p, v)
{
  if (!s)
    s = "";

  if (v == false || v == 0 || v == "0")
     v = "no";
  else if (v == true || v == 1 || v == "1")
     v = "yes";

  if (!v)
     return;

  if (s.length > 0)
    s += ",";

  return s + p + "=" + v;
}

function showPic(href, width, height)
{
  var p;

  if (height)
		p = addParam(p, "height", height);
	if (width)
		p = addParam(p, "width", width);
  p = addParam(p, "left", 50)
  p = addParam(p, "top", 100);

  p = addParam(p, "directories", false);
  p = addParam(p, "location", false);
  p = addParam(p, "menubar", false);
  p = addParam(p, "resizable", false);
  p = addParam(p, "scrollbars", false);
  p = addParam(p, "status", false);
  p = addParam(p, "toolbar", false);

  w = window.open("/showpic.php?href=" + href, '', p);
  w.focus();
  return false;
}

function newWin(href, width, height)
{
return newWnd(href, width, height);
}


function newWnd(href, width, height)
{
  var p;

  if (height)
		p = addParam(p, "height", height);
	if (width)
		p = addParam(p, "width", width);
  /*p = addParam(p, "left", left)
  p = addParam(p, "top", top);*/

  p = addParam(p, "directories", false);
  p = addParam(p, "location", false);
  p = addParam(p, "menubar", false);
  p = addParam(p, "resizable", true);
  p = addParam(p, "scrollbars", true);
  p = addParam(p, "status", false);
  p = addParam(p, "toolbar", false);

  w = window.open(href, '', p);
  w.focus();
  return false;
}
