$(document).ready(function() {
    $("#del_nnw").toggle(function() {
            $(".news_check").attr("checked", "checked");
            return false;
        },
        function() {
            $(".news_check").attr("checked", "");
            return false;
        });
    $("#submit_del_news").click(function() {
        var soob = confirm("Вы уверены?");
        if (soob == true) {
            return true;
        }
        else {
            return false;
        }
    });
    $('.popupVideo, .closePopupVideoImage').click(function(){
        var thiz = $(this), parent = thiz.parent().parent(), video = parent.find('.popupVideoOBJ')
            widthDiv = video.width(), heightDiv = video.height(), widthWindow = $(window).width(), heightWindow = $(window).height();
        video.css({
            left: (widthWindow/2-widthDiv/2)+'px',
            top: (heightWindow/2-heightDiv/2 + $(window).scrollTop())+'px'
        }).show();
        return false;
    });
    $('.closePopupVideo').click(function(){
        $(this).parent().hide();
    });
});
var pullDnWin = 0; //del

function makePullDn(name, source, width, height) {
    return open(source, name, "scrollbars=no,resizable=yes,dependent=no," +
        "width=" + width + ",height=" + height +
        ",screenX=" + Math.round((top.innerWidth - width) / 2 + top.screenX) +
        ",screenY=" + Math.round((top.innerHeight - height) / 2 + top.screenY + 20));
}

function view_desc(id_t) {
    makePullDn("view_desc", "view_desc.phtml?id_p=" + id_t, 650, 550);
}
function view_prop(id_t) {
    makePullDn("view_prop", "view_prop.phtml?id_p=" + id_t, 690, 550);
}

app = navigator.appName;
ver = navigator.appVersion;
mac = ver.indexOf("Macintosh") > 0;
win = ver.indexOf("Win") > 0;
vnum = parseFloat(ver);
mook = ((app == "Netscape") && (vnum >= 3 ) ||
    ((mac) && (app == "Microsoft Internet Explorer") && (vnum >= 3.01 )) ||
    ((win) && (app == "Microsoft Internet Explorer") && (vnum >= 4 )) );
if (mook) {
    qOn = new Image;
    qOn.src = "img/nav/about.gif";
    qOff = new Image;
    qOff.src = "img/nav/about1.gif";

    wOn = new Image;
    wOn.src = "img/nav/lastn.gif";
    wOff = new Image;
    wOff.src = "img/nav/lastn1.gif";

    eOn = new Image;
    eOn.src = "img/nav/arhiv.gif";
    eOff = new Image;
    eOff.src = "img/nav/arhiv1.gif";

    rOn = new Image;
    rOn.src = "img/nav/moz.gif";
    rOff = new Image;
    rOff.src = "img/nav/moz1.gif";

    yOn = new Image;
    yOn.src = "img/nav/zahody.gif";
    yOff = new Image;
    yOff.src = "img/nav/zahody1.gif";

    uOn = new Image;
    uOn.src = "img/nav/advert.gif";
    uOff = new Image;
    uOff.src = "img/nav/advert1.gif";

    iOn = new Image;
    iOn.src = "img/nav/partners.gif";
    iOff = new Image;
    iOff.src = "img/nav/partners1.gif";

    oOn = new Image;
    oOn.src = "img/nav/contacts.gif";
    oOff = new Image;
    oOff.src = "img/nav/contacts1.gif";
}

function off(imgName) {
    if (mook)
        document[imgName].src = eval(imgName + "On.src");
}

function on(imgName) {
    if (mook)
        document[imgName].src = eval(imgName + "Off.src");
}

<!--
function popupfile(path, ww, wh) {
    var v = parseInt(navigator.appVersion);
    isNetscape = navigator.appName.indexOf('Netscape') >= 0;
    isExplorer = navigator.appName.indexOf('Explorer') >= 0;
    positionCode = '';
    if (v >= 4) {
        sw = screen.width;
        sh = screen.height;
        wbx = Math.round((sw - ww) * 0.90);
        wby = Math.round((sh - wh) / 10);
        if (isExplorer) positionCode = 'left=' + wbx + ',top=' + wby + ',';
        if (isNetscape) positionCode = 'screenX=' + wbx + ',screenY=' + wby + ',';
    }
    p = 'scrollbars=0,width=' + ww + ',height=' + wh + ',' + positionCode + 'offscreenBuffering=0,alwaysRaised=yes';


    if ((navigator.userAgent.indexOf('MSIE')) == -1) {
        xxx1 = open(path, "model", p);
        xxx1.focus();
    }
    if (((navigator.userAgent.indexOf('MSIE')) != -1)) {
        xxx1 = open('', "model", 'width=1,height=1,resizable=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no');
        xxx1.close();
        xxx1 = open(path, "model", p);
    }


}
function recolor_test() {
    test.style.background = "#004500";
}
//-->
