function checkValues(form)
{
	var error=false;
	
	var toCheck=new Array();
	
	toCheck[0]='vorname';
	toCheck[1]='nachname';
	toCheck[2]='unternehmen';
	toCheck[3]='email';
							
	for(x=0;x<toCheck.length;x++){
		if($(toCheck[x]).value==''){
			$(toCheck[x]).style.borderColor="#e10000";
			error=true;
		}
		else{
			$(toCheck[x]).style.borderColor="#00cc00";
		}
	}
							
	if(error==false)
	{
		$('mailer_message_errortext').style.display='none';
		var currPost='&ajax=true';
		
		for(x=0;x<form.length;x++)
		{
			if (form[x].value!=''){
				if (form[x].type=='checkbox'){
					if (form[x].checked==true){
						currPost=currPost+'&'+form[x].name+'='+form[x].value;
					}
				}else{
					currPost=currPost+'&'+form[x].name+'='+form[x].value;
				}
			}else{
				if (form[x].tagName=='INPUT' || form[x].tagName=='TEXTAREA'){
					if (form[x].type=='checkbox'){
						if (form[x].checked==true){
							currPost=currPost+'&'+form[x].name+'='+form[x].value;
						}
					}else{
						currPost=currPost+'&'+form[x].name+'='+form[x].value;
					}
				}else{
					currPost=currPost+'&'+form[x].name+'='+form[x].options[form[x].selectedIndex].value;
					if(form[x].selectedIndex==0){
						currPost=currPost+'&'+form[x].name+'=Herr';
					}else{
						currPost=currPost+'&'+form[x].name+'=Frau';
					}
				}
			}
		}
		//alert(currPost);
		$('mailer_message_text').style.display='';
		$('kontakt_formular').style.display='none';
		
	new Ajax.Updater('mailer_message_text','../scripts/forms/mailer.php', { asynchronous:true, postBody:currPost });
	}else{
		$('mailer_message_errortext').style.display='';
	}

	return false;
}
toggleBox = function(id){
	if($(id).style.display=='none'){
		$(id).style.display='';
	}else{
		$(id).style.display='none';
	}
}
