function sortSelect(obj) {
	var o = new Array();
	if (!hasOptions(obj)) { return; }
	for (var i=0; i<obj.options.length; i++) {
		o[o.length] = new Option( obj.options[i].text, obj.options[i].value, obj.options[i].defaultSelected, obj.options[i].selected) ;
		}
	if (o.length==0) { return; }
	o = o.sort( 
		function(a,b) { 
			if ((a.text+"") < (b.text+"")) { return -1; }
			if ((a.text+"") > (b.text+"")) { return 1; }
			return 0;
			} 
		);

	for (var i=0; i<o.length; i++) {
		obj.options[i] = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);
		}
	}


function hasOptions(obj) {
	if (obj!=null && obj.options!=null) { return true; }
	return false;
	}

function moveSelectedOptions(from,to) {
	// Unselect matching options, if required
    
	if (arguments.length>3) {
		var regex = arguments[3];
		if (regex != "") {
			unSelectMatchingOptions(from,regex);
			}
		}
			
	// Move them over
	if (!hasOptions(from)) { return; }
	for (var i=0; i<from.options.length; i++) {
		var o = from.options[i];
		if (o.selected) {
			if (!hasOptions(to)) { var index = 0; } else { var index=to.options.length; }
			to.options[index] = new Option( o.text, o.value, false, false);
			}
		}
		
	// Delete them from original
	for (var i=(from.options.length-1); i>=0; i--) {
		var o = from.options[i];
		if (o.selected) {
			from.options[i] = null;
			}
		}
		
	if ((arguments.length<3) || (arguments[2]==true)) {
		sortSelect(from);
		sortSelect(to);
		}
		
	from.selectedIndex = -1;
	to.selectedIndex = -1;
	return false;
	}

function selectUnselectMatchingOptions(obj,regex,which,only) {
	if (window.RegExp) {
		if (which == "select") {
			var selected1=true;
			var selected2=false;
			}
		else if (which == "unselect") {
			var selected1=false;
			var selected2=true;
			}
		else {
			return;
			}
		var re = new RegExp(regex);
		if (!hasOptions(obj)) { return; }
		for (var i=0; i<obj.options.length; i++) {
			if (re.test(obj.options[i].text)) {
				obj.options[i].selected = selected1;
				}
			else {
				if (only == true) {
					obj.options[i].selected = selected2;
					}
				}
			}
		}
	}

function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}
function ToUpperCase(e,r)
{
r.value = r.value.toUpperCase();
}
function echeck(str) {

		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID");
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID");
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID");
		    return false;
		 }

 		 return true;			
	}

function IsNumeric(sText)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
   
   function IsNumeric1(eName)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 sText = eName.value;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
    if(IsNumber == false)
    {
   eName.value="";
   return false;
   }
   
   }
    function IsNumeric2(eName)
{
   var ValidChars = "0123456789,";
   var IsNumber=true;
   var Char;

 sText = eName.value;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
    if(IsNumber == false)
    {
   eName.value="";
   return false;
   }
   
   }
   function userKey(eName)
{
    eName.value = "";
	return false;
}
function Matrimonyloginsubmit()
		{
			
			if(trim(document.all("txtUserName").value)=="")
			{
				alert("User Name Must be Entered");
				document.all("txtUserName").focus();
				return false;
			}
			
			if(trim(document.all("txtPassword").value)=="")
			{
				alert("Password Must be Entered");
				document.all("txtPassword").focus();
				return false;
			}
			return true;
		}
