var Images = new Array();
Images['40'] = "Blick über den See vom Taucheinstieg";
Images['41'] = "Blick über den See vom linken Ufer aus.";
Images['42'] = "Stefan und Chris beim Einstieg in den Grünen See.
(c) Neptun Diving";
Images['43'] = "Ja! Dieses Foto wurde unter Wasser aufgenommen. :-)
(c) Neptun Diving";
Images['44'] = "Noch eine geflutete Wiese.
(c) Neptun Diving";
Images['45'] = "Manche Pflanzen blühen auch unter Wasser...
(c) Neptun Diving";
Images['46'] = "Eine der sehr neugierigen Forellen.
(c) Neptun Diving";
Images['47'] = "Diese Forelle fühlt sich wohl wie im Dschungel...
(c) Neptun Diving";
Images['48'] = "Am grünen See kann man Spiegelungen an der Wasseroberfläche auch unter Wasser beobachten. :-)
(c) Neptun Diving";
Images['49'] = "Auch Bäume werden manchmal vom Wasser überflutet.
(c) Neptun Diving";
var fps = 25;
var fade_time = 1; //in Sekunden
var zoom_time = 1; //in Sekunden
var photo = new Image();
var window_heigt = 0;
var window_width = 0;
if (navigator.appName == "Microsoft Internet Explorer")
{
window_height = document.documentElement.clientHeight;
window_width = document.documentElement.clientWidth;
}
else
{
window_height = window.innerHeight;
window_width = window.innerWidth;
}
function open_photo (cat, id)
{
fade ("photo_viewer", "in");
show_photo (cat, id);
}
function change_photo (cat, id)
{
fade ("photo_viewer", "out");
zoom (document.getElementById("photo_viewer").height, document.getElementById("photo_viewer").width, 20, 20);
setTimeout('document.getElementById("photo_desc").innerHTML = "wird geladen..."; document.getElementById("photo_viewer").src = "imgs/symbols/loading.gif";', fade_time * 1000 + 10);
setTimeout('fade ("photo_viewer", "in");', fade_time * 1000 + 1000/25);
setTimeout("show_photo ('" + cat + "', '" + id + "');", fade_time * 1000 + 1000/25*3);
}
function show_photo (cat, id)
{
document.getElementById("view_photo_container").style.top = (window_height - 95) / 2 + "px";
document.getElementById("view_photo_container").style.visibility = "visible";
if ( typeof(Images[id-1]) != "undefined" )
{
document.getElementById("prev_img").onclick = function() { change_photo( cat, (parseInt(id)-1) ); }
document.getElementById("prev_img").style.visibility = "visible";
}
else
document.getElementById("prev_img").style.visibility = "hidden";
if ( typeof(Images[parseInt(id) + 1]) != "undefined" )
{
document.getElementById("next_img").onclick = function() { change_photo( cat, (parseInt(id)+1) ); }
document.getElementById("next_img").style.visibility = "visible";
}
else
document.getElementById("next_img").style.visibility = "hidden";
document.getElementById("zoom_img").onclick = function() { zoom_photo( cat, (parseInt(id)) ); }
if (document.getElementById("view_photo_container").style.opacity == 0 || document.getElementById("view_photo_container").style.filter == 'alpha(opacity=0)')
{
fade ("view_photo_container", "in");
}
photo = new Image();
photo.src = "gallery.php?action=get&cat=" + cat + "&id=" + id;
setTimeout ('load_photo(' + id + ');', 1000 * fade_time + 10);
}
function load_photo (id)
{
if ( photo.complete ) {
document.getElementById("photo_desc").innerHTML = Images[id];
var img_height = 0;
var img_width = 0;
(photo.height > (window_height - 75) ) ? img_height = (window_height - 75) : img_height = photo.height;
(photo.width > (window_width - 100) ) ? img_width = (window_width - 100) : img_width = photo.width;
fade ("photo_viewer", "out");
setTimeout ( 'document.getElementById("photo_viewer").src = photo.src; document.getElementById("photo_viewer").style.height = "20px"; document.getElementById("photo_viewer").style.width = "20px";', fade_time * 1000 + 10);
setTimeout ( 'zoom (' + document.getElementById("photo_viewer").height + ', ' + document.getElementById("photo_viewer").width + ', ' + img_height + ', ' + img_width + ');', fade_time * 1000);
setTimeout('fade ("photo_viewer", "in");', fade_time * 1000 + 500);
}
else
setTimeout ( "load_photo(" + id + ");", 250);
}
function hide_photo ()
{
fade ("view_photo_container", "out");
fade ("photo_viewer", "out");
zoom (document.getElementById("photo_viewer").height, document.getElementById("photo_viewer").width, 20, 20);
setTimeout("close_photo ();", 1000 * fade_time + 10);
}
function close_photo ()
{
document.getElementById("view_photo_container").style.visibility = "hidden";
document.getElementById("prev_img").style.visibility = "hidden";
document.getElementById("next_img").style.visibility = "hidden";
document.getElementById("photo_desc").innerHTML = "wird geladen...";
document.getElementById("photo_viewer").src = "imgs/symbols/loading.gif";
}
function fade (id, dir, step)
{
var time = fade_time;
var steps = fps * time;
var opacity_step = 100 / steps;
if (!step)
{
if ( dir == "in" ) var step=1;
if ( dir == "out" ) var step=steps;
}
document.getElementById(id).style.opacity = step*opacity_step / 100;
document.getElementById(id).style.filter = "alpha(opacity=" + step*opacity_step + ")";
if ( dir == "in" )
{
step ++;
if (step <= steps) { setTimeout("fade ('" + id + "', '" + dir + "', " + step + ")", 1000/fps);}
}
if ( dir == "out" )
{
step --;
if (step > 0) { setTimeout("fade ('" + id + "', '" + dir + "', " + step + ")", 1000/fps);}
else
{
document.getElementById(id).style.opacity = 0;
document.getElementById(id).style.filter = 'alpha(opacity="0")';
}
}
}
function zoom (from_height, from_width, to_height, to_width, step)
{
var time = fade_time;
var steps = fps * time;
if (!step) step = 1;
var step_height = Math.ceil( (to_height - from_height) / steps * step ) + from_height;
var step_width = Math.ceil( (to_width - from_width) / steps * step ) + from_width;
document.getElementById("photo_viewer").style.height = step_height + "px";
document.getElementById("photo_viewer").style.width = step_width + "px";
document.getElementById("photo_frame").style.height = step_height + 75 + "px";
document.getElementById("photo_frame").style.width = step_width + 50 + "px";
document.getElementById("view_photo_container").style.top = (window_height - step_height - 75) / 2 + "px";
step ++;
if (step <= steps)
setTimeout ("zoom(" + from_height + ", " + from_width + ", " + to_height + ", " + to_width + ", " + step + ");", 1000/fps);
}
function zoom_photo (cat, id)
{
window.open("./gallery.php?action=get_full&cat=" + cat + "&id=" + id);
}
function write_slide_show_comment (cat, a)
{
var XMLHTTP = null;
if (window.XMLHttpRequest) {
XMLHTTP = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
XMLHTTP =
new ActiveXObject("Msxml2.XMLHTTP");
}
catch (ex) {
try {
XMLHTTP =
new ActiveXObject("Microsoft.XMLHTTP");
}
catch (ex) {
}
}
}
//Kommentar ermitteln
XMLHTTP.open("GET", 'gallery.php?action=get_comment&cat=' + cat + '&id=' + a, true);
XMLHTTP.onreadystatechange = function() {
if(XMLHTTP.readyState == 4 && XMLHTTP.status == 200) {
document.getElementById("slideshow_desc").innerHTML = XMLHTTP.responseText;
}
}
XMLHTTP.send(null);
}
function write_slide_show_link (cat, a, page)
{
var XMLHTTP = null;
if (window.XMLHttpRequest) {
XMLHTTP = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
XMLHTTP =
new ActiveXObject("Msxml2.XMLHTTP");
}
catch (ex) {
try {
XMLHTTP =
new ActiveXObject("Microsoft.XMLHTTP");
}
catch (ex) {
}
}
}
//Seiten-ID ermitteln
XMLHTTP.open("GET", 'gallery.php?action=get_page&cat=' + cat + '&id=' + a, true);
XMLHTTP.onreadystatechange = function() {
if(XMLHTTP.readyState == 4 && XMLHTTP.status == 200) {
document.getElementById("slideshow_link").href = page + XMLHTTP.responseText;
}
}
XMLHTTP.send(null);
}
function slide_show_next ()
{
var cat = '';
var id = 0;
var page = '';
var a = Math.floor(Math.random()*4);
switch (a)
{
case 0:
case 1:
cat = 't';
a= Math.ceil(Math.random()*3200);
page = 'travel.php?id=';
break;
case 2:
cat = 'w';
a= Math.ceil(Math.random()*400);
page = 'trekking.php?id=';
break;
case 3:
cat = 'd';
a= Math.ceil(Math.random()*39);
page = 'diving.php?id=';
break;
}
document.getElementById("slideshow_img").src = "gallery.php?action=preview&cat=" + cat + "&id=" + a;
write_slide_show_comment (cat, a);
write_slide_show_link (cat, a, page);
}