/*

COPYRIGHT-HINWEIS:

©  Michael Kalis
   http://www.stadtkapelle-gleisdorf.at

Alle hier inkludierten Skripte sind geistiges
Eigentum des Autors und werden mit dessen Erlaubnis
auf http://www.stoariegler.at/ verwendet.

Die Verwendung und Verwertung von Teilen
oder dem gesamten Inhalt dieser Datei für
andere Websites ist nicht gestattet.

*/


function CreateAddress(Addr,Title,StyleClass) {

if(Addr!=null)
{
Addr=unescape(Addr);
if(Title==null) Title=Addr;
Addr='<a href=\"mailto:'+Addr+'\"';
if(StyleClass!=null) Addr+=' class=\"'+StyleClass+'\"';
document.write(Addr+'>'+Title+'<\/a>');
}

} // End Function CreateAddress


function Update(Page) {

if(Page!=null)
{
var html_mode=true;key=prompt('Administrations-Passwort eingeben:','');
if(key!=null)
{
if(document.all&&(Page=='index'||Page=='about'||Page=='guestbook'))
html_mode=confirm('Auswahl des Bearbeitungs-Modus:\n\nKlicken Sie auf OK, um den Editor im HTML-Modus zu laden.\nAndernfalls erfolgt die Bearbeitung mit Vorschau.');
Page='./update.php?page='+Page+'&key='+key;
if(!html_mode) Page+='&editor=1';
top.location.href=Page;
}
}

} // End Function Update


function GalleryImage(ImageID) {

this.url=null;this.turl=null;this.info='';this.tinfo='';this.size='';this.tsize='';
if(GalleryTitle.length>2) this.title=GalleryTitle;
else this.title='www.stoariegler.at - Fotoalbum';
if(ImageID!=null)
{
var t=null;

if(String(ImageID).length>5) t=ImageID;
else t=ImageGallery[ImageID];

if(t!=null)
{
var s=new Array();
s=t.split('|');
if(s[0].length>4)
{
this.url=s[0];
t=s[0].lastIndexOf('/');
this.turl=(t==-1) ? './t/'+s[0] : s[0].substring(0,t)+'/t'+s[0].substring(t,s[0].length);
}
if(s.length>1)
{
t=s[1].split('x');
if(parseInt(t[0])>=0) this.size=' width=\"'+t[0]+'\"';
if(parseInt(t[1])>=0) this.size+=' height=\"'+t[1]+'\"';
}
if(s.length>2)
{
t=s[2].split('x');
if(parseInt(t[0])>=0) this.tsize=' width=\"'+t[0]+'\"';
if(parseInt(t[1])>=0) this.tsize+=' height=\"'+t[1]+'\"';
}
if(s.length>3)
{
this.info=s[3];
this.tinfo=s[3];
t=s[3].indexOf(']');
if(s[3].charAt(0)=='['&&t>0)
{
this.info=s[3].substring(t+1,s[3].length);
this.tinfo=s[3].substring(1,t);
}
}
if(s.length>4&&s[4].length>4) this.turl=s[4];
if(s.length>5&&s[5].length>3) this.title=s[5];
if(this.info=='') this.info='&copy; Old Stoariegler Dixielandband'; else { this.info=this.info.replace(/\n/g,'<br />'); this.info=this.info.replace(/\t/g,'<span style=\"padding-left:30px;\">&nbsp;<\/span>'); }
if(this.tinfo=='') this.tinfo='&copy; Old Stoariegler Dixielandband'; else { this.tinfo=this.tinfo.replace(/\n/g,' '); this.tinfo=this.tinfo.replace(/\t/g,' '); }
}
}

} // End Function GalleryImage


