// JavaScript Document
//------------------------------------------------------------------------------------------------------
var aMessages = new Array();

aMessages["login"] = new Array();
aMessages["login"]["blank"] = "Profile ID is mandatory.";
aMessages["login"]["^0-9a-z_"] = "Incorrect format for Profile ID. Please use only alphabets and numerals (0-9, a-z, A-Z, ‘_’). Example Rajdoctor_28";
aMessages["login"]["length < 4"] = "Your profile ID should be between 4 to 20 characters (0-9, a-z, A-Z, ‘_’).<br> Example Rajdoctor_28";
aMessages["login"]["length > 20"] = "Your profile ID should be between 4 to 20 characters (0-9, a-z, A-Z).Example Rajdoctor28.";
aMessages["login"]["_$"] = "Please do not end your Profile ID with an '_'";
aMessages["login"]["^_"] = "Please do not begin your Profile ID with an '_'";
aMessages["login"]["login email@ same"] = "Your Profile ID & Email username (text before the @ sign) cannot be the same, for security reasons.";
aMessages["login"]["login email same"] = "Your Profile ID & Email Address cannot be the same, for security reasons.";
aMessages["login"]["check if available"] = "Checking if Profile ID is available...";
aMessages["login"]["check if available error"] = "A technical error occurred while processing your Profile ID request. Please type your Profile ID again.";
aMessages["login"]["numerics > 4"] = "Please do not use more than 4 numeric characters.";
aMessages["email"] = new Array();
aMessages["email"]["blank"] = "Your email address is mandatory.";
aMessages["email"]["invalid"] = "Incorrect email address format. Please type a valid email address. Example raj_23@yahoo.com";
aMessages["email"]["@shaadi.com"] = "Incorrect Email Address. This Email Address does not exist. Please use your correct email address.";
aMessages["email"]["login email@ same"] = "Your Profile ID & Email username (text before the @ sign) cannot be the same, for security reasons.";
aMessages["email"]["login email same"] = "Your Profile ID & Email Address cannot be the same, for security reasons.";
aMessages["email"]["check if available"] = "Checking if Email Address already exists...";
aMessages["email"]["check if available error"] = "A technical error occurred while checking if this email address exists. Please type your email address again.";

aMessages["retypeemail"] = new Array();
aMessages["retypeemail"]["blank"] = "Enter your E-mail address....";
aMessages["retypeemail"]["mismatch"] = "Your Confirm email addresses do not match...";

aMessages["password1"] = new Array();
aMessages["password1"]["blank"] = "Password is mandatory.";
aMessages["password1"]["\s"] = "Incorrect password format. Please do not use spaces in your password.";
aMessages["password1"]["\."] = "Incorrect password format. Please do not use .(dot)  in your password.";
aMessages["password1"]["length < 4"] = "Your password should be between 4 to 20 characters. It cannot contain spaces.";
aMessages["password1"]["length > 20"] = "Your password should be between 4 to 20 characters. It cannot contain spaces.";
aMessages["password1"]["login password same"] = "In order to protect your privacy your profile ID & password cannot be identical. Please change your profile ID or your password.";
aMessages["password1"]["email password same"] = "In order to protect your privacy your email address & password cannot be identical Please change your email address or your password.";

aMessages["password2"] = new Array();
aMessages["password2"]["blank"] = "Please type your Password again.";
aMessages["password2"]["mismatch"] = "Both the Passwords you typed do not match. Please use identical Passwords in both the form fields.";

aMessages["gender"] = new Array();
aMessages["gender"]["blank"] = "Gender is mandatory.";

aMessages["dateofbirth"] = new Array();
aMessages["dateofbirth"]["blank"] = "Date of birth is mandatory.";
aMessages["dateofbirth"]["day"] = "Date is mandatory.";
aMessages["dateofbirth"]["month"] = "Month is mandatory.";
aMessages["dateofbirth"]["year"] = "Year is mandatory.";
aMessages["dateofbirth"]["Invalid"] = "Incorrect Date of Birth. Please select the correct Date of Birth of the person looking to get married.";
//aMessages["dateofbirth"]["check if valid"] = "Checking if Date of Birth is valid...";
aMessages["dateofbirth"]["check if valid"] = "";
aMessages["dateofbirth"]["check if valid error"] = "A technical error occurred while checking the Date of Birth. Please select the Date of Birth again.";

aMessages["community"] = new Array();
aMessages["community"]["blank"] = "Religion / community is mandatory.";

aMessages["countryofresidence"] = new Array();
aMessages["countryofresidence"]["blank"] = "Country of residence is mandatory.";



// validated ajax values
sLoginValidatedVal = "";
sEmailValidatedVal = "";
sDateOfBirthValidatedVal = "";


// To trim the string in JS..
// create the prototype on the String object
String.prototype.trim = function()
{
	// skip leading and trailing whitespace
	// and return everything in between
	var x=this;
	x=x.replace(/^\s*(.*)/, "$1");
	x=x.replace(/(.*?)\s*$/, "$1");
	return x;
}


// same function is in registration2-2.js
function toggleHint(sMode, sElementName)
{
	sDisplay = (sMode == "show") ? "inline" : "none";

	if(oElement = eval(document.getElementById('hint_' + sElementName)))
	{
		oElement.style.display = sDisplay;
	}
}

