
/**************************************************/
/* Popup window : 
   A paraméterben átadott értéket, a felugró 
   konténerére kell rárakni azonosítóként!
   A konténer legyen rejtve! */
/**************************************************/
function popupShow(container){
	
	var overLayStyle = String('position:absolute; top:0px; left:0px; z-index:1000; width:100%; height:100%; background:#000;');
	var popupDivStyle = String('position:absolute; z-index:1000; border: 5px solid #00386b; background:#FFF; text-align:center;');
	var popupCloseStyle = String('position:absolute; z-index:1002; display:block; width:30px; height:30px; line-height:30px; background:#000; font-family:Arial; font-size:14px; font-weight:bold; color:#FFF; cursor:pointer; text-align:center;');
	
		$('<div id=\'overLay\' style=\''+overLayStyle+'\' onclick=\'popupHide();\'></div>').appendTo('body');
		$('<div id=\'popupDiv\' style=\''+popupDivStyle+'\'></div>').appendTo('body');
		$('<div id=\'popupDivContent\' style=\'margin:10px;\'></div>').appendTo('#popupDiv');					
	var overLayWidth = $('#overLay').width();	
	var overLayHeight = $('.hatter_jobbtop_fill').height();
	var popupDivWidth =$('#'+container+'').width();
	var popupDivHeight = $('#'+container+'').height();	
			
		$('#overLay').css('height',overLayHeight);	
		if (popupDivWidth > overLayWidth) {	overLayWidth = popupDivWidth; }	
		leftSpace = (overLayWidth - popupDivWidth)/2;
		if (popupDivHeight > overLayHeight) { overLayHeight = popupDivHeight+25; }	
		//topSpace = (overLayHeight - popupDivHeight)/2;
		topSpace = 100;			
		$('#popupDiv').css({'left':leftSpace, 'top':topSpace});	
				
		$('#popupDivContent').html($('#'+container+'').html())
		$('#popupDiv').css('opacity','0.0').animate({opacity:1});    
		$('#overLay').css('opacity','0.0').animate({opacity:0.6});  
		$('<div id=\'popupClose\' style=\''+popupCloseStyle+'\' onclick=\'popupHide();\'>X</div>').appendTo('body');
		$('#popupClose').css({'left':leftSpace+popupDivWidth+25, 'top':topSpace-25});		              
		//$('html, body').css('overflow','hidden');	
};

function popupHide(){
	$('#overLay').remove(); $('#popupDiv').remove(); $('#popupClose').remove();  
	//$('html, body').css('overflow','auto'); 
}

