var pr = Math.round(1 * 333.45)/1;
document.getElementById('protection').value = pr;
document.getElementById('prot').style.display = 'none';
function string_trim(String)
{
	return (String.replace(/^\s+|\s+$/g,""));
}
function gel(a)
{
	return document.getElementById?document.getElementById(a):null;
}
function client_valid()
{
	var name = gel("name");
	name.value = string_trim(name.value);
	if(name.value=='')
	{
		alert("请输入客户联系姓名"); name.focus(); return false;
	}
	var country = gel("country");
	country.value = string_trim(country.value);
	if(country.value=='')
	{
		alert("请选择客户所在的国家/地区"); country.focus(); return false;
	}
	var email = gel("email");
	email.value = string_trim(email.value);
	if(email.value=='')
	{
		alert("请输入客户的电子邮件"); email.focus(); return false;
	}
	var emailPattern = /\w+@.+\..+$/;
	if (emailPattern.test(email.value)==false){	alert("请正确输入客户的电子邮件"); email.focus(); return false;}


  var s = document.getElementsByTagName('input');
  var foundCount=0;
	for (var i=0;i<s.length;i++)
	{
		if(s[i].type == "checkbox")
		{
			if(s[i].checked == true)
			{
				foundCount++
			}
		}
	}
	if(foundCount==0)
	{
		alert("请选择改客户所属的服务类型");  return false;
	}

	return true;
}
function quote_valid()
{
	var country = gel("country");
	country.value = string_trim(country.value);
	if(country.value=='')
	{
		alert("请选择您所在的国家/地区"); country.focus(); return false;
	}

  var s = document.getElementsByTagName('input');
  var foundCount=0;
	for (var i=0;i<s.length;i++)
	{
		if(s[i].type == "checkbox")
		{
			if(s[i].checked == true)
			{
				foundCount++
			}
		}
	}
	if(foundCount==0)
	{
		alert("请选择您需要的服务");  return false;
	}

	return true;
}	