function regSubmit()
{
	var frmObj = document.frmRegister;

	var junk = "@!~+%<>?`;:#$%^&*()=|[]{}\\";
	var NotNum = "1234567890";
	var otherjunk = "!~+%<>?`;:#$%^&*()=|[]{}\\";	//allows @,.

	subscriptionType = 	frmObj.subscriptionType.value;
	//licences = frmObj.licences.value;

	password = frmObj.password.value;
	retypepassword = frmObj.retypepassword.value;
	
	title = frmObj.title.value;
	firstname = frmObj.firstname.value;
	lastname = frmObj.lastname.value;

	ddlb_from_day = frmObj.ddlb_from_day;
	ddlb_from_mth = frmObj.ddlb_from_mth;
	ddlb_from_yr = frmObj.ddlb_from_yr;

	agegroup = frmObj.agegroup.value;


	city = frmObj.city.value;	
	country = frmObj.country.value;	
	profession = frmObj.profession.value;	
	organisation = frmObj.organisation.value;	
	designation = frmObj.designation.value;	

	login = frmObj.login.value;	
	
	phone = frmObj.phone.value;
	mobile = frmObj.mobile.value;
	fax = frmObj.fax.value;
	corporatemail = frmObj.corporatemail.value;
	personalmail = frmObj.personalmail.value;
	terms = frmObj.terms.checked;


/*--------------username/login check begins--------------*/
		/*
			Checks on Username
			1) It should not be null
			2) It should not contain junk
		*/


		// Checking for null
		stat = checkNull("User name", login);
		if(!stat){
			frmObj.login.focus( );
			return;
		}

		//Checking for junk characters
		stat = checkJunk("User name",  login ,otherjunk);
		if(!stat){
			frmObj.login.focus( );
			return;
		}

		// Checking for Min length
		stat = checkMinLength("User name", login, 6);
		if(!stat){
			frmObj.login.focus( );
			return;
		}

		// Checking for Max length
		stat = checkMaxLength("User name", login, 30);
		if(!stat){
			frmObj.login.focus( );
			return;
		}

		/*--------------password check begins--------------*/
			/*
				Checks on password
				1) It should not be null
				2) It should not exceed 6 characters
				3) It should not contain junk values
			*/

			

			// Checking for null
			stat = checkNull("Password", password);

			if(!stat){
				frmObj.password.focus( );
				return;
			}

			// Checking for Min length
			stat = checkMinLength("Password", password, 6);

			if(!stat){
				frmObj.password.focus( );
				return;
			}

			// Checking for Max length
			stat = checkMaxLength("Password", password, 15);

			if(!stat){
				frmObj.password.focus( );
				return;
			}

			// Checking for junk characters
			stat = checkJunk("Password", password, junk);

			if(!stat){
				frmObj.password.focus( );
				return;
			}

		/*--------------password check ends--------------*/


		/*--------------Retype  password check begins--------------*/
			/*
				Checks on Retype  password
				1) It should not be null
				2) It should not exceed 6 characters
				3) It should not contain junk values
			*/

			

			// Checking for null
			stat = checkNull("Retype  Password", retypepassword);

			if(!stat){
				frmObj.retypepassword.focus( );
				return;
			}

			// Checking for min length
			stat = checkMinLength("Retype  Password", retypepassword, 6);

			if(!stat){
				frmObj.retypepassword.focus( );
				return;
			}


			// Checking for Max length
			stat = checkMaxLength("Password", retypepassword, 15);

			if(!stat){
				frmObj.retypepassword.focus( );
				return;
			}

			// Checking for junk characters
			stat = checkJunk("Retype  Password", retypepassword, junk);

			if(!stat){
				frmObj.retypepassword.focus( );
				return;
			}

		/*--------------Retype  PIN check ends--------------*/

		// Check if the entered PIN and the Retype  PIN match
		if(password == retypepassword){
			//
		}
		else{
			alert("Entered Passwords do not match ! ");
			frmObj.retypepassword.focus( );
			return;
		}

		/*----------Title Check---------*/ 
		// Checking for null
		/*
		stat = checkNull("Title", title);
		if(!stat){
			frmObj.title.focus();
			return;
		}
		*/
		/*----------firstname Check---------*/ 
			/*
				Checks on Firstname
				1) It should not be null
				2) It should not contain junk values
			*/
			// Checking for null
			stat = checkNull("Firstname", firstname);
			if(!stat){
				frmObj.firstname.focus( );
				return;
			}

			// Checking for junk characters
			stat = checkJunk("Firstname", firstname, junk);

			if(!stat){
				frmObj.firstname.focus( );
				return;
			}


			//Checking for Not a Number characters
			stat = checkJunk("Firstname",  firstname ,NotNum);
			if(!stat){
				frmObj.firstname.focus( );
				return;
			}

		/*----------lastname Check---------*/ 
			/*
				Checks on lastname
				1) It should not be null
				2) It should not contain junk values
			*/
			// Checking for null
			stat = checkNull("Lastname", lastname);
			if(!stat){
				frmObj.lastname.focus( );
				return;
			}

			// Checking for junk characters
			stat = checkJunk("Lastname", lastname, junk);
			if(!stat){
				frmObj.lastname.focus( );
				return;
			}
			//Checking for Not a Number characters
			stat = checkJunk("Lastname",  lastname ,NotNum);
			if(!stat){
				frmObj.lastname.focus( );
				return;
			}



		/*----------Date Check---------*/ 
		checkDate(ddlb_from_day, ddlb_from_mth, ddlb_from_yr);

		/*----------AgeGroup Check---------*/ 
		
		/*		
			stat = checkNull("AgeGroup",  agegroup);
			if(!stat){
				frmObj.agegroup.focus();
				return;
			}
		*/	


		/*----------Organisation Check---------*/ 
			/*
				Checks on organisation
				1) It should not be null
				2) It should not contain junk values
			*/

			

			// Checking for null
			stat = checkNull("Organisation", organisation);

			if(!stat){
				frmObj.organisation.focus( );
				return;
			}

			// Checking for junk characters
			stat = checkJunk("Organisation", organisation, junk);

			if(!stat){
				frmObj.organisation.focus( );
				return;
			}
	


		/*----------Designation Check---------*/ 
			/*
				Checks on designation
				1) It should not be null
				2) It should not contain junk values
			*/

			

			// Checking for null
			stat = checkNull("Designation", designation);

			if(!stat){
				frmObj.designation.focus( );
				return;
			}

			// Checking for junk characters
			stat = checkJunk("Designation", designation, junk);

			if(!stat){
				frmObj.designation.focus( );
				return;
			}
		/*--------------Designation check ends--------------*/

		/*--------------subscriptionType check begins--------------*/
/*			if (subscriptionType == 0)
			{
				alert("Please select / enter a valid value for Subscription Type !");
				frmObj.subscriptionType.focus();
				return;
			} */


		/*--------------subscriptionType check ends--------------*/



		/*----------Profession Check---------*/ 
			/*
				Checks on profession
				1) It should not be null
				2) It should not contain junk values
			*/

			// Checking for null
			stat = checkNull("Profession", profession);
			if(!stat){
				frmObj.profession.focus( );
				return;
			}




		var officeAddressValue = convertBR(frmObj.offAddress.value); //alert(officeAddressValue);
		frmObj.officeaddress.value = officeAddressValue;

		var postalAddressValue = convertBR(frmObj.postAddress.value); //alert(postalAddressValue);
		frmObj.postaladdress.value = postalAddressValue;

		/* Address Check */
/*
		// Checking for null
		
		stat = checkNull("Office Address", frmObj.offAddress.value);
		if(!stat){
			frmObj.offAddress.focus( );
			return;
		}
*/
		stat = checkNull("Postal Address", frmObj.postAddress.value);
		if(!stat){
			frmObj.postAddress.focus( );
			return;
		}


		/*----------City Check---------*/ 
			/*
				Checks on City
				1) It should not be null
				2) It should not contain junk values
			*/

			

			// Checking for null
			stat = checkNull("City", city);

			if(!stat){
				frmObj.city.focus( );
				return;
			}

			// Checking for junk characters
			stat = checkJunk("City", city, junk);

			if(!stat){
				frmObj.city.focus( );
				return;
			}

		//Checking for Not a Number characters
			stat = checkJunk("City",  city ,NotNum);
			if(!stat){
				frmObj.city.focus( );
				return;
			}
		

		/*----------Country Check---------*/ 
			/*
				Checks on country
				1) It should not be null
				2) It should not contain junk values
			*/

			

			// Checking for null
			stat = checkNull("Country", country);

			if(!stat){
				frmObj.country.focus( );
				return;
			}

			// Checking for junk characters
			stat = checkJunk("Country", country, junk);

			if(!stat){
				frmObj.country.focus( );
				return;
			}


			//Checking for Not a Number characters
			stat = checkJunk("Country",  country ,NotNum);
			if(!stat){
				frmObj.country.focus( );
				return;
			}





/*-------------- Email corporatemail Id check begins--------------*/
	/*
		Checks on corporatemail Id
		1) It should not contain junk
	*/

	if ((corporatemail == null)||(corporatemail == "")){
		alert("Please select / enter a valid value for CorporateMail ID !");
		frmObj.corporatemail.focus();
		return;
	}
	if (checkEmail(corporatemail)==false){
		corporatemail = "";
		frmObj.corporatemail.focus();
		return;
	}

/*--------------personalmail Id check begins--------------*/
	/*
		Checks on personalmail Id
		1) It should not contain junk
	*/
	
	if ((personalmail == null)||(personalmail == "")){
		alert("Please select / enter a valid value for Newsletter EmailID !");
		frmObj.personalmail.focus();
		return;
	}

	if (personalmail != "")
	{
		if (checkEmail(personalmail)==false){
			personalmail = "";
			frmObj.personalmail.focus();
			return;
		}
	}


		/*--------------phone check begins--------------*/
			/*
				Checks on phone
				1) It should not contain junk
				2) It should not contain characters
			*/

			// Checking for null
			stat = checkNull("Phone No ", phone);
			if(!stat){
				frmObj.phone.focus( );
				return;
			}

			stat = checkJunk("Phone No ", phone, junk);
			if(!stat){
				frmObj.phone.focus();
				return;
			}

			if(isNaN(phone) == true){
				alert("Please select / enter a valid value for Phone No!");
				frmObj.phone.focus();
				return;
			}


		/*--------------Mobile check begins--------------*/
			/*
				Checks on Mobile
				1) It should not contain junk		
				2) Check Min length
				3) It should not contain characters
			*/
			/*
			// Checking for null
			stat = checkNull("Mobile No ", mobile);
			if(!stat){
				frmObj.mobile.focus( );
				return;
			}
			*/
			stat = checkJunk("Mobile No ", mobile, junk);
			if(!stat){
				frmObj.mobile.focus();
				return;
			}
			if(!stat){
				if(mobile < 10){
					alert("Mobile No should be of atleast 10 characters ");
					frmObj.mobile.focus();
					return;
				}
			}
			if(isNaN(mobile) == true){
				alert("Please select / enter a valid value for Mobile No !");
				frmObj.mobile.focus();
				return;
			}



		/*--------------fax check begins--------------*/
			/*
				Checks on fax
				1) It should not contain junk
				2) It should not contain characters
			*/
			// Checking for null
			/*
			stat = checkNull("Fax No", fax);
			if(!stat){
				frmObj.fax.focus( );
				return;
			}
			*/
			stat = checkJunk("Fax No", fax, junk);
			if(!stat){
				frmObj.fax.focus();
				return;
			}
			if(isNaN(fax) == true){
				alert("Please select / enter a valid value for Fax No !");
				frmObj.fax.focus();
				return;
			}

		/*--------------fax check Ends--------------*/

		/*--------------Terms & Conditions Check begins--------------*/
			/*
				Checks on fax
				1) It should not left unchecked
			*/
	
			if (terms == false)
			{
				alert("Please Accept the Terms & Conditions !");
				frmObj.terms.focus();
				return;
			}



	frmObj.target="_self";
	frmObj.action="../register/registerSubmit.jsp";
	frmObj.submit( );
}


