$('document').ready(function(){	    /*$('.left-menu li a').click(function(){				if($(this).parent().find('ul').css('display') == 'none')		{			$(this).parent().find('ul').css('display','block');		}		else		{			$(this).parent().find('ul').css('display','none');		}			if($(this).attr('href') == '#')		{			return false;		}	});	*/    $('.past-wars .one-war:first').addClass('one-war-top');    $('.past-wars .one-war:first').next().addClass('one-war-top');    $('.past-wars .one-war:last').addClass('one-war-bottom');    $('.past-wars .one-war:last').prev().addClass('one-war-bottom');    $('.past-wars .one-war:odd').addClass('one-war-right');    $('.add-mention-show').hover(function(){        $(this).css('border-bottom','1px dotted #f6f2d7');	    },function(){        $(this).css('border-bottom','1px dotted #d10a2c');	    });    $('.add-mention-show').click(function(){        $('.add-mention').slideDown(700);        return false;    });    $('.add-mention-hide').click(function(){        $('.add-mention').slideUp(700);        return false;    });    $('.pos-mention, .neg-mention').click(function(){        $('.pos-mention, .neg-mention').removeClass('clicked');        $(this).addClass('clicked');        return false;    })	    $('.cs-map-show').hover(function(){        $(this).find('span').css('border-bottom','0');	    },function(){        $(this).find('span').css('border-bottom','1px dotted #000');	    });	    $('.cs-map-show').click(function(){        if($(this).parent().hasClass('opened'))        {			            $('.cs-map').removeClass('opened');            $('.cs-map').animate({                width: '220px',                height: '153px'            },700,function(){                $('.cs-map-show').html('<span>Развернуть карту</span>');                $('.cs-review').fadeIn(500);            });					        }        else        {	            $('.cs-review').fadeOut(500,function(){                $('.cs-map').addClass('opened');                $('.cs-map').animate({                    width: '90%',                    height: '241px'                },700,function(){                    $('.cs-map-show').html('<span>Свернуть карту</span>');                });				            });	        }        return false;    })	    $('.h3-type-2').hover(function(){        $(this).find('span').css('border-bottom','1px dotted #f6f2d7');	    },function(){        $(this).find('span').css('border-bottom','1px dotted #0376ab');	    });		    $('.h3-type-2').click(function(event) {        event.preventDefault();        $(this).css('display','none');        $(this).parent().find('.h3-type-1').css('display','block');        $(this).parent().find('.cs-add-mention-in').slideDown(700,function(){            params = {                refreshEl: ".address-select select",                 visRows: 15            }            cuSelRefresh(params);			        });     });    $('.add-mention-hide-2').click(function(){        $(this).parent().parent().slideUp(700);        $(this).parent().parent().siblings('.h3-type-2').css('display','block');		        return false;    });		    $('.ml-filter a span').hover(function(){        $(this).css('border-bottom','0');    },function(){        if($(this).parent().hasClass('selected'))        {}        else        {            $(this).css('border-bottom','1px dotted #0376ab');	        }		    });		    $('.pn-filter a span').hover(function(){        $(this).css('border-bottom','0');    },function(){        if($(this).parent().hasClass('selected'))        {}        else        {            $(this).css('border-bottom','1px dotted #0376ab');	        }    });	    $('.pn-filter a').click(function(){        $('.pn-filter a').removeClass('selected');        $('.pn-filter a span').css('border-bottom','1px dotted #0376ab');	        $(this).addClass('selected');        $(this).find('span').css('border-bottom','0');        return false;    });    $('.ml-filter a').click(function(){        $('.ml-filter a').removeClass('selected');        $('.ml-filter a span').css('border-bottom','1px dotted #0376ab');	        $(this).addClass('selected');        $(this).find('span').css('border-bottom','0');    });	    $('.cl-selection').hover(function(){        $(this).find('.cl-selection-txt').css('border-bottom','0');    },function(){        if($(this).hasClass('selected'))        {}        else        {            $(this).find('.cl-selection-txt').css('border-bottom','1px dotted #0376ab');	        }    });	    $('.cl-selection').click(function(){        $('.cl-selection').removeClass('selected');        $('.cl-selection .cl-selection-txt').css('border-bottom','1px dotted #0376ab');        $(this).addClass('selected');        $(this).find('.cl-selection-txt').css('border-bottom','0');	    });	    $('.label').hover(function(){        $(this).find('.address-t').css('display','block');    },function(){        $(this).find('.address-t').css('display','none');    });	    $(document).keyup(function(event){        if (event.keyCode == 27)         {            $('#overlay').css('display', 'none');            $('.popup-t').css('display', 'none');            resetForms();        }    });	    $('#close').click(function(){        $('#overlay').css('display', 'none');        $('.popup-t').css('display', 'none');        resetForms();        window.location.reload()        return false;    });    $('#overlay, #close_r').click(function(){        $('#overlay').css('display', 'none');        $('.popup-t').css('display', 'none');        resetForms();                return false;    });    $('.show-p1').click(function(){        $('.p1').css('display','block');        $('#overlay').css('display', 'block');	    })    $('.show-p2').click(function(){        $('.p2').css('display','block');        $('#overlay').css('display', 'block');	    })    $('.show-p3').click(function(){        $('.p3').css('display','block');        $('#overlay').css('display', 'block');	    })	    $('.iTxt-popup input').focus(function(){        $(this).parent().addClass('focused');    })    $('.iTxt-popup input').blur(function(){        $(this).parent().removeClass('focused');    })	    $('.cancel').click(function(){        resetForms();    });			    /*    $('.one-cs-logo img').each(function(){        $(this).css({            marginLeft: -Math.round(($(this).width()/2)) + 'px',             marginTop: -Math.round(($(this).height()/2)) + 'px'            });    });    $('.cs-logo-2 img').each(function(){        $(this).css({            marginLeft: -Math.round(($(this).width()/2)) + 'px',             marginTop: -Math.round(($(this).height()/2)) + 'px'            });    });*/        $('.one-cs-logo img').each(function(){        setMarginTop(this);    });    $('.cs-logo-2 img').each(function(){        setMarginTop(this);    });    $('.otziv_oglyd_pic img').each(function(){        setMarginTop(this);    });			    $('#submit_login_form_mainpage').click(function(event) {        event.preventDefault();        $('#login_form').submit();    });            $('a.open-popup').fancybox({        'hideOnContentClick': false,        'type': 'iframe'    });	});function resetForms(){    $(".form").each(function(){        this.reset();    });}function setMarginTop(element) {    $(element).load(function() {        $(element).css({            marginTop: ($(element).parent().height() - $(element).height()) / 2 + 'px'        });     });}