function membersubmit()
{
			
			if(trim(document.frmRegistration.txtName.value)=="")
			{
				alert("Name Must be Entered");
				document.frmRegistration.txtName.focus();
				return false;
			}
			if(trim(document.frmRegistration.txtAge.value)=="")
			{
				alert("Age Must be Entered");
				document.frmRegistration.txtAge.focus();
				return false;
			}
			var mStatus = false;
			for(i=0;i<document.forms[0].elements.length;i++)
		   	{
		   		eName1 = document.forms[0].elements[i];
		   		
		   		if(eName1.name.indexOf("chkMStatus")== 0 )
		   		{
		   			
		   			if(eName1.checked==true)
		   				mStatus = true;
		   		}
		   	}
		  
			if(mStatus==false)
			{
				alert("Marital Status Must be Selected");
				
				return false;
			}
			if(trim(document.frmRegistration.selReligion.value)=="")
			{
				alert("Religion Must be Entered");
				document.frmRegistration.selReligion.focus();
				return false;
			}
			if(trim(document.frmRegistration.selCountry.value)=="")
			{
				alert("Country Living Must be Entered");
				document.frmRegistration.selCountry.focus();
				return false;
			}
			if(trim(document.frmRegistration.selCitizen.value)=="")
			{
				alert("Citizenship Must be Entered");
				document.frmRegistration.selCitizen.focus();
				return false;
			}
			/*alert(document.frmRegistration.radRStatus.checked);
			if(document.frmRegistration.radRStatus.checked==false)
			{
				alert("Residential Status Must be Entered");
				//document.frmRegistration.selCitizen.focus();
				return false;
			}
			if(trim(document.frmRegistration.radEmployee.value)=="")
			{
				alert("Employed in Must be Entered");
				//document.frmRegistration.radEmployee.focus();
				return false;
			}*/
			if (echeck(document.frmRegistration.txtEmail.value)==false)
			{
				document.frmRegistration.txtEmail.focus();
				return false;
			}
			if(trim(document.frmRegistration.txtUserId.value)=="")
			{
				alert("User Id Must be Selected");
				document.frmRegistration.txtUserId.focus();
				return false;
			}
			if(trim(document.frmRegistration.txtPassword.value)=="")
			{
				alert("Password Must be Selected");
				document.frmRegistration.txtPassword.focus();
				return false;
			}
			if(document.frmRegistration.txtPassword.value.length < 4)
			{
				alert("Password Must be Minimum 4 Character");
				document.frmRegistration.txtPassword.focus();
				return false;
			}
		   if(trim(document.frmRegistration.txtCPassword.value)=="")
			{
				alert("Confirm Password Must be Entered");
				document.frmRegistration.txtCPassword.focus();
				return false;
			}
			 if(trim(document.frmRegistration.txtPassword.value)!=trim(document.frmRegistration.txtCPassword.value))
			{
				alert("Password and Confirm Password Must be equal");
				document.frmRegistration.txtCPassword.focus();
				return false;
			}
			if(trim(document.frmRegistration.txtCode.value)=="")
			{
				alert("Code Must be Entered");
				document.frmRegistration.txtCode.focus();
				return false;
			}
			
			
			return true;
			
}



function forgotsubmit()
{
	if(trim(document.frmForgot.txtUName1.value)=="")
			{
				alert("ProfileId Must be Entered");
				document.frmForgot.txtUName1.focus();
				return false;
			}
			
			return true;
}
function editmembersubmit()
{
			
			if(trim(document.frmEditRegistration.txtName.value)=="")
			{
				alert("Name Must be Entered");
				document.frmEditRegistration.txtName.focus();
				return false;
			}
			
			if(trim(document.frmEditRegistration.txtAge.value)=="")
			{
				alert("Age Must be Entered");
				document.frmEditRegistration.txtAge.focus();
				return false;
			}
			
			var mStatus = false;
			for(i=0;i<document.forms[0].elements.length;i++)
		   	{
		   		eName1 = document.forms[0].elements[i];
		   		
		   		if(eName1.name.indexOf("chkMStatus")== 0 )
		   		{
		   			
		   			if(eName1.checked==true)
		   				mStatus = true;
		   		}
		   	}
		  
			if(mStatus==false)
			{
				alert("Marital Status Must be Selected");
				
				return false;
			}
			if(trim(document.frmEditRegistration.selReligion.value)=="")
			{
				alert("Religion Must be Entered");
				document.frmEditRegistration.selReligion.focus();
				return false;
			}
			
			if(trim(document.frmEditRegistration.selCountry.value)=="")
			{
				alert("Country Living Must be Entered");
				document.frmEditRegistration.selCountry.focus();
				return false;
			}
			if(trim(document.frmEditRegistration.selCitizen.value)=="")
			{
				alert("Citizenship Must be Entered");
				document.frmEditRegistration.selCitizen.focus();
				return false;
			}
			
			if (echeck(document.frmEditRegistration.txtEmail.value)==false)
			{
				document.frmEditRegistration.txtEmail.focus();
				return false;
			}
			
			
						
			
			return true;
			
}