// same function is in registration2-2.js
function toggleHint_new (sMode, sElementName, sElement, sWidth)
{
	sLeftPos = 0;
	while(sElement)
	{
		sLeftPos += sElement.offsetLeft;
		sElement = sElement.offsetParent;
	}
//	//alert(sLeftPos);
	//alert(sWidth);
	sLeftPos = sLeftPos + sWidth + 25 + "px";
	sDisplay = (sMode == "show") ? "inline" : "none";

	if(oElement = eval(document.getElementById('hint_' + sElementName)))
	{
		oElement.style.left = sLeftPos;
		oElement.style.display = sDisplay;
	}
}

function getNoOfNumerics(sStr)
{
	var iNumericCharsCount = 0;

	for(i=0; i< sStr.length; i++)
	{
		if(!isNaN(sStr.charAt(i)))
		{
			iNumericCharsCount++;
		}
	}

	return iNumericCharsCount;
}


function uncheck(obj)
{
	if(eval(obj))
	{
		for(var i=0; i<obj.length; i++)
		{
			obj[i].checked=false;
		}
	}
}


function fix_email(sVal)
{
	sVal = sVal.replace(/@_/i, "@");
	sVal = sVal.replace(/\s@\s|\s@|@\s/i, "@");
	sVal = sVal.replace(/_\._|_\.|\._/i, ".");
	sVal = sVal.replace(/\s\.\s|\s\.|\.\s/i, ".");
	sVal = sVal.replace(/,/gi, ".");

	return sVal;
}


function validate_email()
{
	var oField = document.forms["form1"].email;
	var oFieldLogin = document.forms["form1"].login;
	var oFieldGo = document.forms["form1"].go;
	var oElement = document.getElementById('errmsg_email');

	toggleHint('hide', 'email');
	oField.value = fix_email(oField.value.trim());
	aEmailValBeforeAtSign = oField.value.split("@");
	oElement.innerHTML = "";
	oField.className = "field_filled";


	oRegX = new RegExp(/^[\w_-]+(\.[\w_-]+)*@[\w_-]+(\.[\w_-]+)*\.\w{2,4}$/gi);

	if(oField.value == "")
	{
		oElement.innerHTML = aMessages["email"]["blank"];
		oField.className = "field_err";
	}
	else if(/@shaadi.com/gi.test(oField.value))
	{
		oElement.innerHTML = aMessages["email"]["@worldrelation.com"].replace(/<!--EMAIL-->/, oField.value);
		oField.className = "field_err";
	}
	else if(oFieldLogin.value.toLowerCase() == oField.value.toLowerCase())
	{
		oElement.innerHTML = aMessages["email"]["login email same"];
		oField.className = "field_err";
	}
	else if(oFieldLogin.value.toLowerCase() == aEmailValBeforeAtSign[0].toLowerCase())
	{
		oElement.innerHTML = aMessages["email"]["login email@ same"];
		oField.className = "field_err";
	}
	else if(!oRegX.test(oField.value))
	{
		oElement.innerHTML = aMessages["email"]["invalid"];
		oField.className = "field_err";
	}
	else
	{
		sParams = "&login=" + oFieldLogin.value + "&go=" + oFieldGo.value;
		sUrl = "MatrimonyRegistration.aspx?valid=is_email_available&email=" + escape(oField.value) + sParams;
		sendRequestAndGetResponse(sUrl, oElement, aMessages["email"]["check if available"], aMessages["email"]["check if available error"]);

	}

} // EO validate_email()



function validate_retypeemail()
{	
	var oField = document.forms["form1"].retypeemail;
	//var oFieldEmail = document.forms["form1"].email;
	var oElement = document.getElementById('errmsg_retypeemail');

	toggleHint('hide', 'retypeemail');
	oField.value = fix_email(oField.value.trim());
	oElement.innerHTML = "";
	oField.className = "field_filled";

	if(oField.value == "")
	{
		oElement.innerHTML = aMessages["retypeemail"]["blank"];
		oField.className = "field_err";
	}
//	else if(oFieldEmail.value.toLowerCase() != oField.value.toLowerCase())
//	{
//		oElement.innerHTML = aMessages["retypeemail"]["mismatch"];
//		oField.className = "field_err";
//	}

} // EO validate_retypeemail()



function validate_password1()
{	
	var oField = document.forms["form1"].password1;
	var oFieldLogin = document.forms["form1"].login;
	var oFieldEmail = document.forms["form1"].email;
	var oElement = document.getElementById('errmsg_password1');

	toggleHint('hide', 'password1');
	oField.value = oField.value.trim();
	oElement.innerHTML = "";
	oField.className = "field_filled";

	if(oField.value == "")
	{
		oElement.innerHTML = aMessages["password1"]["blank"];
		oField.className = "field_err";
	}
	else if(/\s/.test(oField.value))
	{
		oElement.innerHTML = aMessages["password1"]["\s"];
		oField.className = "field_err";
	}
	else if(/\./.test(oField.value))
	{
		oElement.innerHTML = aMessages["password1"]["\."];
		oField.className = "field_err";
	}
	else if(oField.value.length < 4)
	{
		oElement.innerHTML = aMessages["password1"]["length < 4"];
		oField.className = "field_err";
	}
	else if(oField.value.length > 20)
	{
		oElement.innerHTML = aMessages["password1"]["length > 20"];
		oField.className = "field_err";
	}
	else if(oFieldLogin.value.toLowerCase() == oField.value.toLowerCase())
	{
		oElement.innerHTML = aMessages["password1"]["login password same"];
		oField.className = "field_err";
	}
	else if(oFieldEmail.value.toLowerCase() == oField.value.toLowerCase())
	{
		oElement.innerHTML = aMessages["password1"]["email password same"];
		oField.className = "field_err";
	}

} // EO validate_password1()



