function win(url,name,w,h,scroll){
var popup;
popup = window.open(url,name,"width="+w+",height="+h+",scrollbars="+scroll+",screenX=0,screenY=0,resizable=yes");
popup.moveTo((screen.width-450)/2,(screen.height-550)/3);
popup.window.focus();
}

function winpr(url){
var popup;
popup = window.open(url,"Drucken","locationbar=yes,menubar=yes,width=550,height=450,scrollbars=yes,screenX=0,screenY=0,resizable=yes");
popup.moveTo((screen.width-450)/2,(screen.height-550)/3);
popup.window.focus();
}


function rechnen(){


	if(((document.mond.lieferung.value=='1')||(document.mond.lieferung.value=='0'))&&(document.mond.land.value=='DE')){
	
		document.mond.zahlart[1].disabled = true;
		document.mond.zahlart[2].disabled = true;
		document.mond.zahlart[3].disabled = true;
		document.mond.konto.disabled = true;
		document.mond.blz.disabled = true;
		document.mond.bank.disabled = true;
		document.mond.kontoinhaber_vorname.disabled = true;
		document.mond.kontoinhaber_nachname.disabled = true;
		document.getElementById('id1').style.visibility="hidden";
		document.getElementById('id2').style.visibility="hidden";
		document.getElementById('id3').style.visibility="hidden";
		document.getElementById('id4').style.visibility="hidden";
		document.getElementById('id5').style.visibility="hidden";
		document.mond.zahlart[0].checked = true;
		alert("Zu Ihrer Information:\nBei Expresslieferung ist die Bezahlung nur per Kreditkarte oder PayPal möglich!");	
	
	} else {
	
		document.mond.zahlart[1].disabled = false;
		document.mond.zahlart[2].disabled = false;
		document.mond.zahlart[3].disabled = false;
		document.mond.konto.disabled = false;
		document.mond.blz.disabled = false;
		document.mond.bank.disabled = false;
		document.mond.kontoinhaber_vorname.disabled = false;
		document.mond.kontoinhaber_nachname.disabled = false;
		document.getElementById('id1').style.visibility="visible";
		document.getElementById('id2').style.visibility="visible";
		document.getElementById('id3').style.visibility="visible";
		document.getElementById('id4').style.visibility="visible";
		document.getElementById('id5').style.visibility="visible";
		
		if(document.mond.land.value!='DE'){
			document.mond.lieferung.value = 3;
		}
	
	}
	

	 if(((document.mond.lieferung.value=='1')||(document.mond.lieferung.value=='0'))&&(document.mond.land.value!='DE')){
		alert("Die Expresslieferung ist leider nur innerhalb Deutschlands möglich!");
		document.mond.lieferung.value="2";
	}
	
	 if(((document.mond.lieferung.value=='1')||(document.mond.lieferung.value=='2')||(document.mond.lieferung.value=='0'))&&(document.mond.land.value!='DE')){
		alert("Bitte waehlen Sie den Versand fuer ausserhalb Deutschlands!");
		document.mond.lieferung.value="3";
	}
	

	 
}

function rechnen0(){
	 if(document.mond.land.value!='DE'){
		document.mond.zahlart[3].checked = false;
		document.mond.zahlart[1].checked = false;
		document.mond.zahlart[3].disabled = true;
		document.mond.zahlart[1].disabled = true;
		document.getElementById('id1').style.visibility="hidden";
		document.getElementById('id2').style.visibility="hidden";
		document.getElementById('id3').style.visibility="hidden";
		document.getElementById('id4').style.visibility="hidden";
		document.getElementById('id5').style.visibility="hidden";
		
		document.mond.lieferung.value = 3;

		//document.mond.lieferung.disabled = true;
	} else {
		//document.mond.lieferung.value="2";
		document.mond.zahlart[3].checked = false;
		document.mond.zahlart[1].checked = false;
		document.mond.zahlart[3].disabled = false;
		document.mond.zahlart[1].disabled = false;
		document.getElementById('id1').style.visibility="visible";
		document.getElementById('id2').style.visibility="visible";
		document.getElementById('id3').style.visibility="visible";
		document.getElementById('id4').style.visibility="visible";
		document.getElementById('id5').style.visibility="visible";
	}
	
	if(document.mond.land.value=='CH'){
		document.getElementById('div1').style.visibility="visible";
		document.mond.lieferung.color="#999999";
		document.mond.lieferung.disabled = true;
	} else {
		document.getElementById('div1').style.visibility="hidden";
		//document.mond.lieferung.disabled = false;
	}
	
	if(document.mond.lieferung.value=='1'){
		document.getElementById('id6').style.visibility="hidden";
		document.getElementById('id7').style.visibility="hidden";
	} else {
		document.getElementById('id6').style.visibility="visible";
		document.getElementById('id7').style.visibility="visible";
	}
	
}



