$(document).ready(
	function(){
		$('#fade').innerfade({
			animationtype: 'fade',
			speed: 'slow',
			timeout: 10000,
			type: 'sequence',
			containerheight: 'auto',
			runningclass: 'innerfade'
		}); 
		
		$('a.lightbox').lightBox({
			overlayBgColor: '#000000',
			overlayOpacity: 0.7,
			imageLoading: 'fileadmin/img/lightbox/loading.gif',
			imageBtnClose: 'fileadmin/img/lightbox/close.gif',
			imageBtnPrev: 'fileadmin/img/lightbox/prevlabel.gif',
			imageBtnNext: 'fileadmin/img/lightbox/nextlabel.gif',
			containerBorderSize: 10,
			containerResizeSpeed: 500,
			txtImage: 'Bild',
			txtOf: 'von'
   		});
	}
);


function changeImage(img_name,objectname)
{
  if(document.images)
    document.images[img_name].src = eval(objectname + ".src");
}

var winObj

function showPicture(url,picWidth,picHeight)
{
  if(winObj && !winObj.closed)
    winObj.close();

  var properties = "left=" + ((screen.availWidth - picWidth) / 2);
    properties += ",top=" + ((screen.availHeight - picHeight) / 2);
    properties += ",width=" + (picWidth > screen.availWidth-10 ? screen.availWidth-10 : picWidth);
    properties += ",height=" + (picHeight > screen.availHeight-10 ? screen.availHeight-10 : picHeight);
    properties += ",scrollbars=no,resizable=no";
    
  winObj = window.open("","Picture",properties);
  winObj.location = url;
}

function showPDF(url)
{
  if(winObj && !winObj.closed)
    winObj.close();

  $width = 320;
  $height = 280;

  var properties = "left=" + ((screen.availWidth - $width) / 2);
    properties += ",top=" + ((screen.availHeight - $height) / 2);
    properties += ",width=" + ($width > screen.availWidth-10 ? screen.availWidth-10 : $width);
    properties += ",height=" + ($height > screen.availHeight-10 ? screen.availHeight-10 : $height);
    properties += ",scrollbars=no,resizable=no";
    
  winObj = window.open("","PDF",properties);
  winObj.location = url;
}

function openAlbenPopup(url)
{
  if(winObj && !winObj.closed)
    winObj.close();

  var winWidth = 650;
  var winHeight = 580;

  var properties = "left=" + ((screen.availWidth - winWidth) / 2);
    properties += ",top=" + ((screen.availHeight - winHeight) / 2);
    properties += ",width=" + (winWidth > screen.availWidth-10 ? screen.availWidth-10 : winWidth);
    properties += ",height=" + (winHeight > screen.availHeight-10 ? screen.availHeight-10 : winHeight);
    properties += ",scrollbars=no,resizable=no";

  winObj = window.open("","Gallery",properties);
  winObj.location = url;
  winObj.focus();
}

function changeAlbenPopup(url)
{
  self.document.location.href = url;
  self.focus();
}
