function jQ_CommonSetup() { //|---------------------------------- //| Custom JQuery extensions //|---------------------------------- //| Case-insensitive $.Contains() jQuery.extend(jQuery.expr[':'], { Contains : "(a.innerText||a.innerHTML).toUpperCase().indexOf(m[3].toUpperCase())>=0" }) jQuery.fn.CenterOnScreen = function () { this.css("position","absolute"); this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px"); this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px"); return this; } jQuery.fn.CenterHoriz = function () { this.css("position","absolute"); this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px"); return this; } jQuery.fn.CenterVert = function () { this.css("position","absolute"); this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px"); return this; } jQuery.fn.Maximize = function () { this.css({left: '0', top: '0'}); this.css("width", $(document).width() + "px"); this.css("height", $(document).height() + "px"); return this; } jQuery.fn.CenterAtTop = function () { this.CenterOnScreen(); nTopOfObject = parseInt(this.css("top").replace(/[^\.\-0-9]/g,"")); nTopOfViewport = $(window).scrollTop(); if (nTopOfObject < (nTopOfViewport + 40)) { this.css("top", nTopOfViewport + 10); } //else { this.append(nTopOfObject + " - " + nTopOfViewport) } return this; } //|---------------------------------- //| Attribute-based bindings //|---------------------------------- //|---------------------------------- //| DHTML behaviors //|---------------------------------- $("[data-ElementsToggled]").click( function () { arrElementIDs = $(this).attr("data-ElementsToggled").split("|"); for (var nElement = 0; nElement < arrElementIDs.length; nElement++) { $("#" + arrElementIDs[nElement]).toggle(); } }); //|---------------------------------- //| Ajax automation //|---------------------------------- $("[data-frameafter_url]").click( function () { $(this).after("