<!--
function validate_age(){
    
	var diff = parseInt(document.basic_search.cmbhageto.options[document.basic_search.cmbhageto.selectedIndex].text) - parseInt(document.basic_search.cmbhagefrom.options[document.basic_search.cmbhagefrom.selectedIndex].text);
	
	 if(parseInt(document.basic_search.cmbhageto.options[document.basic_search.cmbhageto.selectedIndex].text) < parseInt(document.basic_search.cmbhagefrom.options[document.basic_search.cmbhagefrom.selectedIndex].text)){
		document.basic_search.cmbhageto.focus();
		alert("Please select valid Age of From  & To");
		return false;
	}
	else {
		if(community_check() == true){
	       return true;
	     }
		 else return false;
			
	}
}
function community_check(){
	if (document.basic_search.cmbhcommunity.options[document.basic_search.cmbhcommunity.selectedIndex].value == ""){
		alert("Please select community");
		return false;
	}else{
		return true;
	}
}

function valid_age(){
	
	
//	var diff = parseInt(document.advsearch.ageto.options[document.advsearch.ageto.selectedIndex].text) - parseInt(document.advsearch.agefrom.options[document.advsearch.agefrom.selectedIndex].text);
	
   if(parseInt(document.advsearch.ageto.options[document.advsearch.ageto.selectedIndex].text) < parseInt(document.advsearch.agefrom.options[document.advsearch.agefrom.selectedIndex].text))
	 {
		alert("Please select valid Age of From  & To");
		document.advsearch.ageto.focus();
		return false;
	}
	  
	 if(height_check() == false)
	 {
	       return false;
	 }
	 return true;
}
function height_check(){
 var diff = parseInt(document.advsearch.heightto.options[document.advsearch.heightto.selectedIndex].text) - parseInt(document.advsearch.heightfrom.options[document.advsearch.heightfrom.selectedIndex].text);
	if(parseInt(document.advsearch.heightto.options[document.advsearch.heightto.selectedIndex].text) < parseInt(document.advsearch.heightfrom.options[document.advsearch.heightfrom.selectedIndex].text))
	 {
		alert("Please select valid Height of From  & To");
		return false;
	}
	else
	{
	return true;
	}

}
function age(){
	
	//alert('hi');
	var diff = parseInt(document.citysearch.cmbcityageto.options[document.citysearch.cmbcityageto.selectedIndex].text) - parseInt(document.citysearch.cmbcityagefrom.options[document.citysearch.cmbcityagefrom.selectedIndex].text);
	
   if(parseInt(document.citysearch.cmbcityageto.options[document.citysearch.cmbcityageto.selectedIndex].text) < parseInt(document.citysearch.cmbcityagefrom.options[document.citysearch.cmbcityagefrom.selectedIndex].text))
	 {
		alert("Please select valid Age of From  & To");
		return false;
	}
	  
	 if(city_check() == false)
	 {    
	       return false;
	 }
	 return true;
}
function city_check(){
 if(document.citysearch.txtcity.value == "")	 {
		alert("Please select city");
		return false;
	}
	if(check_text(trimme(document.citysearch.txtcity.value)) == false)
 {
	 return false
	 }
	else
	{
	return true;
	}

}
function trimme(str)
{
        str = str.replace(/^\s*|\s*$/g,"");
        return str;
}
function feature_age(){
	
	//alert('hi');
	var diff = parseInt(document.citysearch.cmbcityageto.options[document.citysearch.cmbcityageto.selectedIndex].text) - parseInt(document.citysearch.cmbcityagefrom.options[document.citysearch.cmbcityagefrom.selectedIndex].text);
	
   if(parseInt(document.citysearch.cmbcityageto.options[document.citysearch.cmbcityageto.selectedIndex].text) < parseInt(document.citysearch.cmbcityagefrom.options[document.citysearch.cmbcityagefrom.selectedIndex].text))
	 {
		alert("Please select valid Age of From  & To");
		return false;
	}
	  
	 
	 return true;
}
function key_age(){
	
	//alert('hi');
	var diff = parseInt(document.key_search.cmbkyageto.options[document.key_search.cmbkyageto.selectedIndex].text) - parseInt(document.key_search.cmbkyagefrom.options[document.key_search.cmbkyagefrom.selectedIndex].text);
	
   if(parseInt(document.key_search.cmbkyageto.options[document.key_search.cmbkyageto.selectedIndex].text) < parseInt(document.key_search.cmbkyagefrom.options[document.key_search.cmbkyagefrom.selectedIndex].text))
	 {
		alert("Please select valid Age of From  & To");
		return false;
	}
	  
	 if(key_check() == false)
	 {    
	       return false;
	 }
	 return true;
}
function key_check(){
	
 if(document.key_search.textkyfield.value == "")	 {
		alert("Please enter data in the keyword field.");
		return false;
	}
 if(check_text(document.key_search.textkyfield.value) == false)
 {
	 return false
	 }
	else
	{
	return true;
	}

}
function check_text(str)
{

		validString = 1;count=0;
		for( var idx=0; idx< str.length; idx++ )
		{
			ch = str.charAt(idx);count++;

			if( !((ch>='a') && (ch<='z')) && !((ch>='A') && (ch<='Z')) )
			{
				validString = 0;
				
				break;
			}
		}
		if (validString==0)
		{   alert("Please Select alphabets only");
			return false;
		}

		//if(str == document.citysearch.txtcity.value)

		  //return true;
		if(count<4)
		{
			alert("Please enter minimum 4 characters.");
			return false;
			}
		else 
			return true;
}
function photo_age(){
	
	//alert('hi');
	var diff = parseInt(document.photosearch.ageto.options[document.photosearch.ageto.selectedIndex].text) - parseInt(document.photosearch.agefrom.options[document.photosearch.agefrom.selectedIndex].text);
	
   if(parseInt(document.photosearch.ageto.options[document.photosearch.ageto.selectedIndex].text) < parseInt(document.photosearch.agefrom.options[document.photosearch.agefrom.selectedIndex].text))
	 {
		alert("Please select valid Age of From  & To");
		return false;
	}
	if(document.photosearch.maritalstatus.value=='')
	{
		alert('Please select the marital status');
		return false;
		}
	return true;
}
function validate(age){
	 
	//alert('hi');
	var diff = parseInt(age.sel_age_max.options[age.sel_age_max.selectedIndex].text) - parseInt(age.sel_age_min.options[age.sel_age_min.selectedIndex].text);

   if(parseInt(age.sel_age_max.options[age.sel_age_max.selectedIndex].text) <  parseInt(age.sel_age_min.options[age.sel_age_min.selectedIndex].text))
	 {
		alert("Please select valid Age of From  & To");
		return false;
	}
	  
	// if(height_check(age) == false)
	 //{     
	   //    return false;
	 //}
	
	 return true;
}
/*function height_check(height){
	
 var diff = parseInt(height.cmb_height_max.options[height.cmb_height_max.selectedIndex].text) - parseInt(height.cmb_height_min.options[height.cmb_height_min.selectedIndex].text);
	if(parseInt(height.cmb_height_max.options[height.cmb_height_max.selectedIndex].text) <= parseInt(height.cmb_height_min.options[height.cmb_height_min.selectedIndex].text))
	 {
		alert("Please select valid Height of From  & To");
		return false;
	}
	else
	{
	return true;
	}

}*/
function validation(age){
	 
	//alert('hi');
	var diff = parseInt(age.sel_age_max.options[age.sel_age_max.selectedIndex].text) - parseInt(age.sel_age_min.options[age.sel_age_min.selectedIndex].text);
	
   if(parseInt(age.sel_age_max.options[age.sel_age_max.selectedIndex].text) < parseInt(age.sel_age_min.options[age.sel_age_min.selectedIndex].text))
	 {  
		alert("Please select valid Age of From  & To");
		age.sel_age_max.focus();
		return false;
	}
	  
	  if(parseInt(age.cmb_height_max.options[age.cmb_height_max.selectedIndex].text) < parseInt(age.cmb_height_min.options[age.cmb_height_min.selectedIndex].text))
	 {  
		alert("Please select valid height From  & To");
		age.cmb_height_max.focus();
		return false;
	}
	 /*if(height_check(age) == false)
	 {     
	       return false;
	 }*/
	
	 return true;
}
/*function height_check(height){
alert(	height.cmb_height_max.selectedIndex);
 var diff = parseInt(height.cmb_height_max.options[height.cmb_height_max.selectedIndex].text) - parseInt(height.cmb_height_min.options[height.cmb_height_min.selectedIndex].text);
	if(height.cmb_height_max.options[height.cmb_height_max.selectedIndex].text <= height.cmb_height_min.options[height.cmb_height_min.selectedIndex].text)
	 {  //if(height.cmb_height_max.selectedIndex <= height.cmb_height_min.selectedIndex)
alert ('hi');
//{//
	 //alert(parseInt(height.cmb_height_min.options[height.cmb_height_min.selectedIndex].text));
		alert("Please select valid Height of From  & To");
		height.cmb_height_max.focus();
		return false;
	}//}
	else
	{
	return true;
	}

}*/

function ResetForm(which)
{
	which.reset(); return false;
	
}

/*function chk_index(str)
{
		
		validString = 1;count=0;
		for( var idx=0; idx< str.length; idx++ )
		{
			ch = str.charAt(idx);count++;

			if( !((ch>='a') && (ch<='z')) && !((ch>='A') && (ch<='Z')) )
			{
				validString = 0;
				
				break;
			}
		}
		if (validString==0)
		{   alert("Please Select alphabets only");
			return false;
		}
		if(str == document.citysearch.txtcity.value)
		  return true;
		if(count<4)
		{
			alert("Please enter minimum 4 characters.");
			return false;
			}
		else 
			return true;
}*/
//-->