//<script language="javascript" src="js/Rule.js"></script>

/////////////////////////////////////////////////////
//Email 校验规则

function Rule_EmailAddress()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^\s*([A-Za-z0-9_\-]+(\.[A-Za-z0-9_\-]+)*@([\w\-]+\.)+\w{2,5})\s*$/;
this.cnMessage='请给出一个正确的Email地址！';
this.enMessage='Invalid Email Address!';
}

var EmailAddressRule=new Rule_EmailAddress();

//Email 校验规则结束
//////////////////////////////////////////////////////////


/////////////////////////////////////////////////////
//密码 校验规则

function Rule_Password()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[_a-z0-9A-Z]{6,15}$/;
this.cnMessage='请正确填写密码，且长度必须大于5！';
this.enMessage='The length of the password must be greater than 5!';
}

function Rule_BlankPassword()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请正确填写密码！';
this.enMessage='The password is not correct!';
}

function Rule_TwoPassword()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='两次输入的密码不一致！';
this.enMessage='The confirm password does not match with the password!';
}

function Rule_OldPassword()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请填写旧密码！';
this.enMessage='The old password is not correct!';
}

function Rule_EasyPassword()
{
	this.Validate=Rule_RegTestBoolean;
	this.Alert=Rule_ShowMessage;
	this.RegExp='';
	this.cnMessage='密码过于简单！';
	this.enMessage='The password is too simple!';
}



//----------------------
//一个简单密码的共用函数
function easy(password){
   var coup=Object();
   var errors=0;
   coup.length=10;
   coup[0]="123456";
   coup[1]="111111";
   coup[2]="888888";
   coup[3]="666888";
   coup[4]="666666";
   coup[5]="000000";
   coup[6]="12345678";
   coup[7]="654321";
   coup[8]="123123";
   coup[9]="999999";
   for (var i=0;i<coup.length;i++){
       if (password==coup[i]) {
          errors=1;
          break;
       }
    }
  return errors;
}


var Password_Rule=new Rule_Password();
var BlankPassword_Rule=new Rule_BlankPassword();
var TwoPassword_Rule=new Rule_TwoPassword();
var OldPassword_Rule=new Rule_OldPassword();
var EasyPassword_Rule=new Rule_EasyPassword();

//密码 校验规则结束
///////////////////////////////////////////////////////////////////

//密码问题
//////////////////////////////////////////////////////////////////
function Rule_PwdAsk(){
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^\s*].{1,15}$/;
	this.cnMessage='请选择密码问题!';
	this.enMessage='Please select a question!';
}
var PwdAsk_Rule=new Rule_PwdAsk();

//密码问题校验规则结束
///////////////////////////////////////////////////////////////////


//密码答案
//////////////////////////////////////////////////////////////////
function Rule_PwdAnswer(){
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^0-9@$%^*\-_=|{}:;"'<><?/]{1,100}$/;
	this.cnMessage='请填写密码答案!';
	this.enMessage='Please enter Answer!';
}
var PwdAnswer_Rule=new Rule_PwdAnswer();

//密码答案校验规则结束
///////////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////
//姓名 校验规则
function Rule_Name()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[^\s*].{1,15}$/;
this.cnMessage='请正确填写姓名！';
this.enMessage='Please enter a valid Name.';
}

var Name_Rule=new Rule_Name();


///////////////////////////////////////////////////////////////////

function Rule_Education(){
	this.Validate=Rule_RegTestEducation;
	this.Alert=Rule_ShowMessage;
	this.RegExp='';
	this.cnMessage='请选择最高学历!';
	this.enMessage='Please select Education Level.';
}

var Education_Rule=new Rule_Education();

function Rule_RegTestEducation(v){
	if ((v=='') || (v=='0'))
		return false;
	return true;
}

//////////////////////////////////////////////////////////////////////////

function Rule_ChooseMajor(){
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/[^\s]/;
	this.cnMessage='请选择专业类别!';
	this.enMessage='Please select Course.';
}

