// ½Ç½Ã°£ ·Î±× ÀÔ·Â

var LogTK = new Object()

LogTK.Loader = function(iType, iDocId, sAuth, iPumDocId, dWrite, sAdult, sLCat, sMCat, iFileSize) {
    this._sUrl = "/common/Q/QcSvcLogRealRanking.asp"
    this._dMin = new Date().ConvertDate("M", -1)
    if(iPumDocId == "") iPumDocId = 0
    

    if(!isNaN(iType) && !isNaN(iDocId) && sAuth == "YYYY" && (parseInt(iPumDocId) == 0) && (this._dMin < dWrite.toDate()) && sAdult == "N" && !(sLCat == "06" && sMCat == "007") && iFileSize >= 1024)
    {
        this._sUrl = this._sUrl + "?docid=" + iDocId + "&type=" + iType  
        getRequestXHR(this._sUrl, false, true)
    }
    else
        return
}

Date.prototype.ConvertDate = function(sP, iD) {
    var iYear   = this.getYear()
    var iMonth  = this.getMonth()
    var iDate   = this.getDate()
    
    if(isNaN(iD)) return
    
    switch (sP)
    {
        case "D":
            iDate + (parseInt(iD))
        case "M":
            iMonth + (parseInt(iD))
        case "Y":
            iYear + (parseInt(iD))
    }
    
    return new Date(iYear, iMonth, iDate)
}

String.prototype.toDate = function() {
    var arrCut = this.split("-")
    var datNew = new Date(arrCut[0], arrCut[1], arrCut[2])

    return datNew
}

