String.prototype.trim=function(){ return this.replace(/(^\s*)|(\s*$)/g, ''); } 
String.prototype.ltrim=function() { return this.replace(/(^s*)/g,''); } 
String.prototype.rtrim=function() { return this.replace(/(s*$)/g,''); } 

function VerifyData() 
{

if (document.loginform.name.value.trim()=="")
	{
	alert("联系人姓名不能为空！");
	document.loginform.name.focus();
	return false;
	}


if (document.loginform.tel.value=="")
	{
	alert("联系电话不能为空！");
	document.loginform.tel.focus();
	return false;
	}
if (checktel(document.loginform.tel.value)==false)
	{
	alert("联系电话格式不对！");
	document.loginform.tel.focus();
	return false;
	}
if (chkemail(document.loginform.email.value)==0)
	{
	alert("电子邮件格式不正确！");
	document.loginform.email.focus();
 	return false;
	}

if (document.loginform.content.value=="")
	{
	alert("您的留言不能为空！");
	document.loginform.content.focus();
	return false;
	}
if (document.loginform.content.value.length>500)
	{
	alert("您的留言的长度不能超过500个字符！");
	document.loginform.content.focus();
 	return false;
	}

}
function checktel(v)
{
	var pattern=/^\d+(\-\d+)?$/;
	var flag=pattern.test(v);
	return flag;
}


           
            function inix(){
            
                Atop = findPos(document.getElementById("Layer1"))[1];
            }
            
            function move(){
                document.getElementById("Layer1").style.pixelTop = Atop + document.documentElement.scrollTop;
            }
            
            function findPos(obj){
                var curleft = curtop = 0;
                if (obj.offsetParent) {
                    do {
                        curleft += obj.offsetLeft;
                        curtop += obj.offsetTop;
                    }
                    while (obj = obj.offsetParent);
                }
                return [curleft, curtop];
            }
            
            
       // JavaScript Document
