
var ID;
function checkForm(type, swt){

	v=$('#'+type).val();

	switch(type){

		case 'name':
			if(v == ''){$('#e_name').html('空白です');}else{$('#e_name').html('');}
			
			break;

		case 'form_content':
			if(v == ''){$('#e_content').html('空白です');}else{$('#e_content').html('');}
			
			break;
			
			
		case 'email':

			///^[a-zA-Z0-9_-]+@[a-zA-Z0-9]+\.[0-9a-zA-Z]+$/
			if(!v.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9]+\.[0-9a-zA-Z]+$/)){
				$('#e_email').html('アドレスの書式が正しくありません');
			}else{
				$('#e_email').html('');
			}
			break;
			
		case 'tel':
			
			if(v.match(/[^0-9\-]+/) || v == ''){$('#e_tel').html('使用できるのは半角数字とハイフン(-)のみです');}else{$('#e_tel').html('');}
			break;

	
	}
	if(swt == 'on'){{ID=setInterval('checkForm("'+type+'",0)',700);}}	
	if(swt == 'off'){clearInterval(ID);}

	

	
}