var jsp_address = new Array ();
jsp_address['faq_fb']        = "/ajax/faq.html";
jsp_address['about_fb']      = "/ajax/about.html";
jsp_address['comments_fb']   = "/ajax/comments.html";
jsp_address['buywm_fb']      = "/ajax/rurwm.html";
jsp_address['attestatwm_fb'] = "/ajax/attestatwm.html";
jsp_address['security_fb']   = "/ajax/security.html";
jsp_address['rate_fb']       = "/ajax/rate.html";
jsp_address['office1_fb']    = "/ajax/office_1.html";
jsp_address['office2_fb']    = "/ajax/office_2.html";
jsp_address['office3_fb']    = "/ajax/office_3.html";

function openFloatingBlock(linkID)
{
    jQuery ("#fb_bg, #floating_block, div#"+linkID).show ();
    jQuery ('#page_container').css('position','fixed');

    jQuery.get (jsp_address[linkID], function (text) {
	var windowHeight = jQuery (window).height ();
	var pane = jQuery("div#"+linkID+" div.scroll-pane");
	var api = pane.data('jsp');

	api.getContentPane().html (text);

	var textHeight = api.getContentPane ().height ();
	var optimalHeight;

	if (textHeight > 0.55 * windowHeight)
	    optimalHeight = Math.round (0.55 * windowHeight);
	else
	    optimalHeight = textHeight + 1;

	pane.css ('height', optimalHeight);
	api.reinitialise ();
    }, 'html');
}

function closeFloatingBlock()
{
    jQuery ("#fb_bg").add ("#floating_block").add ('.fb_paper_sheet').hide ();
    jQuery ('#page_container').css('position','relative');

    return false;
}
