<?php

##############################################################################
// eCards Virtual Greeting Card System
// Copyright (C) 2004 by 4n-community.de
// http://www.4n-community.de
// ---------------------------------------------------------------------------
// LICENSE:
// This Script is copyright of www.4n-community.de and may free of charge be used exclusively for private homepage.
// For free use  must all copyright notices unchanged in the Script! Also not be removed, converted, hidden or made invisible.
// If you liked not to indicate the copyright reference or the Script on commercial sides begin, you can acquire a license (= > LIZENZ.txt)!
// ---------------------------------------------------------------------------
// Filename: Card_V7.1
// Original Author: Lothar Dambowsky
// Purpose: Create via web a Virtual Greeting Card
// ---------------------------------------------------------------------------
// Forum to the Script of: http://www.4n-community.de/modules.php?name=4nForum
##############################################################################

if (!isset($mainfile)) { include("mainfile.php");}
include('header.php');
include('modules/Card/include.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$index=0;
OpenTable();
echo "<center><h3>Slideshow</h3></center>";
?>

<style>

.blend1	{filter:blendTrans(Duration=0.7, Transition=16);}
.blend2	{filter:blendTrans(Duration=1.5, Transition=16);}
.thumb	{filter:Alpha(style=2 finish-opacity=100); cursor:'hand';-moz-opacity:0.5;}

</style>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
if(document.all)var isIE=true;

var fotos = new Array();

function neu(url,text)
{
	Neu = fotos.length;
	fotos[Neu] = new Array();
	fotos[Neu]["text"]=text;
	fotos[Neu]["pic"]=new Image()
	fotos[Neu]["pic"].src=url;
}


exakt=false;
height=300;
width=900;

preview=3;  // Anzahl der vorschaubilder
time=5000   // Blendzeit
function skalieren(x,h,w,e)
{
	H=fotos[x]["pic"].height;
	W=fotos[x]["pic"].width;
	W1=W;
	H1=H;
	if(!e)
	{
		if(H>h)
		{
			W1=W*h/H;
			H1=h;
		}
		if(W>w)
		{
			H1=H*w/W;
			W1=w;
		}
	}else
	{
		H1=h;
		W1=w;
	}
	var re = new Array();
	re["w"]=W1;
	re["h"]=H1;
	return(re); W1=""; H1=""; W=""; H="";
}
thumb_height=height/preview;
thumb_width=100000;
thumb_exakt=false;

function thumb_table(offset)
{
	table="<table width=100% height=100%>";
	for(var x=offset; x<=offset+preview-1; x++)
	{
		if(fotos[x])
		{
			var Size = skalieren(x,thumb_height,thumb_width,thumb_exakt);
			size="width="+Size["w"]+" height="+Size["h"];
			table+="<tr><th><img "+size+" onclick=\"show('"+x+"',true)\" class='thumb' "+size+" src='"+fotos[x]["pic"].src+"' alt=\""+fotos[x]["text"]+"\"></th></tr>"
		}
	}
	table+="</table>";
	return(table);
}


var nav=0;
function navi(v)
{
	v=Number(v);
	if(nav+v>fotos.length-preview)
	{
			V=fotos.length-preview;
	}else
	{
		if(nav+v<0)
		{
			V=0;
		}else
		{
			V=nav+v;
		}
	}
	nav=V;
	if(isIE)	document.getElementById("thumbs").filters.blendTrans.Apply();
	document.getElementById("thumbs").innerHTML=thumb_table(V);
	if(isIE)	document.getElementById("thumbs").filters.blendTrans.Play();
}
NAV=-1;
function show(x,fs)
{
	x=Number(x);
	if(fotos[x])
	{
		var Size = skalieren(x,height,width,exakt);
		if(fs){size="width="+Size["w"]+" height="+Size["h"]; alt="alt=\"[show fullsize]\""; was=false} else {size=""; alt="alt=\"[show scaled size]\""; was=true}
		if(isIE)	document.getElementById("inhalt").filters.blendTrans.Apply();
		document.getElementById("inhalt").innerHTML="<table height=100% width=100% ><tr><th><b><img  onclick=\"show('"+x+"',"+was+")\" style=\"cursor:hand;\" "+size+" align=\"absmiddle\" src="+fotos[x]["pic"].src+" "+alt+"></th></tr></table>";
		if(isIE)	document.getElementById("inhalt").filters.blendTrans.Play();
		document.getElementById("name").innerHTML=fotos[x]["text"];
		document.getElementById("status").innerHTML=(x+1)+"/"+fotos.length;
	}
	NAV=x
}
var Timer; running=false;
function start()
{
	if(!running)
	{
		slideshow();
		running=true;
	}
}
function slideshow()
{
		NAV++;
		if(NAV>=fotos.length)NAV=0;
		show(NAV,true);
		Timer = setTimeout("slideshow()",time);
		document.getElementById("status2").innerHTML="[on]";
}
function kill()
{
	running=false
	document.getElementById("status2").innerHTML="[off]";
	if(Timer)clearTimeout(Timer);
}

<?php
$kategorie = array ();
$verz=opendir ('modules/Card/image/');
while ($kateg = readdir ($verz)){if($kateg != "." && $kateg != ".." && $kateg != "index.htm")
{$k++; array_push($kategorie,"$kateg");}}
foreach($kategorie as $kate) {
$pfad="modules/Card/image/$kate/";
$verz2=opendir ($pfad);
while ($bild = readdir ($verz2))
{if($bild != "." && $bild != ".." && $bild != "index.htm" && $bild != stristr($bild,"th_")){
$pfad="modules/Card/image/$kate/$bild";
echo ("neu('$pfad','$kate');");
$i++;
}}}
closedir($verz);
closedir($verz2);
?>
	

//--></script>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
if (document.layers){
window.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
window.onmousedown=rightclick;
window.onmouseup=rightclick;
function rightclick(e) {
if (e.which == 3) {
// Put right mouse code here
alert('Sorry, this Picture is copyright !');
return false;
}
else {
return true;
}
}
}
if (document.all){
function click() {
if (event.button==2) {
alert('Sorry, this Picture is copyright !')
}
if (event.button==3) {
alert('Sorry, this Picture is copyright !')}
}
document.onmousedown=click
}
// -->
</script>
<?php echo "<center><b>"._CARDALTOGETHER." $i "._CARDPICIN." $k "._CARDCATEGORYS."</b></center>"; ?>
<bgsound src="modules/Card/ballade.mid">
<table width="100%" border=0 align="center">
<tr><td><center><h4></h4></center></td></tr>
<tr><td  align="center" id=name></td></tr>
<tr><td class=blend2 id=inhalt><center>
<noscript>please activate javascript in your browser !</noscript>
<br>one moment please !</center></td></tr>
<tr height=20><td><div align="center"><b>Slideshow: </b> <a onclick=start() href="#">[&nbsp;Start&nbsp;]</a>
<a onclick=kill() href="#">[&nbsp;Stop&nbsp;]</a>&nbsp;<span id=status></span>
<span id=status2>&nbsp;[off]</span></div></td>
<tr><td><div align="center"></div>
</td></tr></table>
<?php echo "<center><b>$bild</b></center>"; ?>

<script LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
start();
//--></script>

<?php

echo "<center><a href='modules.php?name=Card'><h5>Zurück</h5></a></center>";
if(file_exists("modules/Card/file.php")){include "modules/Card/file.php"; CloseTable(); include("footer.php");}

// Dieser Link muss erhalten bleiben und darf nicht entfernt werden - not edit or remove this link, thanks!!
echo "<hr><center>eCard Modul-PHP-Nuke &copy by <a href='http://www.4n-community.de' target='_blank'>4n-community</center>";

CloseTable();

include("footer.php");

?>
