﻿//$Author: dmccoy $

//$LastChangedDate: 2010-03-18 16:57:51 -0500 (Thu, 18 Mar 2010) $

//$Rev: 7194 $

//$HeadURL:$

var $j = jQuery.noConflict();

jQuery.fn.center = function() {
    // Always return each...
    return this.each(function() {
        var w = jQuery(window).width();
        var ow = jQuery(this).outerWidth();
        var sl = jQuery(window).scrollLeft();
        var h = jQuery(window).height();
        var oh = jQuery(this).outerHeight();
        var st = jQuery(window).scrollTop();
        var leftPos = (w - ow) / 2 + sl,
            topPos = (h - oh) / 2 + st;

        // Make sure element is not out of bounds
        leftPos = (leftPos < 0) ? 0 : leftPos;
        topPos = (topPos < 0) ? 10 : topPos;

        jQuery(this).css({ left: leftPos + 'px', top: topPos + 'px', zIndex: '1000' });
    });
};

//function setParentClass() {
//    var parentOf = jQuery('span.AspNet-TreeView-ClickableNonLink').parent();
//    parentOf.addClass('noHover');
//};

function pageLoad(sender, args)
{
    var container = $j('body');
    var modalBackground = $j('.ModalBackground');
    var popupServer = $j('.popupServer');

    modalBackground.css('height', container.attr('clientHeight'));
    popupServer.center();

    //setParentClass();
};


