var profile_username_toolong = '对不起，您的用户名超过 20 个字符，请输入一个较短的用户名。';
		var profile_username_tooshort = '对不起，您输入的用户名小于3个字符, 请输入一个较长的用户名。';
		var profile_username_pass = "可用";
		var profile_username_used = "用户名已被占用，请重新设置";
		var profile_username_geshi='用户名应是字母、数字和“_”，长度在3-16字符间'
		var profile_password_notnull='密码不能为空';
		var profile_password_geshi='密码不得少于6个字符';
		var profile_password_issame='两次输入密码不一致';
		var profile_email_notnull='邮箱地址不能为空';
		var profile_email_geshi='邮箱格式不正确';
		
		
		
/*检查用户名*/
function checkNewUser()
{   var str=document.getElementById("username").value;
    var regm = /^[a-zA-Z0-9_]+$/;

     if (!str.match(regm))
   {document.getElementById("checkresult").innerHTML = "<font color='#009900'>" + profile_username_geshi + "</font>"
			return;
			}
			
			
    var unlen=document.getElementById("username").value.length;
    if(document.getElementById("username").value=="")
    {
        document.getElementById("checkresult").innerHTML="<font color='#009900'>" +"用户名不能为空"+"</font>";
        document.getElementById("username").focus();
        return ""; 
    }
   else if(unlen < 3 || unlen > 16)
    {
    document.getElementById("checkresult").innerHTML = "<font color='#009900'>" + (unlen < 3 ? profile_username_tooshort : profile_username_toolong) + "</font>"
			return;
	}
   
    var xmlhttp;
    try{
			xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');
		}catch(e){
			try{
				xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
			}catch(e){
				try{
					xmlhttp= new XMLHttpRequest();
				}catch(e){}
			}
		}
		
    xmlhttp.onreadystatechange=function()
    {
        if(xmlhttp.readyState==4)
        {
            if(xmlhttp.status==200)
            {
                if(xmlhttp.responseText=="OK")
                {
                    document.getElementById("checkresult").innerHTML="<font color='#009900'>"+"此用户名无人注册,可以使用"+"</font>";
                  
                }
                else
                {
                    document.getElementById("checkresult").innerHTML="<font color='#009900'>"+"用户名已被占用，请重新设置"+"</font>";
                } 
            }
            else
            {
                 document.getElementById("checkresult").innerHTML="<font color='#009900'>"+"用户名已被占用，请重新设置"+"</font>"
            }
        }
    }
    var username=document.getElementById("username").value;
    xmlhttp.open("GET","UserReg.aspx?AjaxUserName="+username,false);
    xmlhttp.send(null);
    
}




/*function checkcompany()
{ 
 
    if(document.getElementById("companyname").value=="")
    {
        document.getElementById("checkcompany").innerHTML="<font color='#009900'>" +"企业名称不能为空"+"</font>";
        document.getElementById("companyname").focus();
        return ""; 
    }
 
   
    var xmlhttp;
    try{
			xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');
		}catch(e){
			try{
				xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
			}catch(e){
				try{
					xmlhttp= new XMLHttpRequest();
				}catch(e){}
			}
		}
		
    xmlhttp.onreadystatechange=function()
    {
        if(xmlhttp.readyState==4)
        {
            if(xmlhttp.status==200)
            {
                if(xmlhttp.responseText=="OK")
                {
                    document.getElementById("checkcompany").innerHTML="<font color='#009900'>"+""+"</font>";
                  
                }
                else
                {
                    document.getElementById("checkcompany").innerHTML="<font color='#009900'>"+"此企业已经有人添加"+"</font>";
                } 
            }
            else
            {
                 document.getElementById("checkcompany").innerHTML="<font color='#009900'>"+"此企业已经有人添加l"+"</font>"
            }
        }
    }
    var companyname=document.getElementById("companyname").value;
    xmlhttp.open("GET","UserReg.aspx?AjaxCompanyName="+companyname,false);
    xmlhttp.send(null);
    
}
*/