var ChooseMajor_Rule=new Rule_ChooseMajor();

//////////////////////////////////////////////////////////////////////

function Rule_EnglishLevel()
{
this.Validate=Rule_RegTestBlank;
this.Alert=Rule_ShowMessage;
this.RegExp=/[^\s]/;
this.cnMessage='请选择英语水平！';
this.enMessage='Please choose English Level !';
}
var EnglishLevel_Rule=new Rule_EnglishLevel();

function Rule_ComputerLevel_CODE()
{
this.Validate=Rule_RegTestBlank;
this.Alert=Rule_ShowMessage;
this.RegExp=/[^\s]/;
this.cnMessage='请选择计算机能力！';
this.enMessage='Please choose Computer Level!';
}

var ComputerLevel_CODE_Rule=new Rule_ComputerLevel_CODE();


//////////////////////////////////////////////////////////////////////

//开始时间 校验规则
function Rule_BeginDate()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[^\s*].{1,15}$/;
this.cnMessage='请正确填写开始时间！';
this.enMessage='Please enter a valid Begin Date.';
}

var BeginDate_Rule=new Rule_BeginDate();

//开始时间 校验规则
function Rule_EndDate()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[^\s*].{1,15}$/;
this.cnMessage='请正确填写结束时间！';
this.enMessage='Please enter a valid End Date.';
}
var EndDate_Rule=new Rule_EndDate();

function Rule_BeginEndDate()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请由时间的先后顺序填写！';
this.enMessage='Invalid Salary Range!';
}

var BeginEndDate_Rule=new Rule_BeginEndDate();


function Rule_Description()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[^ま]{50,2000}$/;
this.cnMessage='详细描述不能少于50和超过2000字！';
this.enMessage='Education description not more than 2000.';
}
var Description_Rule=new Rule_Description();

//////////////////////////////////////////////////////////////////////

function Rule_YearsOfWorkExperience()
{
	this.Validate=Rule_RegTest;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[0-9\.]{1,4}$/;
	this.cnMessage='请正确填写工作经验！';
	this.enMessage='Please enter valid year of experience.';
}
var YearsOfWorkExperience_Rule=new Rule_YearsOfWorkExperience();



function Rule_CompanyName(){
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^0-9@$%^*\-_=|{}:;"'<><?/]{1,100}$/;
	this.cnMessage='请正确填写公司名称!';
	this.enMessage='Please enter valid  Company name.';
}

var CompanyName_Rule=new Rule_CompanyName();

////////////////////////////////////////////////////////////////////////




/////////////////////////////////////////////////////////////////////////
////  联系方式验证

function Rule_ContactNumber()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[0-9@$%^*\-_=|{}:;"'<><?/]{7,20}$/;
this.cnMessage='请正确填写联系电话！';
this.enMessage='Please enter valid contact number.';
}
var ContactNumber_Rule=new Rule_ContactNumber();


function Rule_OfficeNumber()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[^a-z]{0,20}$/;
this.cnMessage='请正确填写办公电话！';
this.enMessage='Please enter valid company number.';
}
var OfficeNumber_Rule=new Rule_OfficeNumber();


function Rule_MobileNumber()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[^a-z]{0,20}$/;
this.cnMessage='请正确填写手机号码！';
this.enMessage='Please enter valid mobile number.';
}
var MobileNumber_Rule=new Rule_MobileNumber();

function Rule_ContactMethod()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='联系电话、手机号码、办公电话，至少填写一项！';
this.enMessage='Please at least enter any one of the Contact No., Company No.,and Mobile No.';
}
var ContactMethod_Rule=new Rule_ContactMethod();

function Rule_InstantMessenger()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[0-9]{0,15}$/;
this.cnMessage='请正确填写OICQ/ICQ号码！';
this.enMessage='Please enter valid OICQ/ICQ No.';
}
var InstantMessenger_Rule=new Rule_InstantMessenger();

