function ImageNumber(newnumber)
{
	var last = document.getElementById('LastimageNumber').value;
	last++;
	newnumber++;
	document.getElementById('info').firstChild.data = newnumber + ' von ' + last;
	
	if(newnumber == 1)
	{
		setTimeout("SlidePause()",2500);
	}
}
function SlidePause()
{
	document.slideshow.SetVariable('command','Slideshow_Pause');
}
function breakout_of_frame()
{
	if (top.location != location) {
		top.location.href = document.location.href;
	}
}
function updatecaptchapic()
{
	hamti = new Image ( ); 
	var Jetzt = new Date();
	var Sekunden = Jetzt.getSeconds();
	hamti.src = "rechen-captcha.php?update=" + Sekunden; 
	
	document.getElementById ( 'captchapic' ).src = hamti.src; 
}

function print_page()
{
	a = window.open('','','width=575,height=450,scrollbars=yes');
	window.setTimeout("a.close()",1);
	a.document.open("text/html");
	a.document.write("<html><head>");
	a.document.write("<title>Druckversion: " + document.getElementById('titletag').value + "</title>");
	a.document.write("<style type=\"text/css\">");
	a.document.write("<!--");
	a.document.write("@import url(\"styles/mainprint.css\");");
	a.document.write("-->");
	a.document.write(".contentimage");
	a.document.write("{");
	a.document.write("max-width: 534px;");
	a.document.write("width:expression(this.width > 534 ? \"534px\" : true);");
	a.document.write("}");
	a.document.write("</style>");
	a.document.write("</head><body>");
	a.document.write("<div ID=\"content\" NAME=\"content\">");
	a.document.write(document.getElementById('content').innerHTML);
	a.document.write("</div>");
	a.document.write("</body></html>");
	a.print();
	a.document.close();
}

function cal_termin()
{
	document.getElementById('termincal').style.display = 'block';
	document.getElementById('wettcal').style.display = 'none';
	document.getElementById('vermietungcal').style.display = 'none';
	document.getElementById('wettcallink').style.backgroundColor = '#DEDEDE';
	document.getElementById('wettcallink').style.borderBottom = 'solid 1px #777777';
	document.getElementById('vermietungcallink').style.backgroundColor = '#DEDEDE';
	document.getElementById('vermietungcallink').style.borderBottom = 'solid 1px #777777';
	document.getElementById('termincallink').style.backgroundColor = '#E8E8E8';
	document.getElementById('termincallink').style.borderBottom = 'solid 0px #777777';
}

function cal_wett()
{
	document.getElementById('termincal').style.display = 'none';
	document.getElementById('wettcal').style.display = 'block';
	document.getElementById('vermietungcal').style.display = 'none';
	document.getElementById('termincallink').style.backgroundColor = '#DEDEDE';
	document.getElementById('termincallink').style.borderBottom = 'solid 1px #777777';
	document.getElementById('vermietungcallink').style.backgroundColor = '#DEDEDE';
	document.getElementById('vermietungcallink').style.borderBottom = 'solid 1px #777777';
	document.getElementById('wettcallink').style.backgroundColor = '#E8E8E8';
	document.getElementById('wettcallink').style.borderBottom = 'solid 0px #777777';
}

function cal_vermietung()
{
	document.getElementById('termincal').style.display = 'none';
	document.getElementById('wettcal').style.display = 'none';
	document.getElementById('vermietungcal').style.display = 'block';
	document.getElementById('termincallink').style.backgroundColor = '#DEDEDE';
	document.getElementById('termincallink').style.borderBottom = 'solid 1px #777777';
	document.getElementById('wettcallink').style.backgroundColor = '#DEDEDE';
	document.getElementById('wettcallink').style.borderBottom = 'solid 1px #777777';
	document.getElementById('vermietungcallink').style.backgroundColor = '#E8E8E8';
	document.getElementById('vermietungcallink').style.borderBottom = 'solid 0px #777777';
}

