//<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_Birthday()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[^\s*].{1,15}$/;
this.cnMessage='请正确填写出生日期！';
this.enMessage='Please enter a valid Birthday.';
}

var Birthday_Rule=new Rule_Birthday();

///////////////////////////////////////////////////////////////////

function Rule_Education(){
	this.Validate=Rule_RegTestEducation;
	this.Alert=Rule_ShowMessage;
	this.RegExp='';
	this.cnMessage='请选择最高学历!';
	this.enMessage='Please select Education Level.';
}
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.';
}

function Rule_SchoolName(){
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^0-9@$%^*\-_=|{}:;"'<><?/]{1,100}$/;
	this.cnMessage='请正确填写毕业学校名称!';
	this.enMessage='Please enter valid college or school name.';
}

function Rule_Major(){
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^0-9@$%^*\-_=|{}:;"'<><?/]{1,100}$/;
	this.cnMessage='请正确填写专业名称!';
	this.enMessage='Please enter valid course name.';
}

function Rule_EducationDetail()
{
	this.Validate=Rule_RegTestBoolean;
	this.Alert=Rule_ShowMessage;
	this.RegExp='';
	this.cnMessage='请填写教育背景记录！';
	this.enMessage='Please enter valid Education Record.';
}

function Rule_LatestJobFunction()
{
this.Validate=Rule_RegTestBoolean;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请填写您的目前工作岗位！';
this.enMessage='Expected Job Function Is Empty!';
}
var LatestJobFunction_Rule=new Rule_LatestJobFunction()


//////////////////////////////////////////////////////////////////////

function Rule_EnglishLevel()
{
this.Validate=Rule_RegTestBlank;
this.Alert=Rule_ShowMessage;
this.RegExp=/[^\s]/;
this.cnMessage='请选择英语水平！';
this.enMessage='Please choose English Level !';
}

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();
var EnglishLevel_Rule=new Rule_EnglishLevel();

//////////////////////////////////////////////////////////////////////

//开始时间 校验规则
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=/^[^ま]{0,2000}$/;
this.cnMessage='描述不能超过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 college or school name.';
}

var CompanyName_Rule=new Rule_CompanyName();

function Rule_PositionsName(){
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^0-9@$%^*\-_=|{}:;"'<><?/]{1,100}$/;
	this.cnMessage='请正确填写职位!';
	this.enMessage='Please enter valid position name.';
}

var PositionsName_Rule=new Rule_PositionsName();


function Rule_SkillType(){
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^0-9@$%^*\-_=|{}:;"'<><?/]{1,100}$/;
	this.cnMessage='请正确填写技能类型!';
	this.enMessage='Please enter valid Skill name.';
}

var SkillType_Rule=new Rule_SkillType();

function Rule_SkillLevel(){
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^0-9@$%^*\-_=|{}:;"'<><?/]{1,100}$/;
	this.cnMessage='请正确填写技能级别!';
	this.enMessage='Please enter valid Skill Level.';
}

var SkillLevel_Rule=new Rule_SkillLevel();


////////////////////////////////////////////////////////////////////////


function Rule_IDNumber()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[_a-z0-9A-Z]{1,20}$/;
this.cnMessage='请正确填写证件号码！';
this.enMessage='Please enter number.';
}

function Rule_IDCard()
{
	this.Validate=Rule_RegTest;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/(^[0-9]{15})$|(^[0-9]{17}[a-z0-9A-Z]$)/;
	this.cnMessage='请正确填写身份证号码！';
	this.enMessage='Please enter number.';
}
var IDNumber_Rule=new Rule_IDNumber();
var IDCard_Rule=new Rule_IDCard();

////////////////////////////////////////////////////////////////////////


var Education_Rule=new Rule_Education();
var SchoolName_Rule=new Rule_SchoolName();
var Major_Rule=new Rule_Major();
var ChooseMajor_Rule=new Rule_ChooseMajor();
var EducationDetail_Rule=new Rule_EducationDetail();



/////////////////////////////////////////////////////////////////////////
////  联系方式验证

function Rule_ContactNumber()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^[^a-z]{0,20}$/;
this.cnMessage='请正确填写联系电话！';
this.enMessage='Please enter valid contact number.';
}

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.';
}

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.';
}


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.';
}

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.';
}

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 !';
}


function Rule_Address()
{
this.Validate=Rule_RegTestBlank;
this.Alert=Rule_ShowMessage;
this.RegExp='';
this.cnMessage='请填写联系地址！';
this.enMessage='Contact Address should not be empty !';
}

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 ContactNumber_Rule=new Rule_ContactNumber();
var OfficeNumber_Rule=new Rule_OfficeNumber();
var MobileNumber_Rule=new Rule_MobileNumber();
var InstantMessenger_Rule=new Rule_InstantMessenger();
var CurrentLocation_Rule=new Rule_CurrentLocation();
var Address_Rule=new Rule_Address
var Zip_Rule=new Rule_Zip();
var ContactMethod_Rule=new Rule_ContactMethod();

//////////////////////////////////////////////////////////////////////////
//


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]{0,250}$/g;
this.cnMessage='请填写内容，字数不要超过250字！';
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_MailTitle(){
	this.Validate=Rule_RegTestBlank;
	this.Alert=Rule_ShowMessage;
	this.RegExp=/^[^0-9@$%^*\-_=|{}:;"'<><?/]{1,100}$/;
	this.cnMessage='请正确邮件主题!';
	this.enMessage='Please enter valid Mail title.';
}

var MailTitle_Rule=new Rule_MailTitle();

function Rule_URL()
{
this.Validate=Rule_RegTest;
this.Alert=Rule_ShowMessage;
this.RegExp=/^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/;
this.cnMessage='请给出一个正确的网址，并以http://开头！';
this.enMessage='Invalid URL!';
}
var URL_Rule=new Rule_URL();

