//获取路径中的文件名，不带扩展
function getFileName(s) {
    s = s.replace("\\", "/");
    if (s.indexOf("/") != -1) {
        s = s.substring(s.lastIndexOf("/") * 1 + 1)
    }
    if (s.indexOf(".") != -1) {
        s = s.substring(0, s.lastIndexOf(".") * 1);
    }
    return s;
}

function isNull(name) {
    if (!name) {
        return true;
    }
    return false;
}

function strLen(key) {
    var l = escape(key), len;
    len = l.length - (l.length - l.replace(/\%u/g, "u").length) * 4;
    l = l.replace(/\%u/g, "uu");
    len = len - (l.length - l.replace(/\%/g, "").length) * 2;
    return len;
}

// 选择图片
function imageSel(o) {
    var id = $(o).parent().children("input[type=text]").attr("id");
    // 选择图片
    wBox = $("#hoho").wBox({
        show: true,
        requestType: "iframe",
        iframeWH: { width: 800, height: 400, resize: false },
        target: "../FileManager/Default.aspx?target=" + id
    });
    return true;
}

function showTips(tips, time) {
    //var windowWidth = document.documentElement.clientWidth;
    var tipsDiv = '<div class="tipsClass" style="position: absolute; padding: 15px 30px; background: #f00; font-size: 14px; text-align: center; width: auto; color: #fff; font-weight: bold; opacity: 0.8; ">' + tips + '</div>';
    $('body').append(tipsDiv);
    $('div.tipsClass').css({
        'left': ($(window).width() - $('div.tipsClass').width()) / 2 + 'px',
        'top': ($(window).height() - $('div.tipsClass').height()) / 2 + 'px'
    }).show();
    //alert($(window).width() + "," + $('div.tipsClass').width());
    setTimeout(function() { $('div.tipsClass').fadeOut(); }, (time * 1000));
}