function loginsubmit()
{
	if(trim(document.frmLogin.txtUName1.value)=="")
			{
				alert("Profile Id Must be Entered");
				document.frmLogin.txtUName1.focus();
				return false;
			}
			
			if(trim(document.frmLogin.txtPassword1.value)=="")
			{
				alert("Password Must be Entered");
				document.frmLogin.txtPassword1.focus();
				return false;
			}
			return true;
}
function loginemailsubmit()
{
	if(trim(document.frmLogin.txtEmail.value)=="")
			{
				alert("Email Id Must be Entered");
				document.frmLogin.txtEmail.focus();
				return false;
			}
		if (echeck(document.frmLogin.txtEmail.value)==false)
			{
				document.frmLogin.txtEmail.focus();
				return false;
			}
			return true;
}
function userKey(eName)
{
    eName.value = "";
	return false;
}
function pwdKey(eName)
		{
		
		   	eName.style.display='none';
		   	for(i=0;i<document.forms[0].elements.length;i++)
		   	{
		   		eName1 = document.forms[0].elements[i];
		   		
		   		if((eName1.name.indexOf("txtPassword") > 0)&& (eName1.name.indexOf("txtPasswordText") == -1))
		   		{
		   			
		   			eName1.style.display = 'block';
		   			eName1.value = "";
		   			eName1.focus();
		   			
		   		}
		   	}
		
			return false;
		}
		
		function pwdKey1(eName)
		{
		
		   	eName.style.display='none';
		   	for(i=0;i<document.forms[0].elements.length;i++)
		   	{
		   		eName1 = document.forms[0].elements[i];
		   		
		   		if((eName1.name.indexOf("txtPassword") >= 0)&& (eName1.name.indexOf("txtPasswordText") == -1))
		   		{
		   			
		   			eName1.style.display = 'block';
		   			eName1.value = "";
		   			eName1.focus();
		   			
		   		}
		   	}
		
			return false;
		}
		
		function passwordsubmit()
		{
		
		  if(trim(document.frmMatPassword.txtPassword.value)=="")
			{
				alert("Current Password Must be Entered");
				document.frmMatPassword.txtPassword.focus();
				return false;
			}
			if(trim(document.frmMatPassword.txtNPassword.value)=="")
			{
				alert("New Password Must be Entered");
				document.frmMatPassword.txtNPassword.focus();
				return false;
			}
		
			if(trim(document.frmMatPassword.txtCPassword.value)=="")
			{
				alert("Confirm Password Must be Entered");
				document.frmMatPassword.txtCPassword.focus();
				return false;
			}
			
			if(document.frmMatPassword.txtPassword.value.length < 4)
			{
				alert("Current Password Must be Minimum 4 Character");
				document.frmMatPassword.txtPassword.focus();
				return false;
			}
		   if(document.frmMatPassword.txtNPassword.value.length < 4)
			{
				alert("New Password Must be Minimum 4 Character");
				document.frmMatPassword.txtNPassword.focus();
				return false;
			}
			if(document.frmMatPassword.txtCPassword.value.length < 4)
			{
				alert("Confirm Password Must be Minimum 4 Character");
				document.frmMatPassword.txtCPassword.focus();
				return false;
			}
			 if(trim(document.frmMatPassword.txtNPassword.value)!=trim(document.frmMatPassword.txtCPassword.value))
			{
				alert("New Password and Confirm Password Must be equal");
				document.frmMatPassword.txtNPassword.focus();
				return false;
			}
			 if(trim(document.frmMatPassword.txtPassword.value)!=trim(document.frmMatPassword.hdnPassword.value))
			{
				alert("Your Current Password is incorrect");
				document.frmMatPassword.txtPassword.focus();
				return false;
			}
			return true;
}

