$(document).ready(function() {
   //var windowWidth = measure('window').x;
   var overlaybanner = $("#overlaybanner");
   var container = $("#container");
   if(overlaybanner) {
//      if(overlaybanner.position().left < 10) {
//         overlaybanner.css("margin-left", (windowWidth - 1020)/2);
//      }

      $(document.body).css( "background", "none" );
      container.css("display", "none");

      overlaybanner.wait(4000);
      overlaybanner.fadeOut(1000, function () {
            $(document.body).css( "background", "transparent url(../gfx/v2/bg_patroon.gif) repeat scroll 0 0" );
            container.css("display", "block");
      });
   }
}
);


$.fn.wait = function(time, type) {
     time = time || 1000;
     type = type || "fx";
     return this.queue(type, function() {
         var self = this;
         setTimeout(function() {
             $(self).dequeue();
         }, time);
     });
 };
