function windowSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return {width : myWidth, height: myHeight}
}

function getWindowWidth() {
	var size = windowSize();
	if (size.width > 800 )
		size.width = 800;
	if (size.width < 300 )
		size.width = 350;

	return size.width - 50;
}

function getWindowHeight() {
	var size = windowSize();
	if (size.height > 750 )
		size.height = 750;
	if (size.height < 300 )
		size.height = 350;
		
	return size.height - 50;
}

// Open Modal box. For example, openModalBox({url: this.href, title: this.title});
function openModalBox(params) {
	var mb_script = "Modalbox.show('" + params.url + "', {title: '" + params.title
					+ "', width: " + getWindowWidth() + ", height: " + getWindowHeight()
					+ ", overlayClose: true";
		mb_script += ", method: ";

	if (params.method)
		mb_script += "'" + params.method + "'";
	else
		mb_script += "'get'";

	if (params.afterHide)
		mb_script += ", afterHide: " +  params.afterHide + "";

	if (params.beforeHide)
		mb_script += ", beforeHide: " +  params.beforeHide + "";

	mb_script += " });"
	//alert(mb_script);						
	eval(mb_script);
}	

function ajxGetResidentInfos(  ) {
	params = 'ajxResident=getInfos';
	loadJSON( '/mein-konto', params, function(){ 
		if (req.readyState == 4 && req.status == 200) {
			q = ( eval('('+req.responseText+')') );
			$('hauspost_count').innerHTML = q['hauspost_count'];
			if( q['hauspost_count'] > 0 )
				$( 'hauspost_notify' ).show();
		}
	});
}

function watch( residentId, domicileId, roomId ) {
	params = 'watch=1&residentId=' + residentId;
	if( typeof(domicileId) != 'undefined' ) {
		params += '&domicileId='+domicileId;
	}
	if( typeof(roomId) != 'undefined' ) {
		params += '&roomId='+roomId;
	}
	loadJSON( '/mein-konto', params, function(){ parseWatchResults() });
}

function unwatch( residentId, domicileId, roomId ) {
	params = 'unwatch=1&residentId=' + residentId;
	if( typeof(domicileId) != 'undefined' ) {
		params += '&domicileId='+domicileId;
	}
	if( typeof(roomId) != 'undefined' ) {
		params += '&roomId='+roomId;
	}
	loadJSON( '/mein-konto', params, function(){ parseUnwatchResults() });
}

function parseWatchResults() {
	if (req.readyState == 4 && req.status == 200) {
		document.getElementById( 'notWatched' ).style.display='none';
		document.getElementById( 'watched' ).style.display='inline';
	}
}

function parseUnwatchResults() {
	if (req.readyState == 4 && req.status == 200) {
		document.getElementById( 'notWatched' ).style.display='inline';
		document.getElementById( 'watched' ).style.display='none';
	}
}


// mouseover for rating stars Tipps und Tricks
function sr( id, scale ) {
	document.getElementById( id ).style.backgroundPosition = ( (19 * scale) - 95 ) + 'px 0';
}

// mouseover for rating stars rooms
function srR( id, pos ) {
	document.getElementById( id ).style.backgroundPosition = ( pos-93 ) + 'px 0';
}

// rate room
function rateRoom( rating ) {
	params = 'rating=' + rating + '&room-rate=bewerten';
	loadJSON( window.location.href, params, function(){ parseRateResultsRoom() });
}

// rate tipp
function rateTipp( rating ) {
	params = 'rating=' + rating + '&tipp-rate=bewerten';
	loadJSON( window.location.href, params, function(){ parseRateResults() });
}


// parse JSON response for roomVoting
function parseRateResultsRoom() {
	if (req.readyState == 4 && req.status == 200) {
		q = ( eval('('+req.responseText+')') );


		s3 = document.getElementById( 's3'+q['id'] ); // currentNumVotes3 text
		s4 = document.getElementById( 's4'+q['id'] ); // currentNumVotes4 text
		s5 = document.getElementById( 's5'+q['id'] ); // currentNumVotes5 text
		se = document.getElementById( 'se'+q['id'] ); // currentScore text span
		m = document.getElementById( 'm'+q['id'] ); // ratingMessage
		r = document.getElementById( 'r'+q['id'] ); // mouseOver
			
			
		if(s3) {
			s3.innerHTML = '<center>'+q['rating3']+'</center>';
			s3.title = q['rating3'] + ' Stimmen';
		}
		if(s4) {
			s4.innerHTML = '<center>'+q['rating4']+'</center>';
			s4.title = q['rating4'] + ' Stimmen';
		}
		if(s5) {
			s5.innerHTML = '<center>'+q['rating5']+'</center>';
			s5.title = q['rating5'] + ' Stimmen';
		}
		if(se) {
			se.innerHTML = '(' + q['votes'] + ' Stimmen)';
		}
		if(m) m.style.display = 'block';
		if(r) r.style.display = 'none';
	}
}


