/** common windows functions **/

function BlockAll(){
	
	Block();
	ShowLoading();
}


function UnblockAll(){
	
	Unblock();
	HideLoading();
}

function Block()
{
	var d = document.getElementById('blocker');
	var hider = document.getElementById( 'hider' );
	
	if (d)
	{
		size = getPageSizeWithScroll();
		
		d.style.width = size[0];
		d.style.height = size[1];
		d.style.display = 'block';
	}
	
	if( hider ){

		hider.style.width = size[0];
		hider.style.height = size[1];
		hider.style.display = 'block';		
	}
		
}

function Unblock()
{
	var d = document.getElementById('blocker');
	var hider = document.getElementById( 'hider' );
	
	if ( d)
	{
		d.style.display = 'none';
	}
	
	if( hider ){

		hider.style.display = 'none';

	}	
}


function ShowLoading(){
	
	SetElementDisplay( 'loading', 'block' );
}

function HideLoading(){
	
	SetElementDisplay( 'loading', 'none' );
}


function getPageSizeWithScroll(){
	
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}