function CreateGallery(MaxImgPerRow,StyleClass) {

var a=new Array();
if(StyleClass==null)
StyleClass='img0';
var ImgPerRow=window.innerWidth;
if(ImgPerRow==null)
ImgPerRow=document.body.clientWidth;
ImgPerRow-=240;
ImgPerRow=Math.floor(ImgPerRow/185);
if(MaxImgPerRow!=null&&MaxImgPerRow>0&&ImgPerRow>MaxImgPerRow)
ImgPerRow=Math.floor(MaxImgPerRow);
if(ImgPerRow<1) ImgPerRow=1;
var i,j=0;
document.write('<table cellspacing=\"7\"><tr>\n');
for(i in ImageGallery)
{
var Picture=new GalleryImage(i);
if(Picture.url)
{
if(j==ImgPerRow)
{
document.write('<\/tr><tr>\n');
j=0;
}
document.write('<td class=\"'+StyleClass+'\"><a href=\"'+Picture.url+'\" onClick=\"ImageExplorer('+i+');return false;\" target=\"Explorer\"><img src=\"'+Picture.turl+'\"'+Picture.tsize+' alt=\"'+Picture.tinfo+'\" /><\/a><\/td>\n');
j++;
}
}
while(j<ImgPerRow)
{
document.write('<td class=\"'+StyleClass+'\">&nbsp;<\/td>\n');
j++;
}
document.write('<\/tr><\/table>');

} // End Function CreateGallery


function CreateImage(ImageID,StyleClass) {

if(StyleClass==null)
StyleClass='img0';
var Picture=new GalleryImage(ImageID);
if(Picture.url)
{
document.write('<table cellspacing\"7\" style=\"margin:5px;\"><tr><td class=\"'+StyleClass+'\"><a href=\"'+Picture.url+'\" onClick=\"ImageExplorer(\''+ImageID+'\');return false;\" target=\"Explorer\"><img src=\"'+Picture.turl+'\"'+Picture.tsize+' alt=\"'+Picture.tinfo+'\" /><\/a><\/td><\/tr><\/table>\n');
}

} // End Function CreateImage


function ImageExplorer(ImageID) {

var Picture=new GalleryImage(ImageID);
if(Picture.url)
{
Picture.url=encodeURIComponent(Picture.url); Picture.title=encodeURIComponent(Picture.title); Picture.size=encodeURIComponent(Picture.size); Picture.alt=encodeURIComponent(Picture.alt); Picture.info=encodeURIComponent(Picture.info);
var url='./imageexplorer.php?title='+Picture.title+'&url='+Picture.url+'&size='+Picture.size+'&alt='+Picture.tinfo+'&info='+Picture.info;
if(ImgExplorer.closed||!ImgExplorer) ImgExplorer=window.open(url,'ImageExplorer','width=820,height=670,left='+(screen.width-820)/2+',top='+(screen.height-670-68)/2+',location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
else ImgExplorer.location.href=url;
ImgExplorer.focus();
}

} // End Function ImageExplorer


var PlayerStyle='margin:10px 40px 0px 40px;padding:0px;overflow:hidden;border:none;background:#111;color:#BBC;font-family:Verdana,Sans-Serif;font-size:8pt;text-align:center;';

function SetPlayer(URL,MusicTitle) {

if(typeof(player)!='object') return;
var t='<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-strict.dtd\">\n<html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><head>\n<title>Music Player</title>\n<meta http-equiv=\"content-type\" content=\"text\/html; charset=ISO-8859-1\" \/>\n<meta http-equiv=\"content-style-type\" content=\"text\/css\" \/>\n<\/head>\n';
t+='<body style=\"'+PlayerStyle+'\">\n';
if(URL!=null)
{
if(MusicTitle==null) MusicTitle='Old Stoariegler Dixielandband';
t+='<div style=\"height:25px;\">'+MusicTitle+'<\/div>\n<div>\n';
t+='<object width=\"320\" height=\"44\" classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\">\n';
t+='<param name=\"filename\" value=\"'+URL+'\" \/>\n<param name=\"autostart\" value=\"true\" \/>\n';
t+='<embed width=\"320\" height=\"44\" src=\"'+URL+'\" autostart=\"true\"><\/embed>\n';
t+='<\/object>\n<\/div>\n';
}
t+='<\/body><\/html>';
player.document.open();
player.document.write(t);
player.document.close();

} // End Function SetPlayer


function CreatePlayer() {

document.write('<iframe name=\"player\" id=\"player\" class=\"player\" style=\"width:400px;height:100px;\"><\/iframe>');
SetPlayer();

} // End Function CreatePlayer


GalleryTitle='Image Explorer&nbsp;&nbsp;&nbsp;http://www.stoariegler.at'
ImgExplorer = false;

// End File scripts.js