function ZeitAnzeigen ()
{
	var Wochentagname = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch","Donnerstag", "Freitag", "Samstag");
	var Jetzt = new Date();
	var Tag = Jetzt.getDate();
	var Monat = Jetzt.getMonth() + 1;
	var Jahr = Jetzt.getYear();
	if (Jahr < 999)
		Jahr += 1900;
	var Stunden = Jetzt.getHours();
	var Minuten = Jetzt.getMinutes();
	var Sekunden = Jetzt.getSeconds();
	var WoTag = Jetzt.getDay();
	var Vortag = (Tag < 10) ? "0" : "";
	var Vormon = (Monat < 10) ? ".0" : ".";
	var Vorstd = (Stunden < 10) ? "0" : "";
	var Vormin = (Minuten < 10) ? ":0" : ":";
	var Vorsek = (Sekunden < 10) ? ":0" : ":";
	var Datum = Vortag + Tag + Vormon + Monat + "." + Jahr;
	var Uhrzeit = Vorstd + Stunden + Vormin + Minuten + Vorsek + Sekunden;
	var Gesamt = " " + Wochentagname[WoTag] + ", "  + Datum + " - " + Uhrzeit;
	
	if (DHTML) {
		if (NS4) {
			setContent("id", "Uhr", null, '<span class="Uhr">' + Gesamt + "<\/span>");
		} else {
			setContent("id", "Uhr", null, Gesamt);
		}
		window.setTimeout("ZeitAnzeigen()", 1000);
	}
}

/* Modified to support Opera */
function bookmarksite(title,url)
{
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
}

/*
Form field Limiter script- By Dynamic Drive
For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
This credit MUST stay intact for use
*/

var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder)
{
	if (window.event&&event.srcElement.value.length>=maxlength)
		return false
	else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
		var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
		if (pressedkey.test(String.fromCharCode(e.which)))
		e.stopPropagation()
	}
}

function countlimit(maxlength,e,placeholder)
{
	var theform=eval(placeholder)
	var lengthleft=maxlength-theform.value.length
	var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
	if (window.event||e.target&&e.target==eval(placeholder)){
		if (lengthleft<0)
			theform.value=theform.value.substring(0,maxlength)
		placeholderobj.innerHTML=lengthleft
	}
}

function displaylimit(thename, theid, thelimit)
{
	var theform=theid!=""? document.getElementById(theid) : thename
	var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> Zeichen verbleibend.'
	if (document.all||ns6)
		document.write(limit_text)
	if (document.all){
		eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
		eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
	}
	else if (ns6){
		document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
		document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
	}
}


function addsmiley(smiley)
{
	document.sampleform.text.value=document.sampleform.text.value+' '+smiley+' ';
	document.sampleform.text.focus();
}


var timer_id;
function scroll_iframe(frm,inc,dir) {
  if (timer_id) clearTimeout(timer_id);
  if (window.frames[frm]) {
    if (dir == "v") window.frames[frm].scrollBy(0, inc);
    else window.frames[frm].scrollBy(inc, 0);
    timer_id = setTimeout("scroll_iframe('" + frm + "'," + inc + ",'" + dir + "')", 20);
  }
}

function stopScroll()
{
	if (timer_id) clearTimeout(timer_id); 
}


function printinlay()
{
	window.parent.mitte.focus();
	window.print();
}


function anzeigen(das)
{ 
	if(document.getElementById(das).style.display=='none') 
		
		document.getElementById(das).style.display='block'; 
 	else
		
		document.getElementById(das).style.display='none';
	
} 


function my_onkeydown_handler()
{
	switch (event.keyCode)
	{
		case 80 : // 'P'
			if (event.ctrlKey) // Ctrl-P
			{
	    			event.keyCode = 0;
	    		    	event.returnValue = false;  //BRJ: Cancel default browser action: open print dialog
				print_page();
			}
			break;
	
	}
}
document.attachEvent("onkeydown", my_onkeydown_handler);


var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus();}

