﻿var timerResize = null;

jQuery().ready(function ()
{
    onWindowResizeTimeout();
});

jQuery(window).resize(function () { onWindowResizeTimeout(); });

function onWindowResizeTimeout()
{
    clearTimeout(timerResize);
    resizeTimer = setTimeout(onWindowResize, 75);
}

function onWindowResize()
{
    jQuery(".window_center_horizontal").each(function ()
    {
        var $this = jQuery(this);
        $this.css('left', (jQuery(window).width() - $this.width()) / 2);
    });

    jQuery(".window_center_vertical").each(function ()
    {
        var $this = jQuery(this);
        $this.css('top', (jQuery(window).height() - $this.height()) / 2);
    });
}

function validateEmailAddress(elementValue)
{
    var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
    return emailPattern.test(elementValue);
}

