//******************************************************************************
//* Datei:  mud.js (Bibliothek mit Erweiterungen bestehender JavaScript-       *
//*                 Klassen und neuer JavaScript-Klassen)                      *
//*                                                                            *
//* Autor:  André Wüstefeld                                                    *
//* Firma:  k&w content management                                             *
//*                                                                            *
//* Inhalt:                                                                    *
//*         String.prototype.charAtReverse = function(chr)                     *
//*         String.prototype.ltrim         = function()                        *
//*         String.prototype.rtrim         = function()                        *
//*         String.prototype.trim          = function()                        *
//*                                                                            *
//*         Klasse MyBrowser                                                   *
//*                                                                            *
//*         Klasse Element                                                     *
//*         Klasse FontSize                                                    *
//*                                                                            *
//*         Klasse ContactForm                                                 *
//*         Klasse CheckboxItem                                                *
//*         Klasse SubmitButton                                                *
//*         Klasse TextItem                                                    *
//*         Klasse TextAreaItem                                                *
//*                                                                            *
//*         Klasse Email                                                       *
//*                                                                            *
//*         Klasse GoogleMap                                                   *
//*         Klasse GoogleMapMarker                                             *
//*                                                                            *
//*         Klasse DynamicImage                                                *
//*         Klasse FadingEffect                                                *
//*         Klasse LinkImage                                                   *
//*         Klasse LinkImageCollection                                         *
//*         Klasse Opacity                                                     *
//*         Klasse PreviewImage                                                *
//*         Klasse RolloverImage                                               *
//*         Klasse UpDownNavigation                                            *
//*                                                                            *
//*         Klasse SlideshowGallery                                            *
//*         Klasse SlideshowMenu                                               *
//*         Klasse ImagePreview                                                *
//*         Klasse ImageSlider                                                 *
//******************************************************************************

//////////////////////////// Globale Variablen /////////////////////////////////

var ASCII_AT = '%40';

var CLIP_INITIALIZE = 0;
var CLIP_UPDATE     = 1;

var LANG_ENGLISH = 'en';
var LANG_GERMAN  = 'de';
var LANG_SPANISH = 'es';

var ORIENT_HORIZONTAL = 0;
var ORIENT_VERTICAL   = 1;

var IMAGE_PREVIEW = 0;
var IMAGE_SLIDER  = 1;

var RED_ASTERISK = '<b style="color: red">*</b>';

var ROTATION_BACKWARDS = 0;
var ROTATION_FORWARD   = 1;
var ROTATION_RANDOM    = 2;

var SSM_PREVGALLERY = 0;
var SSM_PREVIMAGE   = 1;
var SSM_STOPSHOW    = 2;
var SSM_STARTSHOW   = 3;
var SSM_NEXTIMAGE   = 4;
var SSM_NEXTGALLERY = 5;

var GMAP_NORMAL    = 0;
var GMAP_SATELLITE = 1;
var GMAP_HYBRID    = 2;
var GMAP_PHYSICAL  = 3;

var GCONTROL_LARGE                      = 0;
var GCONTROL_LARGE_TYPE                 = 1;
var GCONTROL_LARGE_HIERARCHICALTYPE     = 2;
var GCONTROL_SMALL                      = 3;
var GCONTROL_SMALL_TYPE                 = 4;
var GCONTROL_SMALL_HIERARCHICALTYPE     = 5;
var GCONTROL_SMALLZOOM                  = 6;
var GCONTROL_SMALLZOOM_TYPE             = 7;
var GCONTROL_SMALLZOMM_HIERARCHICALTYPE = 8;

/////////////////// Erweitrung der String-Klasse ///////////////////////////////

String.prototype.charAtReverse = function(chr)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strTemp = this.toString();
    
    while(strTemp.length > 0)
    {
        if(strTemp.charAt(strTemp.length - 1) == chr)
            return(strTemp.length - 1);
            
        strTemp = strTemp.substr(0, strTemp.length - 1);
    }
    return(-1);
}

String.prototype.ltrim = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strTemp = this.toString();
	
    while(strTemp.length > 0)
	{
		if(strTemp.charAt(0) == ' ')
		    strTemp = strTemp.substr(1);
		else
			break;
	}
	
	return(strTemp);
}

String.prototype.rtrim = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strTemp = this.toString();
	
    while(strTemp.length > 0)
	{
		if(strTemp.charAt(strTemp.length-1) == ' ')
		    strTemp = strTemp.substr(0, strTemp.length-1);
		else
			break;
	}
	
	return(strTemp);
}

String.prototype.trim = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	return(this.toString().ltrim().rtrim());
}

////////////////////////// Klasse MyBrowser ////////////////////////////////////

function MyBrowser()
//******************************************************************************
//* Klasse MyBrowser: Klasse bleibt ohne Code, da es keine Instanzen gibt.     *
//******************************************************************************
{}

MyBrowser.CookieEnabled = navigator.cookieEnabled;
MyBrowser.Language      = navigator.language;
MyBrowser.Name          = navigator.appName;
MyBrowser.Platform      = navigator.platform;
MyBrowser.UserAgent     = navigator.userAgent;
MyBrowser.Version       = navigator.appVersion;

MyBrowser.Message       = 'Rechte Maustaste ist deaktiviert !';
MyBrowser.Timeout       = 0;

MyBrowser.disableRightMouseButton = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(document.all)
    {
        if(document.getElementById)
            document.oncontextmenu = MyBrowser.eventShowMessage;
        else
            document.onmousedown = MyBrowser.eventCheckButton;
    }
    
    if(!(document.all) && document.getElementById)
        document.oncontextmenu = MyBrowser.eventShowMessage;
    
    if(document.layers)
    {
        document.captureEvents(Event.MOUSEUP | Event.MOUSEDOWN);
        document.onmousedown = MyBrowser.eventDoNothing;
        document.onmouseup = MyBrowser.eventHideContextMenu;
    }
}

MyBrowser.enableRightMouseButton = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(document.all)
    {
        document.oncontextmenu = 'return(true)';
        document.onmousedown = none;
        document.onmouseup = none;
    }
    
    if(!(document.all) && document.getElementById)
        document.oncontextmenu = 'return(true)';
    
    if(document.layers)
    {
        document.releaseEvents(Event.MOUSEUP | Event.MOUSEDOWN);
        document.onmousedown = none;
        document.onmouseup = none;    
    }
}

MyBrowser.eventCheckButtons = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(event.button != 1)
    { 
      showMessage();
      return(false);
    }
}

MyBrowser.eventDoNothing = function(objEvent)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(objEvent.which != 1)
        return(false);
}

MyBrowser.eventHideContextMenu = function(objEvent)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(objEvent.which != 1)
    {
        clearTimeout(MyBrowser.Timeout);
        MyBrowser.Timeout = setTimeout("MyBrowser.HideContextMenu()", 1);
    }
}

MyBrowser.eventShowMessage = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    alert(unescape(MyBrowser.Message));
    return(false);
}

MyBrowser.HideContextMenu = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    clearTimeout(MyBrowser.Timeout);
    showMessage();
}

MyBrowser.isInternetExplorer4 = function()
//******************************************************************************
//* Überprüfung, ob der aktuell verwendete Browser der Internet Explorer       *
//* Version 4 oder höher ist.                                                  *
//******************************************************************************
{
    return(MyBrowser.Name == "Microsoft Internet Explorer"
        && parseInt(MyBrowser.Version) >= 4);
}

MyBrowser.isKonqueror = function()
//******************************************************************************
//* Überprüfung, ob der aktuell verwendete Browser Konqueror (Linux) ist.      *
//******************************************************************************
{
    return(MyBrowser.Name == "Konqueror");
}

MyBrowser.isNetscape5 = function()
//******************************************************************************
//* Überprüfung, ob der aktuell verwendete Browser Netscape Version 5 oder     *
//* höher, aber nicht Safari ist.                                              *
//******************************************************************************
{
    return(MyBrowser.Name == "Netscape"
        && parseInt(MyBrowser.Version) >= 5
		&& MyBrowser.Version.indexOf('Safari') == -1);
}

MyBrowser.isOpera = function()
//******************************************************************************
//* Überprüfung, ob der aktuell verwendete Browser der Opera-Browser ist.      *
//******************************************************************************
{
    return(MyBrowser.Name == "Opera");
}

MyBrowser.isSafari = function()
//******************************************************************************
//* Überprüfung, ob der aktuell verwendete Browser Safari ist.                 *
//******************************************************************************
{
    return(MyBrowser.Name == "Netscape"
		&& MyBrowser.Version.indexOf("Safari") > -1);
}


MyBrowser.javaEnabled = function()
//******************************************************************************
//* Java-Verfügbarkeit überprüfen.                                             *
//******************************************************************************
{
    return(navigator.javaEnabled());
}

//////////////////////////// Klasse Element ////////////////////////////////////

function Element(strObjName, strId)
//******************************************************************************
//* Klasse Element                                                             *
//******************************************************************************
{
	this.Obj     = null;
	this.ObjName = strObjName;
	this.Id      = strId;
	
	this.Delay     = 30;
	this.Step      = 1;
	this.OnMoved   = '';
	this.OnResized = '';
	this.IsLocked  = false;
	
	this.Opacity = new Opacity(this.Id);
	
	this.init();
}


Element.prototype.exists = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	if(!this.Obj)
		this.init();
	return(this.Obj);
}

Element.prototype.getHeight = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var nValue = 0;
	if(this.exists())
		nValue = Number(this.Obj.style.height.replace(/px/, ''));
		
	return(isNaN(nValue) ? 0 : nValue);
}

Element.prototype.getLeft = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var nValue = 0;
	if(this.exists())
		nValue = Number(this.Obj.style.left.replace(/px/, ''));
		
	return(isNaN(nValue) ? 0 : nValue);
}

Element.prototype.getTop = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var nValue = 0;
	if(this.exists())
		nValue = Number(this.Obj.style.top.replace(/px/, ''));
		
	return(isNaN(nValue) ? 0 : nValue);
}

Element.prototype.getWidth = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var nValue = 0;
	if(this.exists())
		nValue = Number(this.Obj.style.width.replace(/px/, ''));
		
	return(isNaN(nValue) ? 0 : nValue);
}

Element.prototype.hide = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	if(this.exists())
	{
		this.Obj.style.display = 'none';
		this.Obj.style.visibility = 'hidden';
	}
}

Element.prototype.init = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	this.Obj = document.getElementById(this.Id);
}

Element.prototype.moveHorizontal = function(nMaxSteps)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	if(this.exists())
	{
		if(nMaxSteps != 0)
		{
			if(nMaxSteps > 0)
				var nStep = (nMaxSteps < this.Step ? nMaxSteps : this.Step)
			else
				var nStep = (nMaxSteps > -this.Step ? nMaxSteps : -this.Step)
					
			nMaxSteps = nMaxSteps - nStep;
				
			this.Obj.style.left =  this.getLeft() + nStep;
			window.setTimeout(this.ObjName + '.moveHorizontal(' + nMaxSteps.toString() + ')', this.Delay);
		}
		else
		{
			eval(this.OnMoved);
			this.IsLocked = false;
		}
	}				
}
				
Element.prototype.moveVertical = function(nMaxSteps)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	if(this.exists())
	{
		if(nMaxSteps != 0)
		{
			if(nMaxSteps > 0)
				var nStep = (nMaxSteps < this.Step ? nMaxSteps : this.Step)
			else
				var nStep = (nMaxSteps > -this.Step ? nMaxSteps : -this.Step)
				
			nMaxSteps = nMaxSteps - nStep;
					
			this.Obj.style.top = this.getTop() + nStep;
			window.setTimeout(this.ObjName + '.moveVertical(' + nMaxSteps.toString() + ')', this.Delay);
		}
		else
		{
			eval(this.OnMoved);
			this.IsLocked = false;
		}
	}				
}
				
Element.prototype.resizeHeight = function(nMaxSteps)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	if(this.exists())
	{
		if(nMaxSteps != 0)
		{
			if(nMaxSteps > 0)
				var nStep = (nMaxSteps < this.Step ? nMaxSteps : this.Step)
			else
				var nStep = (nMaxSteps > -this.Step ? nMaxSteps : -this.Step)
				
			nMaxSteps = nMaxSteps - nStep;
			
			this.Obj.style.height = this.getHeight() + nStep;
			window.setTimeout(this.ObjName + '.resizeHeight(' + nMaxSteps.toString() + ')', this.Delay);
		}
		else
		{
			eval(this.OnResized);
			this.IsLocked = false;
		}
	}				
}
				
Element.prototype.resizeWidth = function(nMaxSteps)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	if(this.exists())
	{
		if(nMaxSteps != 0)
		{
			if(nMaxSteps > 0)
				var nStep = (nMaxStep < this.Step ? nMaxStep : this.Step)
			else
				var nStep = (nMaxStep > -this.Step ? nMaxStep : -this.Step)
				
			nMaxSteps = nMaxSteps - nStep;
			
			this.Obj.style.width = this.getWidth() + nStep;
			window.setTimeout(this.ObjName + '.resizeWidth(' + nMaxSteps.toString() + ')', this.Delay);
		}
		else
		{
			eval(this.OnResized);
			this.IsLocked = false;
		}
	}				
}

Element.prototype.setBackgroundImage = function(strImage)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	if(this.exists())
		this.Obj.style.backgroundImage = 'url(' + strImage + ')';
}

Element.prototype.show = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	if(this.exists())
	{
		this.Obj.style.display = 'block';
		this.Obj.style.visibility = 'visible';
	}
}

/////////////////////////// Klasse FontSize ////////////////////////////////////

function FontSize(strObjectName, strEnclosingId)
//******************************************************************************
//* Klasse FontSize                                                            *
//******************************************************************************
{
	this.EnclosingId = strEnclosingId;
	this.ObjectName  = strObjectName;
	
	this.CurrentSize = 100; // in Prozent
	this.Max  = 200;        // in Prozent
	this.Min  = 50;         // in Prozent
	this.Step = 10;         // in Prozent
	
	this.Label = 'Schriftgr&ouml;&szlig;e:';
	this.Decrease = '&nbsp;-&nbsp;';
	this.Text     = '&nbsp;'
				  + '<span style="font-size:100%;">a</span>'
				  + '<span style="font-size:110%;">a</span>'
				  + '<span style="font-size:130%;">a</span>'
				  + '&nbsp;';
	this.Increase = '&nbsp;+&nbsp;';
}

FontSize.prototype.decrease = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var objHTML = document.getElementsByTagName("html")[0];
	
	if(objHTML)
	{
		this.CurrentSize = this.CurrentSize - this.Step;
		if(this.CurrentSize < this.Min)
			this.CurrentSize = this.Min;
		objHTML.style.fontSize = this.CurrentSize.toString() + '%';
		
		this.showMenu();
	}
}

FontSize.prototype.increase = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var objHTML = document.getElementsByTagName("html")[0];
	
	if(objHTML)
	{
		this.CurrentSize = this.CurrentSize + this.Step;
		if(this.CurrentSize > this.Max)
			this.CurrentSize = this.Max;
		objHTML.style.fontSize = this.CurrentSize.toString() + '%';
		
		this.showMenu();
	}
}

