﻿// JScript 文件
function gensql()
{
   var sql="";
   if(document.getElementById("sex_f").checked)
   {
      sql+="sex=f";
   }
   if(document.getElementById("sex_m").checked)
   {
      sql+="sex=m";
   }
   var minage= document.getElementById("min_age").value;
   if(minage!=0)
   {
       if(sql=="")
       {
          sql+="minage="+minage;
       }
       else
       {
          sql+="&minage="+minage;
       }
   }
   var maxage=document.getElementById("max_age").value;
   if(maxage!=0)
   {
       if(sql=="")
       {
          sql+="maxage="+maxage;
       }
       else
       {
          sql+="&maxage="+maxage;
       }
   }
   var work_location=document.getElementById("work_location").value;
   if(work_location!=0)
   {
      if(sql=="")
      {
         sql+="work_location="+work_location;
      }
      else
      {
         sql+="&work_location="+work_location;
      }
   }
   var work_sublocation=document.getElementById("work_sublocation").value;
   if(work_sublocation!=0)
   {
      if(sql=="")
      {
         sql+="work_sublocation="+work_sublocation;
      }
      else
      {
         sql+="&work_sublocation="+work_sublocation;
      }
   }
   var work_xianlocation=document.getElementById("work_xianlocation").value;
   if(work_xianlocation!=0)
   {
      if(sql=="")
      {
         sql+="work_xianlocation="+work_xianlocation;
      }
      else
      {
         sql+="&work_xianlocation="+work_xianlocation;
      }
   }
   var min_height=document.getElementById("min_height").value;
   if(min_height!=0)
   {
       if(sql=="")
       {
          sql+="min_height="+min_height;
       }
       else   
      {
          sql+="&min_height="+min_height;
      }
  }
  var max_height=document.getElementById("max_height").value;
   if(min_height!=0)
   {
       if(sql=="")
       {
          sql+="max_height="+max_height;
       }
       else   
      {
          sql+="&max_height="+max_height;
      }
  }
  var education=document.getElementById("education").value;
  if(education!=0)
  {
      if(sql=="")
      {
         sql+="education="+education;
      }
      else
      {
         sql+="&education="+education;
      }
  }
  var edu_more_than=document.getElementById("edu_more_than");
  if(edu_more_than.checked)
  {
     if(sql=="")
     {
        sql+="edu_more_than=1";
     }
     else
     {
        sql+="&edu_more_than=1";
     }
  }
  var income=document.getElementById("income").value;
  if(income!=0)
  {
      if(sql=="")
      {
         sql+="income="+income;
      }
      else
      {
         sql+="&income="+income;
      }
  }
  var income_more_than=document.getElementById("income_more_than");
  if(income_more_than.checked)
  {
     if(sql=="")
     {
        sql+="income_more_than=1";
     }
     else
     {
        sql+="&income_more_than=1";
     }
  }
  var marriage= document.getElementById("marriage").value;
  if(marriage!=0)
  {
      if(sql=="")
      {
         sql+="marriage="+marriage;
      }
      else
      {
         sql+="&marriage="+marriage;
      }
  }
  var children=document.getElementById("children").value;
  if(children!=0)
  {
     if(sql=="")
     {
        sql+="children="+children;
     }
     else
     {
        sql+="&children="+children;
     }
  }
  var level=document.getElementById("level").value;
  if(level!=0)
  {
      if(sql=="")
      {
         sql+="level="+level;
      }
      else
      {
         sql+="&level="+level;
      }
  }
  var industry=document.getElementById("industry").value;
  if(industry!=0)
  {
     if(sql=="")
     {
        sql+="industry="+industry;
     }
     else
     {
        sql+="&industry="+industry;
     }
  }
  var house=document.getElementById("house").value;
  if(house!=0)
  {
     if(sql=="")
     {
        sql+="house="+house;
     }
     else
     {
        sql+="&house="+house;
     }
  }
  var auto=document.getElementById("auto").value;
  if(auto!=0)
  {
     if(sql=="")
     {
        sql+="auto="+auto;
     }
     else
     {
        sql+="&auto="+auto;
     }
  }  
  

  var photo=document.getElementById("avatar");
  if(photo.checked)
  {
     if(sql=="") 
     {
        sql+="photo=1";
     }
     else
     {
        sql+="&photo=1";
     }
  }
  
  
  
  
  var home_location=document.getElementById("home_location").value;
   if(home_location!=0)
   {
      if(sql=="")
      {
         sql+="home_location="+home_location;
      }
      else
      {
         sql+="&home_location="+home_location;
      }
   }
   var home_sublocation=document.getElementById("home_sublocation").value;
   if(home_sublocation!=0)
   {
      if(sql=="")
      {
         sql+="home_sublocation="+home_sublocation;
      }
      else
      {
         sql+="&home_sublocation="+home_sublocation;
      }
   }
   var home_xianlocation=document.getElementById("home_xianlocation").value;
   if(home_xianlocation!=0)
   {
      if(sql=="")
      {
         sql+="home_xianlocation="+home_xianlocation;
      }
      else
      {
         sql+="&home_xianlocation="+home_xianlocation;
      }
   }
   if(sql=="")
   {
      sql+="first_post=y";
   }
   else
   {
      sql+="&first_post=y";
   }
   location.href="result.aspx?"+sql;
}

function findsex()
{
   var sql="";
   if(document.getElementById("sex_right_f").checked)
   {
      sql+="sex=f";
   }
   if(document.getElementById("sex_right_m").checked)
   {
      sql+="sex=m";
   }
   if(sql=="")
   {
      sql+="first_post=y";
   }
   else
   {
      sql+="&first_post=y";
   }
   location.href="result.aspx?"+sql;
}

function findnickname()
{
   var sql="";
   if(document.getElementById("nickname").value=="")
   {
      return;
   }
   else
   {
      sql+="uname="+escape(document.getElementById("nickname").value);
   }
      if(sql=="")
   {
      sql+="first_post=y";
   }
   else
   {
      sql+="&first_post=y";
   }
   location.href="result.aspx?"+sql;
}

function findmem()
{
   if(document.getElementById("uid").value=="")
   {
       return false;
   }
   else
   {
      location.href="../memdetails.aspx?id="+document.getElementById("uid").value;
   }
}