function Matrimonial_UserTellAFriendFormValidator()
{
	var email = document.getElementById('mutaff-em');

	if(!isEmpty(email,"Email can't be empty!")){
		if(emailValidator(email, "Please enter a valid email address\nExample: myname@primemarriage.com")){
				return true;
		}
	}
		
	return false;
}

function Matrimonial_UserSendToAFriendFormValidator()
{
	var email = document.getElementById('mustaf-em');

	if(!isEmpty(email,"Email can't be empty!")){
		if(emailValidator(email, "Please enter a valid email address\nExample: myname@primemarriage.com")){
				return true;
		}
	}
		
	return false;
}

function MarriageUserReplyMessageFocusToDescriptionText()
{
	var description = document.getElementById('murm-md');
	
	description.focus();
	
}

function MarriageDisplayMessage(messagenumber)
{
	//alert(messagenumber);
	var link = "mdm.php?id=" + messagenumber;
	var title = "Display_Message" + messagenumber;
	//alert(link);
	mywindow = window.open(link, title, 'status =1, menubar=1, toolbar=1, directories=1, resizable=1, scrollbars =1, top=0, left=100, height=600,width=800');
	//mywindow.moveTo(50,50);

}

function Matrimonial_UserReplyMessageFormValidator()
{
	var title = document.getElementById('murm-mt');
	var description = document.getElementById('murm-md');

	if(!isEmpty(title,"Title/Summary can't be empty!")){
		if(!isEmpty(description,"Description can't be empty!")){
			if(lengthRestriction(description, 50, 65000,"Description")){
				return true;
			}
		}
	}
		
	return false;
	
}

function Matrimonial_UserSendMessageFormValidator()
{
	var title = document.getElementById('musm-mt');
	var description = document.getElementById('musm-md');

	if(!isEmpty(title,"Title/Summary can't be empty!")){
		if(!isEmpty(description,"Description can't be empty!")){
			if(lengthRestriction(description, 50, 65000,"Description")){
				return true;
			}
		}
	}
		
	return false;
	
}

function MarriageForm1SetFocusToTitleText()
{
	var title = document.getElementById('mf1-mt');
	
	title.focus();
	
}

function UserRegistrationSetFocusToFirstName()
{
	var firstname = document.getElementById('urf-fn');
	
	firstname.focus();
	
}

function MarriageForm2SetFocusToAgeRange()
{
	var agerange = document.getElementById('mf2-arp');
	
	agerange.focus();
	
}

function UserLoginSetFocusToUserLoginText()
{
	//alert("Hey");

	var username = document.getElementById('luf-un');
	
	username.focus();
	
}


function MarriageUserTellAFriendFocusToEmail()
{
	//alert("Hey");

	var email = document.getElementById('mutaff-em');
	
	email.focus();
	
}


function MarriageUserSendToAFriendFocusToEmail()
{
	//alert("Hey");

	var email = document.getElementById('mustaf-em');
	
	email.focus();
	
}

function UserForgotUsername_formValidator()
{
	var email = document.getElementById('ufunf-em');

	if(!isEmpty(email, "Must enter an email address!")){
		if(emailValidator(email, "Please enter a valid email address\nExample: myname@primemarriage.com")){
			return true;
		}
	}

	return false;
}

function MarriageUpdateAdGetEmail_formValidator()
{
	var email = document.getElementById('muagef-em');
	var password = document.getElementById('muagef-pw');

	if(!isEmpty(email, "Must enter an email address!")){
		if(emailValidator(email, "Please enter a valid email address\nExample: myname@primemarriage.com")){
			if((lengthRestriction(password, 6, 15,"Password")) && (isAlphanumeric(password, "Password must contain only letters and numbers!"))){
				return true;
			}
		}
	}


	return false;
}

function MarriageQuickSearchGroom_formValidator()
{

	if(MarriageQuickSearchCore_formValidator()){
		return true;
	}

	return false;
}

