if (typeof XMLHttpRequest != 'undefined') 
{
    xmlHttpObject = new XMLHttpRequest();
}

if (!xmlHttpObject) 
{
    try 
    {
        xmlHttpObject = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e) 
    {
        try 
        {
            xmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(e) 
        {
            xmlHttpObject = null;
        }
    }
}

function loadPic(pfad, pic, maxPic)
{
    if(typeof(maxPic) == 'undefined') {
        xmlHttpObject.open('get','/fotoalbum/gallery.php?pfad=' + pfad + '&' + 'pic=' + pic);
    } else {
	xmlHttpObject.open('get','/fotoalbum/gallery.php?pfad=' + pfad + '&' + 'pic=' + pic + '&maxPic=' + maxPic);
    }
    xmlHttpObject.onreadystatechange = handleContent;
    xmlHttpObject.send(null);
    
}

function handleContent()
{
    if (xmlHttpObject.readyState == 4)
    {
        document.getElementById('picSlider').innerHTML = xmlHttpObject.responseText;
    }
}

function slideshowShow(pfad, isAlbum) {
  var bgroundH;  

  if(window.innerHeight)
    bgroundH = window.innerHeight;

   // Explorer 6 Strict Mode
  else if(document.documentElement && document.documentElement.clientHeight)
    bgroundH = document.documentElement.clientHeight;

   // other Explorers
  else if(document.body)
    bgroundH = document.body.clientHeight;

  var bgroundW;

  if(window.innerWidth)
    bgroundW = window.innerWidth;

   // Explorer 6 Strict Mode
  else if(document.documentElement && document.documentElement.clientWidth)
    bgroundW = document.documentElement.clientWidth;

   // other Explorers
  else if(document.body)
    bgroundW = document.body.clientWidth;
   
  
  var fotoH = document.getElementById("picSlider").offsetHeight;
  //var fotoW = document.getElementById("foto").offsetWidth;
 
  document.getElementById("slideShowBG").style.width = bgroundW + "px";
  document.getElementById("slideShowBG").style.height = bgroundH + "px";
  document.getElementById("slideShowBG").style.visibility = "visible";
 
  document.getElementById("picSlider").style.top = ((bgroundH / 2) - ( fotoH / 2)) + "px";
  //document.getElementById("foto").style.left = ((bgroundW / 2) - ( fotoW / 2)) + "px"; 

  loadPic(pfad, isAlbum);

  //damit durch einen link keine neue Seite geoeffnet wird
  return false;
}


function slideshowHide() {
  document.getElementById("slideShowBG").style.visibility = "hidden";
}

 

