$(document).ready(function() {
	$('.unt').keypress (
		function(event){
  			var key, keyChar;
				if(!event) var event = window.event;	
				if (event.keyCode) key = event.keyCode;
				else if(event.which) key = event.which;
				if(key==null || key==0 || key==8 || key==13 || key==37 || key==39 || key==46 || key==9) return true;
				keyChar=String.fromCharCode(key);
				if(!/\d/.test(keyChar)) return false;
});
	$('.unt').focus(function(){
		$('#'+this.name+'Error').slideDown('fast');
	});
	
	$('.unt').blur(function(){
		$('#'+this.name+'Error').slideUp('fast');
	});

	$('#send_contactForm').submit(function(){
		var ss,sf
		$('#send_contactForm input').each(function(){
			if(!$(this).hasClass('unf') ){
				if($(this).val()==''){
					$('#'+this.name+'Error').slideDown('fast');	
					$('#'+this.name+'ErrorS').slideUp('fast');
					ss=true;
				}
				else{
					$('#'+this.name+'Error').slideUp('fast');
					if($(this).hasClass('une')){
						if(!/^\w+[a-zA-Z0-9_.-]*@{1}\w{1}[a-zA-Z0-9_.-]*\.{1}\w{2,4}$/.test($(this).val())){
     					 	$('#'+this.name+'ErrorS').slideDown('fast');
      					 	sf=true;
						}
						else{
							$('#'+this.name+'ErrorS').slideUp('fast');	
						}
					}
				}
			}
		});
	if(ss || sf || $(this).val()!='' ){
		$('#send_error').slideDown('fast');
		$('#send_success').slideUp('fast');
		return false;
	}else{
		$('#send_error').slideUp('fast');
		}
	
	});
});

