function reg1(theForm)

 {

    var why = "";

	why +=checkvalue(theForm.userName.value,"Enter UserName");

	why +=checkvalue(theForm.passwd.value,"Enter password");

    why +=checksame(theForm.passwd.value,theForm.passwd_temp.value,"Does not match Passworsd's");

	why +=checkvalue(theForm.firstName.value,"Enter Your Nmme");

	why +=checkemail(theForm.email.value);

	why +=checkselect(theForm.currentloc,theForm.other_currentloc.value,"Current Location");

	why +=checkvalue(theForm.mobile.value,"Enter Mobile no");

	why +=checkselect(theForm.pref_location,theForm.other_pref1.value,"Prefered Location");

	why +=checkselect(theForm.jobCategory,theForm.other_category.value,"Job Category");

	why +=checkselect(theForm.exp_in_years,"","Year");

	why +=checkselect(theForm.exp_in_months,"","Months");

	why +=checkselect(theForm.highest_degree,theForm.other_degree.value,"Highest Qualification");

	why +=checkselect(theForm.highest_institute,theForm.other_highest_institute.value,"Educational Institute");

if (why != "")

    {

       alert(why);

       return false;

    }

return true;

}

function change_password(theForm)

 {

    var why = "";

	why +=checkvalue(theForm.old_pass.value,"Enter Old Password");

	why +=checkvalue(theForm.new_pass.value,"Enter New Password");

    why +=checksame(theForm.new_pass.value,theForm.new_cpass.value,"Does not match Passworsd's");

if (why != "")

    {

       alert(why);

       return false;

    }

return true;

}

function change_email(theForm)

 {

    var why = "";

	why +=checkvalue(theForm.old_emai.value,"Enter Old Email");

	why +=checkvalue(theForm.new_email.value,"Enter New Email");

    why +=checksame(theForm.new_email.value,theForm.new_cemail.value,"Does not match emailid's");

if (why != "")

    {

       alert(why);

       return false;

    }

return true;

}



function emp(theForm)

 {

    var why = "";

	why +=checkvalue(theForm.userName.value,"Enter UserName");

	why +=checkvalue(theForm.passwd.value,"Enter password");

    why +=checksame(theForm.passwd.value,theForm.passwd_temp.value,"Does not match Passworsd's");

	why +=checkvalue(theForm.fname.value,"Enter Your Name");

	why +=checkvalue(theForm.desgnation.value,"Enter Desgnation");

	why +=checkemail(theForm.email1.value);

	why +=checkvalue(theForm.cname.value,"Enter Your Company Name");

	why +=checkvalue(theForm.address.value,"Enter address");

	why +=checkvalue(theForm.other_city.value,"Enter City");

	why +=checkselect(theForm.Country,"","Country");

	

		if (why != "")

    {

       alert(why);

       return false;

    }

return true;

}

function edit_reg2(theForm)

 {

    var why = "";

	why +=checkvalue(theForm.title.value,"Enter Title Of The Resume");

	why +=checkext(theForm);

	if (why != "")

    {

       alert(why);

       return false;

    }

return true;

}



function reg2(theForm)

 {

    var why = "";

	why +=checkvalue(theForm.title.value,"Enter Resume Title");

	why +=checkext(theForm);

	if (why != "")

    {

       alert(why);

       return false;

    }

return true;

}

function reg3(theForm)

 {

    var why = "";

	why +=checkselect(theForm.bdate1,"","Date");

	why +=checkselect(theForm.bmonth1,"","Month");

	why +=checkselect(theForm.byear1,"","Year");

	why +=checkselect(theForm.nationality,"","Nationality");

		if (why != "")

    {

       alert(why);

       return false;

    }

return true;

}



function checksame(str1,str2,str3)

{

var error="";

if(str1==str2)

error="";

else

error=str3+"\n";

return error;

}



function checkprofile(strng,nam) {

 var error = "";

if((strng.length < 100) || (strng.length > 500))

   {

    error = "The profie is the wrong length.\n";

   }

return error;

}

function checkuser(strng) {

 var error = "";

 if (strng == "")

     {

    error = "You didn't enter a username.\n";

     }

if((strng.length < 5) || (strng.length > 10))

   {

    error = "The username is the wrong length.\n";

   }

return error;

} 

function checkemail(strng) {

 var error = "";

 var emailFilter=/^.+@.+\..{2,3}$/;

if (!(emailFilter.test(strng))) { 

       error = "Please enter a valid email address.\n";

}



return error;

} 

function checkvalue(strng,nam) {

var error = "";

 if (strng == "")

     {

    error = " "+nam+".\n";

     }

return error;

}

function checkselect(object,text,nam) {

var error = "";

 if (object.options[object.selectedIndex].value == -1)

     {

     if(text == "")

    error = "You didn't select a "+nam+".\n";

	else

	text="";

     }

return error;

}

function checkext(object) {

var error = "";

var value="";

var value1="";

var c=0;

value=object.file1.value;

value1=object.resume1.value;

if(value=="")

{

if(value1=="Paste U r CV")

 error="select Resume.\n"

 }

else

if (value.match(".doc") || value.match(".txt"))

{

	return error;

}

else

{

error="only upload docfiles.\n"

}

return error;

}