// parse JSON response
function parseRateResults() {
	if (req.readyState == 4 && req.status == 200) {
		q = ( eval('('+req.responseText+')') );
		
		c = document.getElementById( 'c'+q['id'] ); // currentScore stars
		s = document.getElementById( 's'+q['id'] ); // currentScore text
		se = document.getElementById( 'se'+q['id'] ); // currentScore text span
		m = document.getElementById( 'm'+q['id'] ); // ratingMessage
		r = document.getElementById( 'r'+q['id'] ); // mouseOver
				
		if(c) c.style.width = 19 * Math.round(parseFloat(q['rating'])) + 'px';
		if(s) {
			s.innerHTML = q['rating'];
			s.title = q['votes'] + ' Stimmen';
		}
		if(se) {
			se.innerHTML = '(' + q['votes'] + ' Stimmen)';
		}
		if(m) m.style.display = 'block';
		if(r) r.style.display = 'none';
	}
}


// load JSON
function loadJSON( url, params, callback ) {
	if (window.ActiveXObject) { // ie
		try {
			req = new ActiveXObject( 'Msxml2.XMLHTTP' );
		} 
		catch (e) {
			try {
				req = new ActiveXObject( 'Microsoft.XMLHTTP' );
			} 
			catch (e) {}
		}
	}
	else if (window.XMLHttpRequest) { // moz
		req = new XMLHttpRequest();
		req.overrideMimeType( 'text/plain' );
	}
	req.onreadystatechange = callback;
	
	if( !req ) return false;
	req.open( 'POST', url, true );
	req.setRequestHeader( 'Content-type', 'application/x-www-form-urlencoded; charset=UTF-8' );
	req.setRequestHeader( 'Content-length', params.length );
	req.setRequestHeader( 'Connection', 'close' );
	req.send( params );
}


// ----------------------------------------------------------------------------
// class for creating sizeable textareas
function sizeableTextArea( elementId ) {
	var that = this;
	this.mouse = { 'x': 0, 'y': 0 };
	
	// load the text area and its height
	this.textArea = document.getElementById( elementId );
	var height = cookies[elementId+'Height'];
	this.textArea.style.height =  height ? height : '150px';
	
	// wrap the text area into another div just to be sure
	this.container = document.createElement( 'div' );
	this.textArea.parentNode.insertBefore( this.container, this.textArea );
	this.container.appendChild( this.textArea );
	
	// add the sizing-handle element
	this.handle = document.createElement( 'div' );
	this.handle.className = "textEditorSizer";
	this.container.appendChild( this.handle );
	
	// add the event handler to the sizing-handle
	this.handle.onmousedown = function( e ) { that.initSizing( e ); }
	
	// ------------------------------------------------------------------------
	// initialize sizing
	this.initSizing = function( e ) {
		e = e ? e : event; // IE workaround
		this.mouse = getMousePos( e );
		document.onmouseup = function() { that.endSizing(); }
		document.onmousemove = function( e ) { that.size( e ); }
	}	
	
	// ------------------------------------------------------------------------
	// release the sizing handle
	this.endSizing = function() {
		// save new height
		cookies.set(this.textArea.id + 'Height', this.textArea.style.height);
		document.onmousemove = null;
	}
	
	// ------------------------------------------------------------------------
	// handle mouse movement and update the size of the text area
	this.size = function( e ) {
		e = e ? e : event; // IE workaround
		var y = this.mouse.y
		this.mouse = getMousePos( e );
		
		var newHeight = parseInt(this.textArea.style.height) - (y - this.mouse.y);
		newHeight = newHeight < 14 ? 14 : newHeight;
		this.textArea.style.height = newHeight + "px";
		this.mouseY = e.clientY;
	}
}