FontSize.prototype.reset = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var objHTML = document.getElementsByTagName("html")[0];
	
	if(objHTML)
	{
		this.CurrentSize = 100;
		objHTML.style.fontSize = this.CurrentSize.toString() + '%';
		
		this.showMenu();
	}
}

FontSize.prototype.showMenu = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var objItem = document.getElementById(this.EnclosingId);
	var strHTML = '';
	
	if(objItem)
	{
		strHTML = '<span style="font-size: 11px;">' + this.Label + '</span>';
		
		if(this.CurrentSize > this.Min)
			strHTML += '<a href="javascript:' + this.ObjectName + '.decrease();">' + this.Decrease + '</a>';
		else
			strHTML += '<span class="' + this.EnclosingId + '_disabled">' + this.Decrease + '</span>';;
			
		strHTML += this.Text;
		
		if(this.CurrentSize < this.Max)
			strHTML += '<a href="javascript:' + this.ObjectName + '.increase();">' + this.Increase + '</a>';
		else
			strHTML += '<span class="' + this.EnclosingId + '_disabled">' + this.Increase + '</span>';
		
		objItem.innerHTML = strHTML;
	}
}

////////////////////////// Klasse ContactForm //////////////////////////////////

function ContactForm(strObjectName, strName, strLanguage, strEmailLocal,
                     strEmailDomain, strMsgSubject, strReturnURL)
//******************************************************************************
//* Klasse ContactForm                                                         *
//******************************************************************************
{
    this.ObjectName       = strObjectName;
    this.Name             = strName;
    this.Recipient        = Email.concatenate(strEmailLocal, strEmailDomain);
    this.MsgSubject       = strMsgSubject;
    this.ReturnURL        = strReturnURL;
	this.IsSMTP           = false;
	this.MailServer       = 'kwcm.de';
    this.Action           = 'fileadmin/ext/mud_mailer.php';
    
    this.Items            = new Array();
	
    this.LabelAlign       = 'left';
    this.LabelValign      = 'top';
    this.TextAlign        = 'left';
    this.TextValign       = 'top';
    this.ButtonAlign      = 'left';
    this.ButtonValign     = 'top';
    
    this.TableWidth       = '100%';
    this.FontSizeHeader   = '100%';
    this.FontSizeFootnote = '100%';
    this.FontSizeText     = '100%';

	this.MarginTop        = '100%';
	this.MarginBottom     = '100%';

	this.BorderWidth      = '1px';
	this.BorderStyle      = 'solid';
		
    this.ColorBorder      = '#202020';   // wenn ColorBorder2 gesetzt: bottom und right
    this.ColorBorder2     = '';          // wenn gesetzt: top und left

    this.ColorBackground  = '#c0c0c0';
    this.ColorFootnote    = '#000000';
    this.ColorHeader      = '#404040';
    this.ColorHeaderText  = '#ffffff';
    this.ColorText        = '#000000';

	// Werte werden nur berücksichtigt, wenn IsCSS == false!
	this.IsCSS = true;

	this.ColorItemTextNO = '#606060';
    this.ColorItemBackNO = '#c0c0c0';
	this.ColorItemTextRO = '#202020';
    this.ColorItemBackRO = '#a0a0a0';
    
    if(strLanguage.toLowerCase() == LANG_GERMAN)
    {
		this.Language           = LANG_GERMAN;
        this.SendMessageButton  = 'Nachricht senden';
        this.TextContactUs      = 'Kontaktieren Sie uns';
        this.TextFieldsRequired = 'Die mit einem ' + RED_ASTERISK + ' gekennzeichneten Felder sind Pflichtangaben.';
        this.TextEmptyValue     = 'Bitte füllen Sie alle Pflichtfelder aus!';
        this.TextInvalidEmail   = 'Bitte geben Sie eine gültige E-Mail-Adresse ein!';
        this.TextInvalidNumber  = 'Bitte geben Sie eine gültige Zahl ein!';
		this.TextMessageSent    = 'Vielen Dank für Ihre Anfrage/Rückmeldung.';
    }
    else if(strLanguage.toLowerCase() == LANG_SPANISH)
    {
		this.Language           = LANG_SPANISH;
        this.SendMessageButton  = 'Enviar la noticia';
        this.TextContactUs      = 'Contacte con nosotros';
        this.TextFieldsRequired = 'Los campos marcados con asteriscos ' + RED_ASTERISK + ' son obligatorios.';
        this.TextEmptyValue     = 'Usted tiene que completar todos los campos requeridos!';
        this.TextInvalidEmail   = 'Debe introducir un e-mail válido!';
        this.TextInvalidNumber  = 'Debe introducir un número válido!';
		this.TextMessageSent    = 'Sus datos han sido enviados correctamente.';
    }
    else  // englisch
    {
		this.Language           = LANG_ENGLISH;
        this.SendMessageButton  = 'Send message';
        this.TextContactUs      = 'Contact us';
        this.TextFieldsRequired = 'Fields marked with an asterisk ' + RED_ASTERISK + ' are required.';
        this.TextEmptyValue     = 'You have to fill out all required fields!';
        this.TextInvalidEmail   = 'You have to specify a valid e-mail!';
        this.TextInvalidNumber  = 'You have to specify a valid number!';
		this.TextMessageSent    = 'Your message has been sent successfully.';
    }

    // Initialisieren des Submit-Buttons (nach der Initialisierung von this.SendMessageButton!)
    this.SubmitButton = new SubmitButton(this.getInputName('submit'), this.getInputName('submit'), this.ObjectName + '.SubmitButton');
	this.SubmitButton.Class = 'submit';
	this.SubmitButton.Value = this.SendMessageButton;
}

ContactForm.prototype.addItem = function(objItem)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var nIndex = this.Items.length;
	
	objItem.Id = this.ObjectName + 'Items' + nIndex.toString();
	objItem.ObjectName = this.ObjectName + '.Items[' + nIndex.toString() + ']';
	
	objItem.ColorTextNO = this.ColorItemTextNO;
	objItem.ColorBackNO = this.ColorItemBackNO;
	objItem.ColorTextRO = this.ColorItemTextRO;
	objItem.ColorBackRO = this.ColorItemBackRO;
	
    this.Items.push(objItem);
}

ContactForm.prototype.addMessage = function(strLabel, nCols, nRows)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var objItem = new TextAreaItem(this.getInputName('message'), strLabel, nCols, nRows, true);
    
    this.addItem(objItem);
}

ContactForm.prototype.addMsgSubject = function(strLabel, nSize, nMaxLength,
                                               isRequired)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var objItem = new TextItem(this.getInputName('msgsubject'), strLabel, nSize, nMaxLength,
                               isRequired, false, false);
    
    this.addItem(objItem);
}

ContactForm.prototype.addSendCopy = function(strLabel, isEnabled)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var objItem = new CheckboxItem(this.getInputName('sendcopy'), 'true',
               				       strLabel, isEnabled);
    
    this.addItem(objItem);
}

ContactForm.prototype.addSenderMail = function(strLabel, nSize, nMaxLength,
                                               isRequired)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var objItem = new TextItem(this.getInputName('sendermail'), strLabel, nSize, nMaxLength,
                               isRequired, true, false);
    
    this.addItem(objItem);
}

ContactForm.prototype.addSenderName = function(strLabel, nSize, nMaxLength,
                                               isRequired)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var objItem = new TextItem(this.getInputName('sendername'), strLabel, nSize, nMaxLength,
                               isRequired, false, false);
    
    this.addItem(objItem);
}

ContactForm.prototype.existMsgSubject = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    for(nItem = 0; nItem < this.Items.length; nItem++)
    {
        if(this.Items[nItem].Name == this.getInputName('msgsubject'))
            return(true);
    }
    return(false);
}

ContactForm.prototype.getInputName = function(strName)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	if(strName.length > 0)
	    return(this.ObjectName.toLowerCase() + '_' + strName);
	else
	    return(this.ObjectName.toLowerCase());
}

ContactForm.prototype.send = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var objItem = null;
	
    objItem = document.getElementsByName(this.Name)[0];
               
    objItem.method = 'post';
    objItem.action = this.Action;
    //objItem.submit();  // überflüssig
	
	alert(this.TextMessageSent);
}

ContactForm.prototype.show = function(strButtonNO, strButtonRO, strButtonDown)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var isFieldRequired = false;
    
    document.write('<form name="' + this.Name + '"'
                 + ' onSubmit="return(' + this.ObjectName + '.validate());"'
                 + ' enctype="application/x-www-form-urlencoded">');
    document.write('<table class="contactform"'
                 + ' width="' + this.TableWidth + '" cellpadding="4" cellspacing="0"'
                 + ' style="background-color: ' + this.ColorBackground + ';'
                 + ' color: ' + this.ColorText + ';'
                 + ' border-left: ' + this.BorderWidth + ' ' + this.BorderStyle + ' ' + (this.ColorBorder2.length > 0 ? this.ColorBorder2 : this.ColorBorder) + ';'
                 + ' border-top: ' + this.BorderWidth + ' ' + this.BorderStyle + ' ' + (this.ColorBorder2.length > 0 ? this.ColorBorder2 : this.ColorBorder) + ';'
                 + ' border-right: ' + this.BorderWidth + ' ' + this.BorderStyle + ' ' + this.ColorBorder + ';'
                 + ' border-bottom: ' + this.BorderWidth + ' ' + this.BorderStyle + ' ' + this.ColorBorder + ';'
                 + ' border-collapse: collapse;'
                 + ' font-size: ' + this.FontSizeText + ';">');
    document.write('<tr>');
    document.write('<th colspan="2"'
                 + ' align="left"'
                 + ' style="background-color: ' + this.ColorHeader + ';'
                 + ' color: ' + this.ColorHeaderText + ';'
                 + ' border-collapse: collapse;'
                 + ' font-size: ' + this.FontSizeHeader + ';">');
    document.write(this.TextContactUs);
    document.write('</th></tr>');

    document.write('<tr><td colspan="2" height="' + this.MarginTop + '"></td></tr>');
	
    document.write('<input type="hidden" name="objectname" value="' + this.getInputName('') + '">');
    document.write('<input type="hidden" name="' + this.getInputName('mailserver') + '" value="' + this.MailServer + '">');
    document.write('<input type="hidden" name="' + this.getInputName('smtp') + '" value="' + this.IsSMTP + '">');
    document.write('<input type="hidden" name="' + this.getInputName('language') + '" value="' + this.Language + '">');
    document.write('<input type="hidden" name="' + this.getInputName('recipient') + '" value="' + this.Recipient + '">');
    document.write('<input type="hidden" name="' + this.getInputName('returnurl') + '" value="' + this.ReturnURL +'">');
		
    if(!this.existMsgSubject())
        document.write('<input type="hidden" name="' + this.getInputName('msgsubject') + '" value="' + this.MsgSubject +'">');

    for(nItem = 0; nItem < this.Items.length; nItem++)
    {
        if(this.Items[nItem].Required)
            isFieldRequired = true;
            
        document.write('<tr>');
        this.Items[nItem].show(this);
        document.write('</tr>');    
    }
	
    document.write('<tr class="contactform_last"><td colspan="2" height="' + this.MarginBottom + '"></td></tr>');
	
    document.write('</table>');	
    
    document.write('<table class="contactform_footer" width="' + this.TableWidth + '">');
    if(isFieldRequired)
        document.write('<tr>'
                     + '<td'
                     + ' valign="top"'
                     + ' style="font-size: ' + this.FontSizeFootnote + ';'
                     + ' color: ' + this.ColorFootnote + ';">'
                     + this.TextFieldsRequired
                     + '</td></tr>');

    document.write('<tr>');
    document.write('<td'
                 + ' align="' + this.ButtonAlign + '"'
                 + ' valign="' + this.ButtonValign + '">');

	if(strButtonNO)
		this.SubmitButton.ButtonNO = strButtonNO;
	if(strButtonRO)
		this.SubmitButton.ButtonRO = strButtonRO;
	if(strButtonDown)
		this.SubmitButton.ButtonDown = strButtonDown;
		
	this.SubmitButton.show();
	
    document.write('</td>');
    document.write('</tr>');

    document.write('</table>');
    document.write('</form>');
}

ContactForm.prototype.showLabel = function(strLabel, isRequired)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    document.write('<td align="' + this.LabelAlign + '"'
                 + ' valign="' + this.LabelValign + '">');
                    
    if(isRequired)
    {
        if(this.LabelAlign.toLowerCase() == "right")
            document.write(RED_ASTERISK + '&nbsp;' + strLabel + ':');
        else
            document.write(strLabel + ':&nbsp;' + RED_ASTERISK);
    }
    else
        document.write(strLabel + ':');
            
    document.write('</td>');
}

ContactForm.prototype.validate = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var isValid = true;
    var objItem = null;

    for(nItem = 0; nItem < this.Items.length; nItem++)
    {
        strName = this.Items[nItem].Name;
        objItem = document.getElementsByName(strName)[0];
        
        if(this.Items[nItem].Required)
        {
             if(isValid)
             {
                 if(objItem.value == "")
                 {
                     objItem.focus();
                     objItem.select();
            
                     alert(this.TextEmptyValue);
                     isValid = false;
                 }
            }
        }

        if(this.Items[nItem].Email)
        {            
            if(isValid)
            {
                if(!Email.validate(objItem.value))
                {
                    objItem.focus();
                    objItem.select();
            
                    alert(this.TextInvalidEmail);
                    isValid = false;
                }
            }
        }
        
        if(this.Items[nItem].Number)
        {
            if(isValid)
            {
                if(objItem.value != "")
                {
                    for(nChr = 0; nChr < objItem.value.length; nChr++)
                    {
                        if(objItem.value.charAt(nChr) < '0' || objItem.value.charAt(nChr) > '9')
                        {
                            objItem.focus();
                            objItem.select();
            
                            alert(this.TextInvalidNumber);
                            isValid = false;
                            nChr = objItem.value.length;
                        }
                    }
                }
            }
        }
    }
    
    if(isValid)
    	this.send();
    
    return(isValid);
} 

///////////////////////// Klasse CheckboxItem //////////////////////////////////

function CheckboxItem(strName, strValue, strLabel, isEnabled)
//******************************************************************************
//* Klasse CheckboxItem                                                        *
//******************************************************************************
{
    this.Name       = strName;
	this.Id         = '';
	this.ObjectName = '';
	this.Value      = strValue;
    this.Label      = strLabel;
    this.Enabled    = isEnabled;
    this.Required   = false;      // immer false, da eine Checkbox nur zwei Werte annehmen kann
    this.Email      = false;      // immer false, wird in ContactForm.validate() aufgerufen
    this.Number     = false;      // immer false, wird in ContactForm.validate() aufgerufen

	this.IsCSS = true;

	this.ColorTextNO = '';
    this.ColorBackNO = '';
	this.ColorTextRO = '';
    this.ColorBackRO = '';
}

