function showPopupLayer(strId){
	var el = $(strId);	
	if(!el)	return;	
	var opacity = null;	
	if(Browser.Engine.trident4){
		opacity = 0.7;
	} else {
		opacity = 0.5;		
	}
	new Element('iframe',{
		'id': 'iframePopup',
		'styles':{
			'display': 'block',
			'border': 0,
			'visibility': 'visible',
			'position': 'absolute',
			'top': 0,
			'left': 0,
			'width': window.getWidth() + 'px',
			'height': $('container').getCoordinates().height + 'px',
			'z-index':'500',
			'backgroundColor': '#000000',
			'opacity': opacity
		}
	}).inject($(strId), 'before');	
	
	new Element('div',{
		'id': 'divPopup',
		'styles':{
			'display': 'block',
			'visibility': 'visible',
			'position': 'absolute',
			'top': 0,
			'left': 0,
			'width': window.getWidth() + 'px',
			'height': $('container').getCoordinates().height + 'px',
			'z-index':'500',
			'backgroundColor': '#000000',
			'opacity': opacity
		}
	}).inject($(strId), 'before');
	
	// alert($('iframePopup').getCoordinates().height + ' ' + (window.getHeight() + window.getScrollTop()) + ' ' + $('divPopup').getCoordinates().height)
	
	el.setStyle('display', 'block');
	el.setStyles({
		'position': 'absolute',
		'top': (Browser.Engine.trident4)?(($('container').getCoordinates().height  - el.getCoordinates().height)/2 + window.getScrollTop()):($('container').getCoordinates().height  - el.getCoordinates().height)/2 + 'px',
		'left': (window.getWidth() - el.getCoordinates().width)/2 + 'px',
		'z-index': '9999'
	});
	/*
	if(Browser.Engine.trident4){
		window.removeEvents().addEvent('scroll',function(){
			if(el){
				el.setStyle('top',($('container').getCoordinates().height  - el.getCoordinates().height)/2 + window.getScrollTop() + 'px');				
				var width = window.getWidth();
				var height = window.getHeight();				
				if (height < document.body.clientHeight) {
					height = document.body.clientHeight;
				}	
				if($('divPopup'))	 {
					$('divPopup').setStyles({'width': width, 'height': height});
				}
				if ($('iframePopup')) {
					$('iframePopup').setStyles({'width': width,	'height': height});
				}
			}
		});
	} else {*/							
		el.setStyle('position','absolute');
		if($('divPopup'))	 {		
			$('divPopup').setStyle('position','absolute');	
		}
		if ($('iframePopup')) {	
			$('iframePopup').setStyle('position','absolute');
		}
	//}
	
	window.addEvent('resize', function(e){
		var w = window.getWidth();				
		if(el){
			el.setStyle('top', (Browser.Engine.trident4)?(($('container').getCoordinates().height  - el.getCoordinates().height)/2 + window.getScrollTop()):($('container').getCoordinates().height  - el.getCoordinates().height)/2 + 'px');
			el.setStyle('left', (window.getWidth() - el.getCoordinates().width)/2 + 'px');
		}
		if($('iframePopup')){	
			$('iframePopup').setStyles({
				'width': window.getWidth() + 'px',
				'height': $('container').getCoordinates().height  + 'px'
			});
		}
		if($('divPopup')) {
			$('divPopup').setStyles({
				'width': window.getWidth() + 'px',
				'height': $('container').getCoordinates().height  + 'px'
			});
		}
	});
	
	//add event close 
	$$('#' + strId + ' a.btnClose')[0].addEvent('click', function(e){
		e.stop();		
		el.setStyle('top',-1500);
		if($('divPopup')) {
			$('divPopup').destroy();
		}
		
		if($('iframePopup')) {
			$('iframePopup').destroy();
		}
		if(Browser.Engine.trident4) {
			window.removeEvent('scroll');
		}
		window.removeEvents();
	});
}

function hideAllLayer(){
	$$('.popupLayer').setStyle('top', -1500);
}// JavaScript Document
