function getPageSize() {

   var xScroll, yScroll;

   if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
     xScroll = document.body.scrollWidth;
     yScroll = document.body.scrollHeight;
   }
   else if (window.innerHeight && window.scrollMaxY) {
     xScroll = window.innerWidth + window.scrollMaxX;
     yScroll = window.innerHeight + window.scrollMaxY;
   }
   // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari.
   else {
     xScroll = document.body.offsetWidth;
     yScroll = document.body.offsetHeight;
   }

   var windowWidth, windowHeight;

   if (self.innerHeight) { // All except Explorer.
     if (document.documentElement.clientWidth) {
       windowWidth = document.documentElement.clientWidth;
     }
     else {
       windowWidth = self.innerWidth;
     }
     windowHeight = self.innerHeight;
   }
   // Explorer 6 Strict Mode.
   else if (document.documentElement && document.documentElement.clientHeight) {
     windowWidth = document.documentElement.clientWidth;
     windowHeight = document.documentElement.clientHeight;
   }
   else if (document.body) { // Other Explorers.
     windowWidth = document.body.clientWidth;
     windowHeight = document.body.clientHeight;
   }


   // For small pages with total height less then height of the viewport.
   if (yScroll < windowHeight) {
     pageHeight = windowHeight;
   }
   else {
     pageHeight = yScroll;
   }


   // For small pages with total width less then width of the viewport.
   if (xScroll < windowWidth) {
     pageWidth = windowWidth;
   }
   else {
     pageWidth = xScroll;
   }

   arrayPageSize = [pageWidth, pageHeight, windowWidth, windowHeight];
   return arrayPageSize;
}


function show_dialog_registration(){
	var arrayPageSize = getPageSize();
	var pageHeight = arrayPageSize[1];
	var overlay = '<div id="overlay" style="z-index: 1000; height:'+screen.height+'px; background-color: rgb(0, 0, 0); width: '+screen.width+'px; display: none;"/>';
	$("#bodyNew").append(overlay);
	$('#overlay').css({height: pageHeight + 'px', width: arrayPageSize[0] + 'px','position' : 'absolute','top' : '0px'});
	
	$('#front_overlay').dialog({"width":620,"title":"",resizable: false,close : close_dialog_registration,dialogClass : 'registerbox'});
	$(".ui-dialog").hide();
	$('#overlay').show();
	$(".registerbox").fadeIn("slow");
	$(".registerbox").css({"z-index" : "10091"})
	$('.ui-dialog').click(function(){
		
	});
  	$('#overlay').fadeTo("fast", 0.6);
}

function close_dialog_registration(){
	$('#overlay').fadeOut("slow");
	$(".ui-dialog").remove();
}

$(document).ready(function(){
	/*$("#navbar a,#widgets a,#rotator .rotator-slides a,#messagebord a").click(function(){
		show_dialog_registration();
		return false;
	})*/
 });

