
// globale Instanz von XMLHttpRequest
var xmlHttp = false;

// XMLHttpRequest-Instanz erstellen
// ... für Internet Explorer
try {
    xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
    try {
        xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
        xmlHttp  = false;
    }
}
// ... für Mozilla, Opera und Safari
if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}



function ShowImage(path) {
	Effect.Appear('greyBackground', {duration:0.5, from:0.0, to:0.7});
	document.getElementById('imagePopUp').innerHTML = '<img src="/images/'+path+'" />';
	Effect.Appear('imagePopUp', {duration:0.5});
	Effect.Appear('closeButton', {duration:0.5});
}

function closeAll(path) {
	Effect.Fade('greyBackground', {duration:0.5});
	Effect.Fade('imagePopUp', {duration:0.5});
	Effect.Fade('closeButton', {duration:0.5});
}

function ShowGallery(path) {
	Effect.Appear('greyBackground', {duration:0.5, from:0.0, to:0.7});
	theGallery(path);
	Effect.Appear('imagePopUp', {duration:0.5});
	Effect.Appear('closeButton', {duration:0.5});
}


function theGallery(path) {
	 if (xmlHttp) {
     xmlHttp.open('GET', 'includes/gallery.php?gallery='+path, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("imagePopUp").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
	
}

function showSpecialImage(path,image) {
	document.getElementById('imagePopUp').innerHTML = '<a style="z-index:1000;" href="javascript:theGallery(\''+path+'\');">Zurück zur Gallery</a><br /><br /><img src="'+image+'" />';
}
