
<!--
		function changeBg(o)
		{
			if(o.style.backgroundImage=='')
			{
				o.style.backgroundImage='url(../images/cool_btn_yellow1.gif)';
			}
			else
			{
				o.style.backgroundImage='';
			}
		}
		
		function cancelBg(o)
		{
			o.style.backgroundImage='';
		}
		
//对电话的验证。
		function checkNumber(o)   
		{
		 
		var validStr=o.value;
		validStr= allTrim(validStr);
		//alert(validStr);
		var trueStr="0123456789-";
		for(i=0;i<validStr.length;i++)
		{
			var c=validStr.charAt(i);
			if(trueStr.indexOf(c)==-1)
			{
				alert("请认真填写！");
				o.focus();
				return false;
			}
			if(!checkStrLength(validStr,0,8))
			{
				alert("请认真填写。");
				o.focus();
				return false;
			}
		}
		 
		return true;
		}
		//长度的限制！
		function checkStrLength(str,minlen,maxlen)
		{
			if(str.length<maxlen && str.length>minlen)
			{
				return false;
			}
			else
			{return true;}
		}
		//中文
		function checkChina(o)
		{
			if(!filterChar(o.value)) //先过滤 尖括号<>
			{
			alert("请认真填写》");
			 return false; 
			}
		 if(ifWesternChr(o.value))
		 {	
		 alert("名称必须是中文！");
		 o.focus();
		 }
		 else
		 {
			
		 }
		}
		function ifWesternChr(value) 
{  
	var chrInput_e; 
	for(i=0;i<value.length;i++ )
	{
		chrInput = value.charAt(i);
		chrInput_e=escape(chrInput); 
		if(chrInput_e.length==(chrInput.length)*6||chrInput=='\r'||chrInput=='\n')
		return false;
		else return true; 
	}
}
function checkEmail(o)
{
	if(!check_Email(o.value))
	{
		alert("请认真填写邮箱！");
		o.focus();
	}
}
//是否Email格式
function check_Email(EmailText)
{
 EmailText=allTrim(EmailText);
 if(!filterChar(EmailText))
 {
  return false;
 }
if(EmailText.length==0)
{
	return true;
}
    var checkOk="@";
    var checkStr=EmailText;
    var allValid=true;
    var decPoints=0;
    var allNum="";
    
    if(checkStr.charAt(0)=='@')
       return(false);
    if(checkStr.charAt(checkStr.length-1)=='@')
       return(false);
    if(checkStr.charAt(checkStr.length-1)=='.')
       return(false);
   a_valid=0;
   a_count=0;
   d_valid=0;
 
    for(i=0;i<checkStr.length;i++)
    {
      ch=checkStr.charAt(i);
      if(ch=='@')
       {a_valid=1;a_count++;}
      if(ch=='.')
      {d_valid=1;}
    }
    if(a_valid==0 || a_count==0 || d_valid==0)
    {
    return false;
    }
    else
    {
		return true;
    }
}
//取出空格！
function trim(validStr)
{
	var i,j,len;

	len=validStr.length;
	for(i=0;i<len;i++)
		if(validStr.charAt(i)!=' ') break;
	for(j=len-1;j>=i;j--)
		if(validStr.charAt(j)!=' ') break;

	if(i>j) return "";
	else return validStr.substr(i,j-i+1);
}

//去掉字符串内所有多余空格
function allTrim(str) 
{ 
    while (str.charAt(0)==" "||str.charAt(0)=="　") 
	{
     str=str.substr(1);
	} 
	while (str.charAt(str.length-1)==" "||str.charAt(0)=="　") 
	 {
     str=str.substr(0,str.length-1);
	 } 
    return(str); 
} 
// 特殊字符串的验证。
function filterChar(str)
{
	if(str.indexOf('<')>=0)
	{ return false;}
	if(str.indexOf('>')>=0)
	{ return false;}
	return true;
}
// 特殊字符串的验证。
function checkContent(o)
{
	if(!filterChar(o.value))
	{
		alert("请认真填写内容");
		o.focus();
	}
	else
	{
	 
	}
}
 
 
		-->