//This is the BASIC rule libaray for all other rules.
//Any html page that use Rules in rule library must include this file.
//构造函数
//
function Rule_RegTest(v)
{
  return this.RegExp.test(v);
}

function Rule_RegTestBoolean(v)
{
	return v;
}

function Rule_RegTestBlank(v)
{
	return ((v!='')?true:false);
}


function Rule_ShowMessage()
{
if (LANGUAGE=='EN')
	alert(this.enMessage);
	else 
	alert(this.cnMessage);
}

function RuleTest(objRule,value,control)
{
//对value执行objRule规则的校验
//value值符合objRule所定义的规则则返回true
//否则返回false并将焦点定位于control
if (!objRule.Validate(value))
	{
		objRule.Alert();
		if(control)control.focus();
		return false;
	}
return true;
}

function RuleTest2(objRule,v1,v2,control)
//对v1,v2执行objRule规则的校验
//v1,v2值符合objRule所定义的规则则返回true
//否则返回false并将焦点定位于control
{
if (!objRule.Validate(v1,v2))
	{
		objRule.Alert();
		if(control)control.focus();
		return false;
	}
return true;
}