String.prototype.replaceAll = function(pcFrom, pcTo){
	var i = this.indexOf(pcFrom);
	var c = this;
	
	while (i > -1) {
		c = c.replace(pcFrom, pcTo);
		i = c.indexOf(pcFrom);
	}
	return c;
}

function checkEmail(mail) {
 	reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)' + '(\\@)([a-zA-Z0-9\\-\\.]+)'+ '(\\.)([a-zA-Z]{2,4})$');
  	
  	if(reg.test(mail))
  		return true;
  	else
  		alert('This is not an valid email-adress!');
  	
  	return false;
 }