var toggle_class = 'block02_open';
var toggle_speed = 500;

var flashparams = {
    menu: "false",
    allowScriptAccess: "always"//,
    //wmode: "transparent"
};

swfobject.embedSWF("./images/stservice/fig_atom.swf", "atom_external", "705", "490", "9.0.0", "#fff", "", flashparams, "");

function toggleInit()
{
    $('#main_column .block02').removeClass(toggle_class);
    $('#main_column .block02_shadow').hide();
    $('#main_column .block02 .title .btn').show().click(function() {
        var box_parent = $(this).parent().parent();
        var id = '#' + box_parent.attr('id');
        var box_toggle = box_parent.find('.block02_shadow');
        if (box_parent.hasClass(toggle_class)) {
            box_toggle.animate(
                {opacity: "toggle", height: "toggle"},
                toggle_speed,
                function() {
                    box_parent.removeClass(toggle_class);
                }
            );
        } else {
            box_parent.addClass(toggle_class);
            box_toggle.show().fadeOut(0).fadeIn(toggle_speed);
            $(window).scrollTo(id,toggle_speed);
        }
        return false;
    });
}

function showBlock(num)
{
    var id = '#anchor';
    if (num < 10) id += '0';
    id += num;
    var box_parent = $(id);
    var box_toggle = box_parent.find('.block02_shadow');
    if (!box_parent.hasClass(toggle_class)) {
        box_parent.addClass(toggle_class);
        box_toggle.show().fadeOut(0).fadeIn(toggle_speed);
    }
    scrollTo(id);
    return false;
}

/* initialize */
function init()
{
    toggleInit();
}

$(document).ready(init);