function validate_password2()
{
	var oField = document.forms["form1"].password2;
	var oElement = document.getElementById('errmsg_password2');

	toggleHint('hide', 'password2');
	oField.value = oField.value.trim();
	oElement.innerHTML = "";
	oField.className = "field_filled";

	if(oField.value == "")
	{
		oElement.innerHTML = aMessages["password2"]["blank"];
		oField.className = "field_err";
	}
	else if(document.forms["form1"].password1.value.toLowerCase() != oField.value.toLowerCase())
	{
		oElement.innerHTML = aMessages["password2"]["mismatch"];
		oField.className = "field_err";
	}

} // EO validate_password2()



function validate_gender()
{
	var oField = document.forms["form1"].gender;
	var oElement = document.getElementById('errmsg_gender');

	toggleHint('hide', 'gender');
	oElement.innerHTML = "";
	oField.className = "field_filled";

	if(oField[0].checked == false
	&& oField[1].checked == false)
	{
		oElement.innerHTML = aMessages["gender"]["blank"];
	}

} // EO validate_gender()



function validate_dateofbirth(sFieldName)
{
	var oFieldDay = document.forms["form1"].day;
	var oFieldMonth = document.forms["form1"].month;
	var oFieldYear = document.forms["form1"].year;
	var oElement = document.getElementById('errmsg_dateofbirth');

	toggleHint('hide', 'dateofbirth');

	iDay = oFieldDay.options[oFieldDay.selectedIndex].value;
	iMonth = oFieldMonth.options[oFieldMonth.selectedIndex].value;
	iYear = oFieldYear.options[oFieldYear.selectedIndex].value;

	iDateOfBirth = iDay + iMonth + iYear;

	//alert(sFieldName + "\nday" + iDay + "\nmonth" + iMonth + "\nyear" + iYear + "\n");

	oFieldDay.className = (iDay == "") ? "field_dob_err" : "field_dob_filled";
	oFieldMonth.className = (iMonth == "") ? "field_dob_err" : "field_dob_filled";
	oFieldYear.className = (iYear == "") ? "field_dob_err" : "field_dob_filled";

	if(iDay == "" && iMonth == "" && iYear == "")
	{
		oElement.innerHTML = aMessages["dateofbirth"]["blank"];
	}
	else if(iDay == "")
	{
		oElement.innerHTML = aMessages["dateofbirth"]["day"];
	}
	else if(iMonth == "")
	{
		oElement.innerHTML = aMessages["dateofbirth"]["month"];
	}
	else if(iYear == "")
	{
		oElement.innerHTML = aMessages["dateofbirth"]["year"];
	}
//	else if(iDay != "" && iMonth != "" && iYear != "")
//	{
//		sParams = "&day=" + iDay + "&month=" + iMonth + "&year=" + iYear;
//		sUrl = "/ssi/ajax/registration.php?mode=is_dateofbirth_valid" + sParams;
//		sendRequestAndGetResponse(sUrl, oElement, aMessages["dateofbirth"]["check if valid"], aMessages["dateofbirth"]["check if valid error"]);
//	}
	else
	{
		oElement.innerHTML = "";
	}
} // EO validate_dateofbirth()




function validate_community()
{
	
	var oField = document.forms["form1"].community;
	var oElement = document.getElementById('errmsg_community');
	oElement.innerHTML = "";
	oField.className = "field_filled";

	if(oField.options[oField.selectedIndex].value == "")
	{
		oElement.innerHTML = aMessages["community"]["blank"];
		oField.className = "field_rel_err";
	}

} // EO validate_community()



function validate_countryofresidence()
{
	var oField = document.forms["form1"].countryofresidence;
	var oElement = document.getElementById('countryofresidence');
	oElement.innerHTML = "";
	oField.className = "field_filled";

	if(oField.options[oField.selectedIndex].value == "")
	{
		oElement.innerHTML = aMessages["countryofresidence"]["blank"];
		oField.className = "field_rel_err";
	}

} // EO validate_gender()

//----------------------------------------------------------------------------------------------------------

function login()
 {
	var uname=document.getElementById("txtID").value;
	var pass=document.getElementById("txtpassword").value;
	
	if(uname=="")
	{
	   alert("Enter User ID")
	   return false;
	} 
	if(uname.length<6)
	{
	   alert("User ID Should Be Minimum of 6 Characters");
	   return false;
	} 
	if(pass=="")
	{
	   alert("Enter Password")
	   return false;
	}	
	if(pass.length<6)
	{
	   alert("Password Should Be Minimum of 6 Characters");
	   return false;
	}
	return true; 
 }
 function AdminLogin()
 {
	var uname=document.getElementById("txtUsername").value;
	var pass=document.getElementById("txtPassword").value;
	
	if(uname=="")
	{
	   alert("Enter User ID")
	   return false;
	} 
	if(uname.length<6)
	{
	   alert("User ID Should Be Minimum of 6 Characters");
	   return false;
	} 
	if(pass=="")
	{
	   alert("Enter Password")
	   return false;
	}	
	if(pass.length<6)
	{
	   alert("Password Should Be Minimum of 6 Characters");
	   return false;
	}
	return true; 
 }
 
 function searchid()
 {
    var sid=document.getElementById("txtSearch").value;
	if(sid=="")
	{
		alert("Enter User ID For Searching.");
		return false;
	}
	return true;
 }
 
 //---------------------------------------------------------------------------------------------------------
 
