function open_submenu(id)
{
    if($("#ul_"+id).attr('class') == 'open')
    {
        $("#span_"+id).html("<a href=\"#\" onclick=\"return false;\" id=\"a_"+id+"\">"+$("#span_"+id).html()+"</a>");
        $("#ul_"+id).attr('class', 'close');
    }
    else
    {
        $("#span_"+id).html("<span style=\"cursor: pointer;\">"+$("#a_"+id).html()+"</span>");
        $("#ul_"+id).attr('class', 'open');    
    }    
        
}

function change_picture(id)
{
    current_pic = $("#current_pic").val();
    $("#current_pic").val(id);
    new_picture = $("#_pic"+id).val();
    $("#picture").attr("src", new_picture);
    $("#pic"+current_pic).html("<a href=\"\" onclick=\"change_picture('"+current_pic+"'); return false;\">"+current_pic+"</a>");
    $("#pic"+id).html(id);
}

function counter()
{
    counter = '<a href="http://www.liveinternet.ru/click" '+'target=_blank><img src="http://counter.yadro.ru/hit?t14.1;r'+ escape(document.referrer)+((typeof(screen)=='undefined')?'': ';s'+screen.width+'*'+screen.height+'*'+(screen.colorDepth? screen.colorDepth:screen.pixelDepth))+';u'+escape(document.URL)+ ';'+Math.random()+ '" alt="" title="LiveInternet: показано число просмотров за 24 часа, посетителей за 24 часа и за сегодн\я" '+ 'border=0 width=88 height=31></a>';
    $("#counter_button").html(counter);
}