function rechnen1(){



	 if((document.mond.land.value!='DE')||(document.mond.lieferung.value=='3')||(document.mond.lieferung.value=='7')){
		//document.mond.lieferung.value ="3";
		document.mond.zahlart[3].checked = false;
		document.mond.zahlart[1].checked = false;
		//document.mond.zahlart[2].checked = false;
		document.mond.zahlart[3].disabled = true;
		document.mond.zahlart[1].disabled = true;
		//document.mond.zahlart[2].disabled = true;
		document.getElementById('id1').style.visibility="hidden";
		document.getElementById('id2').style.visibility="hidden";
		document.getElementById('id3').style.visibility="hidden";
		document.getElementById('id4').style.visibility="hidden";
		document.getElementById('id5').style.visibility="hidden";
		
		if(document.mond.rahmen.checked==true || document.mond.rahmen3f2.checked==true){
		
			if(document.mond.land.value=='CH'){
		 		document.mond.lieferung.value = 6;
			} else {
				if(document.mond.land.value!='DE'){
					document.mond.lieferung.value = 5;
				}
			}
		} else {
		//alert(document.mond.lieferung.value);
		//document.mond.lieferung.value = 1;
		}
		//document.mond.lieferung.disabled = true;
	} else {
	
		if(document.mond.lieferung.value=='2'){ //NN
			document.mond.zahlart[0].disabled = true;
			document.mond.zahlart[1].disabled = true;
			document.mond.zahlart[2].disabled = true;
			document.mond.zahlart[3].checked = true;
			document.mond.zahlart[4].disabled = true;
		} else {
	
		//document.mond.lieferung.value="2";
		document.mond.zahlart[3].checked = false;
		document.mond.zahlart[1].checked = false;
		//document.mond.zahlart[2].checked = false;
			document.mond.zahlart[0].disabled = false;
			document.mond.zahlart[1].disabled = false;
			document.mond.zahlart[2].disabled = false;
			document.mond.zahlart[3].disabled = false;
			document.mond.zahlart[4].disabled = false;
		//document.mond.zahlart[2].disabled = false;
		document.getElementById('id1').style.visibility="visible";
		document.getElementById('id2').style.visibility="visible";
		document.getElementById('id3').style.visibility="visible";
		document.getElementById('id4').style.visibility="visible";
		document.getElementById('id5').style.visibility="visible";
		}
	}
	

	
	// if(document.mond.land.value=='CH'){
	// 	document.getElementById('div1').style.visibility="visible";
	// 	document.mond.lieferung.color="#999999";
	// 	document.mond.lieferung.disabled = true;
	// } else {
	// 	document.getElementById('div1').style.visibility="hidden";
	// 	document.mond.lieferung.disabled = false;
	// }
	
	
}


// Bestellformular
function CountDown(target){
	while (target.value.length > 0 && target.value.substring(0,1) == " ")
		target.value = target.value.substring(1,target.value.length);
	
		if (target.value.length > 350 )
			target.value = target.value.substring(0,350);
		
		CharsLeft = 350 - target.value.length;
		document.mond.intFree.value = CharsLeft;
}

// Bestellformular
function CountDown2(target){
	while (target.value.length > 0 && target.value.substring(0,1) == " ")
		target.value = target.value.substring(1,target.value.length);
	
		if (target.value.length > 350 )
			target.value = target.value.substring(0,350);
		
		CharsLeft = 350 - target.value.length;
		document.mond.intFree2.value = CharsLeft;
}

// Bestellformular
function CountDown3(target){
	while (target.value.length > 0 && target.value.substring(0,1) == " ")
		target.value = target.value.substring(1,target.value.length);
	
		if (target.value.length > 350 )
			target.value = target.value.substring(0,350);
		
		CharsLeft = 350 - target.value.length;
		document.mond.intFree3.value = CharsLeft;
}

// Bestellformular
function CountDown4(target){
	while (target.value.length > 0 && target.value.substring(0,1) == " ")
		target.value = target.value.substring(1,target.value.length);
	
		if (target.value.length > 350 )
			target.value = target.value.substring(0,350);
		
		CharsLeft = 350 - target.value.length;
		document.mond.intFree4.value = CharsLeft;
}

