function BuscarEx(aTipo){
 lPath=window.location.href.replace(window.location.search,'');
 lPath=lPath.toLowerCase();
 if (lPath.indexOf('searchex.aspx') < 0){
  lPath = lPath + "/Public/Forms/SearchEx.aspx";}
 lWhere='';
  if (Object("inmIdPoblacion").value!='ALL' && Object("inmIdPoblacion").value!=''){
  if (lWhere!=''){ 
   lWhere=lWhere+" and inmIdPoblacion='"+Object("inmIdPoblacion").value.replace("'","''")+"'"; 
  }else{ 
   lWhere="inmIdPoblacion='"+Object("inmIdPoblacion").value.replace("'","''")+"'";}}
 if (Object("inmTipo").value!='ALL' && Object("inmTipo").value!=''){
  if (lWhere!=''){
   lWhere=lWhere+" and inmTipo='"+Object("inmTipo").value.replace("'","''")+"'"; 
  }else{
   lWhere="inmTipo='"+Object("inmTipo").value.replace("'","''")+"'";}}
 if (Object("segModo").value!='ALL' && Object("segModo").value!=''){
  if (lWhere!=''){
   lWhere=lWhere+" and segModo='"+Object("segModo").value.replace("'","''")+"'";
  }else{
   lWhere="segModo='"+Object("segModo").value.replace("'","''")+"'";}}
 if (Object("segPrecio_Desde").value!=''){
  if (lWhere!=''){
   lWhere=lWhere+" and segPrecio>="+Object("segPrecio_Desde").value; 
  }else{
   lWhere="segPrecio>="+Object("segPrecio_Desde").value;}}
 if (Object("segPrecio_Hasta").value!=''){
  if (lWhere!=''){
   lWhere=lWhere+" and segPrecio<="+Object("segPrecio_Hasta").value; 
  }else{
   lWhere="segPrecio<="+Object("segPrecio_Hasta").value;}}
 if (Object("inmHabitaciones_Desde").value!=''){
  if (lWhere!=''){
   lWhere=lWhere+" and indHabitaciones>="+Object("inmHabitaciones_Desde").value; 
  }else{
   lWhere="indHabitaciones>="+Object("inmHabitaciones_Desde").value;}}
 if (Object("inmHabitaciones_Hasta").value!=''){
  if (lWhere!=''){
   lWhere=lWhere+" and indHabitaciones<="+Object("inmHabitaciones_Hasta").value; 
  }else{
   lWhere="indHabitaciones<="+Object("inmHabitaciones_Hasta").value;}}
 if (lWhere==''){
  window.location=lPath+"?Tipo="+aTipo+"&Where=segPrecio>=0";
 }else{
  window.location=lPath+"?Tipo="+aTipo+"&Where="+lWhere;}}
function Buscar(){
 BuscarEx("Inmuebles");}
function BuscarEqual(aTipo,aCampo){
 lPath=window.location.href.replace(window.location.search,'');
 lPath=lPath.toLowerCase();
 if (lPath.indexOf('searchex.aspx') < 0){
  lPath = lPath + "/Public/Forms/SearchEx.aspx";}
 if (Object(aCampo).value!='ALL' && Object(aCampo).value!=''){
   window.location=lPath+"?Tipo="+aTipo+"&Where="+aCampo+"="+Object(aCampo).value;}}