<!--
///////////////////////////////////////////////////////////////////////////////
//
// 张树林 - 慧佳工作室
//
// Module Name:     user.js
// Abstract:        用户的相关函数
// Version:         1.0
// Date				2008-06-11
// Author:          woods·zhang
// Email:           hoojar@163.com 
// MSN:             hoojar@hotmail.com
// Website:         http://www.hoojar.com/
// Copyright 2001-2008, Hoojar studio All Rights Reserved
//
// 版权 2001-2008，慧佳工作室所有版权保护

//The software for free software, allowing use, copy, 
//modify and distribute the software and files. Any 
//use of this software must place a copy of all the 
//above copyright notice. By the software Huijia studio 
//maintenance, if you have any queries please contact us.
//Thank you. 
//
//此软件为自由软件，允许使用、拷贝、修改、分发本软件及其文档。
//任何使用此软件的地方都得出现以上版权通告所有副本。此软件由
//慧佳工作室维护，如果您有什么疑问请与我们联系。谢谢使用。
//
///////////////////////////////////////////////////////////////////////////////

//ajax对象创建
function ajaxLib()
{
	var objXMLHttp;
	if (window.XMLHttpRequest)
	{
		objXMLHttp = new XMLHttpRequest();
	}
	else
	{
		var MSXML = ['MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];
		for (var n = 0; n < MSXML.length; n ++)
		{
			try
			{
				objXMLHttp = new ActiveXObject(MSXML[n]);        
				break;
			}
			catch(e){}
		}
		if (!objXMLHttp && typeof XMLHttpRequest != 'undefined') 
		{
			objXMLHttp = new XMLHttpRequest();
		}
	}
	return objXMLHttp;
}

//判断用户名是否符合标准
function userOk(ssn)
{
	var re = /^[0-9a-z][\w-.]*[0-9a-z]$/i;
	return re.test(ssn) ? true : false;
}

//判断（中文与英文数字）用户名是否可能通过
function userIsPass(ssn)
{
	var re = /^[a-zA-Z\d_\-@\.]+$/;
	if (re.test(ssn))
	{
		if (ssn.length < 4 || ssn.length > 20)
		{
			return false;
		}
		return true;
	}
	var re = /^(([a-zA-Z\d_\-@\.]|[\u4e00-\u9fa5]){2,10})+$/;
	if (re.test(ssn))
	{
		return true;
	}
	return false;
}
//-->