CheckboxItem.prototype.show = function(objForm)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{    
    document.write('<td colspan="2" align="left" valign="middle">');
	
    document.write('<input type="checkbox"'
                 + ' id="' + this.Id + '"'
                 + ' name="' + this.Name + '"'
                 + ' class="contactform_checkbox"'
                 + ' value="' + this.Value + '"'
				 + ' ' + (this.Enabled ? 'checked="checked"' : '') + '>');

	if(this.Label.length > 0)
        document.write(this.Label);

    document.write('</td>');
}

///////////////////////// Klasse SubmitButton //////////////////////////////////

function SubmitButton(strName, strId, strObjName)
//******************************************************************************
//* Klasse TextItem                                                            *
//******************************************************************************
{
    this.Name       = strName;
	this.Id         = strId;
	this.ObjectName = strObjName;

	this.Class = '';
	this.Value = '';
	this.Title = '';
	
	this.ButtonNO   = '';
	this.ButtonRO   = '';
	this.ButtonDown = '';
	
	this.MouseOutEvent  = this.ObjectName + '.set(false);';
	this.MouseOverEvent = this.ObjectName + '.set(true);';
	this.MouseDownEvent = this.ObjectName + '.set(true);';
}

SubmitButton.prototype.set = function(isPointer, strImage)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	objItem = document.getElementById(this.Id);

    if(isPointer)
	    objItem.style.cursor = 'pointer';
    else
   	    objItem.style.cursor = 'auto';
		
    if(strImage)
	    objItem.src = strImage;
}

SubmitButton.prototype.show = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	if(this.ButtonNO.length > 0)
	    this.MouseOutEvent = this.ObjectName + ".set(false, '" + this.ButtonNO + "');"
		
	if(this.ButtonRO.length > 0)
	    this.MouseOverEvent = this.ObjectName + ".set(true, '" + this.ButtonRO + "');"

	if(this.ButtonDown.length > 0)
	    this.MouseDownEvent = this.ObjectName + ".set(true, '" + this.ButtonDown + "');"

	if(this.ButtonNO.length > 0)
	{
		// Grafischer Submit-Button
	    document.write('<input type="image"'
                     + ' id="' + this.Id + '"'
                     + ' name="' + this.Name + '"'
                     + ' class="' + this.Class + '"'
                     + ' title="' + this.Title + '"'
                     + ' src="' + this.ButtonNO + '"'
                     + ' onMouseOut="' + this.MouseOutEvent + '"'
                     + ' onMouseOver="' + this.MouseOverEvent + '"'
                     + ' onMouseDown="' + this.MouseDownEvent + '">');
	}
	else
	{
		// herkömmlicher Submit-Button mit value-Eigenschaft
	    document.write('<input type="submit"'
				     + ' id="' + this.Id + '"'
                     + ' name="' + this.Name + '"'
                     + ' class="' + this.Class + '"'
                     + ' title="' + this.Title + '"'
                     + ' value="' + this.Value + '"'
				     + ' onMouseOut="' + this.MouseOutEvent + '"'
				     + ' onMouseOver="' + this.MouseOverEvent + '"'
				     + ' onMouseDown="' + this.MouseDownEvent + '">');
	}
}

///////////////////////// Klasse TextboxItem ///////////////////////////////////

function TextItem(strName, strLabel, nSize, nMaxLength,
                  isRequired, isEmail, isNumber)
//******************************************************************************
//* Klasse TextItem                                                            *
//******************************************************************************
{
    this.Name       = strName;
	this.Id         = '';
	this.ObjectName = '';
    this.Label      = strLabel;
    this.Size       = nSize;
    this.MaxLength  = nMaxLength;
    this.Required   = isRequired;  
    this.Email      = isEmail;
    this.Number     = isNumber;
	
	this.IsCSS = true;

	this.ColorTextNO = '';
    this.ColorBackNO = '';
	this.ColorTextRO = '';
    this.ColorBackRO = '';
}

TextItem.prototype.setColor = function(hasFocus)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var	objItem = document.getElementById(this.Id);

	if(hasFocus)
	{
	    objItem.style.color = this.ColorTextRO;
	    objItem.style.backgroundColor = this.ColorBackRO;
	}
	else
	{
	    objItem.style.color = this.ColorTextNO;
	    objItem.style.backgroundColor = this.ColorBackNO;
	}
}

TextItem.prototype.show = function(objForm)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{    
	var strOnFocusEvent  = '';
	var	strOnBlurEvent = '';

	if(this.ObjectName.length > 0)
	{
		strOnFocusEvent = this.ObjectName + '.setColor(true);';
		strOnBlurEvent = this.ObjectName + '.setColor(false);';
	}

    if(this.Label.length > 0)
        objForm.showLabel(this.Label, this.Required);
		
    document.write('<td align="' + objForm.TextAlign + '"'
                 + ' valign="' + objForm.TextValign + '">');
    document.write('<input type="text"'
				 + ' id="' + this.Id + '"'
                 + ' name="' + this.Name + '"'
                 + ' class="contactform"'
                 + ' size="' + this.Size + '"'
                 + ' maxlength="' + this.MaxLength + '"'
                 + ' onFocus="' + strOnFocusEvent + '"'
                 + ' onBlur="' + strOnBlurEvent + '"'
				 + ' style="color:' + this.ColorTextNO + ';'
				 +         'background-color:' + this.ColorBackNO + ';">');
    document.write('</td>');
}

////////////////////////// Klasse TextAreaItem /////////////////////////////////

function TextAreaItem(strName, strLabel, nCols, nRows, isRequired)
//******************************************************************************
//* Klasse TextAreaItem                                                        *
//******************************************************************************
{
    this.Name       = strName;
	this.Id         = '';
	this.ObjectName = '';
    this.Label      = strLabel;
    this.Cols       = nCols;
    this.Rows       = nRows;
    this.Required   = isRequired;
    this.Email      = false;       // immer false, wird in ContactForm.validate() aufgerufen
    this.Number     = false;       // immer false, wird in ContactForm.validate() aufgerufen
	
	this.IsCSS = true;

	this.ColorTextNO = '';
    this.ColorBackNO = '';
	this.ColorTextRO = '';
    this.ColorBackRO = '';
}

TextAreaItem.prototype.setColor = function(hasFocus)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var	objItem = document.getElementById(this.Id);

	if(hasFocus)
	{
	    objItem.style.color = this.ColorTextRO;
	    objItem.style.backgroundColor = this.ColorBackRO;
	}
	else
	{
	    objItem.style.color = this.ColorTextNO;
	    objItem.style.backgroundColor = this.ColorBackNO;
	}
}

TextAreaItem.prototype.show = function(objForm)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var strOnFocusEvent  = '';
	var	strOnBlurEvent = '';

	if(this.ObjectName.length > 0)
	{
		strOnFocusEvent = this.ObjectName + '.setColor(true);';
		strOnBlurEvent = this.ObjectName + '.setColor(false);';
	}

	if(this.Label.length > 0)
        objForm.showLabel(this.Label, this.Required);
            
    document.write('<td align="' + objForm.TextAlign + '"'
                 + ' valign="' + objForm.TextValign + '">');
    document.write('<textarea'
				 + ' id="' + this.Id + '"'
				 + ' name="' + this.Name + '"'
                 + ' class="contactform"'
                 + ' cols="' + this.Cols + '"'
                 + ' rows="' + this.Rows + '"'
                 + ' wrap="wrap"'
                 + ' onFocus="' + strOnFocusEvent + '"'
                 + ' onBlur="' + strOnBlurEvent + '"'
				 + ' style="color:' + this.ColorTextNO + ';'
				 +         'background-color:' + this.ColorBackNO + ';"');
    document.write('>');
    document.write('</textarea>');    
    document.write('</td>');
}

/////////////////////////////// Klasse Email ///////////////////////////////////

function Email(strLocalPart, strDomainPart)
//******************************************************************************
//* Klasse Email                                                               *
//******************************************************************************
{
    this.LocalPart  = strLocalPart;
    this.DomainPart = strDomainPart;
	this.Title      = '';
}

Email.concatenate = function(strLocalPart, strDomainPart)
//******************************************************************************
//* Lokalen E-Mail-Part und Domain-Part verknüpfen.                            *
//******************************************************************************
{
    return(strLocalPart + unescape(ASCII_AT) + strDomainPart);
}

Email.prototype.getAddress = function()
//******************************************************************************
//* E-Mail-Adresse zurückgeben                                                 *
//******************************************************************************
{
    return(Email.concatenate(this.LocalPart, this.DomainPart));
}

Email.prototype.show = function()
//******************************************************************************
//* E-Mail-Adresse anzeigen                                                    *
//******************************************************************************
{
    document.write(this.getAddress());
}

Email.prototype.showLink = function(strEmail)
//******************************************************************************
//* E-Mail-Adresse als Link anzeigen                                           *
//******************************************************************************
{
   document.write('<a href="mailto:' + this.getAddress() + '"'
                + 'title="' + this.Title + '">');
   if(!strEmail)
       document.write(this.getAddress());
   else
       document.write(strEmail);
   document.write('</a>');
}

Email.validate = function(strEmail)
//******************************************************************************
//* E-Mail-Adresse auf Gültigkeit überprüfen                                   *
//******************************************************************************
{
    var pattern = /.*\@.*\..*/;

    return(pattern.test(strEmail));
}

///////////////////////////// Klasse GoogleMap /////////////////////////////////

function GoogleMap(strObjName, strId, nLatitude, nLongitude, nZoom, strLabel,
                   isRouting)
//******************************************************************************
//* Klasse GoogleMap                                                           *
//******************************************************************************
{
    this.ObjectName  = strObjName;
    this.Id          = strId;
    this.Zoom        = nZoom;
	this.Container   = null;
    this.Markers     = new Array();
	
	this.MapType              = GMAP_NORMAL;
	this.MapControl           = GCONTROL_LARGE;	
	this.IsScaleControl       = false;
	this.IsOverviewMapControl = false;	
	this.MapControlPosition   = G_ANCHOR_TOP_LEFT;
	this.TypeControlPosition  = G_ANCHOR_TOP_RIGHT;
	this.MarginControl        = 10;
	
	this.addMarker(nLatitude, nLongitude, strLabel, isRouting);	
}

GoogleMap.prototype.addMarker = function(nLatitude, nLongitude, strLabel,
										 isRouting)
//******************************************************************************
//* Einen neuen Marker hinzufügen                                              *
//******************************************************************************
{
	var objMarker = new GoogleMapMarker(this.ObjectName + '.Markers[' + this.Markers.length.toString() + ']',
                                        nLatitude, nLongitude, strLabel, isRouting);
	this.Markers.push(objMarker);
}

GoogleMap.prototype.load = function()
//******************************************************************************
//* GoogleMaps laden                                                           *
//******************************************************************************
{
    if(GBrowserIsCompatible())
    {		
        this.Container = new GMap2(document.getElementById(this.Id));

        // 'Gelände' zur Auswahl hinzufügen
		// betrifft GMapTypeControl und GHierarchicalMapTypeControl
        this.Container.addMapType(G_PHYSICAL_MAP);

		// Die Methode setCenter muss als erstes nach
		// Aufruf von GMap2() aufgerufen werden !
        this.Container.setCenter(new GLatLng(this.Markers[0].Latitude, this.Markers[0].Longitude), this.Zoom);
        this.Container.setZoom(this.Zoom);		

		for(nItem = 0; nItem < this.Markers.length; nItem++)
            this.showMarker(nItem);

		this.setControls(this.MapControl);

        // Die Methode setMapType() erzeugt einen Fehler,
		// wenn sie direkt nach GMap2() aufgerufen wird !
		this.setMapType(this.MapType);
    }
}

GoogleMap.prototype.setControls = function(nControlType)
//******************************************************************************
//* Steuerelemente setzen                                                      *
//******************************************************************************
{
	var posMapControl = new GControlPosition(this.MapControlPosition, new GSize(this.MarginControl, this.MarginControl));
	var posTypeControl = new GControlPosition(this.TypeControlPosition, new GSize(this.MarginControl, this.MarginControl));
	
	switch(nControlType)
	{
	    case GCONTROL_LARGE:
       	    this.Container.addControl(new GLargeMapControl(), posMapControl);
			break;
				
	    case GCONTROL_LARGE_TYPE:
       	    this.Container.addControl(new GLargeMapControl(), posMapControl);
       	    this.Container.addControl(new GMapTypeControl(), posTypeControl);
			break;
				
	    case GCONTROL_LARGE_HIERARCHICALTYPE:
       	    this.Container.addControl(new GLargeMapControl(), posMapControl);
       	    this.Container.addControl(new GHierarchicalMapTypeControl(), posTypeControl);
			break;
				
	    case GCONTROL_SMALL:
       	    this.Container.addControl(new GSmallMapControl(), posMapControl);
			break;
				
	    case GCONTROL_SMALL_TYPE:
       	    this.Container.addControl(new GSmallMapControl(), posMapControl);
       	    this.Container.addControl(new GMapTypeControl(), posTypeControl);
			break;
				
	    case GCONTROL_SMALL_HIERARCHICALTYPE:
       	    this.Container.addControl(new GSmallMapControl(), posMapControl);
       	    this.Container.addControl(new GHierarchicalMapTypeControl(), posTypeControl);
			break;
				
	    case GCONTROL_SMALLZOOM:
       	    this.Container.addControl(new GSmallZoomControl(), posMapControl);
			break;
				
	    case GCONTROL_SMALLZOOM_TYPE:
       	    this.Container.addControl(new GSmallZoomControl(), posMapControl);
       	    this.Container.addControl(new GMapTypeControl(), posTypeControl);
			break;
				
	    case GCONTROL_SMALLZOOM_HIERARCHICALTYPE:
       	    this.Container.addControl(new GSmallZoomControl(), posMapControl);
       	    this.Container.addControl(new GHierarchicalMapTypeControl(), posTypeControl);
			break;		
	}
	
	if(this.IsScaleControl)
        this.Container.addControl(new GScaleControl());
		
	if(this.IsOverviewMapControl)
        this.Container.addControl(new GOverviewMapControl());
}

GoogleMap.prototype.setMapType = function(nMapType)
//******************************************************************************
//* Kartentyp setzen                                                           *
//******************************************************************************
{
	switch(nMapType)
	{
		case GMAP_NORMAL:
            this.Container.setMapType(G_NORMAL_MAP);
	        break;
			
		case GMAP_HYBRID:
            this.Container.setMapType(G_HYBRID_MAP);
 	        break;
				
		case GMAP_SATELLITE:
            this.Container.setMapType(G_SATELLITE_MAP);
  	        break;
				
		case GMAP_PHYSICAL:
            this.Container.setMapType(G_PHYSICAL_MAP);
		    break;			
	}			
}

GoogleMap.prototype.showMarker = function(nMarker)
//******************************************************************************
//* Einen Marker in den GoogleMaps anzeigen                                    *
//******************************************************************************
{
	var objOptions = null;
	
	if(this.Markers[nMarker].Icon != null)
	{
		objOptions = new Object();
	    objOptions.icon = this.Markers[nMarker].Icon;
	}
	
    var objMarker = new GMarker(new GLatLng(this.Markers[nMarker].Latitude, this.Markers[nMarker].Longitude), objOptions);
	var strHTML = this.Markers[nMarker].getInfoWindowHTML();
	
    GEvent.addListener(objMarker, this.Markers[nMarker].EventOpenInfoWindow, function() {objMarker.openInfoWindowHtml(strHTML); });
    this.Container.addOverlay(objMarker);
	
    this.Markers[nMarker].Marker = objMarker;
}