function MarriageQuickSearchBride_formValidator()
{

	if(MarriageQuickSearchCore_formValidator()){
		return true;
	}

	return false;
}

function MarriageIndexSearch_formValidator()
{
	
	var gender = document.getElementById('mqsf-mgu');
	var agerange = document.getElementById('mqsf-aru');

	if(!isEmpty(gender,"Must select bride or groom!")){
		if(!isEmpty(agerange,"Must select an age range!")){
			return true;
		}
	}

	return false;
}


function MarriageQuickSearch_formValidator()
{
	
	var gender = document.getElementById('mqsf-mgu');

	if(!isEmpty(gender,"Must select bride or groom!")){
		if(MarriageQuickSearchCore_formValidator()){
			return true;
		}
	}

	return false;
}

function MarriageQuickSearchCore_formValidator()
{
	
	var agerange = document.getElementById('mqsf-aru');
	var country = document.getElementById('mqsf-cou');

	if(!isEmpty(agerange,"Must select an age range!")){
		if(!isEmpty(country,"Must select a country!")){
			return true;
		}
	}

	return false;

}

function MarriageDetailSearchGroom_formValidator()
{

		if(MarriageDetailSearchCore_formValidator()){
			return true;
		}

	return false;

}


function MarriageDetailSearchBride_formValidator()
{

		if(MarriageDetailSearchCore_formValidator()){
			return true;
		}

	return false;

}


function MarriageDetailSearch_formValidator()
{
	var gender = document.getElementById('mdsf-mgu');

	if(!isEmpty(gender,"Must select bride or groom!")){
		if(MarriageDetailSearchCore_formValidator()){

			return true;
		}
	}

	return false;

}


function MarriageDetailSearchCore_formValidator()
{

	var agerange = document.getElementById('mdsf-aru');
	var country = document.getElementById('mdsf-cou');
	var maritalstatus = document.getElementById('mdsf-msu');
	var heighttotal = document.getElementById('mdsf-htu');
//	var complexion = document.getElementById('mdsf-cxu');
//	var bodytype = document.getElementById('mdsf-btu');
//	var mothertongue = document.getElementById('mdsf-mtu');
//	var religion = document.getElementById('mdsf-reu');
//	var education = document.getElementById('mdsf-ecu');
//	var ocupation = document.getElementById('mdsf-opu');

	if(!isEmpty(agerange,"Must select an age range!")){
	if(!isEmpty(country,"Must select a country!")){
		if(!isEmpty(maritalstatus,"Must select maritalstatus!")){
			if(!isEmpty(heighttotal,"Must select a height!")){
//				if(!isEmpty(complexion,"Must select a complexion!")){
//					if(!isEmpty(bodytype,"Must select a bodytype!")){
//						if(!isEmpty(mothertongue,"Must select a mother tongue!")){
//							if(!isEmpty(religion,"Must select a religion!")){
//								if(!isEmpty(education,"Must select an education!")){
//									if(!isEmpty(ocupation,"Must select an ocupation!")){
										return true;
//									}
//								}
//							}
//						}
//					}
//				}
			}
		}
	}
	}


	return false;

}

function Matrimonial_MyTrustedPeopleAddFormValidator()
{
	var username = document.getElementById('mmtpaf-un');
	var picture = document.getElementById('mmtpaf-pi');
	var phone = document.getElementById('mmtpaf-ph');
	var email = document.getElementById('mmtpaf-em');

//	alert("hello");
	if(lengthRestriction(username, 6, 15,"UserName") && (isAlphanumeric(username, "Username must contain only letters and numbers!"))){
		return true;
	}

	return false;
}

function Matrimonial_MyTrustedPeopleModifyFormValidator()
{
	var username = document.getElementById('mmtpmf-un');
	var picture = document.getElementById('mmtpmf-pi');
	var phone = document.getElementById('mmtpmf-ph');
	var email = document.getElementById('mmtpmf-em');

//	alert("hello");
	if(lengthRestriction(username, 6, 15,"UserName") && (isAlphanumeric(username, "Username must contain only letters and numbers!"))){
		return true;
	}

	return false;
}

