function reset()
{
	var frm = document.From1;
	frm.drpSex.selectedIndex=0;
	frm.txtAgeFrom.value="18";
	frm.txtAgeTo = "49";
	frm.lstMaritalStatus.selectedIndex=0;
	frm.lstNativeLang.selectedIndex=0;
	frm.lstReligion.selectedIndex=0;
	frm.lstCaste.selectedIndex=0;
	frm.drpSate.selectedIndex=0;
	frm.drpCountry.selectedIndex=0;
	frm.chkPhoto.checked= false;
	return false;
}

function fillState(drpId)
{
	var drpState = document.getElementById("drpSate");
	drpState.options.length = 0;
	drpState.options[drpState.options.length]= new Option("Doesn't Matter","-1");
	
	if(document.getElementById(drpId).selectedIndex>0)
	{
		var cntryCd = document.getElementById(drpId).options[document.getElementById(drpId).selectedIndex].value;		
		var strState = document.getElementById("hdn").value;
		var stringArray = strState.split("|");
		
		for(var i=0 ;i<stringArray.length; i++)
		{	
			var temp= stringArray[i];
			if(temp!="")
			{
				var strA = temp.split("+");
				if(strA[0] == cntryCd)
					drpState.options[drpState.options.length]= new Option(strA[2],strA[1]);
			}			
		}
	}
	
	return false;
}

function height_next()
{
	var frm = document.search;
	frm.drpHeightTo.selectedIndex = frm.drpHeightFrom.selectedIndex;
	return false;
}

function weight_next()
{
	var frm = document.search;
	frm.drpWeightTo.selectedIndex = frm.drpWeightFrom.selectedIndex;
	return false;
}

function height_prev()
{
	var frm = document.search;
	if (frm.drpHeightFrom.selectedIndex > frm.drpHeightTo.selectedIndex)
	{
		alert("Please select proper HEIGHT selection.");
		frm.drpHeightTo.focus();
	}
	return false;
}

function weight_prev()
{
	var frm = document.search;
	if (frm.drpWeightFrom.selectedIndex > frm.drpWeightTo.selectedIndex)
	{
		alert("Please select proper HEIGHT selection.");
		frm.drpWeightTo.focus();
	}
	return false;
}

function search_onclick()
{
	if(document.getElementById("drpSate").options[document.getElementById("drpSate").selectedIndex].value !="-1")
	{
		document.getElementById("hdnState").value = document.getElementById("drpSate").options[document.getElementById("drpSate").selectedIndex].value;
	}	
	return true;
}

function launchphoto(userid) {
	var myBars='directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes'
	var myOptions='width=500,height=600,resizeable=yes,alwaysRaised=yes,z-lock=yes,alwaysLowered=no';
	var myfeatures=myBars + ',' + myOptions;
		window.open("../Profile/photo.aspx?UserID="+userid +"&photoid=m","Photo",myfeatures);
}