////////////////////////// Klasse GoogleMapMarker //////////////////////////////

function GoogleMapMarker(strObjectName, nLatitude, nLongitude, strLabel,
						 isRouting)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	this.ObjectName = strObjectName;
    this.Latitude   = nLatitude;
    this.Longitude  = nLongitude;
    this.Label      = strLabel;
    this.IsRouting  = isRouting;
	this.Marker     = null;
	
	this.Icon                = new GIcon(G_DEFAULT_ICON);
	this.EventOpenInfoWindow = 'mouseover';
	this.HorizontalRow       = 'width:200px; height:1px; color:#808080; background-color:#808080; margin-top:2px; margin-bottom:2px;';
}

GoogleMapMarker.prototype.fromLocation = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    this.Marker.openInfoWindowHtml('<div class="googlemaps_infowindow">' + this.Label
								 + '<hr align="left" style="' + this.HorizontalRow + '" />'
                                 + 'Route f&uuml;r die <a href="javascript:' + this.ObjectName + '.toLocation()">Anreise</a> berechnen<br />'
                                 + 'Route f&uuml;r die Abreise berechnen<br /><br />'
                                 + '<form action="http://maps.google.de/maps" method="get"" target="_blank">'
                                 + 'Zieladresse eingeben:<br />'
								 + '<input type="text" size="30" maxlength="60" name="daddr" id="daddr" value="" /><br />'
                                 + '<input value="Route berechnen" type="submit" class="googlemaps_submit" />'
                                 + '<input type="hidden" name="saddr" value="' + this.Latitude + ',' + this.Longitude + '" />'
								 + '</form></div>');
}

GoogleMapMarker.prototype.getInfoWindowHTML = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strHTML = '<div class="googlemaps_infowindow">' + this.Label;
	
    if(this.IsRouting)
        strHTML += '<hr align="left" style="' + this.HorizontalRow + '" />'
                 + 'Route f&uuml;r die <a href="javascript:' + this.ObjectName + '.toLocation()">Anreise</a> berechnen<br />'
                 + 'Route f&uuml;r die <a href="javascript:' + this.ObjectName + '.fromLocation()">Abreise</a> berechnen';
		
	strHTML += '</div>';
	
	return(strHTML);
}

GoogleMapMarker.prototype.toLocation = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    this.Marker.openInfoWindowHtml('<div class="googlemaps_infowindow">' + this.Label
							     + '<hr align="left" style="' + this.HorizontalRow + '" />'
                                 + 'Route f&uuml;r die Anreise berechnen<br />'
                                 + 'Route f&uuml;r die <a href="javascript:' + this.ObjectName + '.fromLocation()">Abreise</a> berechnen<br /><br />'
                                 + '<form action="http://maps.google.de/maps" method="get" target="_blank">'
                                 + 'Startadresse eingeben:<br />'
								 + '<input type="text" size="30" maxlength="60" name="saddr" id="saddr" value="" /><br />'
                                 + '<input value="Route berechnen" type="submit" class="googlemaps_submit" />'
                                 + '<input type="hidden" name="daddr" value="' + this.Latitude + ',' + this.Longitude + '" />'
								 + '</form></div>');
}

/////////////////////////// Klasse DynamicImage ////////////////////////////////

function DynamicImage(strObjName, strId, nHeight, nWidth, nInterval,
                      isFadingEffect, nRotationOrder)
//******************************************************************************
//* Klasse DynamicImage                                                        *
//******************************************************************************
{
    this.ObjectName    = strObjName;
    this.Id            = strId;
    this.Height        = nHeight;
    this.Width         = nWidth;
    this.Interval      = nInterval;
    this.RotationOrder = nRotationOrder;

    this.AltText       = '';
    this.Border        = 'none';
    this.Current       = -1;
    this.Images        = new Array();
	this.Comments      = new Array();
    
    this.FadeOutInterval = null;
    this.FadeInTimeout   = null;
    this.OnRotation      = this.ObjectName + '.select()'
	
	this.InitializeImage = '';
    
    if(isFadingEffect)
        this.FadingEffect = new FadingEffect(this.ObjectName + '.FadingEffect', this.Id, 3, 60);
    else
        this.FadingEffect = null;
}

DynamicImage.prototype.add = function(strSrc, strComment)
//******************************************************************************
//* Ein Bild in den Speicher laden                                             *
//******************************************************************************
{
    if(document.images)
    {   
        var nImage = this.Images.length;
        
        this.Images[nImage]     = new Image();
        this.Images[nImage].src = strSrc;
		
		this.Comments[nImage] = '';
	    if(strComment)
		    this.Comments[nImage] = strComment;
	}
}

DynamicImage.prototype.fadeIn = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    eval(this.OnRotation);

    if(this.FadingEffect)
    {
        this.FadingEffect.Opacity.set(Opacity.Min);
        this.FadingEffect.fadeIn();
    }
}

DynamicImage.prototype.fadeOut = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.FadingEffect)
    {
        this.FadingEffect.Opacity.set(Opacity.Max);
        this.FadingEffect.fadeOut();
        
        var nDelay = 300; // Verzögerung in Millisekunden
        this.FadeInTimeout = window.setTimeout(this.ObjectName + '.fadeIn()', this.FadingEffect.getFadingPeriod() + nDelay);
    }
    else
        this.fadeIn();
}

DynamicImage.prototype.getRandom = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var nImage = this.Current;
        
    while(nImage == this.Current
       || nImage < 0 || nImage >= this.Images.length)
        nImage = Math.round((Math.random() * (this.Images.length-1)));
        
    return(nImage);
}

DynamicImage.prototype.next = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var nImage = (this.Current < 0 || this.Current >= (this.Images.length-1))
               ? 0 : (this.Current + 1);
               
    this.set(nImage);
}

DynamicImage.prototype.previous = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var nImage = (this.Current > 0 && this.Current <= (this.Images.length-1))
               ? (this.Current - 1) : (this.Images.length-1);
    
    this.set(nImage);
}

DynamicImage.prototype.select = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.RotationOrder == ROTATION_RANDOM)
        this.set(this.getRandom());
    else if(this.RotationOrder == ROTATION_BACKWARDS)
        this.previous();
    else
        this.next();    
}

DynamicImage.prototype.set = function(nImage)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    this.Current = nImage;
    
    objImage = document.getElementById(this.Id);
    if(objImage)
        objImage.src = this.Images[this.Current].src;
		
    objDiv = document.getElementById(this.Id + '_comment');
	if(objDiv)
	{
	    var nodeComment = objDiv.firstChild;
		if(nodeComment)
		    objDiv.removeChild(nodeComment);
		nodeComment = document.createTextNode(this.Comments[this.Current]);
	    objDiv.appendChild(nodeComment);
	}
}

DynamicImage.prototype.shiftBackward = function(nShift)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strSrc = new Array(this.Images.length);
    
    for(nImage = 0; nImage < this.Images.length; nImage++)
        strSrc[nImage] = this.Images[nImage].src;
    
    for(nImage = 0; nImage < this.Images.length; nImage++)
    {
        if(nImage < nShift)
            this.Images[nImage].src = strSrc[this.Images.length + nImage - nShift];
        else
            this.Images[nImage].src = strSrc[nImage-nShift];
    }
}

DynamicImage.prototype.shiftForward = function(nShift)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strSrc = new Array(this.Images.length);
    
    for(nImage = 0; nImage < this.Images.length; nImage++)
        strSrc[nImage] = this.Images[nImage].src;
    
    for(nImage = 0; nImage < this.Images.length; nImage++)
    {
        if((nImage+nShift) > (this.Images.length-1))
            this.Images[nImage].src = strSrc[(nImage+nShift) - this.Images.length];
        else
            this.Images[nImage].src = strSrc[nImage+nShift];
    }
}

DynamicImage.prototype.show = function(isRotation, nDelay, isHidden)
//******************************************************************************
//* Aktuelles Bild anzeigen                                                    *
//******************************************************************************
{
    if(document.images && this.Images.length > 0)
    {                   
        var nOpacity  = (this.FadingEffect) ? Opacity.Min : Opacity.Max;
        var strHeight = (this.Height == 0) ? '' : ' height="' + this.Height.toString() + '"';
        var strWidth  = (this.Width == 0) ? '' : ' width="' + this.Width.toString() + '"';
        var strStyle  = 'style="border:' + this.Border + ';'
                      + ((this.FadingEffect) ? Opacity.getStyleAttribute(nOpacity) + '"' : '"');
        
        document.write('<img id="' + this.Id + '"'
                     + ' src="' + this.InitializeImage + '"'
                     + ' border="' + this.Border + '"'
                     + ' alt="' + this.AltText + '"'
                     + strHeight
                     + strWidth
                     + strStyle + '">');
		document.write('<div id="' + this.Id + '_comment' + '"'
					 + ((this.Width == 0) ? ' style="width:100%"' : ' style="width:' + this.Width.toString() + '"')
					 + ' align="center">'
					 + '</div>');

        if(isHidden)
            eval(this.OnRotation);
        else
        {
            if(isRotation)
            {
                if(!nDelay)
                {
                    this.fadeIn();
                    this.FadeOutInterval = window.setInterval(this.ObjectName + '.fadeOut()', this.Interval);
                }
                else
                {
                    this.FadeInTimeout = window.setTimeout(this.ObjectName + '.fadeIn()', nDelay);
                    this.FadeOutInterval = window.setInterval(this.ObjectName + '.fadeOut()', this.Interval);
                }
            }
            else
            {
                if(!nDelay)
                    this.fadeIn();
                else
                    this.FadeInTimeout = window.setTimeout(this.ObjectName + '.fadeIn()', nDelay);
            }
        }
    }
}

DynamicImage.prototype.startRotation = function()
//******************************************************************************
//* Rotation der Bilder starten                                                *
//******************************************************************************
{
    this.fadeOut();
    this.FadeOutInterval = window.setInterval(this.ObjectName + '.fadeOut()', this.Interval);
}

DynamicImage.prototype.stopRotation = function()
//******************************************************************************
//* Rotation der Bilder anhalten                                               *
//******************************************************************************
{
    window.clearInterval(this.FadeOutInterval);
    window.clearTimeout(this.FadeInTimeout);

    if(this.FadingEffect)
    {
        this.FadingEffect.clearTimeout();
        this.FadingEffect.Opacity.set(Opacity.Max);
    }
}

/////////////////////////// Klasse FadingEffect ////////////////////////////////

function FadingEffect(strObjectName, strId, nStep, nDelay)
//******************************************************************************
//* Klasse FadingEffect                                                        *
//******************************************************************************
{
    this.ObjectName   = strObjectName;
    this.Id           = strId;
    this.Step         = nStep;
    this.Delay        = nDelay;
    
	this.OnFadedIn    = ''; // Ereignisbehandlung, wenn Object vollständig eingeblendet ist.
	this.OnFadedOut   = ''; // Ereignisbehandlung, wenn Object vollständig ausgeblendet ist.
	
    this.InTimeout    = null;
    this.OutTimeout   = null;
	
	this.MaxOpacity   = Opacity.Max;
	this.MinOpacity   = Opacity.Min;
    this.Opacity      = new Opacity(this.Id);
}

FadingEffect.prototype.clearTimeout = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    window.clearTimeout(this.InTimeout);
    window.clearTimeout(this.OutTimeout);
}

FadingEffect.prototype.fadeIn = function()
//******************************************************************************
//* Objekt einblenden                                                          *
//******************************************************************************
{
    var nOpacity = this.Opacity.get();
    
    if(nOpacity < this.MaxOpacity)
    {
        nOpacity += this.Step;
        if(nOpacity > this.MaxOpacity)
            nOpacity = this.MaxOpacity;
            
        this.Opacity.set(nOpacity);
    }
    
    if(nOpacity < this.MaxOpacity)
        this.InTimeout = window.setTimeout(this.ObjectName + ".fadeIn()", this.Delay);
	else
		eval(this.OnFadedIn);
}

FadingEffect.prototype.fadeOut = function()
//******************************************************************************
//* Objekt ausblenden.                                                         *
//******************************************************************************
{
    var nOpacity = this.Opacity.get();
    
    if(nOpacity > this.MinOpacity)
    {
        nOpacity -= this.Step;
        if(nOpacity < this.MinOpacity)
            nOpacity = this.MinOpacity;
            
        this.Opacity.set(nOpacity);
    }
        
    if(nOpacity > this.MinOpacity)
        this.OutTimeout = window.setTimeout(this.ObjectName + ".fadeOut()", this.Delay);
	else
		eval(this.OnFadedOut);
}

FadingEffect.prototype.getFadingPeriod = function()
//******************************************************************************
//* Die Ein- und Ausblendperiode eines Objekts berechnen und zurückgeben.      *
//******************************************************************************
{
	return(Math.round(((this.MaxOpacity - this.MinOpacity) / this.Step) * this.Delay));
}

///////////////////////////// Klasse LinkImage /////////////////////////////////

function LinkImage(strId, strSource, strLinkRef, strWidth, strTextPosition)
//******************************************************************************
//* Klasse LinkImage                                                           *
//******************************************************************************
{
    this.Image        = new RolloverImage(strId, strSource, strLinkRef);
    
    this.TableWidth   = strWidth;
    this.Text         = '';    
    this.TextId       = strId + '_text';    
    this.TextPosition = strTextPosition; // 'left'/'right'/'top'/'bottom'
    this.TextColorRO  = '';
    this.AltText      = '';
	this.LinkTarget   = '_self';
	
    this.ImageAlign   = 'center';        // 'left'/'center'/'right'
    this.ImageValign  = 'middle';        // 'left'/'middle'/'right'
    
    this.MouseOutEvent  = '';
    this.MouseOverEvent = '';
    
    if(this.TextPosition == 'left')
    {
        this.TextAlign  = 'right';
        this.TextValign = 'middle';
    }
    else if(this.TextPosition == 'right')
    {
        this.TextAlign  = 'left';
        this.TextValign = 'middle';
    }
    else if(this.TextPosition == 'top')
    {
        this.TextAlign  = 'center';
        this.TextValign = 'bottom';
    }
    else
    {
        this.TextAlign  = 'center';
        this.TextValign = 'top';
    }
}

LinkImage.prototype.getMouseOutEvent = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    strEvent = "LinkImage.onMouseHandle('" + this.Image.ImageName + "','"
                                           + this.Image.Normal +  "','"
                                           + this.Image.BorderNO +  "','"
                                           + this.TextId + "', '');";
                                    
    if(this.MouseOutEvent.length > 0)
        strEvent = strEvent + this.MouseOutEvent + ';';
        
    return(strEvent);
}

LinkImage.prototype.getMouseOverEvent = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    strEvent = "LinkImage.onMouseHandle('" + this.Image.ImageName + "','"
                                           + this.Image.Rollover + "','"
                                           + this.Image.BorderRO +  "','"
                                           + this.TextId + "','"
                                           + this.TextColorRO + "');";
                                    
    if(this.MouseOverEvent.length > 0)
        strEvent = strEvent + this.MouseOverEvent + ';';
        
    return(strEvent);
}