function Matrimonial_MyTrustedPeopleDeleteFormValidator()
{
	var username = document.getElementById('mmtpdf-un');

//	alert("hello");
	if(lengthRestriction(username, 6, 15,"UserName") && (isAlphanumeric(username, "Username must contain only letters and numbers!"))){
		return true;
	}

	return false;
}

function MarriageDisplayImage(recordnumber)
{
	//alert(recordnumber);
	var link = "mdi.php?id=" + recordnumber;
	var title = "Display_Picture" + recordnumber;
	//alert(link);
	mywindow = window.open(link, title, 'status =1, menubar=1, toolbar=1, directories=1, resizable=1, scrollbars =1, top=0, left=100, height=600,width=800');
	//mywindow.moveTo(50,50c);

}

function MarriageDisplayDefinitions(parameter)
{
	//alert(parameter);
	var link = "definitions.php?x=" + parameter;
	var title = "Display_Definitions" + parameter;
	//alert(link);
	mywindow = window.open(link, title, 'status =1, menubar=1, toolbar=1, directories=1, resizable=1, scrollbars =1, top=0, left=100, height=350,width=400');
	//mywindow.moveTo(50,50);

}

function MarriageDisplayWhyInWithPhotos(parameter)
{
	//alert(parameter);
	var link = "why-in-with-photos.php";
	//alert(link);
	mywindow = window.open(link, 'Display_Why_In_With_Photos', 'status =1, menubar=1, toolbar=1, directories=1, resizable=1, scrollbars =1, top=0, left=100, height=400,width=600');
	//mywindow.moveTo(50,50);

}

function MarriageDisplayWhyNotInWithPhotos(parameter)
{
	//alert(parameter);
	var link = "why-not-in-with-photos.php";
	//alert(link);
	mywindow = window.open(link, 'Display_Why_In_With_Photos', 'status =1, menubar=1, toolbar=1, directories=1, resizable=1, scrollbars =1, top=0, left=100, height=400,width=600');
	//mywindow.moveTo(50,50);

}

function MarriageTellAFriendWindow()
{
	//alert(something);
	var link = "marriage-user-tell-a-friend.php";
	//alert(link);
	mywindow = window.open(link, 'Tell_a_friend', 'status =1, menubar=1, toolbar=1, resizable=1, scrollbars =1, top=0, left=100, height=600,width=800');
	//mywindow.moveTo(50,50);

}

function MarriageDisplayRecord(recordnumber)
{
	//alert(recordnumber);
	var link = "mdr.php?id=" + recordnumber;
	var title = "Display_Record" + recordnumber;
	//alert(link);
	mywindow = window.open(link, title, 'status =1, menubar=1, toolbar=1, resizable=1, scrollbars =1, top=0, left=100, height=600,width=800');
	//mywindow.moveTo(50,50);

}

function MarriageDisplayTrustedPeople(recordnumber)
{
	//alert(recordnumber);
	var link = "mdtp.php?id=" + recordnumber;
	var title = "Display_TrustedPeople" + recordnumber;
	//alert(link);
	mywindow = window.open(link, title, 'status =1, menubar=1, toolbar=1, resizable=1, scrollbars =1, top=0, left=100, height=600,width=800');
	//mywindow.moveTo(50,50);

}


function CheckUserNameAvailability()
{
	//alert("Hello");
	var username=document.getElementById('urf-un');
//	var link = "checkusername.php?x=" + username.value + "\" ,\"Check UserName Availability\"" + ",\"status=0, height=10, width = 100, resizable = 0\"";
	var link = "checkusername.php?x=" + username.value;

	if(lengthRestriction(username, 6, 15,"UserName") && (isAlphanumeric(username, "Username must contain only letters and numbers!"))){
		 window.open(link, 'CheckUserNameAvailability', 'height=200,width=400');
	}

	return false;
}

