(function($){
  $.fn.vhCenter = function(options) {
    var pos = {
      sTop : function() {
        return window.pageYOffset || document.documentElement && document.documentElement.scrollTop ||	document.body.scrollTop;
      },
      wHeight : function() { 
        return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body.clientHeight;
      },
      sLeft : function() {
        return window.pageXOffset || document.documentElement && document.documentElement.scrollLeft ||	document.body.scrollLeft;
      },
      wWidth : function() { 
        return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body.clientWidth;
      }
    };
    return this.each(function(index) {
      if (index == 0) {
        var $this = $(this);
        var elHeight = $this.height();
        var elWidth = $this.width();
		    var elTop = pos.sTop() + (pos.wHeight() / 2) - (elHeight / 2);
		    var elLeft = pos.sLeft() + (pos.wWidth() / 2) - (elWidth / 2);
        $this.css({
          position: 'absolute',
          marginTop: '0',
          top: elTop,
          left: elLeft
        });


      }
    });
  };

})(jQuery);
 
       
        
 (function($)  
 {  
     $.fn.dialogWindow = function(text) {

         return this.each(function()  
         {  
            $(this).stop().css({opacity:1}).vhCenter().html(text);
            
              $(this).show().show().animate({dummy:1}, 1000).animate({"opacity": 0},{ duration: 500});


         });  
     };  
 })(jQuery);