/**
 * @author Horst
 */

function getGruppe() {
	if (document.Formular.beruf[0].checked == true) return "1";
	if (document.Formular.beruf[1].checked == true) return "2";
	if (document.Formular.beruf[2].checked == true) return "3";
	if (document.Formular.beruf[3].checked == true) return "5";
	if (document.Formular.beruf[4].checked == true) return "2";
	if (document.Formular.beruf[5].checked == true) return "2";
	if (document.Formular.beruf[6].checked == true) return "4";
	if (document.Formular.beruf[0].checked == true) return "6";
	return "";
}


function newNewsletter() {
	var vals = {"p": "subscribe",
				"htmlemail": "1",
				"list[2]" : "signup",
				"listname[2]" : "Schiedel Newsletter",
				"VerificationCodeX" : "",
				"subscribe" : "Newsletter anmelden",
				"email": document.Formular.email.value, 
				"attribute1": document.Formular.anrede.value,
				"attribute2": document.Formular.vorname.value,
				"attribute3": document.Formular.nachname.value,
				"attribute4": getGruppe(),
				"attribute5": document.Formular.firma.value,
				"attribute6": document.Formular.strasse.value,
				"attribute7": document.Formular.ort.value,
				"attribute8": document.Formular.plz.value,
				"attribute9": document.Formular.land.value,
				"attribute10": document.Formular.telefon.value,
				"attribute11": document.Formular.herkunftsseite.value};
				
	dojo.xhrPost({
		url: "/newsletter/index.php",
		 load: function(response, ioArgs){
//			alert(response);
        },
        error: function(response, ioArgs) {
                alert(response);
        },
		content : vals,
		sync : true		
		});
}