function Mat_Registration()
{
    var name=document.getElementById("name").value;
	var namecheck=/[A-Z]+[]{0,1}[A-Z]+[][A-Z]/;
    var email=document.getElementById("retypeemail").value;
 	var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	var date=document.getElementById("day").value;
    var month=document.getElementById("month").value;
	var year=document.getElementById("year").value;
	var religion=document.getElementById("community").value;
	var country=document.getElementById("countryofresidence").value;
		
	if(name=="")
	{
		alert("Please Enter 'NAME FIELD'.\n");
		return false;
	}
//	if(!namecheck.test(name))
//	{
//		alert("NAME IS NOT IN CORRECT FORMAT.\n\nIT MUST BE LIKE\n\n 'KUNTAL MAITY'");
//		return false;
//	}
	if(email=="")
    {
	   alert("FILL the 'EMAIL-ID' Field.\n");
	   return false;
    }
    if(!emailcheck.test(email))
    {
	   alert("EMAIL-ID Is not correct Format.\n");
	   return false;
    }
    if(date=="")
	{
		alert("Select 'DATE'.\n");
		return false;
	}
    if(month=="")
	{
		alert("Please Select 'MONTH'.\n");
		return false;
	}
	if(year=="")
	{
		alert("Please Select 'YEAR'.\n");
		return false;
	}
	
	if(religion=="")
	{
		alert("Select 'RELIGION'.\n");
		return false;
	}
	if(country=="")
	{
		alert("Select 'COUNTRY'.\n");
		return false;
	}
		
	return true;
}

function Validationmatreg_selfinfo()
{
	var name=document.getElementById("txtname").value;
	var namecheck=/[A-Z]+[]{0,1}[A-Z]+[][A-Z]/;
	
	var year=document.getElementById("dryear").value;
	var month=document.getElementById("drmonth").value;
	var date=document.getElementById("drday").value;
	var gender=document.getElementById("drGenList").value;
	var handi=document.getElementById("drPhyList").value;
	
	var height=document.getElementById("txtHeight").value;
	var heightcheck=/^\d+\d$/;
	var figure=document.getElementById("drPhyList1").value;

	var fmst=document.getElementById("drFamilyStatus").value;
	var mrst=document.getElementById("drMarList").value;
	var religion=document.getElementById("drReligion").value;
	var religion1=document.getElementById("txtReligion").value;
	var cast=document.getElementById("drInterCast").value;
	var cast1=document.getElementById("txtCaste").value;
	var MotherToung=document.getElementById("DrMotherToung").value;
	var MotherToungother=document.getElementById("txtMotherToung").value;
	
   if(name=="")
	{
		alert("Please Enter 'NAME FIELD'.\n");
		return false;
	}
//	if(!namecheck.test(name))
//	{
//		alert("NAME IS NOT IN CORRECT FORMAT.\n\nIT MUST BE LIKE\n\n 'KUNTAL MAITY'");
//		return false;
//	}
	
	
	if(year=="Select")
	{
		alert("Please Select 'YEAR'.\n");
		return false;
	}
	if(month=="Select")
	{
		alert("Please Select 'MONTH'.\n");
		return false;
	}
	if(date=="Select")
	{
		alert("Select 'DATE'.\n");
		return false;
	}
	if(gender=="0")
	{
		alert("Please Select 'GENDER'.\n");
		return false;
	}
	if(handi=="0")
	{
		alert("PHYSICALLY HANDICAPPED ?");
		return false;
	}
	if(height=="")
	{
		alert("Select 'HEIGHT' FIELD.\n");
		return false;
	}
	if(!heightcheck.test(document.getElementById("txtHeight").value))
	{
		alert("HEIGHT IS NOT IN CORRECT FORMAT.\n");
		return false;
	}
	if(figure=="0")
	{
		alert("Select 'FIGURE'.\n");
		return false;
	}
	if(fmst=="0")
	{
		alert("Select 'FAMILY STATUS'.\n");
		return false;
	}
	if(mrst=="0")
	{
		alert("Select 'MARITAL STATUS'.\n");
		return false;
	}
	if(religion=="Select")
	{
		alert("Select 'RELIGION'.\n");
		return false;
	}
	
	if(religion=="Other" && religion1=="")
	{
			alert("Enter Your 'RELIGION'\n Enter Your Caste.\n");
			return false;
	}
	if(cast=="Select" && cast=="0")
	{
		 alert("Please Select 'CASTE'.\n");
		 return false;
	}
	if(cast=="Other" && cast1=="")
	{
			alert("Enter Your Caste.\n");
			return false;
	}
	if(MotherToung=="Select")
	{
			alert("Select Your Mother Tongue.\n");
			return false;
	}
	if(MotherToung=="Other" && MotherToungother=="")
	{
			alert("If Selected Mother Tongue is 'Other' \n You can't Blank Mother Tongue TextBox.\n .\n");
			return false;
	}		
	return true;
}

