﻿
function SelectAll(id) {
    document.getElementById(id).focus();
    document.getElementById(id).select();
}

function createSlug(text) {


    var input = text.replace(/[^a-zA-Z 0-9]+/g, "-");

    input = input.replace(/\s+/g, '-');
    input = input.replace(/----/g, '-');
    input = input.replace(/---/g, '-');
    input = input.replace(/--/g, '-');

    input = input.toLowerCase().charAt(input.toLowerCase().length - 1, 1) == "-" ?
        input.toLowerCase().substring(0, input.toLowerCase().length - 1) : input.toLowerCase();

    return input;

}

var popup_container;
var aSPxPopupControlPreview;
var cms;

jQuery(function($) {
    function content_resize() {

        var w = $(window);
        var H = w.height();
        var W = w.width();
    }
    $(window).resize(content_resize);
    content_resize();
}
);

function restrictMaxLength(text, long) {
    var maxlength = new Number(long); // Change number to your max length.
    if (text.value.length > maxlength) {
        text.value = text.value.substring(0, maxlength);
    }
}

