/// class PD.Path
/// using PD

PD.Path = Class.extend({
});

PD.Path.resolve = function (path) {

    var vd = PD.ENVIRONMENT.VIRTUAL_DIRECTORY;

    if (path === undefined || path === null) {
        return path;
    }

    if (path.indexOf("~/") === 0 && vd !== null) {
        path = "/" + vd + path.substr(1);
    }

    return path;

};

PD.Path.to16x16 = function (icon, area) {
    area = area || "shared";
    return PD.Path.resolve("~/areas/" + area + "/assets/internal/icons/16x16/" + icon);
};

PD.Path.to24x24 = function (icon, area) {
    area = area || "shared";
    return PD.Path.resolve("~/areas/" + area + "/assets/internal/icons/24x24/" + icon);
};

PD.Path.to32x32 = function (icon, area) {
    area = area || "shared";
    return PD.Path.resolve("~/areas/" + area + "/assets/internal/icons/32x32/" + icon);
};

PD.Path.to48x48 = function (icon, area) {
    area = area || "shared";
    return PD.Path.resolve("~/areas/" + area + "/assets/internal/icons/48x48/" + icon);
};

PD.Path.toMisc = function (icon, area) {
    area = area || "shared";
    return PD.Path.resolve("~/areas/" + area + "/assets/internal/icons/misc/" + icon);
};

PD.Path.getExtension = function (path) {
    return path.substr((~-path.lastIndexOf(".") >>> 0) + 2);
};