var link_buf="";
function ShowGraphBlock(id_bl, part, num, currency)
{
    switch(num)
    {
        case '1':
            //3m; day
		    var so1 = new SWFObject("/amline/amline.swf", "amline", "100%", "160", "8", "#FFFFFF");
		    so1.addVariable("path", "/amline/");
		    so1.addVariable("settings_file", encodeURIComponent("/amline/data/amline_settings_intrb.xml?7"));
		    so1.addVariable("data_file", encodeURIComponent("/amline/data/currency/interbank/"+currency+"."+id_bl+".txt"));
            if(id_bl=='3m')
                so1.addVariable("additional_chart_settings", "<settings> <indicator><enabled>false</enabled></indicator> <graphs> <graph gid='1'><bullet></bullet></graph> <graph gid='2'><bullet></bullet></graph> </graphs></settings>");

            so1.write("flashcontent1");  // this id must match the div id above

        break;

        case '2':
		    var so2 = new SWFObject("/amline/amline.swf", "amline", "100%", "160", "8", "#FFFFFF");
		    so2.addVariable("path", "/amline/");
		    so2.addVariable("settings_file", encodeURIComponent("/amline/data/amline_settings_cash.xml?7"));
		    so2.addVariable("data_file", encodeURIComponent("/amline/data/currency/cash/"+currency+".rates."+id_bl+".csv"));
		    so2.write("flashcontent2");  // this id must match the div id above
        break;

        case '3':
            var so3 = new SWFObject("/amline/amline.swf", "amline", "100%", "160", "8", "#FFFFFF");
		    so3.addVariable("path", "/amline/");
		    so3.addVariable("settings_file", encodeURIComponent("/amline/data/amline_settings.xml?7"));
		    so3.addVariable("data_file", encodeURIComponent("/amline/data/currency/nbu/"+currency+"."+id_bl+".csv"));
		    so3.write("flashcontent3");  // this id must match the div id above
        break;

        case '4':
            var so3 = new SWFObject("/amline/amline.swf", "amline", "100%", "100", "8", "#FFFFFF");
		    so3.addVariable("path", "/amline/");
		    so3.addVariable("settings_file", encodeURIComponent("/amline/data/amline_settings_cash.xml?7"));
		    so3.addVariable("data_file", encodeURIComponent("/amline/data/currency/"+id_bl+"/"+currency+".rates.daily.csv"));
		    so3.write("flashcontent3");  // this id must match the div id above

            $('#change_phrase').empty();
            //$('#change_phrase').html("<a class='forum' href='{$link_curr}'><img src='/i/comments.png' align='absmiddle' width='10' height='10' border='0'><span>Обсуждение валютного рынка</span></a>");
            $('#change_phrase').html(link_buf);

        break;

        case '5':
            var so3 = new SWFObject("/amline/amline.swf", "amline", "100%", "100", "8", "#FFFFFF");
		    so3.addVariable("path", "/amline/");
		    so3.addVariable("settings_file", encodeURIComponent("/amline/data/amline_settings_intrb.xml?7"));
		    so3.addVariable("data_file", encodeURIComponent("/amline/data/currency/interbank/"+currency+".main.txt"));
            so3.addVariable("additional_chart_settings", "<settings> <values> <x><frequency>2</frequency></x> </values> </settings>");
		    so3.write("flashcontent3");  // this id must match the div id above

            link_buf=$('#change_phrase').html();
            $('#change_phrase').empty();
            $('#change_phrase').html("<a class='forum' href='/currency/mb/'><span>Ход торгов на межбанке</span></a>");
        break;

        case '6':
		    var so3 = new SWFObject("/amline/amline.swf", "amline", "100%", "135", "8", "#FFFFFF");
		    so3.addVariable("path", "/amline/");
		    so3.addVariable("settings_file", encodeURIComponent("/amline/data/amline_settings_cash.xml?7"));
		    so3.addVariable("data_file", encodeURIComponent("/amline/data/currency/ukrdiling/"+currency+"."+id_bl+".csv"));
		    so3.write("flashcontent3");  // this id must match the div id above
        break;
    }

    $('#'+part+' dd').attr({style: ""});
    $('#'+part+' dd a').attr({style: "cursor: pointer;"});
    $('#'+id_bl).parent().attr({style: "border: none; background-color: #F0F5F7"});
    $('#'+id_bl).attr({style: "cursor: text;"});
    $('#baks').attr({style: "border-bottom: 0; font-weight: bold;"});
}