function fenster(url,breite,hoehe,options)
{
	posleft=screen.width/2-breite/2;
	postop=screen.height/2-hoehe/2-10;
	window.open(url,'_blank','width='+breite+',height='+hoehe+',left='+posleft+',top='+postop+','+options);
}

function checkContact()
{
	if (document.mail.field_name.value=="") 
		{alert("Bitte geben Sie ihren Namen an!");document.mail.field_name.focus();return false}
	if (document.mail.field_vorname.value=="") 
		{alert("Bitte geben Sie ihren Vornamen an!");document.mail.field_vorname.focus();return false}
	if (document.mail.field_tel.value=="") 
		{alert("Bitte geben Sie ihre Telefonnummer an!");document.mail.field_tel.focus();return false}
	if (document.mail.field_email.value=="") 
		{alert("Bitte geben Sie ihre E-Mail-Adresse an!");document.mail.field_email.focus();return false}
	if (document.mail.field_text.value=="") 
		{alert("Bitte formulieren Sie eine Anfrage!");document.mail.field_text.focus();return false}
	return true;
}

function checkEntry()
{
	if (document.data.name.value=="") 
		{alert("Bitte geben Sie einen Namen an!");document.data.name.focus();return false}
	if (document.data.firstname.value=="") 
		{alert("Bitte geben Sie einen Vornamen an!");document.data.firstname.focus();return false}
	if (document.data.street.value=="") 
		{alert("Bitte geben Sie eine Strasse an!");document.data.street.focus();return false}
	if (document.data.postcode.value=="") 
		{alert("Bitte geben Sie eine PLZ an!");document.data.postcode.focus();return false}
	if (document.data.city.value=="") 
		{alert("Bitte geben Sie einen Ort an!");document.data.city.focus();return false}
	if (document.data.email.value=="") 
		{alert("Bitte geben Sie eine E-Mail an!");document.data.email.focus();return false}
	if (document.data.state.selectedIndex==0) 
		{alert("Bitte wählen Sie ein Bundesland aus!");document.data.state.focus();return false}
	return true;
}
	   
function checkEntry2()
/*(document.data.paymode[0].checked)||(document.data.paymode[1].checked)|| */
{
/*	if (!(document.data.paymode.checked))
			{alert("Bitte wählen Sie eine Zahlungsart aus!");return false} */
/*	if ((document.data.paymode.checked)&&(document.data.reason.value==""))
			{alert("Bitte geben Sie eine Begründung an!");document.data.reason.focus();return false} */
	if (document.data.bankaccount.value=="")
			{alert("Bitte geben Sie eine Kontonummer an!");document.data.bankaccount.focus();return false}
	if (document.data.banknumber.value=="")
			{alert("Bitte geben Sie eine Bankleitzahl an!");document.data.banknumber.focus();return false}
	if (document.data.bankname.value=="")
			{alert("Bitte geben Sie einen Banknamen an!");document.data.bankname.focus();return false}
	if (document.data.bankowner.value=="")
			{alert("Bitte geben Sie einen Kontoinhaber an!");document.data.bankowner.focus();return false}
	if (!document.data.accept_debit.checked)
			{alert("Sie müssen der Lastschrift zustimmen!");return false}
	if (!document.data.accept.checked) 
		{alert("Sie müssen zunächst unseren AGBs zustimmen!");return false}
	return true;
}

function updateState(countryList,stateList,selectedEntry,all,empty)
{
	germany=new Array("Baden-Württemberg","Bayern","Berlin","Brandenburg","Bremen","Hessen","Hamburg","Mecklenburg-Vorpommern","Niedersachsen","Nordrhein-Westfalen","Rheinland-Pfalz","Saarland","Sachsen","Sachsen-Anhalt","Schleswig-Holstein","Thüringen");
	austria=new Array("Burgenland","Kärnten","Niederösterreich","Oberösterreich","Salzburg","Steiermark","Tirol","Vorarlberg","Wien");
	switzerland=new Array("Aargau","Appenzell-Ausserhoden","Appenzell-Innerhoden","Basel-Stadt","Basel-Landschaft","Bern","Freiburg","Genf","Glarus","Graubünden","Jura","Luzern","Neuenburg","Niderwalden","Oberwalden","Schwyz","Schaffhausen","Solothurn","St. Gallen","Tessin","Thurgau","Uri","Waadt","Wallis","Zug","Zürich");
	italy=new Array("Südtirol");
	
	switch (countryList.selectedIndex)
	{
		case 1: stateList.options.length=austria.length;
				for (i=0;i<austria.length;i++)
				{
					stateList.options[i].text=austria[i];
					if (selectedEntry==austria[i]) stateList.options[i].selected=true;
				}
				break;
		case 2: stateList.options.length=switzerland.length;
				for (i=0;i<switzerland.length;i++)
				{
					stateList.options[i].text=switzerland[i];
					if (selectedEntry==switzerland[i]) stateList.options[i].selected=true;
				}
				break;
		case 3: stateList.options.length=italy.length;
				for (i=0;i<italy.length;i++)
				{
					stateList.options[i].text=italy[i];
					if (selectedEntry==italy[i]) stateList.options[i].selected=true;
				}
				break;
		default:stateList.options.length=germany.length;
				for (i=0;i<germany.length;i++)
				{
					stateList.options[i].text=germany[i];
					if (selectedEntry==germany[i]) stateList.options[i].selected=true;
				}
				break;
	}
	if (all) 
	{
		stateList.options.length++;
		for (i=stateList.options.length-1;i>0;i--)
		{
			stateList.options[i].value=stateList.options[i-1].value;
			stateList.options[i].text=stateList.options[i-1].text;
			stateList.options[i].selected=stateList.options[i-1].selected;
		}
		stateList.options[0].value="%";
		stateList.options[0].text="alle";
		if (selectedEntry=="") stateList.options[0].selected=true;
	}
	if (empty) 
	{
		stateList.options.length++;
		for (i=stateList.options.length-1;i>0;i--)
		{
			stateList.options[i].value=stateList.options[i-1].value;
			stateList.options[i].text=stateList.options[i-1].text;
			stateList.options[i].selected=stateList.options[i-1].selected;
		}
		stateList.options[0].value="";
		stateList.options[0].text="[Bitte wählen]";
		if (selectedEntry=="") stateList.options[0].selected=true;
	}				
	/*else
	{
		stateList.options.length++;
		for (i=stateList.options.length-1;i>0;i--)
		{
			stateList.options[i].value=stateList.options[i-1].value;
			stateList.options[i].text=stateList.options[i-1].text;
			stateList.options[i].selected=stateList.options[i-1].selected;
		}
		stateList.options[0].value="";
		stateList.options[0].text="ohne";
		stateList.options[0].selected=true;
	}*/
}
