$(document).ready(function(){
//==Lightbox===============================================
    function change_href(){
        var a_num = $(".photolist .itemlist").find("a").length;
        for(i=0;i<a_num;i++)
        {
            var url = $(".photolist .itemlist a:eq("+i+") span").attr("style");
            var start = url.indexOf("http");
            var end = url.indexOf("s.jpg");
            var src = url.substring(start,end)+"b.jpg";
            $(".photolist .itemlist a:eq("+i+")").attr("href",src);
        }
    }

    $(".photolist .itemlist a span").click(function(){
        change_href();
    });
    $(".photolist .itemlist a").lightBox();
    //=================================================

    $('#tablezebra tr:even').addClass('tablezebra_even');

    if ($(".appendmenu").length) {
        $(".articlelist").remove();
    }
    if ($("#flashonly").length) {
        $(".categorylist").remove();
    }

    //footer 2 bottom;
    function fe_footer2bottom(){
        if ($('body').height() < $(window).height()) {
            $('#footer').css({'position': 'absolute', 'bottom': '0px'});
        } else {
            $('#footer').css({'position': 'relative', 'bottom': ''});
        }
    }

    fe_footer2bottom();
    $(window).resize(function(){
        fe_footer2bottom();
    });
    var width = document.body.clientWidth;
    var height = document.body.clientHeight;
    var leftside = (width-198)/4-74;
    var topsize = (height-157)-68;

    $("#baner").animate({
        width: "320px",
        height: "157px",
        left: leftside ,
        top: topsize
    },0);
    $("#close_btn").click(function(){
        $("#baner").remove();
    });

    //===Baner Zmina Kolis ============================
/*
    var ban_height = $(window).height();
    var ban_width = $(window).width();
    if(main_page){
        $('body').prepend("<div id=\"wheel_change\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\"width=\"1280px\" height=\"1024px\" id=\"wheel\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"movie\" value=\""+SD+"images/wheel_change.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\"><param name=\"bgcolor\" value=\"#ffffff\" /><param name=\"FlashVars\" value=\"\"><embed FlashVars=\"\" src=\""+SD+"images/wheel_change.swf\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#ffffff\" width=\"1280px\" height=\"1024px\" name=\"wheel\" align=\"middle\" allowScriptAccess=\"always\" allowFullScreen=\"false\" FlashVars=\"\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/go/getflashplayer\" /></object></div>");
    }
    $("#wheel").attr({
        width: ban_width,
        height: ban_height
    });
    $("#wheel embed").attr({
        width: ban_width,
        height: ban_height
    });
    $("#wheel_change").css({
        'margin-top':'0px',
        'margin-right':'0px',
        'margin-bottom':'0px',
        'margin-left': '0px',
        'position':'absolute',
        'display':'block'
    });
    */
    //=================================================
});


