ID Obect

function Integration_Id_Builder ()
{
    var  newIntegrationId = new String("OD-1-NULL-");
    var  dateNow = new Date();
    with (dateNow)
    {
        var dmon = new String('0'+(1+getMonth()).toString());
        var dday = new String('0'+getDate().toString());
        var dyr  = getYear().toString();
        var dhr  = new String('0'+getHours().toString());
        var dmin = new String('0'+getMinutes().toString());
        var dsec = new String('0'+getSeconds().toString());
        var dmil = new String('00'+getMilliseconds().toString());

        while (dyr.length > 2) { dyr = dyr.slice(1); }
        while (dmil.length > 3) { dmil = dmil.slice(1); }

        newIntegrationId += dyr;
        newIntegrationId += (dmon.length > 2? dmon.slice(1): dmon);
        newIntegrationId += (dday.length > 2? dday.slice(1): dday);
        newIntegrationId += (dhr.length  > 2? dhr.slice(1):  dhr);
        newIntegrationId += (dmin.length > 2? dmin.slice(1): dmin);
        newIntegrationId += (dsec.length > 2? dsec.slice(1): dsec);
        newIntegrationId += dmil;
    }
    return newIntegrationId;
}