function TutoringPosting_formValidator()
{
	var tutoringtype=document.getElementById('tpf-tty');
	var tutoringtitle = document.getElementById('tpf-tti');
	var city=document.getElementById('tpf-ci');
	var country=document.getElementById('tpf-co');
	var tutoringamount=document.getElementById('tpf-ta');
	var currency=document.getElementById('tpf-cu');
	var per=document.getElementById('tpf-pe');
	var email=document.getElementById('tpf-em');
	var phone=document.getElementById('tpf-ph');
	var fax=document.getElementById('tpf-fx');
	var postaladdress=document.getElementById('tpf-pa');
	
	if(!isEmpty(tutoringtype, "Must select a category!")){
		if(!isEmpty(tutoringtitle, "Must enter a Summary/Title!")){
			if((!isEmpty(city, "Must enter city of tutoring location!"))&& (isAlphanumericWithSpace(city, "City must contain only letters, numbers and space!"))){
				if((!isEmpty(country, "Must enter country of tutoring location!"))&& (isAlphanumericWithSpace(country, "Country must contain only letters, numbers and space!"))){
					if((!isEmpty(tutoringamount, "Must enter salary amount!"))&& isNumeric(tutoringamount, "Salary amount must be numeric value only!")){
						if(!isEmpty(currency, "Must select currency of tutoring amount!")){
							if(!isEmpty(per, "Must select salary amount per (month/year etc)!")){
								if(!isEmpty(email, "Must enter an email address!")){
									if(emailValidator(email, "Please enter a valid email address\nExample: myname@yahoo.com")){
										if(noMsgIsEmpty(phone)){
											if(noMsgIsEmpty(fax)){
												return true;
											}
											else if(isPhone(fax, "Fax number must contain only digits"))
											{
												return true;
											}
										}
										else if(isPhone(phone,"Phone number must contain only digits"))
										{
											if(noMsgIsEmpty(fax)){
												return true;
											}
											else if(isPhone(fax, "Fax number must contain only digits"))
											{
												return true;
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}

	return false;
}


function Matrimonial_form2Validator()
{

	var agerange = document.getElementById('mf2-arp');
	var country = document.getElementById('mf2-cop');
//	var yourdescription = document.getElementById('mf2-pdp');

	if(!isEmpty(agerange,"Must enter an age range!")){
		if(!isEmpty(country,"Must select partners country of residence!")){
			return true;
		}
	}


	return false;
}


function Matrimonial_form1Validator()
{
	//alert("hey");

	var title = document.getElementById('mf1-mt');
	var age = document.getElementById('mf1-age');
	var city = document.getElementById('mf1-ciu');
	var country = document.getElementById('mf1-cou');
	var maritalstatus = document.getElementById('mf1-msu');
	var heightfeet = document.getElementById('mf1-hfu');
	var heightinches = document.getElementById('mf1-hiu');
	var complexion = document.getElementById('mf1-cxu');
	var bodytype = document.getElementById('mf1-btu');
	var mothertongue = document.getElementById('mf1-mtu');
	var religion = document.getElementById('mf1-reu');
	var education = document.getElementById('mf1-ecu');
	var ocupation = document.getElementById('mf1-opu');
	var yourdescription = document.getElementById('mf1-ydu');
	var email = document.getElementById('mf1-emu');
	var phone = document.getElementById('mf1-phu');
	var uploadedfile = document.getElementById('mf1-ufu');


	if(!isEmpty(title, "Must enter a Summary/Title!")){
		if(matrimonial_form1_radio_check()){
			if((!isEmpty(age,"Must enter your age!")) && (valueRestriction(age,18,99,"Age"))){
				if((!isEmpty(city,"Must enter your city name!")) && (isAlphanumericWithSpace(city, "City must contain only letters, numbers and space!"))){
					if(!isEmpty(country,"Must select your country of residence!")){
						if(!isEmpty(maritalstatus,"Must select your marital status!")){
							if(!isEmpty(heightfeet,"Must select your height in feet!")){
								if(!isEmpty(heightinches,"Must select your height in inches!")){
									if(!isEmpty(complexion,"Must select your complexion!")){
										if(!isEmpty(bodytype,"Must select your body type!")){
											if(!isEmpty(mothertongue,"Must select your mother tongue!")){
												if(!isEmpty(religion,"Must select your religion!")){
													if(!isEmpty(education,"Must select your education!")){
														if(!isEmpty(ocupation,"Must select your ocupation!")){
															if(!isEmpty(yourdescription,"Must write some more detials about you!")){
																if(lengthRestriction(yourdescription, 15, 65000,"Description")){
																	if(noMsgIsEmpty(uploadedfile)){
																		if(!isEmpty(email,"Must enter a contact email address")){
																			if(emailValidator(email, "Please enter a valid email address\nExample: myname@yahoo.com")){
																				if(noMsgIsEmpty(phone)){
																					return true;
																				}
																				else if(isPhone(phone,"Phone number must contain only digits"))
																				{
																					return true;
																				}
																			}
																		}
																	}
																	else if(imageFileNameValidator(uploadedfile,"Must be a valid file type (jpg or gif)!")){
																		if(!isEmpty(email,"Must enter a contact email address")){
																			if(emailValidator(email, "Please enter a valid email address\nExample: myname@yahoo.com")){
																				if(noMsgIsEmpty(phone)){
																					return true;
																				}
																				else if(isPhone(phone,"Phone number must contain only digits"))
																				{
																					return true;
																				}
																			}
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}


	return false;
}


function PasswordChange_formValidator()
{

	// Make quick references to our fields
	var username = document.getElementById('pcf-un');
	var email = document.getElementById('pcf-em');
	var oldpassword = document.getElementById('pcf-op');
	var newpassword = document.getElementById('pcf-np');
	var newpassword2 = document.getElementById('pcf-np2');

	// Check each input in the order that it appears in the form!
	if(lengthRestriction(username, 6, 15,"UserName") && (isAlphanumeric(username, "Username must contain only letters and numbers!"))){
		if(emailValidator(email, "Please enter a valid email address\nExample: myname@yahoo.com")){
			if((lengthRestriction(oldpassword, 6, 15,"oldPassword")) && (isAlphanumeric(oldpassword, "OldPassword must contain only letters and numbers!"))){
				if((lengthRestriction(newpassword, 6, 15,"newPassword")) && (isAlphanumeric(newpassword, "NewPassword must contain only letters and numbers!"))){
					if(!isSame(oldpassword,newpassword,"Old password is same as new password\nPlease enter different new password")){
						if(!isNotSame(newpassword,newpassword2,"Re-entered password is not same as new password\nPlease Re-enter same password")){
							return true;
						}
					}
				}
			}
		}
	}

	return false;

}


function Passwordreset_formValidator()
{
	// Make quick references to our fields
	var username = document.getElementById('prf-un');
	var email = document.getElementById('prf-em');

	// Check each input in the order that it appears in the form!
	if(lengthRestriction(username, 6, 15,"UserName") && (isAlphanumeric(username, "Username must contain only letters and numbers!"))){
		if(emailValidator(email, "Please enter a valid email address\nExample: myname@yahoo.com")){
			return true;
		}
	}

	return false;

}

function UserLogin_formValidator()
{
	// Make quick references to our fields
	var username = document.getElementById('luf-un');
	var password = document.getElementById('luf-pw');

	// Check each input in the order that it appears in the form!
	if(lengthRestriction(username, 6, 15,"UserName") && (isAlphanumeric(username, "Username must contain only letters and numbers!"))){
		if((lengthRestriction(password, 6, 15,"Password")) && (isAlphanumeric(password, "Password must contain only letters and numbers!"))){
			return true;
		}
	}

	return false;
}

function UserUpdate_formValidator(){

	// Make quick references to our fields
	var firstname = document.getElementById('muuf-fn');
	var middlename = document.getElementById('muuf-mn');
	var lastname = document.getElementById('muuf-ln');
	var city = document.getElementById('muuf-ci');
	var country = document.getElementById('muuf-co');
	var email = document.getElementById('muuf-em');
	var email2 = document.getElementById('muuf-em2');
	var username = document.getElementById('muuf-un');
	var accept = document.getElementById('muuf-ac');
	var security_code = document.getElementById('security_code');

	// Check each input in the order that it appears in the form!
	if(!isEmpty(firstname, "Must enter a First Name!")&& isAlphabet(firstname, "Please enter only letters for your First Name")){
		if(isEmptyOrAlphabet(middlename, "Please enter only letters for your Middle Name")){
			if(!isEmpty(lastname, "Must enter a Last Name!")&& isAlphabet(lastname, "Please enter only letters for your Last Name")){
				if(!isEmpty(city, "Must enter a city name!")&& isAlphabetWithSpace(city, "Please enter only letters for the City")){
					if(!isNotSelected(country,"Please select a country")){
						if(emailValidator(email, "Please enter a valid email address\nExample: myname@yahoo.com")){
							if(!isNotSame(email,email2,"Re-entered email is not same as Email\nPlease Re-enter same email")){
								if(lengthRestriction(username, 6, 15,"UserName") && (isAlphanumeric(username, "Username must contain only letters and numbers!"))){
									if(!isNotChecked(accept,"Please Accept terms and conditions by checking the box\nI agree to PrimeMarriage.com's Terms of Use.")){
										if(!isEmpty(security_code, "Must enter the security code shown on the right!")&& isAlphanumeric(security_code, "Security Code contains only letters and numbers!")){
											return true;
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	
	return false;
	
}

function UserRegistration_formValidator(){

	// Make quick references to our fields
	var firstname = document.getElementById('urf-fn');
	var middlename = document.getElementById('urf-mn');
	var lastname = document.getElementById('urf-ln');
	var city = document.getElementById('urf-ci');
	var country = document.getElementById('urf-co');
	var email = document.getElementById('urf-em');
	var email2 = document.getElementById('urf-em2');
	var username = document.getElementById('urf-un');
	var password = document.getElementById('urf-pw');
	var password2 = document.getElementById('urf-pw2');
	var accept = document.getElementById('urf-ac');
	var security_code = document.getElementById('security_code');

	// Check each input in the order that it appears in the form!
	if(!isEmpty(firstname, "Must enter a First Name!")&& isAlphabet(firstname, "Please enter only letters for your First Name")){
		if(isEmptyOrAlphabet(middlename, "Please enter only letters for your Middle Name")){
			if(!isEmpty(lastname, "Must enter a Last Name!")&& isAlphabet(lastname, "Please enter only letters for your Last Name")){
				if(!isEmpty(city, "Must enter a city name!")&& isAlphabetWithSpace(city, "Please enter only letters for the City")){
					if(!isNotSelected(country,"Please select a country")){
						if(emailValidator(email, "Please enter a valid email address\nExample: myname@yahoo.com")){
							if(!isNotSame(email,email2,"Re-entered email is not same as Email\nPlease Re-enter same email")){
								if(lengthRestriction(username, 6, 15,"UserName") && (isAlphanumeric(username, "Username must contain only letters and numbers!"))){
									if((lengthRestriction(password, 6, 15,"Password")) && (isAlphanumeric(password, "Password must contain only letters and numbers!"))){
										if(!isNotSame(password,password2,"Re-entered password is not same as password\nPlease Re-enter same password")){
											if(!isNotChecked(accept,"Please Accept terms and conditions by checking the box\nI agree to PrimeMarriage.com's Terms of Use.")){
												if(!isEmpty(security_code, "Must enter the security code shown on the right!")&& isAlphanumeric(security_code, "Security Code contains only letters and numbers!")){
													return true;
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	
	return false;
	
}

function isSame(elem1, elem2, helperMsg)
{
	if(elem1.value == elem2.value)
	{
		alert(helperMsg);
		elem2.focus(); // set the focus to this input
		return true;
	}
	return false;
}

function isNotSame(elem1, elem2, helperMsg)
{
	if(elem1.value != elem2.value)
	{
		alert(helperMsg);
		elem2.focus(); // set the focus to this input
		return true;
	}
	return false;
}

function isNotChecked(elem, helperMsg)
{
	if(elem.checked==0)
	{
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return true;
	}
	return false;
}

function isNotSelected(elem, helperMsg)
{
	if(elem.selectedIndex==0)
	{
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return true;
	}
	return false;
}

function isEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return true;
	}
	return false;
}

function noMsgIsEmpty(elem){
	if(elem.value.length == 0){
		return true;
	}
	return false;
}

function isNumeric(elem, helperMsg){
	
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isPhone(elem, helperMsg){
	var numericExpression = /^[()\-0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}


function isDate(elem, helperMsg){
	var numericExpression = /^[0-9]+\/[0-2]+\/[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphabet(elem, helperMsg){
	var alphaExp = /^[a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphabetWithSpace(elem, helperMsg){
	var alphaExp = /^[a-zA-Z]+\s*[a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isEmptyOrAlphabet(elem, helperMsg){
	var alphaExp = /^[a-zA-Z]+$/;
	if(elem.value.length==0)
	{
		return true;
	}
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}


function isAlphanumeric(elem, helperMsg){
	var alphaExp = /^[0-9a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphanumericWithSpace(elem, helperMsg){
	var alphaExp = /^\s*[0-9a-zA-Z]+\s*[0-9a-zA-Z]+\s*$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphanumericWithSpaceDot(elem, helperMsg){
	var alphaExp = /^\s*[0-9a-zA-Z\.]+\s*[0-9a-zA-Z\.]+\s*$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function valueRestriction(elem, min, max, name){
	var uInput = elem.value;
	if(uInput >= 18 && uInput <= 99){
		return true;
	}else{
		alert(name + " must be between " +min+ " and " +max+ " years");
		elem.focus();
		return false;
	}
}

function lengthRestriction(elem, min, max, name){
	var uInput = elem.value;
	if(uInput.length >= min && uInput.length <= max){
		return true;
	}else{
		alert(name + " must be between " +min+ " and " +max+ " characters");
		elem.focus();
		return false;
	}
}

function madeSelection(elem, helperMsg){
	if(elem.value == "Please Choose"){
		alert(helperMsg);
		elem.focus();
		return false;
	}else{
		return true;
	}
}

function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function matrimonial_form1_radio_check()
{

	var gmu = document.getElementById('mf1-gmu');
	var gfu = document.getElementById('mf1-gfu');

	if((gmu.checked==false) && (gfu.checked==false)){
		alert("Select I'm a Male or Female");
		return false;
	}
	else{
		
		return true;
	}


}

function imageFileNameValidator(elem, helperMsg){
	//jpg, gif

	//var filenameExp = /^[0-9a-zA-Z]+\.[j|J][p|P][g|G]$/;
	
	var filenameExp =  /^[\w\-\.\+\s:\\]+\.[j|J][p|P][g|G]$/;
//	var filenameExp2 = /^[\w\-\.\+\s:\\]+\.[b|B][m|M][p|P]$/;
	var filenameExp3 = /^[\w\-\.\+\s:\\]+\.[g|G][i|I][f|F]$/;
//	var filenameExp4 = /^[\w\-\.\+\s:\\]+\.[p|P][n|N][g|G]$/;
	
	if((elem.value.match(filenameExp)) || (elem.value.match(filenameExp3)) ){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}