// ----------------------------------------------------------------------------
// get current mouse position relative to the body-element
function getMousePos( event ) {
	if(event.pageX || event.pageY){
		return { 
			'x': event.pageX, 
			'y': event.pageY 
		};
	}
	return {
		'x': event.clientX + document.body.scrollLeft - document.body.clientLeft,
		'y': event.clientY + document.body.scrollTop  - document.body.clientTop
	};
}

// ----------------------------------------------------------------------------
// get current position of a html-node relative to the body-element
function findPos( obj ) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return {
		'left':curleft, 
		'top':curtop
	};
}


// ----------------------------------------------------------------------------
// manage cookies - a global "cookies" object will handle all cookie vars
var cookies = new function cookieManager() {
	var that = this;
	
	// load cookies on construction
	var pairs = document.cookie.split(/\s*;\s*/);
	for(var i=0;i < pairs.length;i++) {
		p = pairs[i].split(/\s*=\s*/);
		this[p.shift()] = p.join('=');
	}
	this.set = function( name, value ) {
		document.cookie = name + '=' + value + '; expires=Thu, 01-Jan-2070 00:00:01 GMT;';
	}
}



// ----------------------------------------------------------------------------
// Scrolling Divs
var fixedDivs= new Array();
var windowHeight = 0;
var scrollHeight = 0;
var scrollEvery = 30;
var checkEvery = 500;
var fixedDivMinY = 810;
function fixedDiv( elementId ) {
	var that = this;
	this.element = document.getElementById( elementId );

	this.originalHeight = this.element.offsetHeight;
	fixedDivs.push( this );
}

// Check if window size was changed, or the user scrolled
function checkFixedDivs() {
	var newHeight = document.documentElement.clientHeight;
	var newScroll = document.documentElement.scrollTop;
	if( windowHeight != newHeight || newScroll != scrollHeight ) {
		windowHeight = newHeight;
		scrollHeight = newScroll;
		window.setTimeout( scrollFixedDivs, checkEvery );
	}
	window.setTimeout( checkFixedDivs, checkEvery );
}
window.setTimeout( checkFixedDivs, checkEvery );

function scrollFixedDivs() {

	var newHeight = document.documentElement.clientHeight;
	var newScroll = document.documentElement.scrollTop;
	if (document.getElementById('page'))
		var pageHeight = document.getElementById('page').offsetHeight;
	else 
		var pageHeight = 800;
	var allOk = true;
	for( var i in fixedDivs ) {
		var e = fixedDivs[i];
		if( !e.element ) { continue; }
		var targetHeight = pageHeight - (newHeight + newScroll) + e.originalHeight;
		
		// get current height (try style.height first!)
		var currentHeight = parseInt( e.element.style.height );
		if( !currentHeight ) currentHeight = e.element.offsetHeight;
		
		// check for min Y
		if( targetHeight < e.originalHeight ) {
			targetHeight = e.originalHeight;
		}
		else if( pageHeight - targetHeight < fixedDivMinY ) {
			targetHeight = pageHeight - fixedDivMinY;
		} 
				
		if( targetHeight != currentHeight ) {
			allOk = false;
			
			var delta = (targetHeight - currentHeight) / 5;
			if( delta > 0 && delta < 1 ) 		delta = 1;
			else if( delta < 0 && delta > -1 ) 	delta = -1;

			e.element.style.height = Math.round(currentHeight + delta) + "px";
		}
	}
	
	// not all fixed Divs are at their targets -> repeat!
	if( !allOk ) {
		window.setTimeout( scrollFixedDivs, scrollEvery );
	}
}

// ----------------------------------------------------------------------------
// Show/Hide elements
function show( elementId ) {
	var e = document.getElementById( elementId );
	if( e ) e.style.display = 'block';
}
function hide( elementId ) {
	var e = document.getElementById( elementId );
	if( e ) e.style.display = 'none';
}


// Set hidden Sortorder Values for sortable elements
function setSortOrder( listId ) {
	if( !document.getElementById(listId) ) return true;
	var s = Sortable.serialize(listId);
	if( !s ) return true;
	
	var parts = s.split(/&/);
	for( var i = 0; i < parts.length; i++ ) {
		var kv = parts[i].split(/=/);
		var id = kv[1];
		
		inp = document.getElementById( 'sortOrder_' + id );
		if( !inp ) return true;
		inp.value = i;
	}
	return true;
}

