function newBlankWindow(url,hoehe,breite)
	{
	var win;
	var rand = parseInt(Math.random()*100);
	var name = "Fenster_"+rand;
	var top = (screen.height-hoehe)/2;
	var left = (screen.width-breite)/2;
	var specials = "dependent=yes,location=no,scrollbars=no,toolbar=no,status=yes,menubar=no,resize=no";
	var arguments = "height=" + hoehe + ",width=" + breite + ",left=" + left + ",top=" + top + "," + specials;	
	
	win = window.open(url,name,arguments);
	win.focus();	
	}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


  function startSearch()
	{
	error = "Bitte geben Sie einen Suchbegriff ein.";
	f = document.we_global_form;
	if(f.we_lv_search_0.value=='')
		{
		alert(error);
		f.we_lv_search_0.focus();
		return;		
		}
	f.submit();
	}



function getNav(nr,li,ig)
{
 document.getElementById(nr).style.background="#FBFCFA";
 //document.getElementById(li).style.fontWeight="bold";
 document.getElementById(ig).src="/i/navpoint.gif";
}

function wegNav(nr,li,ig)
{
 document.getElementById(nr).style.background="";
  //document.getElementById(li).style.fontWeight="normal";
  document.getElementById(ig).src="/i/l.gif";
}

function doLink(link)
{
 document.location.href=link;
}

function scroller()
{
	x = document.body.scrollLeft;
	y = document.body.scrollTop;
	step = 2;

	while ((x != 0) || (y != 0)) {
		scroll (x, y);
		step += (step * step / 100);
		x -= step;
		y -= step;
		if (x < 0) x = 0;
		if (y < 0) y = 0;
	} 
	scroll (0, 0);
}

function checkform()
	{
	var name = document.kontaktform.name
	var mail = document.kontaktform.email;
	var nachricht = document.kontaktform.nachricht;
	var betreff = document.kontaktform.betreff;

	if(name.value=="")
		{
		alert("Bitte geben Sie Ihren Namen an.");
		name.focus();
		return;
		}

	if(mail.value=="")
		{
		alert("Bitte geben Sie Ihre Emailadresse an,\ndamit wir mit Ihnen Kontakt aufnehmen können");
		mail.focus();
		return;
		}
	
	affe = false;
	punkt = false;
	
	for(i=0;i<=mail.value.length;i++)
		{
		if(mail.value.charAt(i)==".")
			punkt = true;
		if(mail.value.charAt(i)=="@")
			affe = true;
		}
	
	if(mail.value.length<7 || !affe || !punkt)
		{
		alert("Diese Email-Adresse scheint nicht korrekt zu sein.\nBitte überprüfen Sie diese nochmals.")
		mail.focus();
		mail.select();
		return;
		}
	
	if(nachricht.value=="")
		{
		alert("Keine Nachricht zum übermitteln");
		nachricht.focus();
		return;
		}
		
	if(betreff.value=="")
		{
		alert("Bitte geben Sie der Nachricht einen Kurzen Betreff");
		betreff.focus();
		return;
		}	
	
	
	// Wenn alles OK
	document.kontaktform.submit();	
	
	}


function changeGalleryImage(rang,name)
	{
	document.getElementById('legende'+document.gallery.actualbildname.value).style.visibility= 'hidden';
         document.getElementById('legende'+document.gallery.actualbildname.value).style.display = 'none';	
             
document.getElementById('legende'+name).style.visibility= 'visible';
document.getElementById('legende'+name).style.display = 'block';

	document.gallery.actualbildname.value=name;
	bild = document.images['vorschau'];
	document.gallery.bild_id.value = rang;
	bild.src = "/gallery/images/th_"+name+".jpg";       
	}

function changeGalleryImage2(rang,name)
	{
	document.gallery.actualbildname.value=name;
	bild = document.images['vorschau'];
	document.gallery.bild_id.value = rang;
	bild.src = "/gallery/images/th_"+name+".jpg";       
	}

function showNextPic()
{


document.gallery.bild_id.value=document.gallery.bild_id.value;
var actual=parseInt(document.gallery.bild_id.value);
actual=actual+1;
if(actual>parseInt(document.gallery.anzahlpics.value))actual=1;
document.gallery.bild_id.value=actual;
document.gallery.actualbildname.value=picnames=document.getElementById("picnames"+actual).value;
bild = document.images['vorschau'];

bild.src = "/gallery/images/th_"+document.gallery.actualbildname.value+".jpg";       
}


function showBackPic()
{
document.gallery.bild_id.value=document.gallery.bild_id.value;
var actual=parseInt(document.gallery.bild_id.value);
actual=actual-1;
if(actual==0)actual=document.gallery.anzahlpics.value;
document.gallery.bild_id.value=actual;
document.gallery.actualbildname.value=picnames=document.getElementById("picnames"+actual).value;
bild = document.images['vorschau'];

bild.src = "/gallery/images/th_"+document.gallery.actualbildname.value+".jpg";       
}


function gallery()
	{
	gallerie = document.gallery.gallery_id.value;
	bild = document.gallery.bild_id.value;
	lang = document.gallery.sprache.value;
	pfad = "/gallery/index.php?gid=" + gallerie + "&nr=" + bild + "&lang=" + lang;
	width = 602;
	height= 535;
	links  = (screen.width-width)/2;
	oben  = (screen.height-height)/2;
	gal = window.open(pfad,"Fotogalerie","width="+width+",height="+height+",left="+links+",top="+oben);
	gal.focus();	
	}


function gallery2(nr)
	{
	gallerie = document.gallery.gallery_id.value;
	bild = document.gallery.bild_id.value;
	lang = document.gallery.sprache.value;
	pfad = "/gallery/index.php?gid=" + gallerie + "&nr=" + bild + "&nr="+nr+"&lang=" + lang;
	width = 602;
	height= 535;
	links  = (screen.width-width)/2;
	oben  = (screen.height-height)/2;
	gal = window.open(pfad,"Fotogalerie","width="+width+",height="+height+",left="+links+",top="+oben);
	gal.focus();	
	}


function changeVis(nr)
	{
	obj = document.getElementById("antwort_"+nr);
	if(obj.style.display == 'none')
		obj.style.display = 'block';
	else
		obj.style.display = 'none';
	}