new_last_href='';// змінна для зберігання ссилки на останню переглядувану новину
news_on_off=false;

$(function () {
$('.alert_flash').flash(
    { src: 'content/SWF/null_alert.swf', width: 400, height: 80 },
    { version: '10' }
);

var krpanos = document.getElementById("krpanoSWFObject");
$('#logo').click(function(){krpanos.call("telephon_on()")});


    // клік на прості ссилки в середині новин
    $('#news_div a:not([href*=javascript]):not([href*=mailto])').live('click', function(){
        //alert($(this).attr('href'))
        new_last_href=$(this).attr('href');
        $('#news_div').load(new_last_href);
        return false;
    })

    //імітація кнопки назад длі новин
    $('#news_div a[href*=javascript:history.go]').live('click', function(){
        //alert($(this).attr('href'))
        $('#news_div').load(new_last_href);
        return false;
    })


    $('#news_button').hover(
            function(){
                if(!news_on_off)
                $(this).css('background-position','top 0px left 138px')},
            function(){
                if(!news_on_off)
                $(this).css('background-position','top 0px left 0px')}
        )
        /**/
$('#news_button').click(
       function(){

        news_on();
        $('#krpanoDIV').css('height', '50px');

        $('#news_div').load('news/show_news.php')
       }
);

function news_on(){
    news_on_off=true;
    krpanos.call("news_on()");
    $('#news_button').css('background-position','top 0px left 138px')}
});

function news_off(){
    news_on_off=false;
    $('#krpanoDIV').css('height', '100%');
    $('#news_button').css('background-position','top 0px left 0px');
}