LinkImage.onMouseHandle = function(strImgName, strSrc, strBorder, strTextId,
                                   strTextColor)
//******************************************************************************
//* onMouseHandle wird beim onMouseOver- und onMouseOut-Ereignis aufgerufen.   *
//******************************************************************************
{
    // Darstellung des Bildes ändern
    if(document.images)
    {
        var imgCurrent = document.images[strImgName];
        imgCurrent.src = strSrc;
        
        if(strBorder.length > 0)
            imgCurrent.style.border = strBorder;
    }
    
    // Darstellung des Textes ändern   
    var objItem = document.getElementById(strTextId);
    
    if(objItem)
        objItem.style.color = strTextColor;
}

LinkImage.prototype.show = function(isEnabled)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    document.write('<table class="linkimage"'
                 + ' width="' + this.TableWidth + '"'
                 + ' style="border: none;">');    
    document.write('<tr>');
	
    if(this.TextPosition == 'left')
    {
        this.showText(isEnabled);
        this.showImage(isEnabled);
    }
    else if(this.TextPosition == 'right')
    {
        this.showImage(isEnabled);
        this.showText(isEnabled);
    }
    else if(this.TextPosition == 'top')
    {
        this.showText(isEnabled);
        document.write('</tr>');    
        document.write('<tr>');
        this.showImage(isEnabled);    
    }
    else // this.TextPosition == 'bottom'
    {
        this.showImage(isEnabled);    
        document.write('</tr>');    
        document.write('<tr>');
        this.showText(isEnabled);
    }
    
    document.write('</tr>');    
    document.write('</table>');
}

LinkImage.prototype.showImage = function(isEnabled)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    document.write('<td class="li_image"'
                 + ' id="' + this.Image.Id + '"'
                 + ' align="' + this.ImageAlign + '"'
                 + ' valign="' + this.ImageValign + '">');

    if(!this.Image.AltText)
	    this.Image.AltText = this.AltText;

	this.Image.LinkTarget = this.LinkTarget;

    this.Image.show(isEnabled, this.getMouseOutEvent(), this.getMouseOverEvent());
    
    document.write('</td>');
}

LinkImage.prototype.showText = function(isEnabled)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.Text.length > 0)
    {
        document.write('<td class="li_text"'
                     + ' align="' + this.TextAlign + '"'
                     + ' valign="' + this.TextValign + '">');
                     
        if(isEnabled)
            document.write('<a href="' + this.Image.LinkRef + '"'
                         + ' target="' + this.LinkTarget + '"'
                         + ' id="' + this.TextId + '"'
                         + ' title="' + this.AltText + '"'
                         + ' onMouseOut="' + this.getMouseOutEvent() + '"'
                         + ' onMouseOver="' + this.getMouseOverEvent() + '">'
                         + this.Text
                         + '</a>');
        else
            document.write(this.Text);
                         
        document.write('</td>');
    }
}

//////////////////////// Klasse LinkImageCollection ////////////////////////////

function LinkImageCollection(strId, strWidth, nMaxCol, strTextPosition,
                             strTextColorRO)
//******************************************************************************
//* Klasse LinkImage                                                           *
//******************************************************************************
{
    this.Id           = strId;
    this.TableWidth   = strWidth;
    this.MaxCol       = nMaxCol;
    this.TextPosition = strTextPosition;  // 'left'/'right'/'top'/'bottom'
    this.TextColorRO  = strTextColorRO;
    
    this.Images       = new Array();
    this.Cellpadding  = 4;
}

LinkImageCollection.prototype.add = function(strSource, strText, strLinkRef)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var nCurrent = this.Images.length;
    
    this.Images.push(new LinkImage(this.Id + nCurrent.toString(), 
                                   strSource,
                                   strLinkRef,
                                   this.Width,
                                   this.TextPosition));
                                   
    this.Images[nCurrent].Text         = strText;
    this.Images[nCurrent].TextColorRO  = this.TextColorRO;
}

LinkImageCollection.prototype.show = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    document.write('<table width="' + this.TableWidth + '"'
                 + ' cellpadding="' + this.Cellpadding + '"'
                 + ' cellspacing="0"'
                 + ' style="border: none;">');
    document.write('<tr>');
    
    if(this.TextPosition == 'left'
    || this.TextPosition == 'right')
    {
        for(nImage = 0; nImage < this.Images.length; nImage++)
        {
            if(nImage > 0 && nImage % this.MaxCol == 0)
            {
                document.write('</tr>');
                document.write('<tr>');
            }

            if(this.TextPosition == 'left')
            {
                this.Images[nImage].showText(true);
                this.Images[nImage].showImage(true);
            }
            else
            {
                this.Images[nImage].showImage(true);
                this.Images[nImage].showText(true);
            }
        }
    }
    else
    {
        nImage = 0;
        while(nImage < this.Images.length)
        {
            document.write('<tr>');
            for(nCol = 0; nCol < this.MaxCol; nCol++)
            {
                if(nImage < this.Images.length)
                {
                    if(this.TextPosition == 'top')
                        this.Images[nImage].showText(true);
                    else
                        this.Images[nImage].showImage(true);
                }
                nImage++;
            }
            document.write('</tr>');
            
            document.write('<tr>');
            nImage = nImage - nCol;
            for(nCol = 0; nCol < this.MaxCol; nCol++)
            {
                if(nImage < this.Images.length)
                {
                    if(this.TextPosition == 'top')
                        this.Images[nImage].showImage(true);
                    else
                        this.Images[nImage].showText(true);
                }
                nImage++;
            }
            document.write('</tr>');
        }
    }
    
    document.write('</tr>');
    document.write('</table>');
}

///////////////////////////// Klasse Opacity ///////////////////////////////////

function Opacity(objElem)
//******************************************************************************
//* Klasse Opacity                                                             *
//******************************************************************************
{			 
    this.Id = '';
	this.Element = null;
	
	if(typeof(objElem) == 'string')
        this.Id = objElem;
	else if(typeof(objElem) == 'object')
	    this.Element = objElem;
}

// Konstanten
Opacity.Min = 0;
Opacity.Max = 100;

Opacity.prototype.get = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	var nOpacity = 0;
	
	this.refreshElement();
	
    if(this.Element)
	{
        if(MyBrowser.isInternetExplorer4())
	    {
		    if(this.Element.filters
		    && this.Element.filters.Alpha
		    && this.Element.filters.Alpha.opacity)
                nOpacity = this.Element.filters.Alpha.opacity;
	    }
        else if(MyBrowser.isNetscape5())
            nOpacity = this.Element.style.MozOpacity * Opacity.Max;
            
        else if(MyBrowser.isOpera() || MyBrowser.isSafari())
            nOpacity = this.Element.style.opacity * Opacity.Max;
			
//        Konqueror ab Version 3.4 kein Support von opacity oder -khtml-opacity !
//        else if(MyBrowser.isKonqueror())
//            nOpacity = this.Element.style['-ktml-opacity'] * Opacity.Max;
	}
    return(nOpacity);
}

Opacity.getStyleAttribute = function(nOpacity)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strStyle = '';
    
    if(MyBrowser.isInternetExplorer4())
        strStyle = ' filter:Alpha(opacity=' + nOpacity.toString() + ');';
        
    else if(MyBrowser.isNetscape5())
	{
        //strStyle = ' -moz-opacity:' + (nOpacity / Opacity.Max).toString() + ';';
        strStyle = ' opacity:' + (nOpacity / Opacity.Max).toString() + ';';
	}
        
    else if(MyBrowser.isOpera() || MyBrowser.isSafari())
        strStyle = ' opacity:' + (nOpacity / Opacity.Max).toString() + ';';

//    Konqueror ab Version 3.4 kein Support von opacity oder -khtml-opacity !
//    else if(MyBrowser.isKonqueror())
//        strStyle = ' -khtml-opacity:' + (nOpacity / Opacity.Max).toString() + ';';

    return(strStyle)
}

Opacity.prototype.refreshElement = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.Id.length > 0)
	    this.Element = document.getElementById(this.Id);
}

Opacity.prototype.set = function(nOpacity)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
	this.refreshElement();
	
    if(this.Element)
	{
        if(nOpacity >= Opacity.Min && nOpacity <= Opacity.Max)
        {
            if(MyBrowser.isInternetExplorer4())
                this.Element.style['filter'] = 'Alpha(opacity=' + nOpacity + ')';
                //this.Element.filters.Alpha.opacity = nOpacity;
            
            else if(MyBrowser.isNetscape5())
                this.Element.style.MozOpacity = nOpacity / Opacity.Max;
            
            else if(MyBrowser.isOpera() || MyBrowser.isSafari())
                this.Element.style.opacity = nOpacity / Opacity.Max;
				
//            Konqueror ab Version 3.4 kein Support von opacity oder -khtml-opacity !
//            else if(MyBrowser.isKonqueror())
//                this.Element.style['-khtml-opacity'] = nOpacity / Opacity.Max;
        }
	}
}

///////////////////////// Klasse PreviewImage //////////////////////////////////

function PreviewImage(strObjectName, strEnclosingId, strSrc, strLinkRef,
                      nHeight, nWidth)
//******************************************************************************
//* Klasse PreviewImage                                                        *
//******************************************************************************
{
    this.EnclosingId    = strEnclosingId;
    this.Id             = this.EnclosingId + '_previewimage';
    this.LinkRef        = strLinkRef;
    this.Height         = nHeight;
    this.Width          = nWidth;
    
    this.Image          = new Image();
    this.Image.src      = strSrc;
            
    this.MouseOutEvent  = strObjectName + '.highlight(false)';
    this.MouseOverEvent = strObjectName + '.highlight(true)';
}

PreviewImage.BackgroundColor     = '';             // Hintergrundfarbe der Vorschaubilder
PreviewImage.OpacityValue        = 50;             // Deckgrad der Vorschaubildes
PreviewImage.BorderWidth         = 2;              // Rahmendicke der Vorschaubilder
PreviewImage.BorderStyle         = 'solid';        // Rahmentyp der Vorschaubilder
PreviewImage.BorderColor         = 'transparent';  // Rahmenfarbe der Vorschaubilder
PreviewImage.BorderColorSelected = '#ffffff';      // Rahmenfarbe des ausgewählten Vorschaubildes

PreviewImage.prototype.getHTMLImage = function(showLinkRef)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strHeight     = (this.Height > 0) ? ' height="' + this.Height + 'px"' : '';
    var strWidth      = (this.Width > 0) ? ' width="' + this.Width + 'px"' : '';
    var strStyle      = (PreviewImage.BackgroundColor.length > 0)
                      ? 'style="border: none;'
                      + Opacity.getStyleAttribute(PreviewImage.OpacityValue) + '";'
                      : ' style="border-width:' + PreviewImage.BorderWidth + 'px;'
                      + ' border-style:' + PreviewImage.BorderStyle + ';'
                      + ' border-color:' + PreviewImage.BorderColor + ';'
                      + Opacity.getStyleAttribute(PreviewImage.OpacityValue) + '";';
    var strTableBegin = (PreviewImage.BackgroundColor.length > 0)
                      ? '<table cellspacing="0" cellpadding="0"><tr>'
                      + '<td id="' + this.Id + '_td' + '"'
                      + ' style="background-color:' + PreviewImage.BackgroundColor + ';'
                      + ' border-width:' + PreviewImage.BorderWidth + 'px;'
                      + ' border-style:' + PreviewImage.BorderStyle + ';'
                      + ' border-color:' + PreviewImage.BorderColor + ';">'
                      : '';
    var strTableEnd   = (PreviewImage.BackgroundColor.length > 0)
                      ? '</td></tr></table>'
                      : '';
        
    if(showLinkRef)
        return(strTableBegin
             + '<a href="' + this.LinkRef + '">'
             + '<img id="' + this.Id + '"'
             + ' src="' + this.Image.src + '"'
             + strHeight
             + strWidth
             + ' onmouseover="' + this.MouseOverEvent + '"'
             + ' onmouseout="' + this.MouseOutEvent + '"'
             + strStyle + '>'
             + '</a>'
             + strTableEnd);
    else    
        return(strTableBegin
             + '<img id="' + this.Id + '"'
             + ' src="' + this.Image.src + '"'
             + strHeight
             + strWidth
             + strStyle + '>'
             + strTableEnd); 
}

PreviewImage.prototype.highlight = function(isMouseover)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(isMouseover)
        (new Opacity(this.Id)).set(Opacity.Max);
    else
        (new Opacity(this.Id)).set(PreviewImage.OpacityValue);
}

PreviewImage.prototype.select = function(isSelected)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var objImage     = document.getElementById(this.Id);
    var objTableCell = document.getElementById(this.Id + '_td');

    if(isSelected)
    {
        if(MyBrowser.isNetscape5())
            objImage.blur();  // für Mozilla: Focus-Rahmen entfernen
        
        if(PreviewImage.BackgroundColor.length > 0)
            objTableCell.style.borderColor = PreviewImage.BorderColorSelected;
        else
            objImage.style.borderColor = PreviewImage.BorderColorSelected;
    }
    else
    {
        if(PreviewImage.BackgroundColor.length > 0)
            objTableCell.style.borderColor = PreviewImage.BorderColor;
        else
            objImage.style.borderColor = PreviewImage.BorderColor;
    }
}

PreviewImage.prototype.show = function(showLinkRef)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    document.write(this.getHTMLImage(showLinkRef));
}

PreviewImage.prototype.update = function(showLinkRef)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    document.getElementById(this.EnclosingId).innerHTML = this.getHTMLImage(showLinkRef);
}

////////////////////////// Klasse RolloverImage ////////////////////////////////

function RolloverImage(strId, strSource, strLinkRef)
//******************************************************************************
//* Klasse RolloverImage                                                       *
//******************************************************************************
{
    this.Id         = strId;
    this.Normal     = strSource;
    this.LinkRef    = strLinkRef;
	this.LinkTarget = '_self';
    
    this.ImageName  = strId + '_image';
    this.BorderNO   = 'none';
    this.BorderRO   = 'none';
    this.Disabled   = strSource;
    this.Rollover   = strSource;
    this.AltText    = "";
    this.Height     = 0;
    this.Width      = 0;
}

RolloverImage.onMouseHandle = function(strImageName, strSource, strBorder)
//******************************************************************************
//* onMouseHandle wird beim onMouseOver- und onMouseOut-Ereignis aufgerufen.   *
//******************************************************************************
{
    if(document.images)
    {
        var imgCurrent = document.images[strImageName];
        imgCurrent.src = strSource;
        
        if(strBorder.length > 0)
            imgCurrent.style.border = strBorder;
    }
}

