var PopupWnd = null;
function popup(url,xs,ys) {
  if (PopupWnd != null && !PopupWnd.closed) {
    PopupWnd.focus();
  }
  x = window.screen.width;
  y = window.screen.height;
  if (x != 0 && y != 0) {
    x = (x - xs) / 2;
    y = (y - ys) / 2;
  }
  coords = ",screenx=" + x + ",screeny=" + y + ",left=" + x + ",top=" + y;
  PopupWnd = window.open(url,"SOSPopup","toolbar=no,directories=no,menubar=no,width="+xs+",height="+ys+",scrollbars=yes,resizable=no"+coords);
}

function MouseOver(item) {
  document.images[item].src = "images/" + item + "_over.gif";
}

function MouseOut(item) {
  document.images[item].src = "images/" + item + "_norm.gif";
}

function preview(filename) {
  var textSpan = document.getElementById('preview');
  if (textSpan) {
    var HtmlOut = '<a href="pics/' + filename + '_l.jpg" target="_blank"><img src="pics/' + filename + '_m.jpg" border=0 title="Klicka på bilden för att hämta hem en ännu större bild"></a>';
    textSpan.innerHTML = HtmlOut;
  }
  else {
    document.images['preview'].src = "pics/" + filename + "_m.jpg";
  }
}
