// JavaScript Document

function check_contact(){
	
	
	var name = document.getElementById('name');
	var sendcopy = document.getElementById('sendcopy');
	var email = document.getElementById('email');
	var subject = document.getElementById('subject');
	var notice = document.getElementById('notice');
	var message = document.getElementById('message');
	var file = 'modules/aj/contact.php';
	
	
	if(!reStrAlpha.test(name.value)){
		
		alert('Please enter your name');
		name.select();
		name.focus();
		return false;
	}
	
	if(!reEmail.test(email.value)){
		
		alert('Please enter your email address');
		email.select();
		email.focus();
		return false;
	}
	
	if(!reStrAlpha.test(subject.value)){
		
		alert('Please enter a subject');
		subject.select();
		subject.focus();
		return false;
		
	}
	

	
	if(notice.value==''){
		
		alert('Please enter your notice id');
		notice.select();
		notice.focus();
		return false;
		
	}
	
	if(message.value ==''){
		alert('Please enter your question');
		message.select();
		message.focus();
		return false;
	}
	
	document.getElementById('working_contact').style.display='inline';
	var query = 'name='+encodeURI(name.value)+'&notice='+encodeURI(notice.value)+'&sendcopy='+encodeURI(sendcopy.value)+'&email='+encodeURI(email.value)+'&subject='+encodeURI(subject.value)+'&message='+encodeURI(message.value);
	ajaxCall2(file,query,'contact');
}