// Browser init
var ns = (document.layers) ? true:false;
var ie = (document.all) ? true:false;

// oeffnet popup-fenster und stellt bild dar 
function imageWin(url, width, height, title, comment, returnVal)
{
  imagewin = 'showimage.php?url=' + escape(url) + '&width=' + width + '&height=' + height + '&wintitle=' + escape(title) + '&comment='+escape(comment);

  oWin(imagewin, 'ImageWin', eval("width+40"), eval("height+90"), false);
  return returnVal;
}

// oeffnet popup-fenster und startet download 
function downloadWin(url, returnVal)
{
  filewin = 'download.php?url=' + escape(url);

  oWin(filewin, 'DownloadWin', 200, 100, false);
  return returnVal;
}

// oeffnet popup-fenster mit guestbook 
function guestbookWin(returnVal)
{
  url = 'http://cgi04.puretec.de/cgi-bin/gb?clsid=b22c9a45e5304c4ce7e62e7a02b0c44d';

  oWin(url, 'GuestbookWin', 550, 400, true);
  return returnVal;
}

// oeffnet popup-fenster und stellt bild dar 
function playerWin(returnVal)
{

	if (ns || ie) {
	  url = '../global/dcplayer.htm';

	  winHandlePlayer = window.open(url,'DCPlayerWin','toolbar=no,directories=no,status=no,menubar=no,resizable=no,scrollbar=no,dependent=yes,width=350,height=100');
	} else {
		alert('Your Browser is not supported by DC-Player 1.0!\nIhr Browser wird von DC-Player 1.0 nicht unterstüzt!');
	}
	  return returnVal;
}


function oWin(url,title,sizeH,sizeV, otherHost)
{
  scrollbar = 'scrollbars';
  if (ie || ns)
  {
    if ((screen.availWidth >= sizeH) && (screen.availHeight >= sizeV)) 
	  scrollbars = 'scrollbars=no';
    if (screen.availWidth <= sizeH) 
      sizeH = screen.availWidth;
    if (screen.availHeight <= sizeV) 
      sizeV = screen.availHeight-30;
	else
	  sizeV += 10;
    //Fenster zentrieren
    x = Math.floor((screen.availWidth-sizeH+1)/2);
	y = Math.floor((screen.availHeight-sizeV+1)/2)-30;
	if (x <= 0) x = 0;
	if (y <= 0) y = 0;
  }
  winHandle = window.open(url,title,'toolbar=no,directories=no,status=yes,menubar=no,resizable=yes,'+scrollbar+',dependent=yes,width='+sizeH+',height='+sizeV+',screenX='+x+',screenY='+y);
  if (!otherHost)
    if (ie) winHandle.moveTo(x, y);
}

function chgImgHi(name, url)
{
  if (document.images)
  {
    if (!document.images[name].oldsrc)
	  document.images[name].oldsrc = document.images[name].src;
    document.images[name].src = url;
  }
}

function restoreImg(name)
{
  if (document.images)
  {
    if (document.images[name].oldsrc)
	  document.images[name].src = document.images[name].oldsrc;
  }
}
   