RolloverImage.prototype.show = function(isEnabled, strMouseOutEvent,
                                        strMouseOverEvent)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strHeight    = '';
    var strWidth     = '';
    var strInnerHTML = '';

    if(this.nHeight > 0)
        strHeight = 'height="' + parseInt(this.Height) + 'px"';
    if(this.nWidth > 0)     
        strWidth  = 'width="' + parseInt(this.Width) + 'px"';
        
    if(isEnabled)
    {
        if(!strMouseOutEvent)
            strMouseOutEvent = "RolloverImage.onMouseHandle('" + this.ImageName + "','" + this.Normal + "','" + this.BorderNO + "');";
        
        if(!strMouseOverEvent)
            strMouseOverEvent = "RolloverImage.onMouseHandle('" + this.ImageName + "','" + this.Rollover + "','" + this.BorderRO + "');";
            
        var strImageTag = '<img name="' + this.ImageName + '"'
                        + ' src="' + this.Normal + '"'
                        + ' style="border:' + this.BorderNO + ';"'
                        + ' ' + strHeight
                        + ' ' + strWidth + '>';

        
        strInnerHTML = '<a href="' + this.LinkRef + '"'
					 + ' target="' + this.LinkTarget + '"'
		             + ' title="' + this.AltText + '"'
                     + ' onMouseOut="' + strMouseOutEvent + '"'
                     + ' onMouseOver="' + strMouseOverEvent + '"'
                     + '>' + strImageTag + '</a>';
    }
    else
        strInnerHTML = '<img name="' + this.ImageName + '"'
                     + ' src="' + this.Disabled + '"'
                     + ' alt="' + this.AltText + '"'
                     + ' style=border:' + this.BorderNO + ';"'
                     + ' ' + strHeight
                     + ' ' + strWidth + '>';

     document.getElementById(this.Id).innerHTML = strInnerHTML;
}

////////////////////////// Klasse UpDownNavigation /////////////////////////////

function UpDownNavigation(strObjectName,
                          strTopId, strTopImage, strBottomId, strBottomImage)
//******************************************************************************
//* Klasse UpDownNavigation                                                    *
//******************************************************************************
{
    this.TopAnker            = strTopId + "_anker";
    this.BottomAnker         = strBottomId + "_anker";
    this.TopImage            = new RolloverImage(strTopId, strTopImage, "#" + this.BottomAnker);
    this.BottomImage         = new RolloverImage(strBottomId, strBottomImage, "#" + this.TopAnker);
    this.NavigationEnabled   = false;

    this.TopImage.AltText    = "nach unten";
    this.BottomImage.AltText = "nach oben";

    UpDownNavigation.ObjectName = strObjectName;    
}

UpDownNavigation.prototype.isNavigation = function()
//******************************************************************************
//* Überprüfung, ob die Navigation aktiviert werden soll.                      *
//******************************************************************************
{
    var nBodyHeight   = 0;
    var nOffsetHeight = document.getElementById(this.BottomImage.Id).offsetTop;
                      + document.getElementById(this.BottomImage.Id).offsetHeight
                      - document.getElementById(this.TopImage.Id).offsetTop;
              
    // Netscape
    if(window.innerHeight)
        nBodyHeight = window.innerHeight;
        
    // Internet Explorer
    else
    {
        if(document.documentElement.clientHeight)
            nBodyHeight = document.documentElement.clientHeight;
        // alternativ
        else if(document.body.offsetHeight)
            nBodyHeight = document.body.offsetHeight;
    }

    return(nOffsetHeight > nBodyHeight);
}

UpDownNavigation.onResizeHandle = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    eval(UpDownNavigation.ObjectName + '.show(false)');
}

UpDownNavigation.prototype.show = function(isForceDisplay)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(isForceDisplay || this.NavigationEnabled != this.isNavigation())
    {
        this.NavigationEnabled = this.isNavigation();

        this.TopImage.show(this.NavigationEnabled);
        this.BottomImage.show(this.NavigationEnabled);
        
        var objTop    = document.getElementById(this.TopImage.Id)
        var objBottom = document.getElementById(this.BottomImage.Id)
                 
        if(MyBrowser.isInternetExplorer4())
        {
            objTop.innerHTML    = '<a id="' + this.TopAnker + '"></a>'
                                + objTop.innerHTML;
            objBottom.innerHTML = '<a id="' + this.BottomAnker + '"></a>'
                                + objBottom.innerHTML;
        }                                                           
        else if(MyBrowser.isNetscape5()
             || MyBrowser.isKonqueror()
			 || MyBrowser.isOpera()
			 || MyBrowser.isSafari())
        {
            objTop.innerHTML    = '<a id="' + this.TopAnker + '"></a>'
                                + '<div>' + objTop.innerHTML + '</div>';
            objBottom.innerHTML = '<a id="' + this.BottomAnker + '"></a>'
                                + '<div>' + objBottom.innerHTML + '</div>';
        }
    }
}

UpDownNavigation.prototype.startMonitor = function(strBrowser)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    // Überwachung für Internet Explorer aktivieren
    if(strBrowser == 'Internet Explorer' && MyBrowser.isInternetExplorer4())
        window.onresize = UpDownNavigation.onResizeHandle;
        
    // Überwachung für Netscape oder Opera aktivieren
    else if(strBrowser == 'Netscape'
		&& (MyBrowser.isNetscape5()
 	     || MyBrowser.isKonqueror()
 	     || MyBrowser.isOpera()
		 || MyBrowser.isSafari()))
        window.onresize = UpDownNavigation.onResizeHandle;        
}

////////////////////////// Klasse SlideshowGallery /////////////////////////////

function SlideshowGallery(strObjectName, strEnclosingId, nSize, nPreviewSize,
                          strAlignment, nMaxThumbs, strLanguage,
                          strLibImagePath, nPreviewMode)
//******************************************************************************
//* Klasse SlideshowGallery                                                    *
//******************************************************************************
{
    this.ObjectName      = strObjectName;
    this.Id              = strEnclosingId;
    this.FadeOutInterval = null;
    this.FadeInTimeout   = null;    
    this.Size            = nSize;  // Breite des Bildbereichs (left/right)
                                   // Höhe des Bildbereichs (top/bottom)
								   
    this.Width           = '100%';						   
    this.ExistThumbnail  = false;
    this.DynamicImage    = new DynamicImage(this.ObjectName + '.DynamicImage',
                                            this.Id + '_image',
                                            0,
                                            0,
                                            10000,
                                            true,
                                            ROTATION_FORWARD);

    this.Cellpadding = 0;
    this.Cellspacing = 0;

    this.HideMenu = false;
    this.Menu = new SlideshowMenu(this.Id, strLanguage, strLibImagePath);    
    this.Menu.Buttons[SSM_PREVIMAGE].LinkRef = 'javascript:' + this.ObjectName + '.previousImage()';
    this.Menu.Buttons[SSM_STOPSHOW].LinkRef  = 'javascript:' + this.ObjectName + '.stopSlideshow()';
    this.Menu.Buttons[SSM_STARTSHOW].LinkRef = 'javascript:' + this.ObjectName + '.startSlideshow()';
    this.Menu.Buttons[SSM_NEXTIMAGE].LinkRef = 'javascript:' + this.ObjectName + '.nextImage()';
    
    if(nPreviewMode == IMAGE_SLIDER)
    {
        this.Preview = new ImageSlider(this.ObjectName + '.Preview',
                                       this.Id + '_preview',
                                       0,
                                       0,
                                       2 * nPreviewSize,
                                       nPreviewSize,
                                       nMaxThumbs,
                                       strAlignment,
                                       strLibImagePath);
                                       
        this.Preview.PrevButton.LinkRef = 'javascript:' + this.ObjectName + '.previousImage()';
        this.Preview.NextButton.LinkRef = 'javascript:' + this.ObjectName + '.nextImage()';
    }
    else if(nPreviewMode == IMAGE_PREVIEW)
        this.Preview = new ImagePreview(strAlignment, nPreviewSize, nMaxThumbs);
}

SlideshowGallery.prototype.addImage = function(strSource, strComment)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    this.DynamicImage.add(strSource, strComment);
}

SlideshowGallery.prototype.removeAllImages = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    this.DynamicImage.Images = new Array();
}

SlideshowGallery.prototype.getPreviewImageSrc = function(strImageSrc)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var nPos   = strImageSrc.charAtReverse('.');
    var strSrc = strImageSrc;
    
    if(nPos >= 0)
    {
        strSrc = strImageSrc.substr(0, nPos)
               + '_thumbnail'
               + strImageSrc.substr(nPos, strImageSrc.length);
               
        if(this.ExistThumbnail)
            return(strSrc);
        else
        {
            var objImage = new Image();
            objImage.src = strSrc;

            if(MyBrowser.isNetscape5() || MyBrowser.isKonqueror() || MyBrowser.isSafari())
            {
                if(objImage.width == 0)
                    strSrc = strImageSrc;
            }        
            else if(MyBrowser.isInternetExplorer4() || MyBrowser.isOpera())
            {
                if(!objImage.complete)
                   strSrc = strImageSrc;
            }
        }
    }
    return(strSrc);
}

SlideshowGallery.prototype.initializePreviewImages = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    for(nImage = 0; nImage < this.DynamicImage.Images.length; nImage++)
    {
        if(this.Preview.constructor == ImageSlider)
            this.Preview.addImage(this.getPreviewImageSrc(this.DynamicImage.Images[nImage].src),
                                  'javascript:' + this.ObjectName + '.setImage(' + nImage + ')');
        else
            this.Preview.addImage(this.ObjectName + '.Preview.Images[' + nImage + ']',
                                  this.Id,
                                  this.getPreviewImageSrc(this.DynamicImage.Images[nImage].src),
                                  'javascript:' + this.ObjectName + '.setImage(' + nImage + ')');
    }
}

SlideshowGallery.prototype.nextImage = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{    
    if(this.Preview.constructor == ImageSlider)
        this.Preview.nextImage();
    else
    {
        this.Preview.Images[this.DynamicImage.Current].select(false);
        this.DynamicImage.next();        
        this.Preview.Images[this.DynamicImage.Current].select(true);
    }
}

SlideshowGallery.prototype.previousImage = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.Preview.constructor == ImageSlider)
        this.Preview.previousImage();
    else
    {                                  
        this.Preview.Images[this.DynamicImage.Current].select(false);
        this.DynamicImage.previous();
        this.Preview.Images[this.DynamicImage.Current].select(true);
    }
}

SlideshowGallery.prototype.randomImage = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.Preview.constructor == ImageSlider)
        this.Preview.randomImage(dynamicImage.getRandom());
    else
    {                                
        this.Preview.Images[this.DynamicImage.Current].select(false);
        this.DynamicImage.set(this.DynamicImage.getRandom());
        this.Preview.Images[this.DynamicImage.Current].select(true);
    }
}

SlideshowGallery.prototype.setImage = function(nImage)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.Preview.constructor == ImageSlider)
    {
        this.Preview.setPosition(nImage - this.DynamicImage.Current);
        this.DynamicImage.set(nImage);
    }
    else
    {
        this.Preview.Images[this.DynamicImage.Current].select(false);
        this.DynamicImage.set(nImage);
        this.Preview.Images[this.DynamicImage.Current].select(true);
    }
}

SlideshowGallery.prototype.show = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var nMaxImages = this.DynamicImage.Images.length - 1;
    
    if(nMaxImages >= 0)
    {    
        this.initializePreviewImages();
        
        if(this.Preview.constructor == ImageSlider)
        /*****************************************/
        /* ImageSlider                           */
        /*****************************************/
        {
            if(this.Preview.Alignment == "left" || this.Preview.Alignment == "right")
            {
                var nMargin = 0
                var nWidth  = this.Size;
            
                document.write('<table class="slideshow"'
                             + ' height="' + (this.Preview.getTotalHeight() - this.Menu.ButtonSize) + 'px"'
                             + ' width="' + (this.Size + this.Preview.getTotalWidth()) + 'px"'
                             + ' border="0px"'
                             + ' cellpadding="' + this.Cellpadding + '"'
                             + ' cellspacing="' + this.Cellspacing + '">');
                document.write('<tr>');

                if(this.Preview.Alignment == "left")
                {
                    document.write('<td width="' + this.Preview.getTotalWidth() + 'px"></td>');                                 
                    this.showImage(1);
                    
                    nWidth  = this.Size + this.Preview.getTotalWidth();
                    nMargin = this.Preview.getTotalWidth();
                }
                else
                {
                    this.showImage(1);
                    document.write('<td width="' + this.Preview.getTotalWidth() + 'px"></td>');
                    
                    this.Preview.Left = this.Preview.Left + this.Size;
                }
                document.write('</tr></table>');
                
                this.Preview.show(this.DynamicImage);
				if(!this.HideMenu)
                    this.Menu.show(nWidth + 'px', nMargin);
            }
            else
            {
                document.write('<table class="slideshow"'
                             + ' height="' + (this.Size + this.Preview.getTotalHeight()) + '"'
                             + ' width="' + this.Preview.getTotalWidth() + 'px"'
                             + ' border="0px"'
                             + ' cellpadding="' + this.Cellpadding + '"'
                             + ' cellspacing="' + this.Cellspacing + '">');

                if(this.Preview.Alignment == "top")
                {
                    document.write('<tr><td width="' + this.Preview.getTotalWidth() + 'px"'
                                 + ' height="' + this.Preview.getTotalHeight() + 'px">'
                                 + '</td></tr>');
                                 
                    document.write('<tr height="' + this.Size + 'px">');
                    this.showImage(1);
                    document.write('</tr>');
                }
                else
                {
                    document.write('<tr height="' + this.Size + 'px">');
                    this.showImage(1);
                    document.write('</tr>');

                    document.write('<tr><td width="' + this.Preview.getTotalWidth() + 'px"'
                                 + ' height="' + this.Preview.getTotalHeight() + 'px">'
                                 + '</td></tr>');
                    
                    this.Preview.Top = this.Preview.Top + this.Size;
                }
                document.write('</table>');
                
                this.Preview.show(this.DynamicImage);
				if(!this.HideMenu)
                    this.Menu.show(this.Preview.getTotalWidth() + 'px', 0);
            }            
        }
        else
        /*****************************************/
        /* PreviewMenu                           */
        /*****************************************/
        {        
            document.write('<table class="slideshow"'
                         + ' width="' + this.Width + '"'
                         + ' border="0"'
                         + ' cellpadding="' + this.Cellpadding + '"'
                         + ' cellspacing="' + this.Cellspacing + '">');
            
            if(this.Preview.Alignment == "left")
            {
                document.write("<tr>");
                this.Preview.show(nMaxImages, this.Cellpadding);
                this.showImage(1);
                document.write("</tr>");
            }
            else if(this.Preview.Alignment == "right")
            {
                document.write("<tr>");
                this.showImage(1);
                this.Preview.show(nMaxImages, this.Cellpadding);
                document.write("</tr>");
            }
            else if(this.Preview.Alignment == "top")
            {
                document.write("<tr>");
                this.Preview.show(nMaxImages, this.Cellpadding);
                document.write("</tr>");
                document.write("<tr>");
                this.showImage(this.Preview.ImagesInRow);
                document.write("</tr>");
            }
            else if(this.Preview.Alignment == "bottom")
            {
                document.write("<tr>");
                this.showImage(this.Preview.ImagesInRow);
                document.write("</tr>");
                document.write("<tr>");
                this.Preview.show(nMaxImages, this.Cellpadding);
                document.write("</tr>");
            }            
            document.write('</table>');

			if(!this.HideMenu)
                this.Menu.show('100%', 0);
            this.Preview.Images[this.DynamicImage.Current].select(true);
        }
    }
}

