$(document).ready(function()
	{
	$('#pop_back').hide();
	$('#popup').hide();
	
var height=$(document).height();
var width=$(document).width();
	
function popup(wid, hei, type)
	   {
		if (type==1)
		  {
			var L=((width/2)-(wid/2));
			var T=((height/2)-(hei/2));
		  }
		else if (type==2)
		  {
			var T=700;
			var L=((width/2)-(wid/2));
		  }
		
		$('#pop_back').css({
					'width':width,
					'height':height,
					'position':'absolute',
					'top':'0px',
					'left':'0px',
					'background-color':'#000000',
					'opacity':'0.5',
					'display':'none'
				})
				
		$('#popup').css({
					'width':wid,
					'height':hei,
					'position':'absolute',
					'top':T,
					'left':L,
					'background':'bottom repeat-x #FFFFFF',
					'display':'none',
					'padding':'1px',					
					'border':'2px solid #D0D0D0',
					'-moz-border-radius':'4px',
					'-webkit-border-radius':'4px'
				})	
		
		$('#pop_back').fadeIn();
		$('#popup').fadeIn();
		}

function pop_close(){
		$('#pop_back').fadeOut();
		$('#popup').fadeOut();
		showflash();
	}
	
$('#pop_back').click(function()
    {
		pop_close();				 
	})
	
$('#btn2').click(function(){
		hideflash();
		popup(750, 650, 2);						 
	})

$('#close_btn').click(function(){
		
		pop_close();				 
	})
})
