﻿
//获取城市网址
function IpToCity_Page_OnLoad() {
    var paramObject = new Object();
    paramObject["requestMethod"] = "getCityAddress";
    paramObject["ipAddress"] = "";
    $.ajax({
        url: "ajax/index.aspx",                     //后台处理程序
        type: 'post',                                   //数据发送方式
        dataType: 'json',                            //接受数据格式
        data: paramObject,                        //要传递的数据
        success: GetCityAddressAjaxReturn  //回调方法
    });
var loadhtml = "<div class='box_loading'><div class='txt'>欢迎您来到我秀中国, 正在加载城市站...</div><div class='img'><img src='images/ajax-loader2.gif' align='absmiddle' /></div></div>";  
$("body").append(loadhtml);
}

//获取城市回调方法
function GetCityAddressAjaxReturn(json) {
    var strMethod = json["requestMethod"];
    switch (strMethod) {
        case "getCityAddress":
            {
                CityToWeb(json["cityPy"]);
            }
            break;
    }
}

//根据城市跳转相对网址
function CityToWeb(cityPy) {
    var url = "http://bj.ishowchina.com/";      //默认北京
    if (cityPy != null && cityPy != "" && cityPy != undefined) {
//        var tempurl = IPCity[cityPy];
//        if (tempurl != null && tempurl != "" && tempurl != undefined) {
        url = cityPy;
//        }
    }
    window.location = url;
}