SlideshowGallery.prototype.showImage = function(nSpan)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var nRowSpan = 1;
    var nColSpan = 1;
       
    if(this.Preview.Alignment == "top" || this.Preview.Alignment == "bottom")
        nColSpan = nSpan;
    else
        nRowSpan = nSpan;
    
    document.write('<td align="center" valign="middle"'
                 + ' colspan="' + nColSpan.toString() + '"'
                 + ' rowspan="' + nRowSpan.toString() + '">');
    
    this.DynamicImage.show(false);
    
    document.write('</td>');
}

SlideshowGallery.prototype.startSlideshow = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{        
	if(!this.HideMenu)
        this.Menu.update(true);
    
    if(this.Preview.constructor == ImageSlider)
    {
        this.Preview.PrevButton.show(false);
        this.Preview.NextButton.show(false);
        
        this.Preview.startRotation();
    }
    else
    {
        for(nImage = 0; nImage < this.Preview.Images.length; nImage++)
            this.Preview.Images[nImage].update(false);
        this.Preview.Images[this.DynamicImage.Current].select(true);

        if(this.DynamicImage.RotationOrder == ROTATION_RANDOM)
            this.DynamicImage.OnRotation = this.ObjectName + '.randomImage()';
        else if(this.DynamicImage.RotationOrder == ROTATION_BACKWARDS)
            this.DynamicImage.OnRotation = this.ObjectName + '.previousImage()';
        else
            this.DynamicImage.OnRotation = this.ObjectName + '.nextImage()';
    
        this.DynamicImage.startRotation();
    }
}

SlideshowGallery.prototype.stopSlideshow = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{    
    if(this.Preview.constructor == ImageSlider)
    {
        this.Preview.stopRotation();
        
        this.Preview.PrevButton.show(this.Preview.Images.length-1 > 0);
        this.Preview.NextButton.show(this.Preview.Images.length-1 > 0);
    }
    else
    {
        this.DynamicImage.stopRotation();

        for(nImage = 0; nImage < this.Preview.Images.length; nImage++)
            this.Preview.Images[nImage].update(true);
        this.Preview.Images[this.DynamicImage.Current].select(true);
    }
	
    if(!this.HideMenu)
        this.Menu.update(false);
}

/////////////////////////// Klasse SlideshowMenu ///////////////////////////////

function SlideshowMenu(strEnclosingId, strLanguage, strLibImagePath)
//******************************************************************************
//* Klasse SlideshowMenu                                                       *
//******************************************************************************
{
    this.Cellpadding = 2;
    this.Cellspacing = 0;
    this.ButtonSize  = 32;
    this.Buttons     = new Array(6);

    this.Buttons[SSM_PREVGALLERY] = new RolloverImage(strEnclosingId + '_prevgallery', strLibImagePath + 'prevgallery_no.gif', '');
    this.Buttons[SSM_PREVGALLERY].Rollover = strLibImagePath + 'prevgallery_ro.gif';
    this.Buttons[SSM_PREVGALLERY].Disabled = strLibImagePath + 'prevgallery_disabled.gif';
    
    this.Buttons[SSM_PREVIMAGE] = new RolloverImage(strEnclosingId + '_previmage',   strLibImagePath + 'previmage_no.gif', '');
    this.Buttons[SSM_PREVIMAGE].Rollover = strLibImagePath + 'previmage_ro.gif';
    this.Buttons[SSM_PREVIMAGE].Disabled = strLibImagePath + 'previmage_disabled.gif';
    
    this.Buttons[SSM_STOPSHOW] = new RolloverImage(strEnclosingId + '_stopshow',    strLibImagePath + 'stopshow_no.gif', '');
    this.Buttons[SSM_STOPSHOW].Rollover = strLibImagePath + 'stopshow_ro.gif';
    this.Buttons[SSM_STOPSHOW].Disabled = strLibImagePath + 'stopshow_disabled.gif';
    
    this.Buttons[SSM_STARTSHOW] = new RolloverImage(strEnclosingId + '_startshow',   strLibImagePath + 'startshow_no.gif', '');
    this.Buttons[SSM_STARTSHOW].Rollover = strLibImagePath + 'startshow_ro.gif';
    this.Buttons[SSM_STARTSHOW].Disabled = strLibImagePath + 'startshow_disabled.gif';
    
    this.Buttons[SSM_NEXTIMAGE] = new RolloverImage(strEnclosingId + '_nextimage',   strLibImagePath + 'nextimage_no.gif', '');
    this.Buttons[SSM_NEXTIMAGE].Rollover = strLibImagePath + 'nextimage_ro.gif';
    this.Buttons[SSM_NEXTIMAGE].Disabled = strLibImagePath + 'nextimage_disabled.gif';
    
    this.Buttons[SSM_NEXTGALLERY] = new RolloverImage(strEnclosingId + '_nextgallery', strLibImagePath + 'nextgallery_no.gif', '');
    this.Buttons[SSM_NEXTGALLERY].Rollover = strLibImagePath + 'nextgallery_ro.gif';
    this.Buttons[SSM_NEXTGALLERY].Disabled = strLibImagePath + 'nextgallery_disabled.gif';

    if(strLanguage == LANG_GERMAN)
    {
        this.Buttons[SSM_PREVGALLERY].AltText = "Vorherige Galerie anzeigen";
        this.Buttons[SSM_PREVIMAGE].AltText   = "Vorheriges Bild anzeigen";
        this.Buttons[SSM_STOPSHOW].AltText    = "Diashow beenden";
        this.Buttons[SSM_STARTSHOW].AltText   = "Diashow starten";
        this.Buttons[SSM_NEXTIMAGE].AltText   = "Nächstes Bild anzeigen";
        this.Buttons[SSM_NEXTGALLERY].AltText = "Nächste Galerie anzeigen";    
    }
    else if(strLanguage == LANG_SPANISH)
    {    
        this.Buttons[SSM_PREVGALLERY].AltText = "Visualizar galería anterior";
        this.Buttons[SSM_PREVIMAGE].AltText   = "Visualizar imagen anterior"
        this.Buttons[SSM_STOPSHOW].AltText    = "Terminar exposición de diapositivas";
        this.Buttons[SSM_STARTSHOW].AltText   = "Comenzar exposición de diapositivas";
        this.Buttons[SSM_NEXTIMAGE].AltText   = "Visualizar proxima imagen";
        this.Buttons[SSM_NEXTGALLERY].AltText = "Visualizar proxima galería";
    }
    else  // englisch
    {
        this.Buttons[SSM_PREVGALLERY].AltText = "Show previous gallery";
        this.Buttons[SSM_PREVIMAGE].AltText   = "Show previous image"
        this.Buttons[SSM_STOPSHOW].AltText    = "Stop slideshow";
        this.Buttons[SSM_STARTSHOW].AltText   = "Start slideshow";
        this.Buttons[SSM_NEXTIMAGE].AltText   = "Show next image";
        this.Buttons[SSM_NEXTGALLERY].AltText = "Show next gallery";
    }
}

SlideshowMenu.prototype.show = function(strWidth, nMarginLeft)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    document.write('<table class="slideshow_menu"'
                 + ' width="' + strWidth + '"'
                 + ' height="' + this.ButtonSize + 'px"'
                 + ' border="0px"'
                 + ' cellpadding="' + this.Cellpadding + '"'
                 + ' cellspacing="' + this.Cellspacing + '"'
                 + '>');
    document.write('<tr>');
    
    if(nMarginLeft > 0)
        document.write('<td width="' + nMarginLeft + 'px"></td>');
    
    document.write('<td id="' + this.Buttons[SSM_PREVGALLERY].Id + '" valign="middle" align="left"></td>');
    document.write('<td id="' + this.Buttons[SSM_PREVIMAGE].Id   + '" valign="middle" align="right"  width="' + this.ButtonSize + 'px"></td>');
    document.write('<td id="' + this.Buttons[SSM_STOPSHOW].Id    + '" valign="middle" align="center" width="' + this.ButtonSize + 'px"></td>');
    document.write('<td id="' + this.Buttons[SSM_STARTSHOW].Id   + '" valign="middle" align="center" width="' + this.ButtonSize + 'px"></td>');
    document.write('<td id="' + this.Buttons[SSM_NEXTIMAGE].Id   + '" valign="middle" align="left"   width="' + this.ButtonSize + 'px"></td>');
    document.write('<td id="' + this.Buttons[SSM_NEXTGALLERY].Id + '" valign="middle" align="right"></td>');
    document.write('</tr>');
    document.write('</table>');
    
    this.update(false);
}

SlideshowMenu.prototype.update = function(isSlideshowMode)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.Buttons[SSM_PREVGALLERY].LinkRef.length > 0
    || this.Buttons[SSM_NEXTGALLERY].LinkRef.length > 0)
    {
        this.Buttons[SSM_PREVGALLERY].show(this.Buttons[SSM_PREVGALLERY].LinkRef.length > 0);
        this.Buttons[SSM_NEXTGALLERY].show(this.Buttons[SSM_NEXTGALLERY].LinkRef.length > 0);
    }
    
    this.Buttons[SSM_PREVIMAGE].show(!isSlideshowMode);
    this.Buttons[SSM_STOPSHOW].show(isSlideshowMode);
    this.Buttons[SSM_STARTSHOW].show(!isSlideshowMode);
    this.Buttons[SSM_NEXTIMAGE].show(!isSlideshowMode);    
}

//////////////////////////// Klasse ImagePreview ///////////////////////////////

function ImagePreview(strAlignment, nImageWidth, nImagesInRow)
//******************************************************************************
//* Klasse ImagePreview                                                        *
//******************************************************************************
{
    this.Alignment   = strAlignment;     // Position der Vorschaubilder bzgl. des eigentlichen Bildes
                                         // Mögliche Werte: left, top, right, bottom
    this.ImageWidth  = nImageWidth;
    this.ImagesInRow = nImagesInRow;     // Anzahl Vorschaubilder in einer Zeile

    this.HorizontalAlignment = 'center'; // Horizontale Ausrichtung der Vorschaubilder
                                         // Mögliche Werte: left, center, right
    this.VerticalAlignment   = 'middle'; // Vertikale Ausrichtung der Vorschaubilder
                                         // Mögliche Werte: top, middle, bottom
    this.Images= new Array();
}

ImagePreview.prototype.addImage = function(strObjectName, strEnclosingId,
                                           strSrc, strLinkRef)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var nImage = this.Images.length;
    
    this.Images[nImage] = new PreviewImage(strObjectName,
                                           strEnclosingId + '_preview' + nImage.toString(),
                                           strSrc,
                                           strLinkRef,
                                           0, 
                                           this.ImageWidth);
}

ImagePreview.prototype.show = function(nMaxImages, nPadding)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.Alignment == 'top' || this.Alignment == 'bottom')
    {
        if(this.HorizontalAlignment == 'left')
        {
            var strStyle1 = ' ';
            var strStyle2 = ' style="float:left;padding:' + nPadding + ';"';
        }
        else if(this.HorizontalAlignment == 'right')
        {
            var strStyle1 = ' ';
            var strStyle2 = ' style="float:right;padding:' + nPadding + ';"';
		}
        else //if(this.HorizontalAlignment == 'center')
        {
            var strStyle1 = ' style="position:relative; float:left; left:50%; margin:0 auto;"';
            var strStyle2 = ' style="position:relative; float:left; right:50%;padding:' + nPadding + ';"';
        }

	    document.write('<td'
       		         + ' valign="' + this.VerticalAlignment + '">');
		document.write('<div' + strStyle1 + '>');
		for(nImage = 0; nImage <= nMaxImages; nImage++)
		{
	        document.write('<div id="' + this.Images[nImage].EnclosingId + '"'
                          + strStyle2 + '>');
    		this.Images[nImage].show(true);
   			document.write('</div>');

            if((nImage+1) % this.ImagesInRow == 0 || nImage == nMaxImages)
	        	document.write('<div style="clear:both;"></div>');
   	    }
    	document.write('</div>');
       	document.write('<div style="clear:both;"></div>');
    	document.write('</td>');
    }
	else
	{
    	for(nCell = 0; nCell < this.ImagesInRow; nCell++)
	    {
		    document.write('<td'
    		             + ' align="' + this.HorizontalAlignment + '"'
        		         + ' valign="' + this.VerticalAlignment + '"'
            		     + '>');
			for(nImage = 0; nImage <= nMaxImages; nImage++)
			{    
				if(nImage % this.ImagesInRow == nCell)
				{
			        document.write('<div id="' + this.Images[nImage].EnclosingId + '"'
                                 + ' style="padding:' + nPadding + ';">');
    	    		this.Images[nImage].show(true);
        			document.write('</div>');
				}
    	    }
	    	document.write('</td>');
        }
    }
}

///////////////////////// Klasse ImageSlider ///////////////////////////////////

function ImageSlider(strObjectName, strId, nTop, nLeft, nSize, nImageSize,
                     nVisibleImages, strAlignment, strLibImagePath)
//******************************************************************************
//* Klasse ImageSlider                                                         *
//******************************************************************************
{
    this.ObjectName      = strObjectName;
    this.Id              = strId;

    this.Alignment       = strAlignment;    
    this.Cellpadding     = 2;
    this.ImageSize       = nImageSize;
    
    this.Top             = nTop;
    this.Left            = nLeft;    
    this.Size            = nSize;
    this.ClipSize        = 0;
    
    this.ButtonSize      = 24;
    
    this.Interval        = 10;
    this.Step            = 4;
    this.FasterStep      = 8;
    this.Scrolling       = false;

    this.DynamicImage    = null;
    this.Images          = new Array();    
    this.Position        = 0;
    this.VisibleImages   = nVisibleImages;
    
    this.LibImagePath    = strLibImagePath;
    this.BackgroundColor = '';

    //*****************************
    //* NextButton initialisieren *
    //*****************************    
    var strImgNo       = (this.getOrientation() == ORIENT_VERTICAL) ? 'arrowdown_no'       : 'arrowright_no';
    var strImgRo       = (this.getOrientation() == ORIENT_VERTICAL) ? 'arrowdown_ro'       : 'arrowright_ro';
    var strImgDisabled = (this.getOrientation() == ORIENT_VERTICAL) ? 'arrowdown_disabled' : 'arrowright_disabled';
    
    this.NextButton = new RolloverImage(this.Id + '_slider_next',
                                        this.LibImagePath + strImgNo + '.gif',
                                        '');
    this.NextButton.Rollover = this.LibImagePath + strImgRo + '.gif';
    this.NextButton.Disabled = this.LibImagePath + strImgDisabled + '.gif';

    //*****************************    
    //* PrevButton initialisieren *
    //*****************************    
    strImgNo       = (this.getOrientation() == ORIENT_VERTICAL) ? 'arrowup_no'       : 'arrowleft_no';
    strImgRo       = (this.getOrientation() == ORIENT_VERTICAL) ? 'arrowup_ro'       : 'arrowleft_ro';
    strImgDisabled = (this.getOrientation() == ORIENT_VERTICAL) ? 'arrowup_disabled' : 'arrowleft_disabled';
    
    this.PrevButton = new RolloverImage(this.Id + '_slider_prev',
                                        this.LibImagePath + strImgNo + '.gif',
                                        '');
    this.PrevButton.Rollover = this.LibImagePath + strImgRo + '.gif';
    this.PrevButton.Disabled = this.LibImagePath + strImgDisabled + '.gif';
}

