﻿
var PptHeight=536;
var PptWidth=710;
var MarginMin=15;

function tralala()
{
alert("tralala");
}


function SetZindex (PfObject,PfVisibility)
{
document.getElementById(PfObject).style.zIndex=PfVisibility;
document.getElementById("Bild").style.visibility="hidden";  //TEST!!!
document.getElementById("BildContainer").style.zIndex=-6
document.getElementById("MovieContainer").style.zIndex=-6;
}

function HidePlayer()
{
document.getElementById("QTplayer").style.visibility="hidden";
}


function ShowBild()
{
if (document.getElementById("BildContainer").style.zIndex > 0)
{document.getElementById("Bild").style.visibility="visible";}

}

function AdjustSource(Source)
{
if (document.title.indexOf("•") == -1) //nur index hat kein "bullet" ...clumsy...clumsy...
{
var First=Source.substring(0,Source.indexOf("/"));
if (First == "")
{First=Source}
	if (First == "Bilder")
	{ return "Pages08/Architektur/"+Source }
	else if (First == "Animationen")
	{ return "Pages08/Architektur/"+Source }
	else if (First == "Content")
	{ return "Pages08/CG/"+Source }
	else if (First == "Fotos")
	{ return "Pages08/Foto/"+Source }
	else if (First == "HamburgGothic.jpg")
	{ return "Pages08/Contact/"+Source }
	else if (First == "Arbeitsplatz01.jpg")
	{ return "Pages08/PT/"+Source }
	else
	{return Source}
}
else
{return Source}
}


function ShowMovie(Source,Ws,Hs)
{
document.getElementById("Bild").style.visibility="hidden";  //TEST!!!
Source=AdjustSource(Source);
var W=Number(Ws);
var H=Number(Hs)-16; // kein Controller!!! da sonst Stop-Link über den (nun ausgeschalteten) Controller geht
var FilmName=Source.substring(Source.lastIndexOf("/")+1,Source.length);
document.getElementById("caption").innerHTML=document.getElementById(FilmName+"Text").innerHTML;
document.getElementById("BildContainer").style.visibility="hidden";
document.getElementById("Passepartout_").style.zIndex=5;
document.getElementById("MovieContainer").style.visibility="visible";

if (W>=H)
{// Querformat
var Hdelta=10;
var FilmLeft=Math.ceil((PptWidth-W)/2); 
var FilmTop=Math.ceil((PptHeight-H)/2-Hdelta);
document.getElementById("MovieContainer").style.left=String(FilmLeft)+"px";
document.getElementById("MovieContainer").style.top=String(FilmTop)+"px";
document.getElementById("MovieContainer").style.width=String(W)+"px";
document.getElementById("MovieContainer").style.height=String(H)+"px";
document.getElementById("MovieContainer").innerHTML='<object id="QTplayer" title="zurück zur Galerie" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" onclick=\'javascript:SetZindex("Passepartout_","-5");HidePlayer()\' codebase="http://www.apple.com/qtactivex/qtplugin.cab" height='+String(H)+' width='+String(W)+'><param name="src" value='+Source+' /><param name="autoplay" value="true" /><param name="controller" value="false" /><embed height='+String(H)+' pluginspage="http://www.apple.com/quicktime/download/" src='+Source+' type="video/quicktime" width='+String(W)+' controller="false" autoplay="true"></embed> </object>';
document.getElementById("TextContainer").style.left="0px";
document.getElementById("TextContainer").style.top=String(FilmTop+H)+"px"  ;
document.getElementById("TextContainer").style.width=String(PptWidth)+"px";
document.getElementById("TextContainer").style.height=String(70)+"px";
document.getElementById("TextContainer").style.textAlign="center";
//document.getElementById("Passepartout_").style.zIndex=5;
}

else
{  //Hochformat
var FilmLeft=3*MarginMin; 
var FilmTop=Math.ceil((PptHeight-H)/2);
document.getElementById("MovieContainer").style.left=String(FilmLeft)+"px";
document.getElementById("MovieContainer").style.top=String(FilmTop)+"px";
document.getElementById("MovieContainer").style.width=String(W)+"px";
document.getElementById("MovieContainer").style.height=String(H)+"px";
document.getElementById("MovieContainer").innerHTML='<object id="QTplayer" title="zurück zur Galerie" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" onclick=\'javascript:SetZindex("Passepartout_","-5");HidePlayer()\' codebase="http://www.apple.com/qtactivex/qtplugin.cab" height='+String(H)+' width='+String(W)+'><param name="src" value='+Source+' /><param name="autoplay" value="true" /><param name="controller" value="false" /><embed height='+String(H)+' pluginspage="http://www.apple.com/quicktime/download/" src='+Source+' type="video/quicktime" width='+String(W)+' controller="false" autoplay="true"></embed> </object>';
document.getElementById("TextContainer").style.left=String(FilmLeft+W+MarginMin)+"px";
document.getElementById("TextContainer").style.top=String(FilmTop)+"px";//String(Math.ceil(PptHeight/1.2))+"px";
document.getElementById("TextContainer").style.width=String(710-(FilmLeft+W+2*MarginMin))+"px";
document.getElementById("TextContainer").style.height=String(200)+"px";
document.getElementById("TextContainer").style.textAlign="left";

}

document.getElementById("MovieContainer").style.zIndex=6
}



