//version 2.0.2.1
/**
    Returns the year from the date object in parameter
*/
function takeYear(theDate) {
    var x = theDate.getYear();
    var y = x % 100;
    y += (y < 38) ? 2000 : 1900;
    return y;
}
/**
    Returns the month from the date object in parameter
*/
function takeMonth(theDate) {
    var x = theDate.getMonth() + 1;
    var y = "";
    if (x < 10) {
        y = "0" + x;
    } else {
        y = "" + x;
    }
    return y;
}
/**
    Returns the day from the date object in parameter
*/
function takeDay(theDate) {
    var x = theDate.getDate();
    var y = "";
    if (x < 10) {
        y = "0" + x;
    } else {
        y = "" + x;
    }
    return y;
}
/**
    return true if date1 > date2
*/
function dateOneIsUpperThanDateTwo(date1, date2) {
    var delta = date1.getTime() - date2.getTime();
    if (delta >= 0) {
        return true;
    }
    return false;
}

/**
    Build the date object in function of given date/time Strings parameters
*/
function buildDateTimeObject(date, time) {
    var Year = date.substring(0, 4) * 1;
    var month = date.substring(4, 6) * 1;
    var day = date.substring(6, 8) * 1;
    var videoHour = time.substring(0, 2) * 1;
    var videoMinute = time.substring(2, 4) * 1;
    var videoSecond = time.substring(4, 6) * 1;
    var result = new Date(Year, month - 1, day, videoHour, videoMinute, videoSecond);
    return result;
}
