﻿function $(id) {
    return document.getElementById(id);
}
function posturl() {
    if ($("ddlCountry_specialty").value == "-2") {
        alert("请选择国家!")
    }
    else if ($("ddlSpecialtyType").value == "-2") {
        alert("请选择专业!")
    }
    else {
        var url = "http://www.igo.cn/Speciality/index.aspx?CountryID=" + $("ddlCountry_specialty").value + "&Speciality=" + $("ddlSpecialtyType").value;
        if (url != "")
            openurl(url);
    }

}
function openurl(url) {
    parent.window.open(url, "_blank");
}

function bindspecialty() {
    var responseStr = "85,商科管理类;98,工程类;109,信息技术类;116,法学类;120,健康科学类;128,艺术设计类;138,语言教育类;143,应用科学类;149,文科类;153,其他专业";
    var obj = $("ddlSpecialtyType");
    obj.length = 0;
    obj.options.add(new Option("专业选择", "-2"));
    var arrarList = responseStr.split(';');
    var childList;
    for (var i = 0; i < arrarList.length; i++) {
        childList = arrarList[i].split(',');
        obj.options.add(new Option(childList[1], childList[0]));
    }
}
//绑定国家
function bindcountry() {
    var responseStr = "美国,加拿大,澳洲,英国,荷兰,新加坡,日本,韩国,爱尔兰,法国,新西兰,瑞士,德国,俄罗斯,乌克兰,意大利,瑞典,丹麦,马耳他,马来西亚,西班牙,中国,其他";
    var obj = $("ddlCountry_specialty");
    obj.length = 0;
    obj.options.add(new Option("国家选择", "-2"));
    var arrayList = responseStr.split(',');
    for (var i = 0; i < arrayList.length; i++) {
        obj.options.add(new Option(arrayList[i], i));
    }
}
bindspecialty();
bindcountry();
//PostInfoToAjax("http://www.igo.cn/Search/ReturnItems.aspx", bindspecialty, "get", "item", "specialty"); //专业类型
//PostInfoToAjax("http://www.igo.cn/Search/ReturnItems.aspx", bindcountry, "get", "item", "Nations"); //国家