function Validationmatreg_residential()
{
    var clivein=document.getElementById("drCountryLiveIn").value;
	var resi=document.getElementById("drResidentList").value;
	
	var citizen=document.getElementById("drCountryCTZEN").value;
	var citizen1=document.getElementById("txtCountryOther2").value;
	var state=document.getElementById("drState").value;
	var state1=document.getElementById("txtStateOther").value;
	
	var district=document.getElementById("drDistrict").value;
	var district1=document.getElementById("txtDistrictOther").value;
	
	var drop=document.getElementById("drCategory").value;
	var other=document.getElementById("txtCatOther").value;
	
   if(resi=="0")
		{
			alert("Please Select 'Residential Status'.\n");
			return false;	
		}
   if(citizen=="Other" && citizen1=="")
		{
			alert("Enter 'CITIZENSHIP' in other field.\n");
			return false;
		}
   if(citizen=="Other" && state1=="")
		{
			alert("Enter 'STATE' in other field.\n");
			return false;
		}
   if(citizen=="Other" && district1=="")
		{
			alert("Enter 'District' into District other field .\n");
			return false;	
		}
	if(state=="Select")
		{
			alert("Select 'STATE'.\n");
			return false;
		}
		
	if(state=="Other" && state1=="")
		{
			alert("Enter 'STATE' in other field.\n");
			return false;	
		}
	if(district=="Select")
		{
			alert("Select 'District'.\n");
			return false;	
		}
	if(district=="Other" && district1=="")
		{
			alert("Enter 'District' into District other field .\n");
			return false;	
		}
	if(drop=="0")
		{
			alert("Select 'Category'\n");
			return false;	
		}	
	if(drop=="Other" && other=="")
		{
			alert("If Category Select 'Other' \n You can't Blank Category TextBox.\n");
			return false;	
		}	
	return true;
}

function Validationmatreg_educational()
{
	var hquali=document.getElementById("drQualification").value;
	var profession=document.getElementById("drProfesion").value;
	var employedin=document.getElementById("drEmployedList").value;
	var mntincome=document.getElementById("drSalary").value;
	var mntincomein=document.getElementById("drCurrency").value;
	var Hobbies=document.getElementById("txtHobbies").value;
	
	if(hquali=="Select")
	{
		alert("Select your 'QUALIFICATION'.\n");
		return false;
	}	 
	if(profession=="Select")
	{
		alert("Select 'PROFESSION'.\n");
		return false;
	}	
	if(employedin=="Select")
	{
		alert("Select 'EMPLOYED STATUS'.\n");
		return false;
	}	
	if(mntincomein=="0" && mntincome!="Not Mentioned")
	{
		alert("Select the 'UNIT' of Monthly Income.\n");
		return false;
	}
	if(mntincome=="Select")
	{
		alert("Select 'MONTHLY INCOME'.\n");
		return false;
	}
	if(Hobbies=="")
	{
		 alert("You Must Enter Your 'Self Introduction' Field \n As your Hobbies,Future Plan etc.(Max 500 Char)\n");
		 return false;
	}	
	return true;
}
function Validationmatreg_partner()
{
	var Age1=document.getElementById("txtAge1").value;
	var Age2=document.getElementById("txtAge2").value;
	var pmothertongue=document.getElementById("txtMotherTongue").value;

	var PQualification=document.getElementById("drQualification01").value;
	var pManglik=document.getElementById("drManglik").value;
	var PMaritialStatus=document.getElementById("drMarList1").value;
	var pDiet=document.getElementById("drDiet").value;
	var pDrink=document.getElementById("drDrink").value;
	var pSmoke=document.getElementById("drSmoke").value;
	var PCountry=document.getElementById("drCountryLiveIn01").value;
	var pCaste=document.getElementById("drInterCastB").value;
	var Pprofession=document.getElementById("drProfession01").value;
	var psalary=document.getElementById("drSalary01").value;
	var psalaryIn=document.getElementById("drCurrency01").value;
	
	if(Age1=="")
	{
		alert("Please Select 'PARTNER AGE'.\n");
		return false;
	}
	if(Age2=="")
	{
		alert("Please Select 'PARTNER AGE TO FIELD'.\n");
		return false;
	}
	
    if(pmothertongue=="Select")
	{
		 alert("Please Select Partner 'MOTHERTONGUE'.\n");
		 return false;
	}
	
	if(PQualification=="Select")
	{
		 alert("Please Select 'PARTNER QUALIFICATION'.\n");
		 return false;
	}
	if(pManglik=="0")
	{
		 alert("Please Select 'MANGLIK' Field.\n");
		 return false;
	}
	if(PMaritialStatus=="Select")
	{
		 alert("Please Select 'PARTNER MARITIAL STATUS'.\n");
		 return false;
	}
	
	if(pDiet=="0")
	{
		 alert("Please Select 'PARTNER DIET STATUS.\n");
		 return false;
	}
	
	if(pDrink=="0")
	{
		 alert("Please Select 'PARTNER DRINK' Status.\n");
		 return false;
	}
	if(pSmoke=="0")
	{
		 alert("Please Select 'PARTNER SMOKE' Status.\n");
		 return false;
	}
	
	if(PCountry=="Select")
	{
		 alert("Please Select 'PARTNER COUNTRY'.\n");
		 return false;
	}
	
	if(Pprofession=="Select")
	{
		 alert("Please Select 'PARTNER PROFESSION'.\n");
		 return false;
	}
	if(psalary=="0")
	{
		 alert("Please Select 'PARTNER MONTHLY INCOME'.\n");
		 return false;
	}
	if(psalaryIn=="0" && psalary!="Does'nt Matter")
	{
		alert("Select the 'UNIT' of PARTNER Monthly Income.\n");
		return false;
	}
	return true;
}
function Validationmatreg_access()
{
	var email=document.getElementById("txtEmail").value;
	
 	var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
 	var pass=document.getElementById("txtPASWRD").value;
	var conpass=document.getElementById("txtCONPASWRD").value;

	 if(email=="")
	{
		alert("FILL the 'EMAIL-ID' Field.\n");
		return false;
	}
	if(!emailcheck.test(email))
	{
		alert("EMAIL-ID Is not correct Format.\n");
		return false;
	}
	
	if(pass=="")
	{
		alert("Please Fill'PASSWORD' Field.\n");
		return false;
	}
	if(pass.length>0 && pass.length<6)
	{
		alert("'PASSWORD' minimum 6 Characters.\n");
		return false;	
	}
	if(conpass=="")
	{
		alert("Enter 'CONFIRM PASWORD' Field.\n");
		return false;
	}
	if(pass!=conpass)
	{
		alert("'CONFIRM-PASSWORD'Must be Same as 'PASSWORD'Field.\n");
		return false;
	}
	return true;
}