function submit_tippPictureEdit() {
	var bname = document.getElementById('bildName')
	if ( bname.value.length < 3 ) {
		alert( 'Der Name fur den Raum muss mindenstens 3 Zeichen lang sein!' );
	}
	else {
		return true;
	}
	bname.focus();
	bname.style.backgroundColor='#FF4444';
	bname.style.color='White';
	bname.select();
	return false;
}

function submit_imageAdd( entityName ) {
	if (entityName != null && entityName !='') {
		if ( confirm( 'Soll das Bild automatisch ' + entityName + ' zugewiesen werden? Es ist nur im Raum zu sehen, wenn es ihm auch zugewiesen wurde.') ) {
			var add_image_to_entity = document.getElementById('add_image_to_entity');
			add_image_to_entity.value = "1";
		}
	}
	return true;
}

function submit_albumEdit(is_modalbox) {
	var aname = document.getElementById('albumName');
	var adescription = document.getElementById('albumDescription');
	if( aname.value == 'Mein Album' ) {
		alert( 'Bitte gib noch einen eigenen Namen fur diesen Album ein!' );
	}
	else if ( aname.value.length < 4 ) {
		alert( 'Der Name fur den Album muss mindenstens 4 Zeichen lang sein!' );
	}
	else {
		return true;
	}
	aname.focus();
	aname.style.backgroundColor='#FF4444';
	aname.style.color='White';
	aname.select();
	return false;
}

function submit_roomEdit() {
	var rdescription = document.getElementById('textAreaDescription');
	var rname = document.getElementById('roomName');
	var catid = document.getElementById('categoryId');
	var err = 0;
	if( rname.value == 'Mein Raum' ) {
		err = 1;
		alert( 'Bitte gib noch einen eigenen Namen fÃ¼r diesen Raum ein!' );
	}
	else if ( rname.value.length < 3 ) {
		err = 2;
		alert( 'Der Name fÃ¼r den Raum muss mindenstens 3 Zeichen lang sein!' );
	}
	else if ( catid.selectedIndex == 0 ) {
		err = 3;
		alert( 'Bitte eine Kategorie fÃ¼r den Raum auswÃ¤hlen!' );
	}
	else if ( rdescription.value.length < 3 ) {
		alert( 'Du hast noch keine Beschreibung fÃ¼r den Raum eingegeben. Wenn Du magst, kannst Du das jetzt nachholen! Der Raum und deine Eingaben werden aber auch ohne Beschreibung gespeichert.' );
		return true;
	}
	else {
		return true;
	}
	if(err == 1 || err == 2) {
		rname.focus();
		rname.style.backgroundColor='#FF4444';
		rname.style.color='White';
		rname.select();
	} else if (err == 3) {
		catid.focus();
		catid.style.backgroundColor='#FF4444';
		catid.style.color='White';
		catid.select();
	}
	return false;
}

function submit_domicileEdit() {
	var rdescription = document.getElementById('textAreaDescription');
	var dname = document.getElementById('domicileName')
	if( dname.value == 'Mein Domizil' ) {
		alert( 'Bitte gib noch einen eigenen Namen fur dieses Domizil ein!' );
	}
	else if ( dname.value.length < 3 ) {
		alert( 'Der Name fur das Domizil muss mindenstens 3 Zeichen lang sein!' );
	}
	else if ( rdescription.value.length < 3 ) {
		alert( 'Du hast noch keine Beschreibung fÃ¼r das Domizil eingegeben. Wenn Du magst, kannst Du das jetzt nachholen! Das Domizil und deine Eingaben werden aber auch ohne Beschreibung gespeichert.' );
		return true;
	}
	else {
		return true;
	}
	dname.focus();
	dname.style.backgroundColor='#FF4444';
	dname.style.color='White';
	dname.select();
	return false;
}

function submit_tippEdit() {
	var tname = document.getElementById('tippName')
	var tdescription = document.getElementById('textAreaDescription');
 	if( tname.value == 'Mein Tipp' ) {
		alert( 'Bitte gib noch einen eigenen Namen fur dieses Tipp ein!' );
		flag = 1; 
	}
	else if ( tname.value.length < 3 ) {
		alert( 'Der Name fÃ¼r den Tipp muss mindenstens 3 Zeichen lang sein!' );
		flag = 1; 
	} else if ( tdescription.value.length < 40 ) {
		alert( 'Der Beschreibung fÃ¼r den Tipp muss mindenstens 40 Zeichen lang sein!' );
		flag = 2;
	} else {
		return true;
	}
	if (flag == 1){
		tname.focus();
		tname.style.backgroundColor='#FF4444';
		tname.style.color='White';
		tname.select(); 
		tdescription.style.backgroundColor='#FFFFFF';
		tdescription.style.color='black';
	} else {
		tdescription.focus();
		tdescription.style.backgroundColor='#FF4444';
		tdescription.style.color='White';
		tdescription.select(); 
		tname.style.backgroundColor='#FFFFFF';
		tname.style.color='black';

	}
	return false;
}