/* 检验电话输入格式*/
function checkphone()
{
var str=document.getElementById("phone").value;
var regm =/^(^(\d{2,4}[-_－—]?)?\d{3,8}([-_－—]?\d{3,8})?([-_－—]?\d{1,7})?$)|(^0?1[35]\d{9}$)/;
if (!str.match(regm) )
    {
    document.getElementById("checkphone").innerHTML="<font color='#009900'>"+"电话格式不正确"+"</font>";
        return;
    }
    else
    {
    document.getElementById("checkphone").innerHTML="<font color='#009900'>"+""+"</font>";
        return;
    }
}




/* 检验邮编输入格式*/
function checkmailcode()
{
var str=document.getElementById("mailcode").value;
var regm =/^[1-9]\d{5}$/;
if (!str.match(regm) )
    {
    document.getElementById("checkmailcode").innerHTML="<font color='#009900'>"+"邮编格式不正确"+"</font>";
        return;
    }
    else
    {
     document.getElementById("checkmailcode").innerHTML="<font color='#009900'>"+""+"</font>";
        return;
    }
}



/* 检验手机输入格式*/
function checkmobilephone()
{
var str=document.getElementById("mobilephone").value;
var regm =/^((\(\d{3}\))|(\d{3}\-))?13\d{9}|15[89]\d{8}$/ ;
if (!str.match(regm) )
    {
    document.getElementById("checkmobilephone").innerHTML="<font color='#009900'>"+"手机格式不正确"+"</font>";
       return;
    }
    else
    {
    document.getElementById("checkmobilephone").innerHTML="<font color='#009900'>"+""+"</font>";
       return;
    }
}



/* 检验传真输入格式*/
function checkfax()
{
var str=document.getElementById("fax").value;
var regm= /^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
        
//var regm =/^(0\d{2,3}-)?\d{7,8}$/;
if (!str.match(regm) )
    {
    document.getElementById("checkfax").innerHTML="<font color='#009900'>"+"传真格式不正确"+"</font>";
        return;
    }
    else
    {
    document.getElementById("checkfax").innerHTML="<font color='#009900'>"+""+"</font>";
        return;
    }
}




/*检验用户输入邮箱*/
function checkemail()
{  var str=document.getElementById("email").value;
   var regm = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
    if(str=="")
    {
        document.getElementById("checkemail").innerHTML="<font color='#009900'>"+"邮箱不能为空"+"</font>";
        document.getElementById("email").focus();
        return ""; 
    }
    if (!str.match(regm) )
    {
    document.getElementById("checkemail").innerHTML="<font color='#009900'>"+"邮箱格式不正确"+"</font>";
        
        return ""; 
    }
    var xmlhttp;
    try{
			xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');
		}catch(e){
			try{
				xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
			}catch(e){
				try{
					xmlhttp= new XMLHttpRequest();
				}catch(e){}
			}
		}
		
    xmlhttp.onreadystatechange=function()
    {
        if(xmlhttp.readyState==4)
        {
            if(xmlhttp.status==200)
            {
                if(xmlhttp.responseText=="OK")
                {
                    document.getElementById("checkemail").innerHTML="<font color='#009900'>"+"邮箱可以使用"+"</font>";
                   
                }
                else
                {
                    document.getElementById("checkemail").innerHTML="<font color='#009900'>"+"邮箱已经被人占用"+"</font>";
                 
                } 
            }
            else
            {
                 document.getElementById("checkemail").innerHTML="邮箱已经被人占用";
            }
        }
    }
    var email=document.getElementById("email").value;
    xmlhttp.open("GET","UserReg.aspx?AjaxEmail="+email,false);
    xmlhttp.send(null);
    
}





