var message = "функция отключена";
function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; }
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } }
document.onmousedown = rtclickcheck;

//var $J = jQuery.noConflict();
jQuery(document).ready(function(){


/*        jQuery('a.lightbox').lightBox();

        clouds();

        $("a").focus(function(){
                $(this).blur();
        });

        $(".corner_top").corner('10px top');

        //$("#feedback").corner('10px bottom cc:#02192d');

        $(".info_content, .info_content td").each(function(){
                $("ul:last", this).css({'border-bottom': 'none'});
        }); */

	    $('.open').live('click',function(){
	        showPopup();
			$("#YMapsIDPop").data('map').redraw();
	    });
	    $('.close, #opaco').live('click',function(){
	        closePopup();
	    });

});
    function look(type){
        if ($('a.'+type).is(':hidden')){
        $('a.'+type).css('display','block')
}else{
        $('a.'+type).css('display','none')
}
//    param=document.getElementById(type);
//    if(param.style.display == "none")
//    { param.style.display = "block"}
//    else
//   { param.style.display = "none"}
//    return true
    }

function closePopup(){
    $('#opaco').toggleClass('hidden').removeAttr('style');
    $('#open').toggleClass('hidden');
    return false;
}
function showPopup(){
    if($.browser.msie){
        $('#opaco').height($(document).height()).toggleClass('hidden');
    } else {
        $('#opaco').height($(document).height()).toggleClass('hidden').fadeTo('slow', 0.7);
    };
    $('#open').alignCenter().toggleClass('hidden');
    return false;
}
$.fn.alignCenter = function() {
	var marginLeft = Math.max(40, parseInt($(window).width()/2 - $(this).width()/2)) + 'px';
	var marginTop = Math.max(40, parseInt($(window).height()/2 - $(this).height()/2)) + 'px';
	return $(this).css({'margin-left':marginLeft, 'margin-top':marginTop});
};

/* $(window).resize(function(){
        clouds();
});*/

clouds = function () {
        if ($("#layout_body").width() < 1196) {
                $("#cloud5").hide();
        } else {
                $("#cloud5").show();
        };
        if ($("#layout_body").width() < 1480) {
                $("#cloud3").hide();
                $("#center1, #center2").css({'background-image': 'none'});
                $("#center3").css({'background-image': 'none', 'padding-right': '0px'});
        } else {
                $("#cloud3").show();
                $("#center1").css({'background-image': 'url(/data/img/bg_center.jpg)'});
                $("#center2").css({'background-image': 'url(/data/img/bg_center_t.jpg)'});
                $("#center3").css({'background-image': 'url(/data/img/bg_center_b.jpg)', 'padding-right': '42px'});
        }
};
