function makeOverlay(){
	hideScrollbars();
	var overlay=new Element('div', {	
		'id': 'overlay'
	});	
	overlay.injectInside($('bodyElement'));
}

function makeWindow(){
	var window=new Element('div', {	
		'id': 'window'
	});	
	window.injectInside($('overlay'));
}

function makeLoading(){
	var loading=new Element('div', {	
		'id': 'loading'
	});	
	loading.injectInside($('window'));
}
function Loading(){
	makeOverlay();
	makeWindow();
	makeLoading();
}
function makeDiv(id){
	var info=new Element('div', {	
		'id': id
	});	
	info.injectInside($('window'));
}

function displayZacheta(){	
	displayLayer('zacheta');
	var zamknij=new Element('div', {	
		'class': 'zamknij'
	});	
	zamknij.onclick=function(a){destroyLayer("zacheta");};
	zamknij.injectInside($('zacheta'));
	
	var tak=new Element('div', {	
		'class': 'tak'
	});	
	tak.onclick=function(a){destroyLayer("zacheta"); window.open('http://pffshop.pl/pffchat/chat_gui.php');};
	tak.injectInside($('zacheta'));
	
	var nie=new Element('div', {	
		'class': 'nie'
	});	
	nie.onclick = function(a){
		destroyLayer("zacheta")
	};
	nie.injectInside($('zacheta'));
}



function displayLayer(id){
	makeOverlay();
	makeWindow();
	makeDiv(id);
}

function destroyLayer(id){
	if($(id)) $(id).remove();
	if($('window')) $('window').remove();
	if($('overlay')) $('overlay').remove();
	if($('ov')) $('ov').remove();
}

function destroyLoading(){
	if($('loading')) $('loading').remove();
	if($('window')) $('window').remove();
	if($('overlay')) $('overlay').remove();
	if($('ov')) $('ov').remove();
}
function hideScrollbars(){
	
}