function IframePopup()
{
	var iframePopup = document.createElement('div');
	iframePopup.id = 'iframe_popup';
	$j(iframePopup).html(
		'<div id="prop_details">'+
			'<div id="popup-title-bar">' +
				'<div id="iframe_popup-title" style="float: left;"></div>'+
				'<div class="button blue" style="width: 60px; float: right; margin-top: 10px;" id="popup_close_btn"><div>Close</div></div>' +
			'</div>'+
			'<div id="iframe_popup-message"></div>'+
			'<div>'+
				'<iframe id="iframe_popup_iframe" name="iframe_popup_iframe" src="" style="border:0px;"></iframe>'+
			'</div>'+
		'</div>'
		);
			
	var iframeMask = document.createElement('div');
	iframeMask.id = 'iframe_popup-mask';
	
	$j(iframeMask).hide();
	$j(iframePopup).hide();
	
	$j(document.body).prepend(iframePopup);
	$j(document.body).prepend(iframeMask);

	var object = this;
	$j('#popup_close_btn').bind('click',function(){object.hide()});
	
	var dl = $j(iframePopup);
	
	this.hide();
}

IframePopup.prototype = {
	show: function(title, src, width, height)
	{
		if(width == null) width = 400;
		if(height == null) height = 250;
		
		$j('#iframe_popup_iframe').attr('src', src).css({height: height+'px', width: width+'px'});
		$j('#iframe_popup_iframe').parent('div').css({height: height+'px', width: width+'px'});
		
		$j('#iframe_popup-title').html(title);
		$j('#iframe_popup-message').hide();
		
		var dl = $j('#iframe_popup')
		dl.css('width', (width+5)+'px');
		dl.css('height', (height+40)+'px');
		
		var dialogTop = $j(document).scrollTop() + (Math.abs($j(window).height() - dl.height()) / 2);
		dl.css('left', ($j(window).width() - dl.width()) / 2);
		dl.css('top', (dialogTop >= 25) ? dialogTop : 25);
		dl.show();
		
		//hide selects for ie 6
		if(jQuery.browser.msie && parseInt(jQuery.browser.version.substr(0,1), 10) <= 6)
		{
			$j('select').css('visibility','hidden');
		}
		
		$j('#iframe_popup-mask').css('height', $j(window.document).height()+'px');
		$j('#iframe_popup-mask').show();
	},
	hide: function()
	{
		$j('#iframe_popup').hide();
		$j('#iframe_popup-mask').hide();
		$j('#iframe_popup_iframe').attr('src', '');
		
		//show selects for ie 6
		if(jQuery.browser.msie && parseInt(jQuery.browser.version.substr(0,1), 10) <= 6)
		{
			$j('select').css('visibility','visible');
		}
	}
}
