function OpenModalIframe(url, width, height) // {{{
{
	/*
	*	изначально диллерам был роздан неверный код ссылки, поэтому пляшем с бубном...
	*/
	var true_url = 'http://www.bezlimitno.ru/__popup/gold_number/index.htm?for_iframe=1';
	var params = '';
	if(-1 != url.indexOf('&')) params = url.substring(url.indexOf("&"));
	url = true_url+params;

	var body = jQuery('body').eq(0);

	var window_height = parseInt(window.innerHeight || document.body.clientHeight || 0);
	//alert(window_height);
	var total_height = parseInt(body.attr('offsetHeight'));
	//alert(total_height);
	if(total_height < window_height) total_height = window_height;

	var total_height = parseInt(window.innerHeight || document.body.clientHeight || 600);

	var ua = navigator.userAgent.toLowerCase();
	var isOpera = (ua.indexOf('opera')  > -1);
	var isIE = (!isOpera && ua.indexOf('msie') > -1);
	 
 
	function getDocumentHeight() {
	  return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollHeight : document.documentElement.scrollHeight, getViewportHeight());
	}
	 
	function getViewportHeight() {
	  return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientHeight : document.body.clientHeight : (document.parentWindow || document.defaultView).innerHeight;
	}
	 

	var total_height = getDocumentHeight();
	
	var bg = jQuery('<div>').appendTo(body).attr('name', 'modal_background').css({
				position: 'absolute',
				left: '0px',
				top: '0px',
				width: body.attr('offsetWidth'),
				height: total_height,
				backgroundColor:'#6e6e6e',
				opacity: 0.5,
				zIndex:100
			})
			.bind('click', function(){
				jQuery('div[@name="modal_testdiv"]').remove();
				jQuery('iframe[@name="modal_iframe_new"]').remove();
				jQuery('div[@name="lefttop_new"]').remove();
				jQuery('div[@name="leftbottom_new"]').remove();
				jQuery('div[@name="righttop_new"]').remove();
				jQuery('div[@name="rightbottom_new"]').remove();
				jQuery('div[@name="top_new"]').remove();
				jQuery('div[@name="bottom_new"]').remove();
				jQuery('div[@name="crush"]').remove();
				jQuery(this).remove();
			});


	var w = parseInt(width) || 300;
	var h = parseInt(height) || 300;
	var t = 60;

	if (navigator.appName == 'Microsoft Internet Explorer') {var sdvig=-8}
	else
	{var sdvig=3;w=w-1;}


	var l = Math.ceil(parseInt(bg.attr('offsetWidth')) / 2 - (w / 2)+sdvig);
	
	var t_new= t-38;
	var l_new= l+38;
	var l_end= l+w-38;
	var t_end= t+h;
	var w_new= w-(38*2);
	var h_freim = h-20;
	var w_freim = w-100;

	var test_div = jQuery('<div>').attr('name', 'modal_testdiv').css({
		backgroundColor: '#ffffff',
		position: 'absolute',
		left: l,
		top: t,
		height: h,
		width: w,
		opacity: 1,
		zIndex: 110
		}).appendTo(body);
	
	var fr_new = jQuery('<iframe frameborder="0" hspace="0" vspace="0" src="'+url+'">').attr('name', 'modal_iframe_new').css({
		position: 'absolute',
		left: 50,
		top: 5,
		height: h_freim,
		width: w_freim,
		opacity: 1,
		zIndex: 130
		}).appendTo(jQuery('div[@name="modal_testdiv"]'));
	
	var lefttop_new = jQuery('<div>').appendTo(body).attr('name', 'lefttop_new').css({
				position: 'absolute',
				left: l,
				top: t_new,
				width: '38px',
				height: '38px' ,
				background:'url(http://www.bezlimitno.ru/images/pm/top_left.png) no-repeat top left',
				zIndex:115
			});
	var leftbottom_new = jQuery('<div>').appendTo(body).attr('name', 'leftbottom_new').css({
				position: 'absolute',
				left: l,
				top: t_end,
				width: '38px',
				height: '38px' ,
				background:'url(http://www.bezlimitno.ru/images/pm/bottom_left.png) no-repeat top left',
				zIndex:115
			});
	var top_new = jQuery('<div>').appendTo(body).attr('name', 'top_new').css({
				position: 'absolute',
				left: l_new,
				top: t_new,
				width: w_new,
				height: '38px' ,
				background:'url(http://www.bezlimitno.ru/images/pm/whitepoloska.gif) repeat-x top left',
				zIndex:115
			});
	var bottom_new = jQuery('<div>').appendTo(body).attr('name', 'bottom_new').css({
				position: 'absolute',
				left: l_new,
				top: t_end,
				width: w_new,
				height: '38px' ,
				background:'url(http://www.bezlimitno.ru/images/pm/whitepoloska.gif) repeat-x top left',
				zIndex:115
			});
	var righttop_new = jQuery('<div>').appendTo(body).attr('name', 'righttop_new').css({
				position: 'absolute',
				left: l_end,
				top: t_new,
				width: '38px',
				height: '38px' ,
				background:'url(http://www.bezlimitno.ru/images/pm/top_right.png) no-repeat top left',
				zIndex:115
			});
			
	var rightbottom_new = jQuery('<div>').appendTo(body).attr('name', 'rightbottom_new').css({
				position: 'absolute',
				left: l_end,
				top: t_end,
				width: '38px',
				height: '38px' ,
				background:'url(http://www.bezlimitno.ru/images/pm/bottom_right.png) no-repeat top left',
				zIndex:115
			});
	var crush = jQuery('<div>').appendTo(jQuery('div[@name="righttop_new"]')).attr('name', 'crush').css({
				position: 'absolute',
				left: 0,
				top: 20,
				cursor: 'pointer',
				width: '14px',
				height: '14px' ,
				background:'url(http://www.bezlimitno.ru/images/pm/crush.gif) no-repeat top left',
				zIndex:115
			})
			.bind('click', function(){
				jQuery('div[@name="modal_background"]').remove();
				jQuery('div[@name="modal_testdiv"]').remove();
				jQuery('iframe[@name="modal_iframe_new"]').remove();
				jQuery('div[@name="lefttop_new"]').remove();
				jQuery('div[@name="leftbottom_new"]').remove();
				jQuery('div[@name="righttop_new"]').remove();
				jQuery('div[@name="rightbottom_new"]').remove();
				jQuery('div[@name="top_new"]').remove();
				jQuery('div[@name="bottom_new"]').remove();
				jQuery(this).remove();
			});
} // }}}


// vim: set ts=4 sw=4 foldmethod=marker foldlevel=0: