﻿function SendSwitch(mkid)
{
   if(mkid!="00000000000000000021")
   {
    $("mkone").className="now1";
   }
   else
   {
    $("mkone").className="curr";
   }
   var url = "QuankeASHX/SendSwitch.ashx";
   var param="mkid="+mkid;
   //alert(param);
   var ajax = new Ajax.Request(url,{method:"post",parameters:param,onComplete:SendSwitchBack});
}
function SendSwitchBack(ajaxResponse)
{
    //alert(ajaxResponse.responseText);
    $("zxdiv").innerHTML=ajaxResponse.responseText;
}

function SwitchSF()
{
    var url="QuankeASHX/SwitchSF.ashx";
    var param="sfid="+$("SFDDL").options[$("SFDDL").selectedIndex].value;
    var ajax = new Ajax.Request(url,{method:"post",parameters:param,onComplete:SwitchSFBack});
}
function SwitchSFBack(ajaxResponse)
{
    //alert(ajaxResponse.responseText);
    $("CSDDL").options.length=0;
    var citys=ajaxResponse.responseText;
    var arr=citys.split(',');
    var selindex=0;
    
    for(var i=0;i<(arr.length-1);i++)
    {
        var city=arr[i].split('-');
        var option = new Option(city[1],city[0])
//        option.innerText = city[1];
//        option.value = city[0];
        $("CSDDL").options.add(option);
        if(city[0]==$("selcity").value)
        {
            option.selected=true;
            selindex=i;
        }
    }
    if((arr.length-1)<=0)
    {
        var option = new Option("所有城市","")
        $("CSDDL").options.add(option);
    }
    else
    {
        //alert(selindex);
        if(selindex==0)
        {
            var city=arr[0].split('-');
            $("selcity").value=city[0];
        }
    }
}
function SwitchCity()
{
    $("selcity").value=$("CSDDL").options[$("CSDDL").selectedIndex].value;
}
