


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.display = 'block';
		d.style.width = size[0];
		d.style.height = size[1];		
	}
	
	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 ShowLoading2( obj ){
	
	x = findPosX( obj ) + 265;
	y = findPosY( obj ) - 45;
	
	SetElementPositionX('loading2', x );
	SetElementPositionY('loading2', y );
	
	SetElementDisplay('loading2', 'block');		
}


function ChangeBlockDisplayStatus( blockId ){
	
	var status = 1;
	var htmlId = 'block_' + blockId;
	
	if( !$(htmlId) ){
		
		return false;
	}
	
	status = ( $(htmlId).style.display == 'block' ) ? 0 : 1;
	
	data = 'action=change_block_dysplay&blockid=' + blockId + '&status=' + status ;
	SendData( 'ajax.php', data );	
}



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 if( navigator.userAgent.indexOf('Opera') >= 0 ) {//Opera

		yWithScroll = window.innerHeight;
		xWithScroll = window.innerWidth;		
				
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
  	
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);

	return arrayPageSizeWithScroll;
}