function Rule_CurrentLocation()
{
this.Validate=Rule_RegTestBlank;
this.Alert=Rule_ShowMessage;
this.RegExp=/[^\s]$/g;
this.cnMessage='请选择目前所在地！';
this.enMessage='Current Location should not be empty !';
}
var CurrentLocation_Rule=new Rule_CurrentLocation();

function Rule_Address()
{
this.Validate=Rule_RegTestBlank;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请填写联系地址！';
this.enMessage='Contact Address should not be empty !';
}
var Address_Rule=new Rule_Address

function Rule_Zip()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[0-9]{0,6}$/;
this.cnMessage='请正确填写邮政编码！';
this.enMessage='Please enter valid Postal Code.';
}
var Zip_Rule=new Rule_Zip();


//////////////////////////////////////////////////////////////////////////
//


function Rule_ExpectedJobLocation()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请选择工作地区！';
this.enMessage='Expected Job Location Is Empty!';
}

function Rule_ExpectedJobFunction()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请选择岗位类别！';
this.enMessage='Expected Job Function Is Empty!';
}


function Rule_ExpectedAvailabilityDay()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请选择可到岗时间！';
this.enMessage='Expected Availability Day Is Empty!';
}

var ExpectedJobLocation_Rule=new Rule_ExpectedJobLocation();
var ExpectedJobFunction_Rule=new Rule_ExpectedJobFunction();
var ExpectedAvailabilityDay_Rule=new Rule_ExpectedAvailabilityDay();


//////////////////////////////////////////////////////////////////////////

function Rule_Salary()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[0-9]{1,6}$/;
this.cnMessage='请正确填写月薪！';
this.enMessage='Please enter valid monthly salary.';
}
var Salary_Rule=new Rule_Salary();


//////////////////////////////////////////////////////


function Rule_SearchName()
{
this.Validate=Rule_RegTestBlank;
this.Alert=Rule_ShowMessage;
this.RegExp=/[^\s]$/g;
this.cnMessage='请正确填写搜索器名称！';
this.enMessage='Please enter valid Search Name.';
}

function Rule_Keyword()
{
this.Validate=Rule_RegTestBlank;
this.Alert=Rule_ShowMessage;
this.RegExp=/[^\s]$/g;
this.cnMessage='请正确填写关键字！';
this.enMessage='Please enter valid keyword.';
}


function Rule_MinSalary()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[0-9]{0,6}$/;
this.cnMessage='请正确填写最低月薪要求！';
this.enMessage='Please enter valid minimum monthly salary.';
}

function Rule_MaxSalary()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[0-9]{0,6}$/;
this.cnMessage='请正确填写最高月薪要求！';
this.enMessage='Please enter valid maximum monthly salary';
}

function Rule_MaxMinSalary()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请由低到高填写月薪要求！';
this.enMessage='Invalid Salary Range!';
}

var SearchName_Rule=new Rule_SearchName();
var Keyword_Rule=new Rule_Keyword();
var MinSalary_Rule=new Rule_MinSalary();
var MaxSalary_Rule=new Rule_MaxSalary();
var MaxMinSalary_Rule=new Rule_MaxMinSalary();
//////////////////////////////////////////////////////////////////////////

function Rule_FriendName()
{
this.Validate=Rule_RegTestBlank;
this.Alert=Rule_ShowMessage;
this.RegExp=/[^\s]$/g;
this.cnMessage='请正确填写朋友昵称！';
this.enMessage='Please enter valid Firend nickname.';
}


function Rule_FriendsEmailList()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请选择需要推荐的朋友！';
this.enMessage='Expected Friend Email Function Is Empty!';
}

function Rule_Content()
{
this.Validate=Rule_RegTestBlank;
this.Alert=Rule_ShowMessage;
this.RegExp=/[^\s]$/g;
this.cnMessage='请填写荐言！';
this.enMessage='Please enter valid Content.';
}

var FriendsEmailList_Rule=new Rule_FriendsEmailList()
var FriendName_Rule=new Rule_FriendName();
var Content_Rule=new Rule_Content();