ImageSlider.prototype.addImage = function(strSrc, strLinkRef)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var nImage  = this.Images.length;
    var nHeight = (this.getOrientation() == ORIENT_VERTICAL) ? this.ImageSize : 0;
    var nWidth  = (this.getOrientation() == ORIENT_VERTICAL) ? 0 : this.ImageSize;
    
    this.Images[nImage] = new PreviewImage(this.ObjectName + '.Images[' + nImage.toString() + ']',
                                           this.Id + '_previewimage' + nImage.toString(), 
                                           strSrc, strLinkRef, nHeight, nWidth);
}

ImageSlider.prototype.getOrientation = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.Alignment == 'left' || this.Alignment == 'right')
        return(ORIENT_VERTICAL);
    else
        return(ORIENT_HORIZONTAL);
}

ImageSlider.prototype.getHeight = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.getOrientation() == ORIENT_VERTICAL)
        return(this.VisibleImages * this.getImageSize());
    else
        return(this.Size);
}

ImageSlider.prototype.getHTMLClip = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strInnerHTML = '<table border="0px"'
                     + ' cellpadding="' + this.Cellpadding + '"'
                     + ' cellspacing="0">';

    if(this.getOrientation() == ORIENT_HORIZONTAL)   
        strInnerHTML = strInnerHTML + '<tr>';

    for(i = 0; i <= this.VisibleImages; i++)
        if(i < this.Images.length)
            strInnerHTML = strInnerHTML + this.getHTMLImage(i);
    
    if(this.getOrientation() == ORIENT_HORIZONTAL)
        strInnerHTML = strInnerHTML + '</tr>';
        
    strInnerHTML = strInnerHTML + '</table>';
    
    return(strInnerHTML);
}

ImageSlider.prototype.getHTMLImage = function(nImage)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strHTML    = '';
    var strImgCode = this.Images[nImage].getHTMLImage(true);

    if(this.getOrientation() == ORIENT_VERTICAL)
    {
        strHTML = '<tr><td id="' + this.Images[nImage].EnclosingId + '"'
                + ' align="center"'
                + ' width="' + this.getWidth() + '">'
                + strImgCode
                + '</td></tr>';
    }
    else
    {
        strHTML = '<td id="' + this.Images[nImage].EnclosingId + '"'
                + ' valign="middle"'
                + ' height="' + this.getHeight() + '">'
                + strImgCode
                + '</td>';
    }
    return(strHTML);            
}

ImageSlider.prototype.getImageSize = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    return(this.ImageSize + (PreviewImage.BorderWidth + this.Cellpadding) * 2);
}

ImageSlider.prototype.getIndex = function(nValue)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(nValue > this.Images.length - 1)
        return(nValue - this.Images.length);
    else if(nValue < 0)
        return(nValue + this.Images.length);
        
    return(nValue);
}

ImageSlider.prototype.getTotalHeight = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.getOrientation() == ORIENT_VERTICAL)
        return(this.VisibleImages * this.getImageSize() + 2 * this.ButtonSize);
    else
        return(this.Size + 2 * this.Cellpadding);
}

ImageSlider.prototype.getTotalWidth = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.getOrientation() == ORIENT_VERTICAL)
        return(this.Size + 2 * this.Cellpadding);
    else
        return(this.VisibleImages * this.getImageSize() + 2 * this.ButtonSize);
}

ImageSlider.prototype.getWidth = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.getOrientation() == ORIENT_VERTICAL)
        return(this.Size);
    else
        return(this.VisibleImages * this.getImageSize());
}

ImageSlider.prototype.ClipOnBottom = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    return(this.ClipSize == 0);
}

ImageSlider.prototype.ClipOnTop = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    return(this.ClipSize == this.getImageSize());
}

ImageSlider.prototype.nextImage = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(this.Scrolling)
        return;
    
    if(this.Images.length > this.VisibleImages
    && (this.Position >= this.VisibleImages
    || (this.Position == (this.VisibleImages-1) && this.ClipOnBottom())))
    {
        this.scrollForward(1, this.Step);
    }
    else if(this.Position >= (this.Images.length-1))
    {
        this.setPosition((this.Images.length - 1) * (-1));
        this.DynamicImage.set(0);
    }
    else
    {
        this.setPosition(1);
        this.DynamicImage.next();
    }
}

ImageSlider.prototype.previousImage = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{    
    if(this.Scrolling)
        return;
    
    if(this.Images.length > this.VisibleImages
    && (this.Position <= 0
    || (this.Position == 1 && this.ClipOnTop())))
    {
        this.scrollBackward(1, this.Step);
    }    
    else if(this.Position <= 0)
    {
        this.setPosition(this.Images.length - 1);
        this.DynamicImage.set(this.Images.length - 1);
    }
    else
    {
        this.setPosition(-1);
        this.DynamicImage.previous();
    }
}

ImageSlider.prototype.randomImage = function(nCurrent)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var nMinPos = (this.ClipOnTop() ? 1 : 0);
    var nMaxPos = (this.ClipOnTop() ? this.VisibleImages : this.VisibleImages-1);

    if(this.Scrolling)
        return;

    if(!nCurrent)
        nCurrent = this.DynamicImage.getRandom();
        
    var nShift = nCurrent - this.DynamicImage.Current;

    if((nShift >= 1  && nShift <= (nMaxPos - this.Position))
    || (nShift <= -1 && (this.Position - Math.abs(nShift) >= nMinPos)))
    {
        this.DynamicImage.set(this.Position + nShift);
        this.setPosition(nShift);
    }

    else if(nShift == 1)
        this.nextImage();
    
    else if(nShift == -1)
        this.previousImage();
    
    else if(nShift > 1)
    {
        var nOldShift = nShift;
        
        nShift = nShift - (nMaxPos - this.Position);

        if(Math.abs(nShift) > parseInt((this.Images.length - this.VisibleImages) / 2))
        {
            if(nOldShift > 0)
                nShift = nOldShift - (this.Images.length - this.Position);
            else
                nShift = nOldShift + (this.Images.length - this.Position);
        }

        if(nShift > 0)
            this.scrollForward(nShift, this.FasterStep);
        else
            this.scrollBackward(Math.abs(nShift), this.FasterStep);
    }
}

ImageSlider.prototype.scrollClip = function(nShift, nDistance, nStep)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{    
    var nPixel = 0;
    
    if(nDistance > 0)
    {
        this.Scrolling = true;
        
        if(nStep < nDistance)
        {
            nPixel    = (nShift > 0) ? nStep : -nStep;
            nDistance = nDistance - nStep;
        }
        else
        {
            nPixel    = (nShift > 0) ? nDistance : -nDistance;
            nDistance = 0;
        }            
        this.setClipStyle(CLIP_UPDATE, nPixel);

        setTimeout(this.ObjectName + '.scrollClip(' + nShift + ',' + nDistance + ',' + nStep + ')', this.Interval);
    }
    else if(Math.abs(nShift) > 1)
    {
        if(nShift > 0)
        {
            this.shiftForward();
            nShift -= 1;
        }
        else
        {
            this.shiftBackward();
            nShift += 1;
        }
        this.scrollClip(nShift, this.getImageSize(), nStep);
    }
    else
    {
        this.Position = (nShift > 0 ? (this.VisibleImages) : 0);
        this.Images[this.Position].select(true);
        
        this.Scrolling = false;
    }
}

ImageSlider.prototype.scrollBackward = function(nImage, nStep)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    this.Images[this.Position].select(false);
    
    if(this.ClipOnBottom())
    {
        this.shiftBackward();
        this.DynamicImage.shiftBackward(nImage);
    }
    else if(nImage > 1)
        this.DynamicImage.shiftBackward(nImage - 1);
    
    this.DynamicImage.set(0);
    
    this.scrollClip((-1) * nImage, this.getImageSize(), nStep);
}

ImageSlider.prototype.scrollForward = function(nImage, nStep)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    this.Images[this.Position].select(false);

    if(this.ClipOnTop())
    {
        this.shiftForward();
        this.DynamicImage.shiftForward(nImage);
    }        
    else if(nImage > 1)
        this.DynamicImage.shiftForward(nImage - 1);
        
    this.DynamicImage.set(this.VisibleImages);
    
    this.scrollClip(nImage, this.getImageSize(), nStep);
}

ImageSlider.prototype.setClipStyle = function(nMode, nPixel)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var objClip = document.getElementById(this.Id);

    if(nMode == CLIP_INITIALIZE)
    {
        //nPixel = (this.Images.length > this.VisibleImages ? this.getImageSize() : 0);
    
        objClip.style.position        = 'absolute';
        objClip.style.backgroundColor = this.BackgroundColor;
        objClip.style.zindex          = '1';
    
        if(this.getOrientation() == ORIENT_VERTICAL)
        {
            objClip.style.top   = (this.Top + this.ButtonSize) + 'px';
            objClip.style.left  = this.Left + 'px';
            objClip.style.width = this.getWidth() + 'px';
        }
        else
        {
            objClip.style.top    = this.Top + 'px';
            objClip.style.left   = (this.Left + this.ButtonSize) + 'px';
            objClip.style.height = this.getHeight() + 'px';
        }
    }
    else if(nMode == CLIP_UPDATE)
    {
        this.ClipSize += nPixel;

        if(this.getOrientation() == ORIENT_VERTICAL)
            objClip.style.top = (parseInt(objClip.style.top) - nPixel) + 'px';
        else
            objClip.style.left = (parseInt(objClip.style.left) - nPixel) + 'px';
    }    
    
    if(this.getOrientation() == ORIENT_VERTICAL)
        objClip.style.clip = 'rect(' + this.ClipSize
                           + ' ' + this.getWidth()
                           + ' ' + (this.ClipSize + this.getHeight())
                           + ' 0)';
     else
        objClip.style.clip = 'rect(0'
                           + ' ' + (this.ClipSize + this.getWidth())
                           + ' ' + this.getHeight()
                           + ' ' + this.ClipSize + ')';
}

ImageSlider.prototype.setPosition = function(nShift)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    if(nShift != 0)
    {
        var nOldPosition = this.Position;
        
        this.Position = this.Position + nShift;
    
        if(this.Position < 0)
            this.Position = 0;
        else if(this.Position > this.VisibleImages)
            this.Position = this.VisibleImages;
            
        if(this.Position != nOldPosition)
        {
            this.Images[nOldPosition].select(false);
            this.Images[this.Position].select(true);
        }
    }
}

ImageSlider.prototype.shiftBackward = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strSrc = this.Images[this.Images.length - 1].Image.src;
    
    for(i = (this.Images.length-1); i > 0; i--)
        this.Images[i].Image.src = this.Images[i-1].Image.src;
    this.Images[0].Image.src = strSrc;

    for(i = 0; i <= this.VisibleImages; i++)
        document.getElementById(this.Images[i].Id).src = this.Images[i].Image.src;

    this.setClipStyle(CLIP_UPDATE, this.getImageSize());
}

ImageSlider.prototype.shiftForward = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    var strSrc = this.Images[0].Image.src;
    
    for(i = 0; i < this.Images.length-1; i++)
        this.Images[i].Image.src = this.Images[i+1].Image.src;
    this.Images[this.Images.length-1].Image.src = strSrc;
    
    for(i = 0; i <= this.VisibleImages; i++)
        document.getElementById(this.Images[i].Id).src = this.Images[i].Image.src;

    this.setClipStyle(CLIP_UPDATE, this.getImageSize() * (-1));
}

ImageSlider.prototype.show = function(dynamicImage)
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    document.write('<table cellspacing="0" cellpadding="0" border="0px"'
                 + ' height="' + this.getTotalHeight() + '"'
                 + ' width="' + this.getTotalWidth() + '"'
                 + ' style="position:absolute;'
                 + ' top:' + this.Top + 'px;'
                 + ' left:' + this.Left + 'px;">');
           
    //**********************************
    //* Slider (Vorheriges Bild)       *
    //**********************************
    if(this.getOrientation() == ORIENT_VERTICAL)
        document.write('<tr><td id="' + this.Id + '_slider_prev"'
                     + ' align="center">'
                     + '</td></tr><tr>');
    else
        document.write('<tr><td id="' + this.Id + '_slider_prev"'
                     + ' valign="middle">'
                     + '</td>');
    this.PrevButton.show(this.Images.length > this.VisibleImages);
    
    //**********************************
    //* Slider (Mittelteil)            *
    //**********************************
    document.write('<td height="' + this.getHeight() + 'px"'
                 + ' width="' + this.getWidth() + 'px">'
                 + '</td>');
    
    //**********************************
    //* Slider (Nächstes Bild)         *
    //**********************************    
    if(this.getOrientation() == ORIENT_VERTICAL)
        document.write('</tr><tr><td id="' + this.Id + '_slider_next"'
                     + ' align="center">'
                     + '</td></tr>');
    else
        document.write('<td id="' + this.Id + '_slider_next"'
                     + ' valign="middle">'
                     + '</td></tr>');                     
    this.NextButton.show(this.Images.length > this.VisibleImages);
   
    document.write('</table>');

    //************************
    //* ImageSlider anzeigen *
    //************************
    document.write('<div id="' + this.Id + '"></div>');

    var objClip = document.getElementById(this.Id);
    objClip.innerHTML = this.getHTMLClip();
    
    this.setClipStyle(CLIP_INITIALIZE);
    
    if(this.Images.length > 0)
    {
        this.DynamicImage = dynamicImage;
        
        if(this.DynamicImage.Current == 0)
            this.Images[this.DynamicImage.Current].select(true);
            
        else  // this.DynamicImage.OnRotation == ROTATON_RANDOM
        {
            var nCurrent = this.DynamicImage.Current
            this.DynamicImage.Current = 0;
            this.randomImage(nCurrent);
        }
    }
}

ImageSlider.prototype.startRotation = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    this.SlideshowMode = true;    
    
    for(i = 0; i <= this.VisibleImages; i++)
        this.Images[i].update(false);

    if(this.DynamicImage.RotationOrder == ROTATION_RANDOM)
        this.DynamicImage.OnRotation = this.ObjectName + '.randomImage()';
    else if(this.DynamicImage.RotationOrder == ROTATION_BACKWARDS)
        this.DynamicImage.OnRotation = this.ObjectName + '.previousImage()';
    else
        this.DynamicImage.OnRotation = this.ObjectName + '.nextImage()';
    
    this.DynamicImage.startRotation();
}

ImageSlider.prototype.stopRotation = function()
//******************************************************************************
//*                                                                            *
//******************************************************************************
{
    this.DynamicImage.stopRotation();
    
    for(i = 0; i <= this.VisibleImages; i++)
        this.Images[i].update(true);

    this.Images[this.Position].select(true);
    
    this.SlideshowMode = false;    
}