function ViewProfileSubmit()
{
	if(trim(document.frmViewProfile.txtProfileId.value)=="")
		{
			document.frmViewProfile.txtProfileId.focus();
			alert("Please Enter the Profile ID");
			return false;
		}	
	return true;
}
function ViewProfileIndexSubmit()
{
	if(trim(document.frmIndex.txtProfilId.value)=="")
		{
			document.frmIndex.txtProfilId.focus();
			alert("Please Enter the Profile ID");
			return false;
		}	
	return true;
}
function ForwardProfileSubmit()
{
	
	if(trim(document.frmForwardProfile.txtFrom.value)=="")
		{
			document.frmForwardProfile.txtFrom.focus();
			alert("Please Enter the From");
			return false;
		}	
	if(trim(document.frmForwardProfile.txtEmail.value)=="")
		{
			document.frmForwardProfile.txtEmail.focus();
			alert("Please Enter the E-mail");
			return false;
		}	
	return true;
}
function ContactProfileSubmit()
{
	
	if(trim(document.frmContactProfile.txtSubject.value)=="")
		{
			document.frmContactProfile.txtSubject.focus();
			alert("Please Enter the Subject");
			return false;
		}	
	if(trim(document.frmContactProfile.txtMsg.value)=="")
		{
			document.frmContactProfile.txtMsg.focus();
			alert("Please Enter the Message");
			return false;
		}	
	return true;
}
function photosubmit()
{

	if((trim(document.frmPhotoUpload.txtPhoto1.value)=="")&&(trim(document.frmPhotoUpload.txtPhoto2.value)=="")&&(trim(document.frmPhotoUpload.txtPhoto3.value)=="")&&(trim(document.frmPhotoUpload.hdnDel1.value)=="")&&(trim(document.frmPhotoUpload.hdnDel2.value)=="")&&(trim(document.frmPhotoUpload.hdnDel3.value)==""))
		{
			document.frmPhotoUpload.txtPhoto1.focus();
			alert("Please upload atlease one photo");
			return false;
		}	
		
		if((document.frmPhotoUpload.radPhoto1[0].checked==true) && (trim(document.frmPhotoUpload.hdnDel1.value)==""))
		{
			if(trim(document.frmPhotoUpload.txtPhoto1.value)=="")
			{
				alert("Please upload photo 1 before you make it as main photo");
				document.frmPhotoUpload.txtPhoto1.focus();
				return false;
			}
		}
		
		if((document.frmPhotoUpload.radPhoto1[1].checked==true)&& (trim(document.frmPhotoUpload.hdnDel2.value)==""))
		{
			if(trim(document.frmPhotoUpload.txtPhoto2.value)=="")
			{
				alert("Please upload photo 2 before you make it as main photo");
				document.frmPhotoUpload.txtPhoto2.focus();
				return false;
			}
		}
		if((document.frmPhotoUpload.radPhoto1[2].checked==true)&& (trim(document.frmPhotoUpload.hdnDel3.value)==""))
		{
			if(trim(document.frmPhotoUpload.txtPhoto3.value)=="")
			{
				alert("Please upload photo 3 before you make it as main photo");
				document.frmPhotoUpload.txtPhoto3.focus();
				return false;
			}
		}
		if((trim(document.frmPhotoUpload.hdnDel1.value)=="")&&(trim(document.frmPhotoUpload.hdnDel2.value)=="")&&(trim(document.frmPhotoUpload.hdnDel3.value)==""))
		{
			if((document.frmPhotoUpload.radPhoto1[0].checked==false)&& (document.frmPhotoUpload.radPhoto1[1].checked==false)&& (document.frmPhotoUpload.radPhoto1[2].checked==false))
			{
				alert("Please select any uploaded photo as main photo");
				return false;
			}
		}
		
		if((document.frmPhotoUpload.radPhoto1[0].checked==false) && (document.frmPhotoUpload.radPhoto1[1].checked==false)&& (document.frmPhotoUpload.radPhoto1[2].checked==false))
		{
			if((trim(document.frmPhotoUpload.txtPhoto1.value)!="")|| (trim(document.frmPhotoUpload.txtPhoto2.value)!="") || (trim(document.frmPhotoUpload.txtPhoto2.value)!="")) 
			{
				alert("Please select Photo as main photo");
				return false;
			}
		}
		
	return true;
}

function horosubmit()
{
	
	if((trim(document.frmPhotoUpload.hdnPhoto4.value)=="N"))
		{
			document.frmPhotoUpload.txtHoro1.focus();
			alert("Please upload the horoscope");
			return false;
		}	
		return true;
}

