﻿// JScript 文件

//取得子分类
function CategoryParentChange(childId, parent_value, action, default_message)
{
    var $obj_wucg_child = $('#' + childId);
    $obj_wucg_child.get(0).options.length = 0;
    var url = '/PositionCategoryHandler.ashx?action=' + action + '&ParentID=' + parent_value;
    $.ajax({ 
        url: url,
        type:'get',           
        dataType:'json',
        data: 'name=John&location=Boston',
        success:function(msg){ 
             var result = msg;
             if(result.success){ 
                if($.trim(default_message) != '') 
                {
                    $('<option value="0">' + default_message + '</option>').appendTo($obj_wucg_child);
                }
                for(var i=0;i<result.data.length;i++){
                    $('<option value="'+result.data[i].id+'">'+result.data[i].name+'</option>').appendTo($obj_wucg_child);
                }
             }
        } 
    });
}

//弹出窗口
function popWindow(url)
{
    var s_time = (new Date()).getTime();
    var sUrl ;
    if(url.indexOf('?')>0)
    {
        sUrl = url + '&tmp=' + s_time;
    }
    else
    {
        sUrl = url + '?tmp=' + s_time;
    }
    set_msg_box(
        sUrl,
        {action:'show'});
    return false;
}
