function changePictureLang(id,pic)
{
	document.getElementById('topNav_'+id).src = 'img/language_'+id+'_'+pic+'.jpg';
}

function changePictureNav(id,pic)
{
	document.getElementById('Nav'+id).src = 'img/'+pic;
}

function bild(id) {

	popUp = window.open("bild.asp?ID="+id, "Bild", "toolbar=no,menubar=no,scrollbars=no,width=200,height=200,left=200,top=200");
	popUp.focus();
}

function bildSB(path) {

	popUp = window.open("bildSB.asp?ID="+path, "Bild", "toolbar=no,menubar=no,scrollbars=no,width=200,height=200,left=200,top=200");
	popUp.focus();
}

function bildvar(id) {

	popUp = window.open("bildvar.asp?ID="+id, "Bild", "toolbar=no,menubar=no,scrollbars=no,width=200,height=200,left=200,top=200");
	popUp.focus();
}

function openPic(picName)
	{
		popUp = window.open("inc/openPic.asp?name="+picName, "Bild", "toolbar=no,menubar=no,scrollbars=no,width=100,height=100,left=200,top=200");
		popUp.focus();
	}

function ValidateForm()
{
	var email=document.frmKontakt.email;
	var name=document.frmKontakt.name;
	var vorname=document.frmKontakt.vorname;
	var adresse=document.frmKontakt.adresse;
	var plz_ort=document.frmKontakt.plz_ort;
	var land=document.frmKontakt.land;
	var tel=document.frmKontakt.tel;
		
	if ((email.value==null)||(email.value==""))
	{
		alert("Geben Sie bitte eine gültige E-Mail Adresse ein!");
		email.focus();
		return false;
	}
	if (echeck(email.value)==false)
	{
		email.value="";
		email.focus();
		return false;
	}
	if ((name.value==null)||(name.value=="")||(vorname.value==null)||(vorname.value=="")||(adresse.value==null)||(adresse.value=="")||(plz_ort.value==null)||(plz_ort.value=="")||(land.value==null)||(land.value=="")||(tel.value==null)||(tel.value==""))
	{
		alert("Bitte füllen Sie alle Felder mit * aus!");
		return false;
	}
	return true;
}

function echeck(str) 
{
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	
	if (str.indexOf(at)==-1){
	   alert("Geben Sie bitte eine gültige E-Mail Adresse ein!");
	   return false;
	}
	
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Geben Sie bitte eine gültige E-Mail Adresse ein!");
	   return false;
	}
	
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    alert("Geben Sie bitte eine gültige E-Mail Adresse ein!");
	   return false;
	}
	
	 if (str.indexOf(at,(lat+1))!=-1){
	    alert("Geben Sie bitte eine gültige E-Mail Adresse ein!");
	   return false;
	 }
	
	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    alert("Geben Sie bitte eine gültige E-Mail Adresse ein!");
	   return false;
	 }
	
	 if (str.indexOf(dot,(lat+2))==-1){
	    alert("Geben Sie bitte eine gültige E-Mail Adresse ein!");
	   return false;
	 }
	
	 if (str.indexOf(" ")!=-1){
	    alert("Geben Sie bitte eine gültige E-Mail Adresse ein!");
	   return false;
	 }
	 return true;
}

function sendSearchForm()
{
	var searchString = document.search.sStr.value;
	if (searchString.indexOf("Suchen") < 1 && searchString.length > 0)
	{
		document.search.submit();
	}
}

function wopenSitemap(fileName)
{
	fenster1 = window.open(fileName, 'openWindow', 'width=875,height=500,left=100,top=200');
}

function wopenContact(fileName)
{
	fenster1 = window.open(fileName, 'openWindow', 'width=500,height=473,left=100,top=200');
}

function openPopUp(id)
{
	fenster1 = window.open('inc/popup.asp?ID='+id, 'openWindow', 'scrollbars=yes,width=500,height=600,left=100,top=200');
}

function openPublication()
{
	fenster1 = window.open('inc/publication.asp', 'openWindow', 'scrollbars=no,width=500,height=413,left=100,top=200');
}

function openSitzbank()
{
	fenster1 = window.open('sitzbank.asp?ID=71', 'openWindow', 'scrollbars=yes,width=1000,height=800,left=200,top=50');
}

function addProd(pId, vId)
{
	var left = ((screen.width - 300) / 2);
	var top = ((screen.height - 300) / 2);
	popUp = window.open('addProd.asp?pID='+pId+'&vID='+vId, 'openWindow', "toolbar=no,menubar=no,status=yes,scrollbars=no,width=300,height=300,left=" + parseInt(left) + ",top=" + parseInt(top));
	popUp.focus();
}