function profilesubmit(mode)
{
			
			
			if(trim(document.frmProfile.txtName.value)=="")
			{
				alert("Name Must be Entered");
				document.frmProfile.txtName.focus();
				return false;
			}
			if(trim(document.frmProfile.txtAge.value)=="")
			{
				alert("Age Must be Entered");
				document.frmProfile.txtAge.focus();
				return false;
			}
				
			/*var mStatus = false;
			for(i=0;i<document.forms[0].elements.length;i++)
		   	{
		   		eName1 = document.forms[0].elements[i];
		   		
		   		if(eName1.name.indexOf("chkMStatus")== 0 )
		   		{
		   			
		   			if(eName1.checked==true)
		   				mStatus = true;
		   		}
		   	}
		  
			if(mStatus==false)
			{
				alert("Marital Status Must be Selected");
				
				return false;
			}*/
			if(trim(document.frmProfile.selMStatus.value)=="")
			{
				alert("Marital Status Must be Selected");
				document.frmProfile.selMStatus.focus();
				return false;
			}
			if(trim(document.frmProfile.selHeight.value)=="")
			{
				alert("Height Must be Selected");
				document.frmProfile.selHeight.focus();
				return false;
			}
			
			if(trim(document.frmProfile.selWeight.value)=="")
			{
				alert("Weight Must be Selected");
				document.frmProfile.selWeight.focus();
				return false;
			}
			if(trim(document.frmProfile.selBType.value)=="")
			{
				alert("Body Type Must be Selected");
				document.frmProfile.selBType.focus();
				return false;
			}
			
			if(trim(document.frmProfile.selComplextion.value)=="")
			{
				alert("Complextion Must be Selected");
				document.frmProfile.selComplextion.focus();
				return false;
			}
		
			if(trim(document.frmProfile.txtBGroup.value)=="")
			{
				alert("Blood Group Must be Entered");
				document.frmProfile.txtBGroup.focus();
				return false;
			}
					
			if(trim(document.frmProfile.txtMTongue.value)=="")
			{
				alert("Mother Tongue Must be Entered");
				document.frmProfile.txtMTongue.focus();
				return false;
			}
			
		/*   if(trim(document.frmProfile.txtPStatus.value)=="")
			{
				alert("Physical Status Must be Selected");
				document.frmProfile.txtPStatus.focus();
				return false;
			}*/
		
			if(trim(document.frmProfile.selReligion.value)=="")
			{
				alert("Religion Must be Selected");
				document.frmProfile.selReligion.focus();
				return false;
			}
			if((document.frmProfile.selCaste.value=="")&&(trim(document.frmProfile.txtCaste.value)==""))
			{
				alert("Caste / Division Must be Selected");
				document.frmProfile.selCaste.focus();
				return false;
			}
			/*if(trim(document.frmProfile.txtGothram.value)=="")
			{
				alert("Gothra(m) Must be Entered");
				document.frmProfile.txtGothram.focus();
				return false;
			}*/
			if(trim(document.frmProfile.selEduCat.value)=="")
			{
				alert("Education Category Must be Selected");
				document.frmProfile.selEduCat.focus();
				return false;
			}
			if(trim(document.frmProfile.selOccupation.value)=="")
			{
				alert("Occupation Must be Selected");
				document.frmProfile.selOccupation.focus();
				return false;
			}
			
		/*	if(trim(document.frmProfile.txtAmt.value)=="")
			{
				alert("Annual Income Must be Entered");
				document.frmProfile.txtAmt.focus();
				return false;
			}*/
			if(trim(document.frmProfile.selCitizen.value)=="")
			{
				alert("Citizen Of Must be Selected");
				document.frmProfile.selCitizen.focus();
				return false;
			}
			if(trim(document.frmProfile.selCountry.value)=="")
			{
				alert("Country Living in Must be Selected");
				document.frmProfile.selCountry.focus();
				return false;
			}
			if(trim(document.frmProfile.txtRState.value)=="")
			{
				alert("Residing State Must be Entered");
				document.frmProfile.txtRState.focus();
				return false;
			}
			if(trim(document.frmProfile.txtRCity.value)=="")
			{
				alert("Residing City Must be Entered");
				document.frmProfile.txtRCity.focus();
				return false;
			}
			if(trim(document.frmProfile.selRStatus.value)=="")
			{
				alert("Residing Status Must be Selected");
				document.frmProfile.selRStatus.focus();
				return false;
			}
			if(trim(document.frmProfile.txtContact.value)=="")
			{
				alert("Contact Address Must be Entered");
				document.frmProfile.txtContact.focus();
				return false;
			}
	
		
			if(mode=="E")
			{
				delMsg = confirm("Changes will reflect after it gets approved by the admin. Do you want to Continue?");
					if(delMsg)
						return true;
					else
						return false;
			}
			return true;
			
}