function Validationmatregupdate()
{
	var name=document.getElementById("txtname").value;
	var namecheck=/[A-Z]+[]{0,1}[A-Z]+[][A-Z]/;
	
	var height=document.getElementById("txtHeight").value;
	var heightcheck=/^\d+\d$/;
	
	var email=document.getElementById("txtEmail").value;
	var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
		
		if(name=="")
		{
			alert("YOU MUST FILL THE NAME FIELD.\n");
			return false;
		}
		if(!namecheck.test(document.getElementById("txtname").value))
		{
			alert("NAME IS NOT IN CORRECT FORMAT.\n\nIT MUST BE LIKE\n\n BISWAJIT ROY");
			return false;
		}
		if(height=="")
		{
			alert("YOU MUST FILL THE HEIGHT FIELD.\n");
			return false;
		}
		if(!heightcheck.test(document.getElementById("txtHeight").value))
		{
			alert("HEIGHT IS NOT IN CORRECT FORMAT.\n");
			return false;
		}
		
		if(email=="")
		{
			alert("YOU MUST FILL THE EMAIL-ID FIELD.\n");
			return false;
		}
		if(!emailcheck.test(document.getElementById("txtEmail").value))
		{
			alert("EMAIL-ID IS NOT IN CORRECT FORMAT.\n");
			return false;
		}
	return true;
}
function year()
{
		var year=document.getElementById("dryear").value;
		
		if(year=="Select")
		{
			alert("Please Select Year first.\n");
				return false;	
		}		 
		return true;
}
function month()
{
		var year=document.getElementById("dryear").value;
		var month=document.getElementById("drmonth").value;
		
		if(year=="Select" || month=="Select")
		{
			alert("Please Select Year and Month first.\n");
				return false;	
		}
		return true;
}
function Validationmatup_selfinfo()
{
    try
    {
	    var name=document.getElementById("txtname").value;
	    var namecheck=/[A-Z]+[]{0,1}[A-Z]+[][A-Z]/;
    	
	    var height=document.getElementById("txtHeight").value;
	    var heightcheck=/^\d+\d$/;

	    var religion=document.getElementById("drReligion").value;
	    var religion1=document.getElementById("txtReligion").value;
	    var cast=document.getElementById("drInterCast").value;
	    var cast1=document.getElementById("txtCaste").value;
	    var MotherToung=document.getElementById("DrMotherToung").value;
	    var MotherToungother=document.getElementById("txtMotherToung").value;
    	
	    if(name=="")
	    {
		    alert("Please Enter 'NAME FIELD'.\n");
		    return false;
	    }
//	    if(!namecheck.test(document.getElementById("txtname").value))
//	    {
//		    alert("NAME IS NOT IN CORRECT FORMAT.\n\nIT MUST BE LIKE\n\n 'KUNTAL MAITY'");
//		    return false;
//	    }	
	    if(height=="")
	    {
		    alert("Enter Your'HEIGHT' !!\n");
		    return false;
	    }
	    if(!heightcheck.test(document.getElementById("txtHeight").value))
	    {
		    alert("HEIGHT IS NOT IN CORRECT FORMAT.\n");
		    return false;
	    }		
	    if(religion=="Other" && religion1=="")
	    {
			    alert("Enter Your 'RELIGION'\n Enter Your Caste.\n");
			    return false;
	    }
	    if(cast=="Select")
	    {
		     alert("Please Select 'CASTE'.\n");
		     return false;
	    }
	   if(document.getElementById("drInterCast").value=="Select")
	   {
	   alert("Please Select 'CASTE'.\n");
		     return false;
	   
	   }
	    if(cast=="Other" && cast1=="")
	    {
			    alert("Enter Your Caste.\n");
			    return false;
	    }		
	    if(MotherToung=="Other" && MotherToungother=="")
	    {
			    alert("If Selected Mother Tongue is 'Other' \n You can't Blank Mother Tongue TextBox.\n .\n");
			    return false;
	    }		
	    return true;
    }
    catch(e)
    {
    }
}