function ShowPicture(Source)
{
Source=AdjustSource(Source);
document.getElementById("BildContainer").style.zIndex=-6;
document.getElementById("MovieContainer").style.visibility="hidden";
document.getElementById("BildContainer").style.visibility="hidden";
var BildName=Source.substring(Source.lastIndexOf("/")+1,Source.length);
document.getElementById("Bild").src="../SitePics/Dummy.gif";
document.getElementById("Bild").src=Source
var W=Number(document.getElementById(BildName+"Width").innerHTML);
var H=Number(document.getElementById(BildName+"Height").innerHTML);
document.getElementById("caption").innerHTML=document.getElementById(BildName+"Text").innerHTML;
document.getElementById("BildContainer").style.width=String(W)+"px";
document.getElementById("BildContainer").style.height=String(H)+"px";
if (W>=H)
{  // Querformat
var Hdelta=10;
var BildLeft=Math.ceil((PptWidth-W)/2); 
var BildTop=Math.ceil((PptHeight-H)/2-Hdelta);
document.getElementById("BildContainer").style.left=String(BildLeft)+"px";
document.getElementById("BildContainer").style.top=String(BildTop)+"px";
document.getElementById("TextContainer").style.left="0px";
document.getElementById("TextContainer").style.top=String(BildTop+H)+"px"  ;
document.getElementById("TextContainer").style.width=String(PptWidth)+"px";
document.getElementById("TextContainer").style.height=String(70)+"px";
document.getElementById("TextContainer").style.textAlign="center";
}
else
{  //Hochformat
//var Wmax=438;
var BildLeft=3*MarginMin; 
var BildTop=Math.ceil((PptHeight-H)/2);
document.getElementById("BildContainer").style.left=String(BildLeft)+"px";
document.getElementById("BildContainer").style.top=String(BildTop)+"px";
document.getElementById("TextContainer").style.left=String(BildLeft+W+MarginMin)+"px";
document.getElementById("TextContainer").style.top=String(Math.ceil(PptHeight/1.2))+"px";
document.getElementById("TextContainer").style.width=String(710-(BildLeft+W+2*MarginMin))+"px";
document.getElementById("TextContainer").style.height=String(200)+"px";
document.getElementById("TextContainer").style.textAlign="left";
}
document.getElementById("BildContainer").style.visibility="visible";
document.getElementById("Passepartout_").style.zIndex=5;
document.getElementById("BildContainer").style.zIndex=6;
}

