function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function ShowFotoView(id, doc_id)
{
	html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1013" height="768" id="foto_flash" align="middle">';
	html += '<param name="movie" value="' + doc_root + '/fotoview/FotoView.swf?' + new Date() + '" />';
	html += '<param name="menu" value="false" />';
	html += '<param name="quality" value="high" />';
	html += '<param name="scale" value="exactfit" />';
	html += '<param name="wmode" value="transparent" />';
	html += '<param name="allowscriptaccess" value="sameDomain" />';
	html += '<param name="flashvars" value="idmode=1&main_data=' + doc_root + '/fotoview/modal.php?id=' + id + '|' + doc_id + '" />';
	html += '<!--[if !IE]>-->';
	html += '<object type="application/x-shockwave-flash" data="' + doc_root + '/fotoview/FotoView.swf?' + new Date() + '" width="1013" height="768" align="middle">';
	html += '<param name="menu" value="false" />';
	html += '<param name="quality" value="high" />';
	html += '<param name="scale" value="exactfit" />';
	html += '<param name="wmode" value="transparent" />';
	html += '<param name="allowscriptaccess" value="sameDomain" />';
	html += '<param name="flashvars" value="idmode=1&main_data=' + doc_root + '/fotoview/modal.php?id=' + id + '|' + doc_id + '" />';
	html += '<!--<![endif]-->';
	html += '<div style="padding: 9px;font-color:#fff;">';
	html += '<h4>Нужно обновление</h4>';
	html += '<p>Пожалуйста, обновите Flash проигрыватель до версии <strong>9.*</strong></p>';
	html += '</div>';
	html += '<!--[if !IE]>-->';
	html += '</object>';
	html += '<!--<![endif]-->';
	html += '</object>';
	html += '<img id="ob_cross" src="' + doc_root + '/_img/official/cross.gif" onmouseover="this.src=\'' + doc_root + '/_img/official/cross_hov.gif\';" onmouseout="this.src=\'' + doc_root + '/_img/official/cross.gif\';" onclick="QuitFotoView();" />';

	$("#content_foto").html(html);

	$("#background").css("display", "block");
    $("#foto").css("display", "block");

    if (document.body.scrollTop > 0) top_offset = document.body.scrollTop;
	else top_offset = document.documentElement.scrollTop;

	$("#foto").css("top", 15 + top_offset);

	left_offset = Math.ceil((getClientWidth() - 1013)/2);
	$("#foto").css("left", left_offset);
}

function QuitFotoView()
{
    $("#background").css("display", "none");
    $("#foto").css("display", "none");
    $("#content_foto").html('');
}