////////////////////////////////////////////////////////////////////////////////

function Rule_Trade()
{
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/[^\s]/;
	this.cnMessage='请选择所属行业！';
	this.enMessage='Please choose Trade !';
}
var Trade_Rule=new Rule_Trade();

function Rule_ComProperty()
{
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/[^\s]/;
	this.cnMessage='请选择企业性质！';
	this.enMessage='Please choose Trade !';
}
var ComProperty_Rule=new Rule_ComProperty();

function Rule_StayPlace()
{
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/[^\s]/;
	this.cnMessage='请选择公司所在地！';
	this.enMessage='Please choose Trade !';
}
var StayPlace_Rule=new Rule_StayPlace();

function Rule_ContactMan()
{
	this.Validate=Rule_RegTest;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^\s*].{1,15}$/;
	this.cnMessage='请正确填写联系人！';
	this.enMessage='Please enter a valid Name.';
}
var ContactMan_Rule=new Rule_ContactMan();


////////////////////////////////////////////////////////////////////////////////

function Rule_PositionName()
{
	this.Validate=Rule_RegTest;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^\s*].{1,15}$/;
	this.cnMessage='请正确填写职位名称！';
	this.enMessage='Please enter a valid Position Name.';
}
var PositionName_Rule=new Rule_PositionName();


function Rule_MinAge()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[0-9\.]{1,6}$/;
this.cnMessage='请正确填写最低年龄要求！';
this.enMessage='Please enter valid minimum Age.';
}
var MinAge_Rule=new Rule_MinAge();

function Rule_MaxAge()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[0-9\.]{1,6}$/;
this.cnMessage='请正确填写最高年龄要求！';
this.enMessage='Please enter valid maximum Age';
}
var MaxAge_Rule=new Rule_MaxAge();

function Rule_MaxMinAge()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请由低到高填写年龄要求！';
this.enMessage='Invalid Age Range!';
}
var MaxMinAge_Rule=new Rule_MaxMinAge();

function Rule_EmployeeNumber()
{
	this.Validate=Rule_RegTest;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[0-9\.]{1,5}$/;
	this.cnMessage='请正确填写招聘人数！';
	this.enMessage='Please enter a valid Employee Number.';
}
var EmployeeNumber_Rule=new Rule_EmployeeNumber();

function Rule_Salary()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[0-9\.]{1,7}$/;
this.cnMessage='请正确填写月薪要求！';
this.enMessage='Please enter valid minimum monthly salary.';
}
var Salary_Rule=new Rule_Salary();

function Rule_PubDate()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[^\s*].{1,15}$/;
this.cnMessage='请选择发布时间！';
this.enMessage='Please enter valid Pub Date.';
}
var PubDate_Rule=new Rule_PubDate();

function Rule_ValidDay()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[0-9\.]{1,5}$/;
this.cnMessage='请选择信息有效期！';
this.enMessage='Please enter valid Date.';
}
var ValidDay_Rule=new Rule_ValidDay();

function Rule_ResumeFolder()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/[^\s]/;
this.cnMessage='请选择接收简历文件夹！';
this.enMessage='Please enter valid Resume Folder.';
}
var ResumeFolder_Rule=new Rule_ResumeFolder();

function Rule_SelectJob()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[^\s*].{1,15}$/;
this.cnMessage='请选择职位！';
this.enMessage='Please enter valid Position.';
}
var SelectJob_Rule=new Rule_SelectJob();

function Rule_InterviewTime()
{
	this.Validate=Rule_RegTest;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^\s*].{1,15}$/;
	this.cnMessage='请正确填写面试时间！';
	this.enMessage='Please enter a valid Interview Time.';
}
var InterviewTime_Rule=new Rule_InterviewTime();

function Rule_MaxMinEdu()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请由低到高选择学历要求！';
this.enMessage='Invalid Age Range!';
}
var MaxMinEdu_Rule=new Rule_MaxMinEdu();
