function OpenPopUp(url, isModal, fullScreenPopUp,width, height, queryParam) {

    if (width == undefined) {
        var width = $(window).width();
        if (width > 900)
            width = 900;
        else
            width -= 50;
    }
    if (height == undefined) {
        var height = $(window).height();
        if (height > 600)
            height = 600;
        else
            height -= 50;
    }

    //var jqxhr = $.get("example.php", function () {
    //    alert("success");
    //})
    //.fail(function () {
    //    alert("error");
    //})
        //.done(function () {
        //    alert("second success");
        //})
        //.always(function () {
        //    alert("finished");
        //});
   
    //$('#ComponentsPopupModal').on('show', function () {
    //    $('iframe').attr("src", url);
    //});
    //$('iframe').attr("src", url);
    //$('#ComponentsPopupModal').modal({ show: true })

    fullScreenPopUp = localStorage.getItem('fullScreenPopUp');

    if (fullScreenPopUp == 'true')
        var popUpObj = window.open(url + (queryParam != undefined ?  '?listener=' + queryParam: ''), '', 'directories=no,toolbar=no,location=no,status=no,menubar=no,fullscreen=yes,height=' + screen.availWidth + ',width=' + screen.availWidth);
    else
        var popUpObj = window.open(url + (queryParam != undefined ? '?listener=' + queryParam : ''), '', 'directories=no,toolbar=no,location=no,status=no,menubar=no,width=' + width + ',height=' + height);

    if (isModal) {
        //$('body').append("<div class='divModalFreeze'></div>");

        popUpObj.onunload = function (e) {
            if (window != null && !window.closed) {
                //$('.divModalFreeze').detach();
                DisableDiv_Toggle(false);
            }
            return null;
        };

        //popUpObj.addEventListener("onbeforeunload", function () {
        //    if (window != null && !window.closed) {
        //        //$('.divModalFreeze').detach();
        //        DisableDiv_Toggle();
        //    }
        //});

        popUpObj.onload = function (e) {
            if (window != null && !window.closed) {
                if (popUpObj.document.readyState == "complete")
                    if (window != null && !window.closed) {
                        //$('.divModalFreeze').detach();
                        DisableDiv_Toggle(true);
                    }
            }
            return null;
        };

        //popUpObj.addEventListener("onunload", function () {
        //    if (window != null && !window.closed) {
        //            if (popUpObj.document.readyState == "complete")
        //                if (window != null && !window.closed) {
        //                    //$('.divModalFreeze').detach();
        //                    DisableDiv_Toggle();
        //                }
        //        }
        //});

    }
    popUpObj.focus();
}