//  file: s-pop.js
//  description: öffnet ein Popup-Fenster zur anzeige von Bildern
//  version: 1.1 - 08.08.2002
//  (C) OMNIWORX GbR

var win = null;
var aktuell;
var anzahl;
var name;
var breite;
var hoehe;



function openwin(pos, anz, ses) {
	openwin_(0,pos,anz,ses);
}
function openwin_media(pos, anz, ses) {
	openwin_(1,pos,anz,ses);
}
function openwin_(media,pos, anz, ses) {
    win = window.open("pop.php?media="+media+"&akt="+pos+"&max="+anz+"&ses="+ses,"fenster1","width=550, height=580, personalbar=no, status=no, menubar=no, resizable=yes, location=no, scrollbars=no, dependent=no, screenX=100, screenY=100");
    win.focus();
}


function set() {
  aktuell = window.opener.getAktuell();
  anzahl = window.opener.getAnzahl();
  document.pic.src = aktuell +"g.jpg";
}


function nextpic(direct) {
  aktuell = aktuell + direct;
  if (aktuell > anzahl) {
    aktuell = 1;
  }
  if (aktuell < 1) {
    aktuell = anzahl;
  }
  document.pic.src = aktuell +"g.jpg";
}


function getAktuell() {
  return aktuell;
}


function getAnzahl() {
  return anzahl;
}


function closewin() {
  window.close();
}

function fenster(name,breite,hoehe) {
  var text= 'width=' +breite+ ', height=' +hoehe+ ', personalbar=no, status=no, menubar=no, resizable=yes, location=no, scrollbars=no, dependent=no, screenX=100, screenY=100';
  var popwin = window.open(name+ ".php","Diashow",text);
  popwin.focus();
}
