// Slideshow

function processSlideshow(elem, imageList, imageDuration, fadeSpeed, current) 
{
	var listSize = imageList.length;
    if (!current || current >= listSize) current = 0;
    if (!imageDuration) imageDuration = 3000;
    if (!fadeSpeed) fadeSpeed = 1000;
    $(elem + " img").attr("src", imageList[current]);
    if (current == (listSize - 1)) { $(elem).css("background", "transparent url(" + imageList[0] + ") no-repeat");
    } else {
        $(elem).css("background", "transparent url(" + imageList[current + 1] + ") no-repeat");
    }
    $(elem + " img").animate({ opacity: "1" }, imageDuration).
	      animate({ opacity: "0.01" }, fadeSpeed, function() 
		   { 
		     $(this).css("opacity", "1"); processSlideshow(elem, imageList, imageDuration, fadeSpeed, current + 1) 
			});

}
function startSlideshow()
{
$("#slideshow img").css("opacity", "0");
$("#slideshow img").animate({opacity: "1"}, 1000);
setTimeout('processSlideshow("#slideshow", slideShow, 2000, 1000)',1000);
}

// Ende Slideshow


function openwin(theURL,wname,W,H){
var X=(screen.width-W)/2;
var Y=(screen.height-H)/2; 
var s=",width="+W+",height="+H+",screenX="+X+",screenY="+Y+",left="+X+",top="+Y;
var CWIN=window.open(theURL,wname,"toolbar=0,location=0,dependent=1,status=0,menubar=0,scrollbars=no,resizable=0"+s,true);
CWIN.focus();
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
