// JavaScript Document

	
	function checkForm(){
		var oo=$('#txt_subject');
		var str=jQuery.trim(oo.attr('value'));
		oo.attr('value',str);
		if (str.length==0)	{
			oo.focus();
			alert('Subject Required.');
			return false;
		}
		var oo=$('#txt_company');
		var str=jQuery.trim(oo.attr('value'));
		oo.attr('value',str);
		if (str.length==0)	{
			oo.focus();
			alert('Please enter your company name.');
			return false;
		}
		var oo=$('#txt_email');
		var str=jQuery.trim(oo.attr('value'));
		oo.attr('value',str);
		if (str.length==0)	{
			oo.focus();
			alert('Please enter your email.');
			return false;
		}	else	{
			var reg=/w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/i;
			var reg=/^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+]/i; 
			var reg=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/i;

			if (reg.test(str))	{
			}	else	{
				oo.focus();
				alert('Please check your mail address');
				return false;
			}
		}
		
		return true;
	}

	function submitit(){
		if (checkForm())	{
			if (confirm('Ready to send your inquiry?')){
				$.post(
					   '/inquiry_send.php',
					   {
						   lan:$('#txt_lan').attr('value'),
						   subject: $('#txt_subject').val().toString(),
						   company: $('#txt_company').val().toString(),
						   mail: $('#txt_email').val().toString(),
						   phone: $('#txt_phone').val().toString(),
						   msg: $('#txt_msg').val().toString()
						   
						   },
						function(data){
							   alert(data);
						});
//				alert('sending');
			}
		}
	}

