
function popVersionLayer(width,shadow,url){

	var body = document.getElement('body');
	var layerToPop = new Element('div', {'class': 'layerToPop'});
	var blockToPop = document.getElement('div.versionBlockToPop');
	var url = url ? url : false;
	if (shadow){
		layerToPop.setStyles(shadow.getCoordinates());
		if (shadow==document.documentElement){
			layerToPop.setStyles({
				'width':document.documentElement.clientWidth,
				'height':document.documentElement.clientHeight,
				'top':0,
				'bottom':0,
				'left':0,
				'right':0,
				'position':'absolute'
			});
		}
	}else{
		layerToPop.setStyles(body.getCoordinates());
	}
	
	layerToPop.setStyle('z-index', 9998);
	blockToPop.removeClass('hidden');
	blockToPop.setStyles({
		'top': (document.documentElement.clientHeight - blockToPop.offsetHeight)/2,
		'left': (document.documentElement.clientWidth - blockToPop.offsetWidth)/2,
		'z-index': 9999
	});
	if (width) {
		blockToPop.setStyles({
			'width' : width,
			'left': (document.documentElement.clientWidth - width)/2});
	}
	blockToPop.addClass($('page').className);
	
	if (url) {
		var iframe = blockToPop.getElement('iframe');
		iframe.src = url;
	}
	
	layerToPop.injectInside(body);
	blockToPop.injectInside(body);
	ifrlayer.make(blockToPop);
	ifrlayer.make(layerToPop);
};

function releaseVersionLayer(){
	var layerToPop = document.getElement('div.layerToPop');
	var blockToPop = document.getElement('div.versionBlockToPop');
	blockToPop.addClass('hidden');
	layerToPop.remove();
	ifrlayer.hide(blockToPop);
	ifrlayer.hide(layerToPop);
};