function isEmail(str) {
    return /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/.test(str);
}

function isURL(str) {
    return /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/.test(str);
}

function format_french_number(number) {
	
    number += '';
    x = number.split('.');
    x1 = x[0];
    x2 = x.length > 1 ? '.' + x[1] : '';
    var rgx = /(\d+)(\d{3})/;
    while (rgx.test(x1)) {
        x1 = x1.replace(rgx, '$1' + ' ' + '$2');
    }
    var with_space = x1 + x2;

    return with_space.replace(".", ",");
}

function round(number,X) {
    X = (!X ? 2 : X);
    return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}
