$(function () {
    var data = $('td[id="tdBaStaId"]').text();
    var bastaid;
    if (data.length > 0) {
        bastaid = data;
    }
    else {
        bastaid = "-1";
    }
    $('a[id="alink"]').attr("href", "NetResChg.ashx?bastaid=" + bastaid);
});