﻿//获取省
  function GetAreaP()
  {
      $.ajax({
        type: "POST",
        url: "RequestAjax/Area.aspx",
        error: function() {  },
        data: "type=areap",
        success: function(data) {    
         //
         if(data!="")
         {
         $("#areap").html(data); 
         //$("#areap")[0].selectedIndex=0;
         GetCity();
         }       
         else
         {   
         $("#areap").html("<option value='-1'>请选择</option>"); 
         }              
         $("#areac").html("<option value='0'>请选择</option>");
         $("#areaa").html("<option value='0'>请选择</option>");
        }
    });  
     //document.getElementById("areap").options.add(new Option("325sgs","2")); 
    // $("#areap").options.add(new Option('sdgsdgs','2'));
  }
  //获取城市
  function GetCity()
  {
       var city="";
        city=$("#areap").val();       
        $.ajax({
        type: "POST",
        url: "RequestAjax/Area.aspx",
        error: function() { },
        data: "type=areac&cityid="+city,
        success: function(data) {    
         //
         if(data!="")
         {
         $("#areac").html(data); 
         GetArea();
         }   
         else
         {       
         $("#areac").html("<option value='-1'>请选择</option>"); 
         }   
          
         $("#areaa").html("<option value='-1'>请选择</option>"); 
        }
        }); 
  }
  
  //获取地区
  function GetArea()
  {
        var city="";
        city=$("#areac").val();
        $.ajax({
        type: "POST",
        url: "RequestAjax/Area.aspx",
        error: function() {  },
        data: "type=areac&cityid="+city,
        success: function(data) {    
         //
         if(data!="")
         {
         $("#areaa").html(data);  
         }     
         else
         {          
         $("#areaa").html("<option value='-1'>请选择</option>");
         }
         
        }
    }); 
  }
  
  //搜索
  function SearchAreaShop()
  {
     var strP=$("#areap").val();
     var strC=$("#areac").val()
     var strA=$("#areaa").val()
     var url="shoplist/SearchShop.aspx?PerAreaName="+strP+"&c="+strC+"&a="+strA;
     self.location=url;
  }
  