function form_sub()
{
	if(!test_product(document.form_customer_info.product_id.value))
	{
		alert("Please select a product at first!");
		return false;
	}
	
	if(!test_email(document.form_customer_info.customer_email.value))
	{
		alert("Format of E-mail is not right!");
		return false;
	}
}

function test_product(str_product) 
{ 
  var pattern = /[0-9]{8}/; 
  if(pattern.test(str_product)) 
  	return true; 
  else
  	return false; 
}

function test_username(str_username) 
{ 
  var pattern = /[a-zA-Z_]/; 
  if(pattern.test(str_username)) 
  	return true; 
  else
  	return false; 
}

function test_date(str_birthday) 
{ 
  var pattern = /[0-9]{4}-[0-9]{2}-[0-9]{2}/; 
  if(pattern.test(str_birthday)) 
  	return true; 
  else
  	return false; 
}

function test_email(str_email) 
{ 
  var pattern = /^[a-zA-Z0-9_.]+@([a-zA-Z0-9_]+.)+[a-zA-Z]{2,3}$/; 
  if(pattern.test(str_email)) 
  	return true; 
  else
  	return false; 
}

function test_password(str_p1, str_p2) 
{ 
  if(str_p1==str_p2) 
  	return true; 
  else
  	return false; 
}
