function send() {
	var first_name = document.getElementById('first_name');
	var last_name = document.getElementById('last_name');
	var street = document.getElementById('street');
	var number = document.getElementById('number');
	var plz = document.getElementById('plz');
	var city = document.getElementById('city');
	var editorial = document.getElementById('editorial');
	var sender = document.getElementById('sender');
	var press_number = document.getElementById('press_number');
	var email = document.getElementById('email');
	var book = document.getElementById('book');
	
	if (!(isNotEmpty(first_name) & 
		  isNotEmpty(last_name) &
		  isNotEmpty(street) &
		  isNotEmpty(number) &
		  isPostal(plz) &
		  isNotEmpty(city) &
		  isNotEmpty(sender) &
		  isNotEmpty(press_number) &
		  isEmail(email) &
		  isNotEmpty(book)
		  )) {				
		alert ("Bitte füllen sie die gelb markierten Felder korrekt aus.");	
		return;
	}
	
	document.press_form.submit()
	
}

function isNotEmpty(elem) {
	if (elem.value == "") {
		elem.style.backgroundColor = "yellow";	
		return false;
	} else {
		elem.style.backgroundColor = "white";	
		return true;
	}
}

function isEmail(elem) {
	if ((elem.value).search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {
		elem.style.backgroundColor = "yellow";
		return false;
	} else {
		elem.style.backgroundColor = "white";
		return true;
	}
}

function isPostal(elem){
	var re5digit=/^\d{5}$/ //regular expression defining a 5 digit number
	if (elem.value.search(re5digit)==-1) {//if match failed
		elem.style.backgroundColor = "yellow";
		return false;
	} else {
		elem.style.backgroundColor = "white";
		return true;
	}
}


function isName(elem) {
	var charExpression = /^(([a-z]+)|([A-Z]+)|[.]+|[,]+|[-]+|[\/]+|[\s]+)+$/;
	if(elem.value.match(charExpression)){
		elem.style.backgroundColor = "white";
		return true;
	}else{
		elem.style.backgroundColor = "yellow";
		return false;
	}
}

// If the element's string matches the regular expression it is all numbers
function isNumeric(elem) {
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		elem.style.backgroundColor = "white";
		return true;
	}else{
		elem.style.backgroundColor = "yellow";
		return false;
	}
}

function isNumericAndNotEmpty(elem) {
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		elem.style.backgroundColor = "white";
		return true;
	}else{
		elem.style.backgroundColor = "yellow";		
		//alert(helperMsg);
		//elem.focus();
		return false;
	}
}

function printOrder(){  
	if (window.print) {
		window.print() ;  
	} 
}