function askHauspostDelete() {
	return confirm( 'Diese Hauspost wirklich lÃ¶schen?' );
}

function askRatingsDelete() {
	return confirm( 'Die Stimmen dieses Users wirklich lÃ¶schen?' );
}

/***********************************************
* Show Hint script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
		
var horizontal_offset="15px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="25px" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip;
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
dropmenuobj.oldOnMouseOut();
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox




/***************************************
Scroller Class
***************************************/

function $( idName ) { return document.getElementById( idName ); }

function scroller( instanceName, containerId, itemPrefix, buttonPrefix, numItems ) {
	this.containerId = containerId;
	this.itemPrefix = itemPrefix;
	this.buttonPrefix = buttonPrefix;
	this.numItems = numItems;
	this.currentItem = 1;
	this.scrollSpeed = 10;
	this.instanceName = instanceName;
	
	this.scrollerInterval = 0;
	this.autoScrollInterval = 0;
	
	this.prev = function() {
		this.setTarget( (this.currentItem > 1 ? this.currentItem - 1 : 1) );
	}	
	this.next = function() {
		this.setTarget( (this.currentItem < this.numItems ? this.currentItem + 1 : this.numItems) );
	}
	this.first = function() {
		this.setTarget( 1 );
	}
	this.end = function() {
		this.setTarget( this.numItems );
	}	
	this.nextContinuous = function() {
		this.setTarget( (this.currentItem < this.numItems ? this.currentItem + 1 : 1) );
	}
	this.prevContinuous = function() {
		this.setTarget( (this.currentItem > 1 ? this.currentItem - 1 : this.numItems) );
	}
	
	
	this.setTarget = function( targetNumber ) {
		this.currentItem = targetNumber;
		this.setStatus();
		
		var targetId = this.itemPrefix + targetNumber;
		var a = $( targetId );
		if( !a ) return;
		clearInterval( this.scrollerInterval );
		this.scrollerInterval = setInterval( this.instanceName + '.scrollTo('+a.offsetLeft+')', 10 );
		return false;
	}
	
	this.scrollTo = function( x ) {
		var box = $( this.containerId );
		if( !box ) return;
		
		i = box.innerWidth || box.clientWidth;
		w = box.scrollWidth;
		c = box.scrollLeft;
		n = c;
		
		if( x > c ) {
			if( w - x > i ) {
				n += Math.ceil( (x - c) / this.scrollSpeed )
			}
			else {
				n += Math.ceil( (x - c - (w - x)) / this.scrollSpeed )
			}
		} else {
			n = c + ( x - c ) / this.scrollSpeed;
		}
		box.scrollLeft = n;
		
		if( box.scrollLeft == x || Math.abs( box.scrollLeft - c ) < 1 ) {
			clearInterval( this.scrollerInterval );
		}
	}
	this.setStatus = function() {
		var left = this.currentItem > 1 ? true : false;
		var right = this.currentItem < this.numItems ? true : false;
		if( $( this.buttonPrefix + 'Begin') ) $( this.buttonPrefix + 'Begin').className = left ? "imageScrollAktiv" : "imageScrollInaktiv";
		if( $( this.buttonPrefix + 'Prev') ) $( this.buttonPrefix + 'Prev').className = left ? "imageScrollAktiv" : "imageScrollInaktiv";
		if( $( this.buttonPrefix + 'Next') ) $( this.buttonPrefix + 'Next').className = right ? "imageScrollAktiv" : "imageScrollInaktiv";
		if( $( this.buttonPrefix + 'End') ) $( this.buttonPrefix + 'End').className = right ? "imageScrollAktiv" : "imageScrollInaktiv";
	}

	this.setAuto = function( interval ) {
		clearInterval( this.autoScrollInterval );
		if( interval > 0 ) {
			this.autoScrollInterval = setInterval( this.instanceName + '.nextContinuous()', interval );
		}
	}
}
