function switchPic(immoid, pos, titel){
	actPic = pos;
	var url='/kimmobilien/showImage/'+immoid+'/'+actPic+'/440/';
	document.getElementById('titelbild').src=url;
	//document.getElementById('erstesbildUnterschrift').innerHTML=titel;
	document.getElementById('picCounter').innerHTML = '('+actPic+' / '+anzahl+')';
}

function startExposeSlideshow(immoid, anzahl){
	slideshowTimer = setInterval('nextExposePic('+immoid+','+anzahl+')',4000); 
	document.getElementById('slideshowNav').innerHTML = '<a class="whitelink" href="javascript:stopExposeSlideshow('+immoid+','+anzahl+')">'+stopText+'</a>'; 
}

function stopExposeSlideshow(immoid, anzahl){
	clearInterval(slideshowTimer); 
	document.getElementById('slideshowNav').innerHTML = '<a class="whitelink" href="javascript:startExposeSlideshow('+immoid+','+anzahl+')">'+startText+'</a>'; 
}

function prevExposePic(immoid, anzahl){
   if (actPic == 1) 
   	actPic = anzahl;
   else 
      actPic = actPic-1;
	var url='/kimmobilien/showImage/'+immoid+'/'+actPic+'/440/';
	document.getElementById('titelbild').src=url;
	document.getElementById('picCounter').innerHTML = '('+actPic+' / '+anzahl+')';
}

function nextExposePic(immoid, anzahl){
   if (actPic == anzahl) 
   	actPic = 1;
   else 
      actPic = actPic+1;
	var url='/kimmobilien/showImage/'+immoid+'/'+actPic+'/440/';
	document.getElementById('titelbild').src=url;
	document.getElementById('picCounter').innerHTML = '('+actPic+' / '+anzahl+')';
}

function Popup(url){
	F = window.open(url,"popup","width=650,height=650, left=0, top=0, scrollbars=yes, resizable=yes");
}

function laufzeileneffect() {
	if(document.getElementById("laufzeile").style.display == "none") {
		new Effect.Appear(document.getElementById("laufzeile"), {duration: 3});
	} else { 
		new Effect.Fade(document.getElementById("laufzeile"), {duration: 3});
	}
	window.setTimeout("laufzeileneffect()",5000);;
}

function openIfClosed(id) {
	if(document.getElementById(id).style.display == "none")
		new Effect.BlindDown(document.getElementById(id));
}

function switchInfo(divid) {
	if(document.getElementById(divid).style.display == "none") {
		new Effect.BlindDown(document.getElementById(divid));
		
	} else { 
		new Effect.BlindUp(document.getElementById(divid));
	}
}

function disable(o) {
	o.disabled=true;
}

function label(o,text) {
	o.value=text;
}

function immoartchange() {
	if (document.getElementById('objektinfo_art').selectedIndex == 5) {
		document.getElementById('objektinfo_sonstiges').disabled=false;
	} else {
		document.getElementById('objektinfo_sonstiges').disabled=true;
		document.getElementById('objektinfo_sonstiges').value="";
	}
}

function uhrzeit() {
	var zeit = new Date();
	var Uhrzeit;

	Uhrzeit = " "
	
	if(zeit.getDate() < 10) {
		Uhrzeit=Uhrzeit + "0" + zeit.getDate() + ".";
	}
	else {
		Uhrzeit=Uhrzeit + zeit.getDate() + ".";
	}	
	
	if((zeit.getMonth()+1) < 10) {
		Uhrzeit=Uhrzeit + "0" + (zeit.getMonth()+1) + ".";
	}
	else {
		Uhrzeit=Uhrzeit + (zeit.getMonth()+1) + ".";
	}	
	
	Uhrzeit = Uhrzeit + zeit.getFullYear() + " - ";
	
	
	if(zeit.getHours() < 10) {
		Uhrzeit=Uhrzeit + " 0" + zeit.getHours() + ":";
	}
	else {
		Uhrzeit=Uhrzeit + " " + zeit.getHours() + ":";
	}

	if(zeit.getMinutes() < 10) {
		Uhrzeit=Uhrzeit + "0" + zeit.getMinutes() + ":";
	}
	else {
		Uhrzeit=Uhrzeit + zeit.getMinutes() + ":";
	}

	if(zeit.getSeconds() < 10) {
		Uhrzeit=Uhrzeit + "0" + zeit.getSeconds();
	}
	else {
		Uhrzeit=Uhrzeit + zeit.getSeconds();
	}
	
	 document.getElementById('zeit').innerHTML = Uhrzeit;

	window.setTimeout("uhrzeit()",1000);
}