function Validationmatup_residential()
{
    try
    {
        var ctrliv=document.getElementById("drCountryLiveIn").value;
	    var citizen=document.getElementById("drCountryCTZEN").value;
	    var citizen1=document.getElementById("txtCountryOther2").value;
	    var state=document.getElementById("drState").value;
	    var state1=document.getElementById("txtStateOther").value;
	    var district=document.getElementById("drDistrict").value;
	    var district1=document.getElementById("txtDistrictOther").value;
    	
	    var cat=document.getElementById("drCategory").value;
	    var cat1=document.getElementById("txtCatOther").value;
    	
	    if(citizen=="Other" && citizen1=="")
		    {
			    alert("Enter 'COUNTRY LIVING IN' in other field.\n");
			    return false;	
		    }
	    if(citizen=="Other" && state1=="")
		    {
			    alert("Enter 'STATE' in other field.\n");
			    return false;	
		    }
	    if(citizen=="Other" && district1=="")
		    {
			    alert("Enter 'District' into District other field .\n");
			    return false;	
		    }
	    if(state=="Other" && state1=="")
		    {
			    alert("Enter 'STATE' in other field.\n");
			    return false;	
		    }	
	    if(district=="Other" && district1=="")
		    {
			    alert("Enter 'District' into District other field .\n");
			    return false;	
		    }	
	    if(cat=="Other" && cat1=="")
		    {
			    alert("If Category Select 'Other' \n You can't Blank Category TextBox.\n");
			    return false;	
		    }	
	    return true;
    }
    catch(e)
    {
    }
}

function Validationmatup_educational()
{
  try
  {
	var Hobbies=document.getElementById("txtHobbies").value;
	if(Hobbies=="")
	{
		 alert("You Must Enter Your 'Self Introduction' Field \n As your Hobbies,Future Plan etc.(Max 500 Char)\n");
		 return false;
	}	
	return true;
  }
  catch(e)
  {
  }
}
function Validationmatup_partner()
{
    try
    {
	    var Age1=document.getElementById("txtAge1").value;
	    var Age2=document.getElementById("txtAge2").value;
	    var agecheck=/^\d+\d$/;
    	
	    if(Age1=="")
	    {
		    alert("Please Select 'PARTNER AGE'.\n");
		    return false;
	    }
	    if(Age2=="")
	    {
		    alert("Please Select 'PARTNER AGE TO FIELD'.\n");
		    return false;
	    } 
	    if(!agecheck.test(document.getElementById("txtAge1").value))
	    {
		    alert("AGE IS NOT IN CORRECT FORMAT.\n");
		    return false;
	    }	
	    if(!agecheck.test(document.getElementById("txtAge2").value))
	    {
		    alert("AGE IS NOT IN CORRECT FORMAT.\n");
		    return false;
	    } 
	    return true;
    }
    catch(e)
    {
    }
}
function Validationmatup_access()
{
    try
    {
	    var email=document.getElementById("txtEmail").value;
 	    var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
     	
	    if(email=="")
	    {
		    alert("FILL the 'EMAIL-ID' Field.\n");
		    return false;
	    }
	    if(!emailcheck.test(document.getElementById("txtEmail").value))
	    {
		    alert("EMAIL-ID Is not correct Format.\n");
		    return false;
	    }	
	    return true;
    }
    catch(e)
    {
    }
}

