function ShowInfoText(){
	
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
    
    var overlay = document.getElementById('overlay');
    if(overlay != undefined){
        overlay.style.height = (arrayPageSize[1] + 'px');
        overlay.style.width = (arrayPageSize[2] + 'px');
        overlay.style.display = 'block';
    }
    
    var text = document.getElementById('text');
    if(text != undefined){
        text.style.display = 'block';
        text.style.top = '11px';
        text.style.left = ((arrayPageSize[2] - 633) / 2) + 'px';
    }
}

function HideInfoText(){
    var overlay = document.getElementById('overlay');
    if(overlay != undefined){
        overlay.style.display = 'none';
    }
    
    var text = document.getElementById('text');
    if(text != undefined){
        text.style.display = 'none';
    }
}


function getPageScroll(){
	var yScroll;
	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){
		yScroll = document.documentElement.scrollTop;
	} else if (document.body){
		yScroll = document.body.scrollTop;
	}
    
	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}

function getPageSize(){	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY){
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else {
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
    
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
    
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

NewWindow1 = null;
function ShowWin(href, w, h){
	if(NewWindow1){ NewWindow1.close(); }
	if(NewWindow1==null || NewWindow1.closed){
		var top = screen.height/2 - h/2;
		var left = screen.width/2 - w/2;
		var settings =
	 		"left=" + left + "px,"
			+"top=" + top + "px,"
			+"width=" + w + "px,"
			+"height=" + h + "px,"
			+"toolbar=no,"
			+"location=no,"
			+"directories=no,"
			+"status=yes,"
			+"menubar=yes,"
			+"scrollbars=yes,"
			+"resizable=yes";
		NewWindow1 = window.open(href,'okno',settings);
	}
	NewWindow1.focus();
}