function partnersubmit()
{
			
			if(trim(document.frmPartner.txtAgeFrom.value)=="")
			{
				alert("Age From Must be Entered");
				document.frmPartner.txtAgeFrom.focus();
				return false;
			}
			if(trim(document.frmPartner.txtAgeTo.value)=="")
			{
				alert("Age To Must be Entered");
				document.frmPartner.txtAgeTo.focus();
				return false;
			}
			
			if(trim(document.frmPartner.selHeightFrom.value)=="")
			{
				alert("Height From Must be Selected");
				document.frmPartner.selHeightFrom.focus();
				return false;
			}
			if(trim(document.frmPartner.selHeightTo.value)=="")
			{
				alert("Height To Must be Selected");
				document.frmPartner.selHeightTo.focus();
				return false;
			}
			if(trim(document.frmPartner.selReligion.value)=="")
			{
				alert("Religion Must be Selected");
				document.frmPartner.selReligion.focus();
				return false;
			}
			if(trim(document.frmPartner.selCaste.value)=="")
			{
				alert("Caste / Division Must be Selected");
				document.frmPartner.selCaste.focus();
				return false;
			}
			if(trim(document.frmPartner.selCountry.value)=="")
			{
				alert("Country Living in Must be Selected");
				document.frmPartner.selCountry.focus();
				return false;
			}
			
			return true;
			
			
}

function ViewProfile(url)
		{
		  
			window.open(url,'TeluguDreams','height=530,width=800,scrollbars=Yes,resizable=yes,');
			return false;
		}
function PrintProfile(url)
		{
		//  alert(url);
			window.open(url,'TeluguDreams','height=630,width=700,scrollbars=Yes,resizable=yes,');
			return false;
		}		
		
function protectpwdsubmit()
		{
		
		  if(trim(document.frmProtectPhoto.txtPassword.value)=="")
			{
				alert("Password Must be Entered");
				document.frmProtectPhoto.txtPassword.focus();
				return false;
			}
			if(trim(document.frmProtectPhoto.txtCPassword.value)=="")
			{
				alert("Confirm Password Must be Entered");
				document.frmProtectPhoto.txtCPassword.focus();
				return false;
			}
		
			if(document.frmProtectPhoto.txtPassword.value.length < 4)
			{
				alert("Password Must be Minimum 4 Character");
				document.frmProtectPhoto.txtPassword.focus();
				return false;
			}
		   if(document.frmProtectPhoto.txtCPassword.value.length < 4)
			{
				alert("Cofirm Password Must be Minimum 4 Character");
				document.frmProtectPhoto.txtCPassword.focus();
				return false;
			}
			if(trim(document.frmProtectPhoto.txtPassword.value)!=trim(document.frmProtectPhoto.txtCPassword.value))
			{
				alert("Password and Confirm Password Must be equal");
				document.frmProtectPhoto.txtPassword.focus();
				return false;
			}
			return true;
}		

