function initPhoneExtend()
{
    jQuery.extend(Qs_Form_Element_Phone, Qs_Form_Element_Phone_Extend);
}

var Qs_Form_Element_Phone_Extend = {
    init: function (id, options)
    {
        var element = document.getElementById(id);
        if (!element) {
            alert('Qs_Form_Element_Phone. Can not find element with id = ' + id);
            return false;
        }
        if (!element.tagName || element.tagName != 'INPUT') {
            alert('Qs_Form_Element_Phone. Element (id = ' + id + ') is not "input"');
            return false;
        }
        if (element.type != 'text') {
            alert('Qs_Form_Element_Phone. Element (id = ' + id + ') type is not "text"');
            return false;
        }
        $(element).focus(Qs_Form_Element_Phone.onFocus);
        $(element).blur(Qs_Form_Element_Phone.onBlur);
        $(element).keyup(Qs_Form_Element_Phone.onKeyUp);
        Qs_Form_Element_Phone.setElementOptions(id, options);
        $(element).qtip({
            content: 'Use the numbers only and formatting will be done automatically.<br />'
                    + 'E.g.: 1231231234123456 will be formated as (123)-123-1234 ext. 123456',
            prerender: true,
            position: {
                corner: {
                    target: 'topRight',
                    tooltip: 'bottomRight'
                }
            },
            style: {
                tip:true,
                width:500
            }
        });
    }
}



