﻿ $(document).ready(function(){ 
 $("#ashenqing").click(function(){
 ShowShenqing();});
 $("#btntiaozhuan").click(function(){
 if($("#select").val()=="")
 {
 alert("请选择省份");
 $("#select").focus();
 return false;
 }
 if(document.getElementById("select1"))
 {
 if($("#select1").val()=="")
 {
 alert("请选择城市"); $("#select1").focus();
 return false;
 }
 }else
 {
 alert("请选择省份"); $("#select").focus();
 return false;
 }
 if(document.getElementById("select2"))
 {
 if($("#select2").val()=="")
 {
 window.open("http://"+$("#select1").val()+".zhe.cn","_self");
 }else
 {
  window.open("http://"+$("#select2").val()+".zhe.cn","_self");
 }
 }else
 {
  window.open("http://"+$("#select1").val()+".zhe.cn","_self");
 }
 })
$("#select").change(function(){
if($("#select").val()!="")
{
$.ajax({
            url: "/inc/ajax.aspx?abc=showcity1&value="+$("#select").val(),
            type: "GET",
            async: false,
            cache: false,
            success: function(msg) {
            if(msg!="")
            {
            $("#DivCity").html("<select style=\"width:80px;\" name=select1 id=select1><option value=''>请选择城市</option>"+msg+"</select>");
            }else
            {
            $("#DivCity").html("该省份还没有代理");
            }
            $("#DivProper").html("");
            $("#select1").change(function(){

            $.ajax({
            url: "/inc/ajax.aspx?abc=showcity2&value="+$("#select1").val(),
            type: "GET",
            async: false,
            cache: false,
            success: function(msg) {
             if(msg!="")
            {
            $("#DivProper").html("<select style=\"width:80px;\" name=select2 id=select2><option value=''>市区</option>"+msg+"</select>");
            }else
            {
            $("#DivProper").html("");
            }
                      
            }
            });
            
            });
            }
            });

}else
{
 $("#DivCity").html("");
 $("#DivProper").html("");
}

});
});

			function ShowShenqing()
			{
				rtnValue = window.showModalDialog("/toleave.aspx?abc=kcity","","dialogWidth:330px;dialogHeight:310px;center:1;resizable:yes;help:no;status:no;scroll:no");				
				if (rtnValue != 'undefined' && rtnValue != null)
				{
					document.all.txtMobileList.value = rtnValue;
					Form1.txtMobileList.focus();
				}
			}