function Validationmatupupdate()
{
	var name=document.getElementById("txtname").value;
	var namecheck=/[A-Z]+[]{0,1}[A-Z]+[][A-Z]/;
	
	var height=document.getElementById("txtHeight").value;
	var heightcheck=/^\d+\d$/;
	
	var email=document.getElementById("txtEmail").value;
	var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
		
		if(name=="")
		{
			alert("YOU MUST FILL THE NAME FIELD.\n");
			return false;
		}
		if(!namecheck.test(document.getElementById("txtname").value))
		{
			alert("NAME IS NOT IN CORRECT FORMAT.\n\nIT MUST BE LIKE\n\n BISWAJIT ROY");
			return false;
		}
		if(height=="")
		{
			alert("YOU MUST FILL THE HEIGHT FIELD.\n");
			return false;
		}
		if(!heightcheck.test(document.getElementById("txtHeight").value))
		{
			alert("HEIGHT IS NOT IN CORRECT FORMAT.\n");
			return false;
		}
		
		if(email=="")
		{
			alert("YOU MUST FILL THE EMAIL-ID FIELD.\n");
			return false;
		}
		if(!emailcheck.test(document.getElementById("txtEmail").value))
		{
			alert("EMAIL-ID IS NOT IN CORRECT FORMAT.\n");
			return false;
		}
	return true;
}
function Mat_Search()
{
    var Gender=document.getElementById("drGenList").value;
    var Religion=document.getElementById("religion").value;
    var Country=document.getElementById("Select1").value;
		
	if(Gender=="Select")
    {
	   alert("Select Gender!!");
	   return false;
    }
    if(Religion=="")
    {
	   alert("Select Religion!!");
	   return false;
    }	
    if(Country=="")
    {
	   alert("Select Country!!");
	   return false;
    }			
	return true;
}



 function pop_window2()
 {
   var confirmWin = null;
   /*confirmWin = window.open('PopWindow.aspx','anycontent',
                        'width=500,height=500,status ,fullscreen=yes, scrollbars=auto');*/
   confirmWin = window.open('PopWindow.aspx','anycontent','location=no,height=500,width=500');
}
 function pop_windowAdd_Friend()
 {
	       var confirmWin = null;
           confirmWin = window.open('AddToFriend.aspx','anycontent',
	                            'width=350,height=150,status');
 } 
 function pop_window_editfavorite()
 {
	       var confirmWin = null;
           confirmWin = window.open('editfavorite.aspx','anycontent',
	                            'width=350,height=150,status');
 }
 function pop_window_changepassword()
 {
	       var confirmWin = null;
           confirmWin = window.open('changepassword.aspx','anycontent',
	                            'width=350,height=150,status');
   		
 }
 function pop_window_filtermsg()
 {
	       var confirmWin = null;
           confirmWin = window.open('FilterMymsg.aspx','anycontent',
	                            'width=350,height=250,status');
 }
 function pop_window_sucess()
 {
	       var confirmWin = null;
           confirmWin = window.open('SucessStory.aspx','anycontent',
	                            'width=500,height=265,status');
 }
 function pop_window_chatonline()
 {
	       var confirmWin = null;
           confirmWin = window.open('chatonline_popup.aspx','anycontent',
	                            'width=230,height=280,status');
 }
	function pop_window3()
    	  {
	       var confirmWin = null;
           confirmWin = window.open('DisplayUP.aspx','anycontent',
	                            'width=450,height=150,status');
   		}	
		
		function pop_travelwindow()
    	  {
	       var confirmWin = null;
           confirmWin = window.open('Travelpop.aspx','anycontent',
	                            'width=400,height=200,status');
   		}	
		function open_travelsearch()
{
	 var openwin = null;
      //openwin = window.open('http://192.168.0.1/Matrimony/MatrimonyRegistration.aspx');
	  openwin = window.open('TravelSearch.aspx');
	   
}
function open_travel()
{
	 var openwin = null;
      //openwin = window.open('http://192.168.0.1/Matrimony/MatrimonyRegistration.aspx');
	  openwin = window.open('Travel.aspx');
	   
}
		
function searching()
{
	var gen=document.getElementById("DrSg").value;
	var agel=document.getElementById("txtLarge").value;
	var ages=document.getElementById("txtSmall").value;
	var rel=document.getElementById("DrSr").value;
	var coun=document.getElementById("DrSc").value;
	var loc=document.getElementById("DrSl").value;
	var quali=document.getElementById("DrSq").value;
	var prof=document.getElementById("DrSp").value;
	var famst=document.getElementById("DrFs").value;
	var minc=document.getElementById("DrSmi").value;
	var marst=document.getElementById("DrSms").value;
	
	if((gen=="0") && (rel=="0") && ((agel=="") || (ages=="")) && (coun=="0") && (loc=="0") && (quali=="0") && (prof=="0") && (famst=="0") && (minc=="0") && (marst=="0"))
	{
	alert("You must select atleast one item.");
	return false;
	}
return true;
}
//-----------------------------------------
/*function Stop_Right()
{
	   var message="Hey YOU!\nStop Stealing my pictures or\nFACE THE PUNISHMENT!" 
		function click(e) 
		{
			if (document.all) 
			{
				if (event.button == 2) 
				{
					alert(message);
					return false;
				}
			}
			if (document.layers) 
			{
				if (e.which == 3) 
				{
					alert(message);
					return false;
				}
			}
		}
		if (document.layers) 
			{
			   document.captureEvents(Event.MOUSEDOWN);
			}
	  document.onmousedown=click;
}*/
//-------------------------------------------------------

 function pop_window1()
    	{
	  var confirmWin1 = null;
      confirmWin1 = window.open('loginpage.aspx');
   		}
		
    function pop_window()
    	{
	  var confirmWin = null;
      confirmWin = window.open('PopUpWindow.aspx','anycontent',
	                           'width=400,height=200,status');
	   //window.close('index.aspx') ;
   		}
		
	function open_matreg()
    {
	  var openwin = null;
      openwin = window.open('MatrimonyRegistration.aspx');
	  window.close('PopUpWindow.aspx');	
    }
	function open_frndreg()
    {
	  var openwin = null;
      openwin = window.open('http://208.109.47.81/FriendRegistration.aspx');
	  window.close('PopUpWindow.aspx') ;		
    }
	function open_hospital()
    {
	  var openwin = null;
      openwin = window.open('https://worldrelation.com/Hospital/Home.aspx');
	  window.close('PopUpWindow.aspx');	
    }
    function open_job()
    {
	  var openwin = null;
      openwin = window.open('https://worldrelation.com/Job/Home.aspx');
	  window.close('PopUpWindow.aspx');	
    }
	
   function pop_windowm()
   {
    //window.open('ShowUserIdM.aspx');
      var openwin1 = null;
      openwin1 = window.open('ShowUserIdM.aspx');
      window.close('MatrimonyRegistration.aspx');					   
   }