﻿function hidemessage(controlId) 
{

    $(document).ready(function() {
        $("#" + controlId).oneTime("10s", function() {            
            $(this).hide();
        }
                                                    );
    });

}

// Removes leading whitespaces
function LTrim(value) {

    var re = /\s*((\S+\s*)*)/;
    return value.replace(re, "$1");

}

// Removes ending whitespaces
function RTrim(value) {

    var re = /((\s*\S+)*)\s*/;
    return value.replace(re, "$1");

}

// Removes leading and ending whitespaces
function trim(value) {

    return LTrim(RTrim(value));

}

function trimSpaces(controlId) 
{

    $("#" + controlId).val(trim($("#" + controlId).val()));
}

function confirmAction(message) 
{
    return confirm(message);        
}