function yearDisabled()
{
	document.frmSearch.selMonth.disabled=true;
	document.frmSearch.selDay.disabled=true;
	document.frmSearch.selYear.disabled=true;
	document.frmSearch.selMonth.selectedIndex=0;
	document.frmSearch.selDay.selectedIndex=0;
	document.frmSearch.selYear.selectedIndex=0;
	
}
function yearEnabled()
{
	document.frmSearch.selMonth.disabled=false;
	document.frmSearch.selDay.disabled=false;
	document.frmSearch.selYear.disabled=false;
}
function SearchSubmit()
{
	if(document.frmSearch.chkCondition.checked==false)
	{
		alert("The Terms & Conditions should be checked");
		document.frmSearch.chkCondition.focus();
		return false;
	}
	
	var length = 0;
	var val = "";
	length = document.frmSearch.selMTongueList.length;
	for (var i=0; i<length; i++) 
	{
		val= val + document.frmSearch.selMTongueList.options[i].value + "," ;
	}
	document.frmSearch.hdnMTongue.value=val;
//	alert(val);
	length = 0;
	val = "";
	length = document.frmSearch.selCasteList.length;
	for (var i=0; i<length; i++) 
	{
		val= val + document.frmSearch.selCasteList.options[i].value + "," ;
	}
	document.frmSearch.hdnCaste.value=val;
//	alert(val);
	length = 0;
	val = "";
	length = document.frmSearch.selEduList.length;
	for (var i=0; i<length; i++) 
	{
		val= val + document.frmSearch.selEduList.options[i].value + "," ;
	}
	document.frmSearch.hdnEdu.value=val;
//	alert(val);
	length = 0;
	val = "";
	length = document.frmSearch.selOccList.length;
	for (var i=0; i<length; i++) 
	{
		val= val + document.frmSearch.selOccList.options[i].value + "," ;
	}
	document.frmSearch.hdnOcc.value=val;
//	alert(val);
	length = 0;
	val = "";
	length = document.frmSearch.selCitizenList.length;
	for (var i=0; i<length; i++) 
	{
		val= val + document.frmSearch.selCitizenList.options[i].value + "," ;
	}
	document.frmSearch.hdnCitizen.value=val;
//	alert(val);
	length = 0;
	val = "";
	length = document.frmSearch.selCountryList.length;
	for (var i=0; i<length; i++) 
	{
		val= val + document.frmSearch.selCountryList.options[i].value + "," ;
	}
	document.frmSearch.hdnCountry.value=val;
	//alert(val);
	length = 0;
	val = "";
	length = document.frmSearch.selStarList.length;
	for (var i=0; i<length; i++) 
	{
		val= val + document.frmSearch.selStarList.options[i].value + "," ;
	}
	document.frmSearch.hdnStar.value=val;
//	alert(val);
	
	/*document.frmSearch.__VIEWSTATE.disabled = true;
	document.frmSearch.action = "SearchResults.aspx";
	document.frmSearch.method = "post";
	document.frmSearch.submit(true);*/
	return true;
}

function LeftSearchSubmit()
{
	
	/*document.forms[0].__VIEWSTATE.disabled = true;
	document.forms[0].action = "SearchResults.aspx";
	document.forms[0].method = "post";
	document.forms[0].submit(true);*/
}

function pwdsubmit(pId)
		{
		
		  if(trim(document.frmPwd.txtPassword1.value)=="")
			{
				alert("Password Must be Entered");
				document.frmPwd.txtPassword1.focus();
				return false;
			}
		  if((document.frmPwd.txtPassword1.value) != (document.frmPwd.hdnpwd.value))
		  {
			alert("The entered password is not correct");
			return false;
		  }
		  
		    window.opener.document.frmProfileDisplay.hdnPwd.value= 'Y';
		   
			window.opener.document.forms[0].__VIEWSTATE.disabled = true;
			window.opener.document.forms[0].action = "ProfileDisplay.aspx?pId=" + pId;
			window.opener.document.forms[0].method = "post";
			window.opener.document.forms[0].submit(true);
			window.close();
}		
function deleteProfile()
{
  delMsg = confirm("Do you want to delete this profile permanently?");
  	if(delMsg)
		return true;
	else
		return false;
}
 function lettersOnly(e) {
      var evt = (e) ? e : window.event;
      var key = (evt.keyCode) ? evt.keyCode : evt.which;
	
      if(key != null) {
        key = parseInt(key, 10);

        if((key < 65 || key > 90) && (key < 96 || key > 105) ) {
          if(!isUserFriendlyChar(key))
            return false;
        }
      }

      return true;
    }

    function isUserFriendlyChar(val) {
      // Backspace, Tab, Enter, Insert, and Delete
      if(val == 8 || val == 9 || val == 13 || val == 45 || val == 46)
        return true;

      // Ctrl, Alt, CapsLock, Home, End, and Arrows
      if((val > 16 && val < 21) || (val > 34 && val < 41) || (val > 46 && val < 59))
        return true;

      // The rest
      return false;
    }
function reDirect()
{
 window.location.href = "MyMatrimonial.aspx";
}