function selectType(){

	var junk = "@!~%<>?`\"';:,#$%^&*()_=|[]{}\\";
	var frmObj = document.frmRegister;
	subscriptionType = 	frmObj.subscriptionType.value;
	licences = frmObj.licences.value;


	if (subscriptionType != 3){
		frmObj.licences.value="";
		expr = eval(frmObj.licences.disabled=true); 
		eval(expr); 
	}else{

		expr = eval(frmObj.licences.disabled=false); 
		eval(expr); 
		/*--------------licences check begins--------------*/
			if (subscriptionType == 3)
			{
				stat = checkNull("No. of Licences ", licences);
				if(!stat){
					frmObj.licences.focus( );
					return;
				}

				if (licences != "" || licences != null){
					stat = checkJunk("No. of Licences", licences, junk);
					if(!stat){
						frmObj.licences.focus();
						return;
					}

					if(isNaN(licences) == true){
						alert("Please select / enter a valid value for No. of Licences !");
						frmObj.licences.focus();
						return;
					}
				}
			}else{
					expr = eval(frmObj.licences.disabled=true); 
					eval(expr); 
					//alert("Please select a valid SubscriptionType for licences !");
			}

		/*--------------licences check begins--------------*/

	}
}

function setFocus( ){
	frmObj = document.frmRegister;
	frmObj.login.focus( );
	return;
}