﻿function verifInscription()
{
	message = new Array();
	
	salVal = document.getElementById('sal').value;
	firstnameVal = document.getElementById('firstname').value;
	lastnameVal = document.getElementById('lastname').value;
	companyVal = document.getElementById('company').value;
	industryVal = document.getElementById('industry').value;
	fonctionVal = document.getElementById('fonction').value;
	fonctionVal = document.getElementById('fonction').value;
	addressVal = document.getElementById('address').value;
	plzVal = document.getElementById('plz').value;
	ortVal = document.getElementById('ort').value;
	refVal = document.getElementById('Referral').value;
	emailVal = document.getElementById('Email').value;
	phoneVal = document.getElementById('phone').value;
	


	
	
	if(salVal == '')
		message.push('- " Anrede " ist gefordert.');
		
	if(firstnameVal == '')
		message.push('- " Vorname " ist gefordert.');
	
	if(lastnameVal == '')
		message.push('- " Name " ist gefordert.');
	

	
	if(companyVal == '')
		message.push('- " Firma " ist gefordert.');
		
	if(industryVal == '')
		message.push('- " Abteilung " ist gefordert.');
	
	if(fonctionVal == '')
		message.push('- " Funktion " ist gefordert.');
	
	if(addressVal == '')
		message.push('- " Adresse " ist gefordert.');
		
	if(plzVal == '')
		message.push('- " PLZ " ist gefordert.');
		
		
	
if(ortVal == '')
		message.push('- " ort " ist gefordert.');
			
if(refVal == '')
		message.push('- " Partner " ist gefordert.');
		
if(emailVal == '')
		message.push('- " E-Mail-Adresse " ist gefordert.');
		
else
	{
		modele = /^.+@.+\..+$/;
		if(!modele.test(emailVal))
			message.push("- Dieses Feld muss eine e-mail Adresse enthalten.");
	}
		
		
if(phoneVal == '')
		message.push('- " Telefonnummer " ist gefordert.');
	
	if(message.length != 0)
	{
		alerte = 'Bitte füllen Sie alle Pflichtfelder aus.';
		for(i in message)
			alerte += "\n" + message[i];
			
		alert(alerte);
	}
	else
		document.getElementById('formInscription').submit();
}



function sendFriend()
{
	message = new Array();
	


	lastnameVal = document.getElementById('name').value;
	emailexpeVal = document.getElementById('emailexp').value;
	emaildestVal = document.getElementById('emaildest').value;

	
	if(lastnameVal == '')
		message.push('- " Ihr Name " ist gefordert.');
	
		
	if(emailexpeVal == '')
		message.push('- " Ihre E-Mail " ist gefordert.' );
	else
	{
		modele = /^.+@.+\..+$/;
		if(!modele.test(emailexpeVal))
			message.push('- " Ihre E-Mail " muss eine e-mail Adresse enthalten.');
	}
	
	if(emaildestVal == '')
		message.push('- " E-Mail des Empfängers " ist gefordert.');
	else
	{
		modele = /^.+@.+\..+$/;
		if(!modele.test(emaildestVal))
			message.push('- " E-Mail des Empfängers " muss eine e-mail Adresse enthalten.');
	}
	
	
	if(message.length != 0)
	{
		alerte = 'Bitte füllen Sie alle Pflichtfelder aus.';
		for(i in message)
			alerte += "\n" + message[i];
			
		alert(alerte);
	}
	else
		document.getElementById('formSendFriend').submit();
}


function verifDownload()
{
	message = new Array();
	
	salVal = document.getElementById('sal').value;
	firstnameVal = document.getElementById('firstname').value;
	lastnameVal = document.getElementById('lastname').value;
	companyVal = document.getElementById('company').value;
	emailVal = document.getElementById('Email').value;
	phoneVal = document.getElementById('phone').value;
	


	
	
	if(salVal == '')
		message.push('- " Anrede " ist gefordert.');
		
	if(firstnameVal == '')
		message.push('- " Vorname " ist gefordert.');
	
	if(lastnameVal == '')
		message.push('- " Name " ist gefordert.');
	

	
	if(companyVal == '')
		message.push('- " Firma " ist gefordert.');
		
		
if(emailVal == '')
		message.push('- " E-Mail-Adresse " ist gefordert.');
		
else
	{
		modele = /^.+@.+\..+$/;
		if(!modele.test(emailVal))
			message.push("- Dieses Feld muss eine e-mail Adresse enthalten.");
	}
		
		
if(phoneVal == '')
		message.push('- " Telefonnummer " ist gefordert.');
	
	if(message.length != 0)
	{
		alerte = 'Bitte füllen Sie alle Pflichtfelder aus.';
		for(i in message)
			alerte += "\n" + message[i];
			
		alert(alerte);
	}
	else
		document.getElementById('formInscription').submit();
}