/*检查密码*/
function checkpassword(password)
{
var pwlen=password.length;
if(pwlen<1)
{
document.getElementById("passwordtrtxt").innerHTML = "<font color='#009900'>" + profile_password_notnull + "</font>";
return;
}
else if(pwlen<6)
{
document.getElementById("passwordtrtxt").innerHTML = "<font color='#009900'>" + profile_password_geshi + "</font>";
return;
}
else
{
document.getElementById("passwordtrtxt").innerHTML = "<font color='#009900'>" + profile_username_pass + "</font>";
return;
}
}
/*检查密码是否一致*/
function checkpassword1()
{
if(document.getElementById("password").value!=document.getElementById("password2").value)
{
document.getElementById("passwordtrtxt1").innerHTML = "<font color='#009900'>" +  profile_password_issame + "</font>";
}
}



/* 控制显示*/
function showInfo(obj)
{
  if(obj.checked)
  {
     document.getElementById("showInfo").style.display = "" ;
  }
  else
  {
     document.getElementById("showInfo").style.display = "none" ;
   
  }
}



function showit()
{
document.getElementById('showInfo').style.display = '' ;
}


function copymsn(){
        
        txt ="gaowei1311@hotmail.com";
        window.clipboardData.setData('Text',txt);
        alert('MSN已经复制!');
}

function checkEmail(obj)
{
var reg=/^[^\d\-_][\w\-.]*[^\-_]@[^\-][a-zA-Z\d\-]*[^\-](\.[^\-][a-zA-Z\d\-]*[^\-])*\.[a-zA-Z]{2||3}(\.[a-zA-Z]{2})?$/;
if(KillSpace(obj.value)!='')
{
	if(!reg.test(obj.value))
	{
		alert('请你输入正确的邮箱格式。');
		obj.focus();
		obj.select();
	}
}
}



//邮件预定
function sendmail()
{
document.sendmailForm.thisurl.value=location.href;
document.sendmailForm.submit();
}

function frmSubmit()
{
     var strEmail = document.getElementById("email").value;
     var inaccurate =/^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/gi;
     if (strEmail == "请输入邮件地址")
     {
         alert('请输入您的邮件地址！');
         document.getElementById("email").focus();
         return false;
     }
     if (!inaccurate.test(strEmail))
     {
         alert('请输入正确的电子邮件！');
         document.getElementById("email").focus();
         document.getElementById("email").select();
         return false;
     }
     var url ="Order.aspx?ID="+strEmail;
    //alert(url);
     window.location.href=url;
     
}

//站内搜索
function SearchSite(){
var key_word=document.getElementById("SearchKey").value;
var key_type=document.getElementById("SearchSelect").value;
if(key_word=="")
{
alert('请输入关键字');
document.getElementById("SearchKey").focus();
return false;
}
else
{
var path="http://search.ezcap.cn/list.aspx?KeyWord="+key_word+"&&type="+key_type+"&&PageIndex=1";
location.href=path;
}

	
}


function onsearch()
{
var key_word=document.getElementById("SearchKey").value;
var key_type=document.getElementById("SearchSelect").value;
if(key_word=="")
{
alert('请输入关键字');
document.getElementById("SearchKey").focus();
return false;
}
else
{
var path="http://search.ezcap.cn/list.aspx?KeyWord="+key_word+"&&type="+key_type+"&&PageIndex=1";
location.href=path;
}
}


//用户登陆
function LoginUser()
{

    var UserName = document.getElementById("cv_UserName").value;
    var PassWord = document.getElementById("cv_Password").value;
	if(UserName==""){
		alert("请输入用户名!");
		document.getElementById("cv_UserName").focus();
	    return false;
	}
	if(PassWord==""){
		alert("请输入密码!");
		document.getElementById("cv_Password").focus();
	    return false;
	}

 location.href="http://users.ezcap.cn/User/LoginUser.aspx?name="+UserName+"&password="+PassWord;



}

var titles=document.title;  
var newstr= titles.replace("EZCapital","EZCapital(合力投资网)");  
document.title=newstr; 

var title1 = document.getElementById("Description").content;
var newstr1= title1.replace("恒峰合力","恒峰合力(合力投资网)");  
document.getElementById("Description").content=newstr1; 

